[PATCH qemu v2 08/10] m25p80: add RDCR instruction for Macronix chip
Cédric Le Goater
clg at kaod.org
Tue Jun 14 03:16:34 AEST 2016
Some Macronix chips, such as the MX25L25635F used on OpenPower boxes,
have a Read Configuration Register (RDCR) instruction.
Add this new instruction to the m25p80 object and expose 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 3a500ed03c1b..74989ad93612 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -254,6 +254,7 @@ typedef enum {
WRDI = 0x4,
RDSR = 0x5,
WREN = 0x6,
+ RDCR = 0x15,
JEDEC_READ = 0x9f,
BULK_ERASE = 0xc7,
READ_FSR = 0x70,
@@ -703,6 +704,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