diff options
author | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2012-09-22 01:38:06 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2012-09-22 01:38:06 +0000 |
commit | 5609f9d408645657ef0dd2ca986ada5aaad4c875 (patch) | |
tree | 61f34750e39b1c9ec0be45555a8ca5b4125bc75b /spi25.c | |
parent | eb58257b9650b9191d8b987e0b214fed1ad2b77a (diff) | |
download | ast2050-flashrom-5609f9d408645657ef0dd2ca986ada5aaad4c875.zip ast2050-flashrom-5609f9d408645657ef0dd2ca986ada5aaad4c875.tar.gz |
Generify a25.c's SRWD printing function and move it to spi25.c
Corresponding to flashrom svn r1602.
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.c')
-rw-r--r-- | spi25.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -315,7 +315,13 @@ uint8_t spi_read_status_register(struct flashctx *flash) return readarr[0]; } -/* Prettyprint the status register. Common definitions. */ +/* Common highest bit: Status Register Write Disable (SRWD). */ +void spi_prettyprint_status_register_srwd(uint8_t status) +{ + msg_cdbg("Chip status register: Status Register Write Disable (SRWD) is %sset\n", + (status & (1 << 7)) ? "" : "not "); +} + void spi_prettyprint_status_register_welwip(uint8_t status) { msg_cdbg("Chip status register: Write Enable Latch (WEL) is " @@ -366,10 +372,8 @@ static void spi_prettyprint_status_register_common(uint8_t status) */ void spi_prettyprint_status_register_st_m25p(uint8_t status) { - msg_cdbg("Chip status register: Status Register Write Disable " - "(SRWD) is %sset\n", (status & (1 << 7)) ? "" : "not "); - msg_cdbg("Chip status register: Bit 6 is " - "%sset\n", (status & (1 << 6)) ? "" : "not "); + spi_prettyprint_status_register_srwd(status); + spi_prettyprint_status_register_bit(status, 6); spi_prettyprint_status_register_common(status); } |