From 3e9dbea1ce9c94a879deccc48bd72c60eb4b3454 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Wed, 13 May 2009 11:40:08 +0000 Subject: There are various reasons why a SPI command can fail Among others, I have seen the following problems: - The SPI opcode is not supported by the controller. ICH-style controllers exhibit this if SPI config is locked down. - The address in in a prohibited area. This can happen on ICH for any access (BBAR) and for writes in chipset write protected areas. - There is no SPI controller. Introduce separate error codes for unsupported opcode and prohibited address. Add the ability to adjust REMS and RES addresses to the minium supported read address with the help of spi_get_valid_read_addr(). That function needs to call SPI controller specific functions like reading BBAR on ICH. Corresponding to flashrom svn r500. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Uwe Hermann --- flash.h | 1 + 1 file changed, 1 insertion(+) (limited to 'flash.h') diff --git a/flash.h b/flash.h index a843b9d..bf52a56 100644 --- a/flash.h +++ b/flash.h @@ -654,6 +654,7 @@ int spi_disable_blockprotect(void); void spi_byte_program(int address, uint8_t byte); int spi_nbyte_read(int address, uint8_t *bytes, int len); int spi_aai_write(struct flashchip *flash, uint8_t *buf); +uint32_t spi_get_valid_read_addr(void); /* 82802ab.c */ int probe_82802ab(struct flashchip *flash); -- cgit v1.1