summaryrefslogtreecommitdiffstats
path: root/a25.c
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2011-07-29 12:06:04 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2011-07-29 12:06:04 +0000
commite9ccad5298dbc8196428b191d657be60e8c32ce7 (patch)
treec82faf55bef5d997f96262d152ba08970d809ed7 /a25.c
parent314cfbaaf52d014f38b446e996be576f66ad2649 (diff)
downloadast2050-flashrom-e9ccad5298dbc8196428b191d657be60e8c32ce7.zip
ast2050-flashrom-e9ccad5298dbc8196428b191d657be60e8c32ce7.tar.gz
Extract spi_prettyprint_status_register_amic_a25_srwd
Extract spi_prettyprint_status_register_amic_a25_srwd from spi_prettyprint_status_register_amic_a25l* functions Corresponding to flashrom svn r1399. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'a25.c')
-rw-r--r--a25.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/a25.c b/a25.c
index c449be0..5791c46 100644
--- a/a25.c
+++ b/a25.c
@@ -23,6 +23,12 @@
/* Prettyprint the status register. Works for AMIC A25L series. */
+static void spi_prettyprint_status_register_amic_a25_srwd(uint8_t status)
+{
+ msg_cdbg("Chip status register: Status Register Write Disable "
+ "(SRWD) is %sset\n", (status & (1 << 7)) ? "" : "not ");
+}
+
int spi_prettyprint_status_register_amic_a25l05p(struct flashchip *flash)
{
uint8_t status;
@@ -30,8 +36,7 @@ int spi_prettyprint_status_register_amic_a25l05p(struct flashchip *flash)
status = spi_read_status_register();
msg_cdbg("Chip status register is %02x\n", status);
- msg_cdbg("Chip status register: Status Register Write Disable "
- "(SRWD) is %sset\n", (status & (1 << 7)) ? "" : "not ");
+ spi_prettyprint_status_register_amic_a25_srwd(status);
spi_prettyprint_status_register_bit(status, 6);
spi_prettyprint_status_register_bit(status, 5);
spi_prettyprint_status_register_bit(status, 4);
@@ -47,8 +52,7 @@ int spi_prettyprint_status_register_amic_a25l40p(struct flashchip *flash)
status = spi_read_status_register();
msg_cdbg("Chip status register is %02x\n", status);
- msg_cdbg("Chip status register: Status Register Write Disable "
- "(SRWD) is %sset\n", (status & (1 << 7)) ? "" : "not ");
+ spi_prettyprint_status_register_amic_a25_srwd(status);
spi_prettyprint_status_register_bit(status, 6);
spi_prettyprint_status_register_bit(status, 5);
spi_prettyprint_status_register_bp3210(status, 2);
@@ -63,8 +67,7 @@ int spi_prettyprint_status_register_amic_a25l032(struct flashchip *flash)
status = spi_read_status_register();
msg_cdbg("Chip status register is %02x\n", status);
- msg_cdbg("Chip status register: Status Register Write Disable "
- "(SRWD) is %sset\n", (status & (1 << 7)) ? "" : "not ");
+ spi_prettyprint_status_register_amic_a25_srwd(status);
msg_cdbg("Chip status register: Sector Protect Size (SEC) "
"is %i KB\n", (status & (1 << 6)) ? 4 : 64);
msg_cdbg("Chip status register: Top/Bottom (TB) "
@@ -82,8 +85,7 @@ int spi_prettyprint_status_register_amic_a25lq032(struct flashchip *flash)
status = spi_read_status_register();
msg_cdbg("Chip status register is %02x\n", status);
- msg_cdbg("Chip status register: Status Register Write Disable "
- "(SRWD) is %sset\n", (status & (1 << 7)) ? "" : "not ");
+ spi_prettyprint_status_register_amic_a25_srwd(status);
msg_cdbg("Chip status register: Sector Protect Size (SEC) "
"is %i KB\n", (status & (1 << 6)) ? 4 : 64);
msg_cdbg("Chip status register: Top/Bottom (TB) "
OpenPOWER on IntegriCloud