m25p80: add support for two bytes WRSR for Macronix chips
authorCédric Le Goater <clg@kaod.org>
Fri, 15 Jun 2018 13:57:15 +0000 (14:57 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 15 Jun 2018 14:23:34 +0000 (15:23 +0100)
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.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/block/m25p80.c

index a5ccffb4aaef11678b9dbcdde2ba6ba58f4b6fe5..b0ed8fa41887040de848c8d3cb7de2ecdd5459fe 100644 (file)
@@ -698,6 +698,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;