diff options
author | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-10-31 01:53:09 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-10-31 01:53:09 +0000 |
commit | 13cff671e59becc9bbb7a5925b2ca151a48025b1 (patch) | |
tree | 26e572be821ba5ee4d85a439dc55740ff34f3f08 /chipset_enable.c | |
parent | 04bf0559791c4f28fbc6d390ee1e05e7f2292336 (diff) | |
download | flashrom-13cff671e59becc9bbb7a5925b2ca151a48025b1.zip flashrom-13cff671e59becc9bbb7a5925b2ca151a48025b1.tar.gz |
Add infrastructure to check and report to the user the maximum supported decode size for chipsets and tested mainboards
The rationale is to warn users when they, for example, try to flash a 512KB
parallel flash chip but their chipset only supports 256KB, or they try to flash
512KB and the chipset _does_ theoretically support 512KB but their special
board doesn't wire all address lines and thus supports only 256 KB ROM chips
at maximum. This has cost Uwe hours of debugging on some board already, until
he figured out what was going on. We should try warn our users where possible
about this. The chipset and the chip may have more than one bus in common
(e.g. SB600 and Pm49* can both speak LPC+FWH) and on SB600/SB7x0/SB8x0 there
are different limits for LPC and FWH. The only way to tell the user about
the exact circumstances is to spew error messages per bus. The code will
issue a warning during probe (which does fail for some chips if the size
is too big) and abort before the first real read/write/erase action. If no
action is specified, the warning is printed anyway. That way, a user can find
out why probe might not have worked, and will be stopped before he/she gets
incorrect results. Add a bitcount function to the infrastructure.
Corresponding to flashrom svn r755.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'chipset_enable.c')
-rw-r--r-- | chipset_enable.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chipset_enable.c b/chipset_enable.c index 8ca55e1..3b3ab3d 100644 --- a/chipset_enable.c +++ b/chipset_enable.c @@ -42,6 +42,17 @@ unsigned long flashbase = 0; enum chipbustype buses_supported = CHIP_BUSTYPE_NONSPI; +/** + * Programmers supporting multiple buses can have differing size limits on + * each bus. Store the limits for each bus in a common struct. + */ +struct decode_sizes max_rom_decode = { + .parallel = 0xffffffff, + .lpc = 0xffffffff, + .fwh = 0xffffffff, + .spi = 0xffffffff +}; + extern int ichspi_lock; static int enable_flash_ali_m1533(struct pci_dev *dev, const char *name) |