[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 9/9] hw/ssi: npcm7xx_fiu: Correct the dummy cycle emulation logic
From: |
Bin Meng |
Subject: |
[PATCH 9/9] hw/ssi: npcm7xx_fiu: Correct the dummy cycle emulation logic |
Date: |
Thu, 14 Jan 2021 23:09:02 +0800 |
From: Bin Meng <bin.meng@windriver.com>
I believe send_dummy_bits() should also be fixed, but I really don't
know how based on my pure read/guess of the codes since there is no
public datasheet available for this NPCM7xx SoC.
Signed-off-by: Bin Meng <bin.meng@windriver.com>
---
hw/ssi/npcm7xx_fiu.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/hw/ssi/npcm7xx_fiu.c b/hw/ssi/npcm7xx_fiu.c
index 5040132b07..e76fb5ad9f 100644
--- a/hw/ssi/npcm7xx_fiu.c
+++ b/hw/ssi/npcm7xx_fiu.c
@@ -150,7 +150,7 @@ static uint64_t npcm7xx_fiu_flash_read(void *opaque, hwaddr
addr,
NPCM7xxFIUState *fiu = f->fiu;
uint64_t value = 0;
uint32_t drd_cfg;
- int dummy_cycles;
+ int dummy_bytes;
int i;
if (fiu->active_cs != -1) {
@@ -180,10 +180,8 @@ static uint64_t npcm7xx_fiu_flash_read(void *opaque,
hwaddr addr,
break;
}
- /* Flash chip model expects one transfer per dummy bit, not byte */
- dummy_cycles =
- (FIU_DRD_CFG_DBW(drd_cfg) * 8) >> FIU_DRD_CFG_ACCTYPE(drd_cfg);
- for (i = 0; i < dummy_cycles; i++) {
+ dummy_bytes = FIU_DRD_CFG_DBW(drd_cfg) >> FIU_DRD_CFG_ACCTYPE(drd_cfg);
+ for (i = 0; i < dummy_bytes; i++) {
ssi_transfer(fiu->spi, 0);
}
--
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, 2021/01/14
- [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 <=
- 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