Patchwork [v3,10/10] m25p80: Fix WINBOND fast read command handling

login
register
mail settings
Submitter marcin.krzeminski@nokia.com
Date June 24, 2016, 8:07 a.m.
Message ID <1466755631-25201-11-git-send-email-marcin.krzeminski@nokia.com>
Download mbox | patch
Permalink /patch/39629/
State New
Headers show

Comments

marcin.krzeminski@nokia.com - June 24, 2016, 8:07 a.m.
From: Marcin Krzeminski <marcin.krzeminski@nokia.com>

This commit fix obvious bug in WINBOND command handling.
Datasheet states that default dummy cycles is 8 so fix it.

Signed-off-by: Marcin Krzeminski <marcin.krzeminski@nokia.com>
---
 hw/block/m25p80.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index ca5320f..5ab22c4 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -738,6 +738,9 @@  static void decode_fast_read_cmd(Flash *s)
     s->needed_bytes = get_addr_length(s);
     switch (get_man(s)) {
     /* Dummy cycles - modeled with bytes writes instead of bits */
+    case MAN_WINBOND:
+        s->needed_bytes += 8;
+        break;
     case MAN_NUMONYX:
         s->needed_bytes += extract32(s->volatile_cfg, 4, 4);
         break;
@@ -768,7 +771,7 @@  static void decode_dio_read_cmd(Flash *s)
     /* Dummy cycles modeled with bytes writes instead of bits */
     switch (get_man(s)) {
     case MAN_WINBOND:
-        s->needed_bytes = 4;
+        s->needed_bytes += 8;
         break;
     case MAN_SPANSION:
         s->needed_bytes += SPANSION_CONTINUOUS_READ_MODE_CMD_LEN;
@@ -807,7 +810,7 @@  static void decode_qio_read_cmd(Flash *s)
     /* Dummy cycles modeled with bytes writes instead of bits */
     switch (get_man(s)) {
     case MAN_WINBOND:
-        s->needed_bytes = 6;
+        s->needed_bytes += 8;
         break;
     case MAN_SPANSION:
         s->needed_bytes += SPANSION_CONTINUOUS_READ_MODE_CMD_LEN;