aboutsummaryrefslogtreecommitdiffstats
path: root/flashchips.c
diff options
context:
space:
mode:
authorAnastasia Klimchuk <aklm@chromium.org>2022-05-19 14:40:37 +1000
committerNico Huber <nico.h@gmx.de>2022-06-16 09:41:15 +0000
commita721181a08430836352cb23a544e92fdc8d55b99 (patch)
tree25f88e5bfb1c0537f8b1394c20104af33d377ef6 /flashchips.c
parent5b78c08156ddc5b4391157f7d7a0456060eed2c2 (diff)
downloadflashrom-a721181a08430836352cb23a544e92fdc8d55b99.tar.gz
flashrom-a721181a08430836352cb23a544e92fdc8d55b99.tar.bz2
flashrom-a721181a08430836352cb23a544e92fdc8d55b99.zip
dummyflasher: Wire variable size feature via opaque infra
Wire "variable size" feature in dummy programmer via opaque infra. This patch fixes the broken build with CONFIG_DUMMY=no. Dummyflasher registers opaque master for the case when it is initialised with EMULATE_VARIABLE_SIZE. Dummy opaque master emulates read/write/erase as simple memory operations over `data->flashchip_contents`. The feature works via "Opaque flash chip" in flashchips.c which has one block eraser at the moment. If this changes in future, each block eraser needs to be updated in `probe_variable_size`. Fixes: https://ticket.coreboot.org/issues/365 TEST=the following scenarious run successfully Testing build $ make clean && make CONFIG_DUMMY=no $ flashrom -h : dummy is not in the list $ make clean && make CONFIG_EVERYTHING=yes $ flashrom -h : dummy is in the list Testing "variable size" feature $ flashrom -p dummy:size=8388608,emulate=VARIABLE_SIZE -V $ flashrom -p dummy:size=8388608,emulate=VARIABLE_SIZE -r /tmp/dump.bin -V $ head -c 8388608 </dev/urandom >/tmp/image.bin $ flashrom -p dummy:image=/tmp/image.bin,size=8388608,emulate=VARIABLE_SIZE -w /tmp/dump.bin -V also same as above with erase_to_zero=yes Testing standard flow $ flashrom -p dummy:emulate=W25Q128FV -V $ flashrom -p dummy:emulate=W25Q128FV -r /tmp/dump.bin -V $ head -c 16777216 </dev/urandom >/tmp/image.bin $ flashrom -p dummy:image=/tmp/image.bin,emulate=W25Q128FV -w /tmp/dump.bin -V Testing invalid combination of programmer params (`init_data` fails and prints error message which is WAI) $ flashrom -p dummy:size=8388608 -V -> init_data: size parameter is only valid for VARIABLE_SIZE chip. $ flashrom -p dummy:emulate=VARIABLE_SIZE -V -> init_data: the size parameter is not given. $ flashrom -p dummy:emulate=W25Q128FV,erase_to_zero=yes -V -> init_data: erase_to_zero parameter is not valid for real chip. Change-Id: I76402bfdf8b1a75489e4509fec92c9a777d0cf58 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/64488 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Diffstat (limited to 'flashchips.c')
-rw-r--r--flashchips.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/flashchips.c b/flashchips.c
index c333fd16..71a6bfbd 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -19964,28 +19964,6 @@ const struct flashchip flashchips[] = {
{
.vendor = "Generic",
- .name = "Variable Size SPI chip",
- .bustype = BUS_SPI,
- .manufacture_id = PROGMANUF_ID,
- .model_id = PROGDEV_ID,
- .total_size = 64, /* This size is set temporarily */
- .page_size = 256,
- .feature_bits = FEATURE_4BA_READ | FEATURE_4BA_WRITE,
- .tested = TEST_OK_PREW,
- .probe = probe_variable_size,
- .block_erasers =
- {
- {
- .eraseblocks = { {64 * 1024, 1} },
- .block_erase = spi_block_erase_c7,
- }
- },
- .write = spi_chip_write_256,
- .read = spi_chip_read,
- },
-
- {
- .vendor = "Generic",
.name = "unknown SPI chip (RDID)",
.bustype = BUS_SPI,
.manufacture_id = GENERIC_MANUF_ID,