Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
s25f.c: implement probing and block erasers for Spansion
This adds support for Spansion 25Fxxxxx chips. These chips
require their own probing logic because the first 6 bytes
returned by RDID must be examined to identify the chip.

New erase functions are required as the chips support multiple
sector layouts, and the default layout must be changed to be
able to erase the entire flash.

Adapted from cros flashrom at
`9c4c9a56b6a0370b383df9c75d71b3bd469e672d`.

BUG=b:153800073
TEST=builds

Signed-off-by: Nikolai Artemiev <nartemiev@google.com>
Change-Id: I2d23f9c36ce8b2959807fbeee7f60e02444e3763
Reviewed-on: https://review.coreboot.org/c/flashrom/+/46140
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
  • Loading branch information
nartemiev authored and Edward O'Callaghan committed Dec 3, 2020
1 parent f745d0e commit adbae0e
Show file tree
Hide file tree
Showing 5 changed files with 404 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -648,7 +648,7 @@ endif
CHIP_OBJS = jedec.o stm50.o w39.o w29ee011.o \
sst28sf040.o 82802ab.o \
sst49lfxxxc.o sst_fwhub.o edi.o flashchips.o spi.o spi25.o spi25_statusreg.o \
spi95.o opaque.o sfdp.o en29lv640b.o at45db.o writeprotect.o
spi95.o opaque.o sfdp.o en29lv640b.o at45db.o writeprotect.o s25f.o

###############################################################################
# Library code.
Expand Down
5 changes: 5 additions & 0 deletions chipdrivers.h
Expand Up @@ -170,6 +170,11 @@ int erase_sector_49lfxxxc(struct flashctx *flash, unsigned int address, unsigned
int printlock_sst_fwhub(struct flashctx *flash);
int unlock_sst_fwhub(struct flashctx *flash);

/* s25f.c */
int probe_spi_big_spansion(struct flashctx *flash);
int s25fl_block_erase(struct flashctx *flash, unsigned int addr, unsigned int blocklen);
int s25fs_block_erase_d8(struct flashctx *flash, unsigned int addr, unsigned int blocklen);

/* w39.c */
int printlock_w39f010(struct flashctx * flash);
int printlock_w39l010(struct flashctx * flash);
Expand Down
1 change: 1 addition & 0 deletions meson.build
Expand Up @@ -354,6 +354,7 @@ srcs += 'libflashrom.c'
srcs += 'opaque.c'
srcs += 'print.c'
srcs += 'programmer.c'
srcs += 's25f.c'
srcs += 'sfdp.c'
srcs += 'spi25.c'
srcs += 'spi25_statusreg.c'
Expand Down

0 comments on commit adbae0e

Please sign in to comment.