[PATCH qemu 07/12] m25p80: add RDCR instruction for Macronix chip
Cédric Le Goater
clg at kaod.org
Mon May 30 07:20:00 AEST 2016
Some Macronix chips, such as the MX25L25635F (0xc22019) used on
OpenPower boxes, have a Read Configuration Register (RDCR)
instruction. This patch adds this new command to the m25p80 object and
exposes the 4BYTE mode.
Signed-off-by: Cédric Le Goater <clg at kaod.org>
---
hw/block/m25p80.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index c4aee22eae88..02f77012c21b 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -252,6 +252,7 @@ typedef enum {
WRDI = 0x4,
RDSR = 0x5,
WREN = 0x6,
+ RDCR = 0x15,
JEDEC_READ = 0x9f,
BULK_ERASE = 0xc7,
READ_FSR = 0x70,
@@ -708,6 +709,13 @@ static void decode_new_cmd(Flash *s, uint32_t value)
s->state = STATE_READING_DATA;
break;
+ case RDCR:
+ s->data[0] = (!!s->four_bytes_address_mode) << 5;
+ s->pos = 0;
+ s->len = 1;
+ s->state = STATE_READING_DATA;
+ break;
+
case READ_FSR:
s->data[0] = FSR_FLASH_READY;
if (s->four_bytes_address_mode) {
--
2.1.4
More information about the openbmc
mailing list