diff mbox series

hw/block: m25p80: support RDID_90 for Winbond

Message ID 20241015123228.18692-1-nikita.shubin@maquefel.me (mailing list archive)
State New, archived
Headers show
Series hw/block: m25p80: support RDID_90 for Winbond | expand

Commit Message

Nikita Shubin Oct. 15, 2024, 12:32 p.m. UTC
From: Nikita Shubin <n.shubin@yadro.com>

Make Winbond support RDID_90 as all winbond SPI NOR Flashes
support Read Manufacturer/Device ID (90h) command.

Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
---
 hw/block/m25p80.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index f7123f9e68..27f0cd0487 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -829,6 +829,16 @@  static void complete_collecting_data(Flash *s)
         s->enh_volatile_cfg = s->data[0];
         break;
     case RDID_90:
+        if (get_man(s) == MAN_WINBOND) {
+            s->data[0] = s->pi->id[0];
+            s->data[1] = s->pi->id[2];
+            s->pos = 0;
+            s->len = 2;
+            s->data_read_loop = true;
+            s->state = STATE_READING_DATA;
+            break;
+        }
+        /* fallthrough */
     case RDID_AB:
         if (get_man(s) == MAN_SST) {
             if (s->cur_addr <= 1) {