From patchwork Wed Jul 14 09:53:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Allow bus override with forced read Date: Wed, 14 Jul 2010 08:53:03 -0000 From: Carl-Daniel Hailfinger X-Patchwork-Id: 1627 Message-Id: <4C3D88FF.60200@gmx.net> To: flashrom Cc: Stephen Kou 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 Acked-by: Stephen Kou 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);