Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons.
9 comments:
Patchset:
The newest test that I have added uses real spi_send_command, however some previous tests are mocking the same function. Means, we have to have two tests executables where one of executables uses real spi_send_command and second one wraps spi_send_command.
I do intent to split this into two patches, but I just wanted to upload this for review to check that we all agree on the overall idea.
Thanks for reviews! I have two cool tests instead of one, because of the great comments from you!
File tests/chip.c:
/*
* Populate buf with the value used for erase operation, this allows to pass
* verification checks and also emulates successful erase.
*/
buf = memset(buf, 0xff, len);
+1. […]
Andel and Edward, thanks to your great comments, I spent some time with this, and now I have one more test, which is actually using dummyflasher for all chip operations!!! This is 10x more cool, thank you so much!
I still want to keep first test with fake read/write/erase, because they log and also as a foundation for further (later) experiments with various combinations of chip size and layout. Second test has to have it all like real W25Q128.V.
Patch Set #1, Line 42: printf("Unlock chip called\n");
Even better would be to prevent erases/writes if the chip hasn't been unlocked.
Currently unlock is optional, which is
if (flash->chip->unlock)
flash->chip->unlock(flash);
Or do you mean "prevent erases/writes if unlock function present, but hasn't been invoked"?
Patch Set #1, Line 57: char *param_dup = strdup("");
The second parameter of `programmer_init()` is of `const char *` type. […]
This only works for the case when param is empty string. If it is not empty, it needs to be strdup'ed. I think this is because they way extract_programmer_params works.
/*
* Total size less than 16 * 1024 to skip some steps
* in flashrom.c#prepare_flash_access.
*/
Is skipping these steps an issue, though? `spi_master_no_4ba_modes()` can only return true for SPI p […]
Now I have two tests, one with small size chip, another with large chip. Yes right, doesn't seem to be any issues.
Patch Set #1, Line 73: {2 * 1024, 3}
Huh? This is just three blocks of 2 KiB each. The flash chip size is 8 MiB (`total_size` is in KiB). […]
I corrected chip size and layout size, I think I just got confused that total_size is in KiB. The intention was to have fake chip with small size, covered by layout and covered by erase blocks.
Patch Set #1, Line 86: 0x00000000
0
Done
Patch Set #1, Line 86: 0x00002000
chip->total_size * KiB
Done (with -1 because it starts from 0).
Patch Set #1, Line 114: free(param_dup);
If using a string literal on line 57, this must be removed.
Removed for empty param (still need strdup for non-empty param).
To view, visit change 56501. To unsubscribe, or for help writing mail filters, visit settings.