-
Notifications
You must be signed in to change notification settings - Fork 909
[sival/flash_ctrl] Modify flash_ctrl test for checking flash read/write #28627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: earlgrey_1.0.0
Are you sure you want to change the base?
Conversation
c2c578f to
744cc87
Compare
AlexJones0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR still seems to have several instances of commented-out code and old comments. Ideally, if not needed these would be removed or if they are being kept for some purpose (i.e. to be re-introduced after a TODO is resolved) then they would be annotated with a comment as such. I haven't commented on these specifically as there are multiple occurrences.
As an aside - what is the motivation for this change? I think these should currently be correct, at least for FPGA. Is the goal to enable these tests to run in environments with more/different flash memory protection regions configured?
Hi Alex, |
744cc87 to
85880e7
Compare
85880e7 to
3396c57
Compare
AlexJones0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rprakas-gsc, this is looking really good now. I've got a few more small comments that would be nice to address but I think after those this should be all good to merge.
…rite This commit updates the flash_ctrl test files and flash_ctrl test_utils for read/write access before flash operations. Signed-off-by: Ramesh Prakash <[email protected]>
3396c57 to
21e87bd
Compare
AlexJones0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the churn, a last couple of comments to address and then I'm happy for this to be merged.
| void flash_ctrl_testutils_info_region_print( | ||
| dif_flash_ctrl_info_region_t region, dif_flash_ctrl_region_properties_t *p, | ||
| bool locked); | ||
| // #endif // OPENTITAN_SW_DEVICE_LIB_TESTING_FLASH_CTRL_TESTUTILS_H_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to remove this stale comment :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed it
| // Find the first unlocked flash region and use that for testing | ||
|
|
||
| CHECK_STATUS_OK(flash_ctrl_testutils_find_unlocked_region( | ||
| &flash, 0, kDataRegions, &flash_region_index)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the change to use data_region <= end, I think we should be passing in:
| &flash, 0, kDataRegions, &flash_region_index)); | |
| &flash, 0, kDataRegions - 1, &flash_region_index)); |
into each of these calls (repeated in several tests).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated all the tests (flash_ctrl_idle_low_power_test, rv_core_ibex_mem_test, flash_ctrl_ops_test, and flash_ctrl_write_clear_test.c)
|
|
||
| kFlashTestLoc = TOP_EARLGREY_FLASH_CTRL_MEM_BASE_ADDR + | ||
| kBank1StartPageNum * kFlashBytesPerPage, | ||
| // The ROM_EXT protects itself using regions 0-1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stale comment here now that you've removed kFlashRegionNum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the stale comment
This commit updates the flash_ctrl test files to check for unlocked regions before flash operations.