diff options
author | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2010-05-28 15:53:08 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2010-05-28 15:53:08 +0000 |
commit | b245b08eff1664125301326b566adc21203fbf95 (patch) | |
tree | 3a8deb77453a25d539577a7bfe50aa2bf98682f6 /spi.c | |
parent | abc169b2fc2ded7947781e2e3cefd9bd3a5a0253 (diff) | |
download | flashrom-b245b08eff1664125301326b566adc21203fbf95.zip flashrom-b245b08eff1664125301326b566adc21203fbf95.tar.gz |
ICH SPI can enforce address restrictions for all accesses which take an address (well, it could if the chipset implementation was not broken)
Since exploiting the broken implementation is harder than conforming to the
address restrictions wherever possible, conform to the address restrictions
instead. This patch eliminates a lot of transaction errors people were seeing
on chip probe.
Corresponding to flashrom svn r1016.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
Diffstat (limited to 'spi.c')
-rw-r--r-- | spi.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -207,8 +207,22 @@ int spi_chip_write_256(struct flashchip *flash, uint8_t *buf) return spi_programmer[spi_controller].write_256(flash, buf); } +/* + * Get the lowest allowed address for read accesses. This often happens to + * be the lowest allowed address for all commands which take an address. + * This is a programmer limitation. + */ uint32_t spi_get_valid_read_addr(void) { - /* Need to return BBAR for ICH chipsets. */ - return 0; + switch (spi_controller) { +#if INTERNAL_SUPPORT == 1 +#if defined(__i386__) || defined(__x86_64__) + case SPI_CONTROLLER_ICH7: + /* Return BBAR for ICH chipsets. */ + return ichspi_bbar; +#endif +#endif + default: + return 0; + } } |