diff options
author | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-05-09 02:30:21 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-05-09 02:30:21 +0000 |
commit | 43a46601c55a27e07b96deac7d790d54f9634dd9 (patch) | |
tree | 40368d966ea3689aa4c8c2b020984671cc45d1d9 /it87spi.c | |
parent | 7f2315d654cd33ac9db9c8a251e383061b99b984 (diff) | |
download | flashrom-43a46601c55a27e07b96deac7d790d54f9634dd9.zip flashrom-43a46601c55a27e07b96deac7d790d54f9634dd9.tar.gz |
Chips like the SST SST25VF080B can only handle single byte writes outside AAI mode
Change SPI architecture to handle 1-byte chunk chip writing differently from
256-byte chunk chip writing. Annotate SPI chip write functions with _256
or _1 suffix denoting the number of bytes they write at maximum. The 1-byte
chunk writing is cut-n-pasted to different SPI drivers right now. A later
patch can move them to the generic spi_chip_write_1.
Corresponding to flashrom svn r485.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'it87spi.c')
-rw-r--r-- | it87spi.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -219,10 +219,12 @@ static int it8716f_spi_page_program(int block, uint8_t *buf, uint8_t *bios) } /* - * IT8716F only allows maximum of 512 kb SPI mapped to LPC memory cycles * Program chip using firmware cycle byte programming. (SLOW!) + * This is for chips which can only handle one byte writes + * and for chips where memory mapped programming is impossible due to + * size constraints in IT87* (over 512 kB) */ -int it8716f_over512k_spi_chip_write(struct flashchip *flash, uint8_t *buf) +int it8716f_spi_chip_write_1(struct flashchip *flash, uint8_t *buf) { int total_size = 1024 * flash->total_size; int i; @@ -269,13 +271,17 @@ int it8716f_spi_chip_read(struct flashchip *flash, uint8_t *buf) return 0; } -int it8716f_spi_chip_write(struct flashchip *flash, uint8_t *buf) +int it8716f_spi_chip_write_256(struct flashchip *flash, uint8_t *buf) { int total_size = 1024 * flash->total_size; int i; + /* + * IT8716F only allows maximum of 512 kb SPI chip size for memory + * mapped access. + */ if (total_size > 512 * 1024) { - it8716f_over512k_spi_chip_write(flash, buf); + it8716f_spi_chip_write_1(flash, buf); } else { for (i = 0; i < total_size / 256; i++) { it8716f_spi_page_program(i, buf, |