diff options
author | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2012-12-29 15:04:20 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2012-12-29 15:04:20 +0000 |
commit | 57794ac1580fc5efee3ba01a0c3e4539bb58d088 (patch) | |
tree | 4212a02023a6a8c6dd0b03d234e66471ddb5d634 /spi25_statusreg.c | |
parent | 54aaa4ae2bb4026ae7acbf3e0aafe8542aaff2a4 (diff) | |
download | flashrom-57794ac1580fc5efee3ba01a0c3e4539bb58d088.tar.gz flashrom-57794ac1580fc5efee3ba01a0c3e4539bb58d088.tar.bz2 flashrom-57794ac1580fc5efee3ba01a0c3e4539bb58d088.zip |
Add support for Atmel's AT25F series of SPI flash chips
This adds support for the following chips:
- AT25F512, AT25F512A, AT25F512B
- AT25F1024, AT25F1024A
- AT25F2048
- AT25F4096
Besides the definitions of the the chips in flashchips.c this includes
- a dedicated probing method (probe_spi_at25f)
- pretty printing methods (spi_prettyprint_status_register_at25f*), and
- unlocking methods (spi_disable_blockprotect_at25f*)
Corresponding to flashrom svn r1637.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'spi25_statusreg.c')
-rw-r--r-- | spi25_statusreg.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/spi25_statusreg.c b/spi25_statusreg.c index 2e01c06d6..c0891576d 100644 --- a/spi25_statusreg.c +++ b/spi25_statusreg.c @@ -378,6 +378,40 @@ int spi_prettyprint_status_register_at25df_sec(struct flashctx *flash) return spi_prettyprint_status_register_at25df(flash); } +/* used for AT25F512, AT25F1024(A), AT25F2048 */ +int spi_prettyprint_status_register_at25f(struct flashctx *flash) +{ + uint8_t status; + + status = spi_read_status_register(flash); + spi_prettyprint_status_register_hex(status); + + spi_prettyprint_status_register_atmel_at25_wpen(status); + spi_prettyprint_status_register_bit(status, 6); + spi_prettyprint_status_register_bit(status, 5); + spi_prettyprint_status_register_bit(status, 4); + spi_prettyprint_status_register_bp(status, 1); + spi_prettyprint_status_register_welwip(status); + return 0; +} + +int spi_prettyprint_status_register_at25f512a(struct flashctx *flash) +{ + uint8_t status; + + status = spi_read_status_register(flash); + spi_prettyprint_status_register_hex(status); + + spi_prettyprint_status_register_atmel_at25_wpen(status); + spi_prettyprint_status_register_bit(status, 6); + spi_prettyprint_status_register_bit(status, 5); + spi_prettyprint_status_register_bit(status, 4); + spi_prettyprint_status_register_bit(status, 3); + spi_prettyprint_status_register_bp(status, 0); + spi_prettyprint_status_register_welwip(status); + return 0; +} + int spi_prettyprint_status_register_at25f512b(struct flashctx *flash) { uint8_t status = spi_read_status_register(flash); @@ -392,6 +426,21 @@ int spi_prettyprint_status_register_at25f512b(struct flashctx *flash) return 0; } +int spi_prettyprint_status_register_at25f4096(struct flashctx *flash) +{ + uint8_t status; + + status = spi_read_status_register(flash); + spi_prettyprint_status_register_hex(status); + + spi_prettyprint_status_register_atmel_at25_wpen(status); + spi_prettyprint_status_register_bit(status, 6); + spi_prettyprint_status_register_bit(status, 5); + spi_prettyprint_status_register_bp(status, 2); + spi_prettyprint_status_register_welwip(status); + return 0; +} + int spi_prettyprint_status_register_at25fs010(struct flashctx *flash) { uint8_t status = spi_read_status_register(flash); @@ -450,6 +499,16 @@ int spi_disable_blockprotect_at25df_sec(struct flashctx *flash) return spi_disable_blockprotect_at25df(flash); } +int spi_disable_blockprotect_at25f(struct flashctx *flash) +{ + return spi_disable_blockprotect_generic(flash, 0x0C, 1 << 7, 0); +} + +int spi_disable_blockprotect_at25f512a(struct flashctx *flash) +{ + return spi_disable_blockprotect_generic(flash, 0x04, 1 << 7, 0); +} + int spi_disable_blockprotect_at25f512b(struct flashctx *flash) { /* spi_disable_blockprotect_at25df is not really the right way to do @@ -458,6 +517,11 @@ int spi_disable_blockprotect_at25f512b(struct flashctx *flash) return spi_disable_blockprotect_at25df(flash); } +int spi_disable_blockprotect_at25f4096(struct flashctx *flash) +{ + return spi_disable_blockprotect_generic(flash, 0x1C, 1 << 7, 0); +} + int spi_disable_blockprotect_at25fs010(struct flashctx *flash) { return spi_disable_blockprotect_generic(flash, 0x6C, 1 << 7, 0); |