[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/9] hw/block: m25p80: Fix the number of dummy bytes needed for M
From: |
Bin Meng |
Subject: |
[PATCH 3/9] hw/block: m25p80: Fix the number of dummy bytes needed for Macronix flashes |
Date: |
Thu, 14 Jan 2021 23:08:56 +0800 |
From: Bin Meng <bin.meng@windriver.com>
Per datasheet [1], the number of dummy cycles for Macronix flashes
is configurable via two volatible bits (DC1, DC2) in a configuration
register.
Do the same dummy cycle to dummy byte conversion fix as others.
[1]
https://www.macronix.com/Lists/Datasheet/Attachments/7674/MX66U51235F,%201.8V,%20512Mb,%20v1.1.pdf
Fixes: cf6f1efe0b57 ("m25p80: Fast read commands family changes")
Signed-off-by: Bin Meng <bin.meng@windriver.com>
---
hw/block/m25p80.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index c8cd12a6d3..44508b3da9 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -949,10 +949,10 @@ static void decode_fast_read_cmd(Flash *s)
break;
case MAN_MACRONIX:
if (extract32(s->volatile_cfg, 6, 2) == 1) {
- s->needed_bytes += 6;
- } else {
- s->needed_bytes += 8;
+ qemu_log_mask(LOG_UNIMP,
+ "M25P80: the number of dummy bits is not multiple of
8");
}
+ s->needed_bytes += 1;
break;
case MAN_SPANSION:
s->needed_bytes += extract32(s->spansion_cr2v,
@@ -989,13 +989,14 @@ static void decode_dio_read_cmd(Flash *s)
case MAN_MACRONIX:
switch (extract32(s->volatile_cfg, 6, 2)) {
case 1:
- s->needed_bytes += 6;
- break;
+ qemu_log_mask(LOG_UNIMP,
+ "M25P80: the number of dummy bits is not multiple of
8");
+ /* fall-through */
case 2:
- s->needed_bytes += 8;
+ s->needed_bytes += 2;
break;
default:
- s->needed_bytes += 4;
+ s->needed_bytes += 1;
break;
}
break;
@@ -1028,13 +1029,13 @@ static void decode_qio_read_cmd(Flash *s)
case MAN_MACRONIX:
switch (extract32(s->volatile_cfg, 6, 2)) {
case 1:
- s->needed_bytes += 4;
+ s->needed_bytes += 2;
break;
case 2:
- s->needed_bytes += 8;
+ s->needed_bytes += 4;
break;
default:
- s->needed_bytes += 6;
+ s->needed_bytes += 3;
break;
}
break;
--
2.25.1
- [PATCH 0/9] hw/block: m25p80: Fix the mess of dummy bytes needed for fast read commands, Bin Meng, 2021/01/14
- [PATCH 1/9] hw/block: m25p80: Fix the number of dummy bytes needed for Windbond flashes, Bin Meng, 2021/01/14
- [PATCH 2/9] hw/block: m25p80: Fix the number of dummy bytes needed for Numonyx/Micron flashes, Bin Meng, 2021/01/14
- [PATCH 3/9] hw/block: m25p80: Fix the number of dummy bytes needed for Macronix flashes,
Bin Meng <=
- [PATCH 4/9] hw/block: m25p80: Fix the number of dummy bytes needed for Spansion flashes, Bin Meng, 2021/01/14
- [PATCH 5/9] hw/block: m25p80: Support fast read for SST flashes, Bin Meng, 2021/01/14
- [PATCH 6/9] hw/ssi: xilinx_spips: Fix generic fifo dummy cycle handling, Bin Meng, 2021/01/14
- [PATCH 7/9] Revert "aspeed/smc: Fix number of dummy cycles for FAST_READ_4 command", Bin Meng, 2021/01/14
- [PATCH 8/9] Revert "aspeed/smc: snoop SPI transfers to fake dummy cycles", Bin Meng, 2021/01/14
- [PATCH 9/9] hw/ssi: npcm7xx_fiu: Correct the dummy cycle emulation logic, Bin Meng, 2021/01/14
- Re: [PATCH 0/9] hw/block: m25p80: Fix the mess of dummy bytes needed for fast read commands, Cédric Le Goater, 2021/01/14
- Re: [PATCH 0/9] hw/block: m25p80: Fix the mess of dummy bytes needed for fast read commands, no-reply, 2021/01/14
- Re: [PATCH 0/9] hw/block: m25p80: Fix the mess of dummy bytes needed for fast read commands, Francisco Iglesias, 2021/01/14