Skip to contentSkip to conversation

m25p80: add support for two bytes WRSR for Macronix chips

PATCH Applied Cédric Le Goater 3 participants 3 messages Jun 11, 2018 – Jun 15, 2018 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 16 lines · Cédric Le Goater

On Macronix chips, two bytes can written to the WRSR. First byte will configure the status register and the second the configuration register. It is important to save the configuration value as it contains the dummy cycle setting when using dual or quad IO mode.

---
 hw/block/m25p80.c | 1 +
 1 file changed, 1 insertion(+)
hw/block/m25p80.c +0 -0
index b49c8e9caa04..29775e055a24 100644

hw/block/m25p80.c static void complete_collecting_data(Flash *s) · line 705

Quoted 7 lines
hw/block/m25p80.c +1 -0
@@ -699,6 +699,7 @@ static void complete_collecting_data(Flash *s)
         case MAN_MACRONIX:
             s->quad_enable = extract32(s->data[0], 6, 1);
             if (s->len > 1) {
+                s->volatile_cfg = s->data[1];
                 s->four_bytes_address_mode = extract32(s->data[1], 5, 1);
             }
             break;

I sent this patch to qemu-ppc instead of qemu-devel ...

Sorry for the noise.

C.

#2 lore raw
Quoted 7 lines · Cédric Le Goater
Quoted 6 lines · Cédric Le Goater

On Macronix chips, two bytes can written to the WRSR. First byte will configure the status register and the second the configuration register. It is important to save the configuration value as it contains the dummy cycle setting when using dual or quad IO mode.

Alistair

Quoted 24 lines
Quoted 10 lines
---
 hw/block/m25p80.c | 1 +
 1 file changed, 1 insertion(+)
hw/block/m25p80.c +0 -0
index b49c8e9caa04..29775e055a24 100644

hw/block/m25p80.c static void complete_collecting_data(Flash *s) · line 705

Quoted 7 lines
hw/block/m25p80.c +1 -0
@@ -699,6 +699,7 @@ static void complete_collecting_data(Flash *s)
         case MAN_MACRONIX:
             s->quad_enable = extract32(s->data[0], 6, 1);
             if (s->len > 1) {
+                s->volatile_cfg = s->data[1];
                 s->four_bytes_address_mode = extract32(s->data[1], 5, 1);
             }
             break;

I sent this patch to qemu-ppc instead of qemu-devel ...

Sorry for the noise.

C.

#3 lore raw
Quoted 10 lines · Alistair Francis
Quoted 7 lines · Cédric Le Goater
Quoted 6 lines · Cédric Le Goater

On Macronix chips, two bytes can written to the WRSR. First byte will configure the status register and the second the configuration register. It is important to save the configuration value as it contains the dummy cycle setting when using dual or quad IO mode.

Applied to target-arm.next, thanks.

-- PMM