mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 14:33:18 +02:00
Every SPI host controller implemented its own way to read flash chips
This was partly due to a design problem in the abstraction layer. There should be exactly two different functions for reading SPI chips: - memory mapped reads - SPI command reads. Each of them should be contained in a separate function, optionally taking parameters where needed. This patch solves the problems mentioned above, shortens the code and makes the code logic a lot more obvious. Since open-coding the min() function leads to errors, include it in this patch as well. Corresponding to flashrom svn r589. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
2
flash.h
2
flash.h
@ -721,6 +721,7 @@ extern int verbose;
|
||||
#define printf_debug(x...) { if (verbose) printf(x); }
|
||||
void map_flash_registers(struct flashchip *flash);
|
||||
int read_memmapped(struct flashchip *flash, uint8_t *buf);
|
||||
int min(int a, int b);
|
||||
extern char *pcidev_bdf;
|
||||
|
||||
/* layout.c */
|
||||
@ -768,6 +769,7 @@ int spi_disable_blockprotect(void);
|
||||
void spi_byte_program(int address, uint8_t byte);
|
||||
int spi_nbyte_program(int address, uint8_t *bytes, int len);
|
||||
int spi_nbyte_read(int address, uint8_t *bytes, int len);
|
||||
int spi_read_chunked(struct flashchip *flash, uint8_t *buf, int chunksize);
|
||||
int spi_aai_write(struct flashchip *flash, uint8_t *buf);
|
||||
uint32_t spi_get_valid_read_addr(void);
|
||||
|
||||
|
Reference in New Issue
Block a user