If someone wants to perform a forced read of a chip via mmap, we should allow that even if the host doesn't support the bus this chip needs. Example: flashrom -p dummy:bus=spi -V -c Am29F016D -f -r foo.rom This won't work right now because -f won't override probe skipping. So far the only use of this bus override is for the internal programmer, and as such I wonder whether we should make the bus override conditional on the internal programmer. It's pointless for other programmers anyway.
Comments welcome.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-force_chip_incompatible_bus/flashrom.c =================================================================== --- flashrom-force_chip_incompatible_bus/flashrom.c (Revision 1079) +++ flashrom-force_chip_incompatible_bus/flashrom.c (Arbeitskopie) @@ -1007,7 +1007,7 @@ continue; } buses_common = buses_supported & flash->bustype; - if (!buses_common) { + if (!buses_common && !force) { tmp = flashbuses_to_text(buses_supported); msg_gdbg("skipped."); msg_gspew(" Host bus type %s ", tmp);
Am Mittwoch, den 14.07.2010, 11:53 +0200 schrieb Carl-Daniel Hailfinger:
If someone wants to perform a forced read of a chip via mmap, we should allow that even if the host doesn't support the bus this chip needs. Example: flashrom -p dummy:bus=spi -V -c Am29F016D -f -r foo.rom This won't work right now because -f won't override probe skipping. So far the only use of this bus override is for the internal programmer, and as such I wonder whether we should make the bus override conditional on the internal programmer. It's pointless for other programmers anyway.
Another option would be a "mmap" programmer that is read only, doesn't support probes (or supports probing by looking for repetition) and has another special bus type (e.g. DUMMY), which is matched by dummy chips in the chip table with all common sizes. This dummy mmap programmer would *not* have board enables and *not* have chipset enables.
Regards, Michael Karcher
On 14.07.2010 12:06, Michael Karcher wrote:
Am Mittwoch, den 14.07.2010, 11:53 +0200 schrieb Carl-Daniel Hailfinger:
If someone wants to perform a forced read of a chip via mmap, we should allow that even if the host doesn't support the bus this chip needs. Example: flashrom -p dummy:bus=spi -V -c Am29F016D -f -r foo.rom This won't work right now because -f won't override probe skipping. So far the only use of this bus override is for the internal programmer, and as such I wonder whether we should make the bus override conditional on the internal programmer. It's pointless for other programmers anyway.
Another option would be a "mmap" programmer that is read only, doesn't support probes (or supports probing by looking for repetition) and has another special bus type (e.g. DUMMY), which is matched by dummy chips in the chip table with all common sizes. This dummy mmap programmer would *not* have board enables and *not* have chipset enables.
Nice idea, makes a lot of sense. There will be some overlap with forced read functionality, though. I can hack up such a mmap programmer, but this would be greatly simplified by solving the address space alignment problem I posted.
Regards, Carl-Daniel
Acked-by: Stephen Kou stephen@hyarros.com
Dump of "successful" forced read:
flashrom v0.9.2-r1075 on Linux 2.6.32-23-generic (x86_64), built with libpci 3.0.0, GCC 4.4.3, little endian flashrom is free software, get the source code at http://www.flashrom.org
Calibrating delay loop... OK. No coreboot table found. Found chipset "Intel ICH10R", enabling flash write... tried to set 0xdc to 0xb on ICH10R failed (WARNING ONLY) WARNING: SPI Configuration Lockdown activated. FAILED! This chipset supports the following protocols: FWH,SPI. No EEPROM/flash device found. Force read (-f -r -c) requested, pretending the chip is there: Assuming chip "AMD Am29F016D" (2048 KB, Parallel) at physical address 0xffe00000. Please note that forced reads most likely contain garbage. Reading flash... done.
On Wed, 14 Jul 2010 11:53:03 +0200, Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net wrote:
If someone wants to perform a forced read of a chip via mmap, we should allow that even if the host doesn't support the bus this chip needs. Example: flashrom -p dummy:bus=spi -V -c Am29F016D -f -r foo.rom This won't work right now because -f won't override probe skipping. So far the only use of this bus override is for the internal programmer, and as such I wonder whether we should make the bus override conditional on the internal programmer. It's pointless for other programmers anyway.
Comments welcome.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-force_chip_incompatible_bus/flashrom.c
--- flashrom-force_chip_incompatible_bus/flashrom.c (Revision 1079) +++ flashrom-force_chip_incompatible_bus/flashrom.c (Arbeitskopie) @@ -1007,7 +1007,7 @@ continue; } buses_common = buses_supported & flash->bustype;
if (!buses_common) {
if (!buses_common && !force) { tmp = flashbuses_to_text(buses_supported); msg_gdbg("skipped."); msg_gspew(" Host bus type %s ", tmp);