From 05383f55993c7aacf2d2d722d8009b0a67335a05 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Thu, 19 May 2011 00:06:06 +0000 Subject: Add lock printing for AMIC A25L05PT, A25L05PU, A25L10PT, A25L10PU, A25L20PT, A25L20PU, A25L40PT, A25L40PU, A25L80P, A25L16PT, A25L16PU A25L512, A25L010, A25L020, A25L040, A25L080, A25L016, A25L032, A25LQ032 to a25.c. Add lock printing for Atmel AT26DF081A, AT26DF161, AT26DF161A, AT26DF321. Move Atmel AT25*/AT26* lock related functions originally added in r1115 from spi25.c to at25.c. For SPI chips the lock printing was handled by one common function, but sharing a common function which only is a big switch() statement doesn't make sense, especially if we can define lock printing functions per flash chip anyway. The printlock function pointer in struct flashchip is used to print status register and locking information, and serves as replacement for implicit status register and lock printing during probe. That code will later be changed to store locking info in a machine- accessible data structure so flashrom can handle locked regions correctly. Corresponding to flashrom svn r1316. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Stefan Tauner --- flashchips.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'flashchips.c') diff --git a/flashchips.c b/flashchips.c index 60d95ce..d1bf2fe 100644 --- a/flashchips.c +++ b/flashchips.c @@ -546,6 +546,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l05p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -577,6 +578,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l05p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -609,6 +611,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l05p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -641,6 +644,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l05p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -673,6 +677,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l05p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -705,6 +710,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l05p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -742,6 +748,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l40p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -774,6 +781,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l40p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -806,6 +814,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l40p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -841,6 +850,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l40p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -876,6 +886,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l40p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -906,6 +917,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l40p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -936,6 +948,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l40p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -966,6 +979,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l40p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -996,6 +1010,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l40p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -1026,6 +1041,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l40p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -1056,6 +1072,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l40p, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -1092,6 +1109,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25l032, .unlock = NULL, /* Two status reg bytes (read with 0x35 and 0x05) */ .write = spi_chip_write_256, .read = spi_chip_read, @@ -1128,6 +1146,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_amic_a25lq032, .unlock = NULL, /* Two status reg bytes (read with 0x35 and 0x05) */ .write = spi_chip_write_256, .read = spi_chip_read, @@ -1746,6 +1765,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_atmel_at26df081a, .unlock = spi_disable_blockprotect_at25df, .write = spi_chip_write_256, .read = spi_chip_read, @@ -1781,6 +1801,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_at25df, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -1816,6 +1837,7 @@ const struct flashchip flashchips[] = { .block_erase = spi_block_erase_c7, } }, + .printlock = spi_prettyprint_status_register_atmel_at26df081a, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, @@ -1833,6 +1855,7 @@ const struct flashchip flashchips[] = { .tested = TEST_UNTESTED, .probe = probe_spi_rdid, .probe_timing = TIMING_ZERO, + .printlock = spi_prettyprint_status_register_atmel_at26df081a, .unlock = spi_disable_blockprotect, .write = spi_chip_write_256, .read = spi_chip_read, -- cgit v1.1