[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH 3/4] aspeed/smc: handle dummies only in fast read mode
From: |
Cédric Le Goater |
Subject: |
[Qemu-arm] [PATCH 3/4] aspeed/smc: handle dummies only in fast read mode |
Date: |
Thu, 9 Feb 2017 14:47:37 +0100 |
HW works fine in normal read mode with dummy bytes being set. So let's
check this case to not transfer bytes.
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/ssi/aspeed_smc.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index 087b29e8da10..70177078a8f2 100644
--- a/hw/ssi/aspeed_smc.c
+++ b/hw/ssi/aspeed_smc.c
@@ -536,10 +536,13 @@ static uint64_t aspeed_smc_flash_read(void *opaque,
hwaddr addr, unsigned size)
/*
* Use fake transfers to model dummy bytes. The value should
* be configured to some non-zero value in fast read mode and
- * zero in read mode.
+ * zero in read mode. But, as the HW allows inconsistent
+ * settings, let's check for fast read mode.
*/
- for (i = 0; i < aspeed_smc_flash_dummies(fl); i++) {
- ssi_transfer(fl->controller->spi, 0xFF);
+ if (aspeed_smc_flash_mode(fl) == CTRL_FREADMODE) {
+ for (i = 0; i < aspeed_smc_flash_dummies(fl); i++) {
+ ssi_transfer(fl->controller->spi, 0xFF);
+ }
}
for (i = 0; i < size; i++) {
--
2.7.4