[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/32] aspeed/smc: fix dummy cycles count when in dua
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 01/32] aspeed/smc: fix dummy cycles count when in dual IO mode |
Date: |
Tue, 26 Jun 2018 17:56:27 +0100 |
From: Cédric Le Goater <address@hidden>
When configured in dual I/O mode, address and data are sent in dual
mode, including the dummy byte cycles in between. Adapt the count to
the IO setting.
Signed-off-by: Cédric Le Goater <address@hidden>
Reviewed-by: Andrew Jeffery <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>
---
hw/ssi/aspeed_smc.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index 5059396bc62..fce126e6ee9 100644
--- a/hw/ssi/aspeed_smc.c
+++ b/hw/ssi/aspeed_smc.c
@@ -66,6 +66,8 @@
/* CEx Control Register */
#define R_CTRL0 (0x10 / 4)
+#define CTRL_IO_DUAL_DATA (1 << 29)
+#define CTRL_IO_DUAL_ADDR_DATA (1 << 28) /* Includes dummies */
#define CTRL_CMD_SHIFT 16
#define CTRL_CMD_MASK 0xff
#define CTRL_DUMMY_HIGH_SHIFT 14
@@ -492,8 +494,13 @@ static int aspeed_smc_flash_dummies(const AspeedSMCFlash
*fl)
uint32_t r_ctrl0 = s->regs[s->r_ctrl0 + fl->id];
uint32_t dummy_high = (r_ctrl0 >> CTRL_DUMMY_HIGH_SHIFT) & 0x1;
uint32_t dummy_low = (r_ctrl0 >> CTRL_DUMMY_LOW_SHIFT) & 0x3;
+ uint32_t dummies = ((dummy_high << 2) | dummy_low) * 8;
- return ((dummy_high << 2) | dummy_low) * 8;
+ if (r_ctrl0 & CTRL_IO_DUAL_ADDR_DATA) {
+ dummies /= 2;
+ }
+
+ return dummies;
}
static void aspeed_smc_flash_send_addr(AspeedSMCFlash *fl, uint32_t addr)
--
2.17.1
- [Qemu-devel] [PULL 00/32] target-arm queue, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 10/32] hw/dma/omap_dma: Use qemu_log_mask(GUEST_ERROR) instead of fprintf, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 11/32] hw/ssi/omap_spi: Use qemu_log_mask(GUEST_ERROR) instead of fprintf, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 09/32] hw/dma/omap_dma: Use qemu_log_mask(UNIMP) instead of printf, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 12/32] hw/sd/omap_mmc: Use qemu_log_mask(UNIMP) instead of printf, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 07/32] hw/input/pckbd: Use qemu_log_mask(GUEST_ERROR) instead of fprintf, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 13/32] hw/i2c/omap_i2c: Use qemu_log_mask(UNIMP) instead of fprintf, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 14/32] hw/arm/omap1: Use qemu_log_mask(GUEST_ERROR) instead of fprintf, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 05/32] xilinx_spips: Make dma transactions as per dma_burst_size, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 02/32] aspeed/smc: fix HW strapping, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 01/32] aspeed/smc: fix dummy cycles count when in dual IO mode,
Peter Maydell <=
- [Qemu-devel] [PULL 17/32] hw/net/stellaris_enet: Fix a typo, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 19/32] hw/net/smc91c111: Use qemu_log_mask(GUEST_ERROR) instead of hw_error, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 08/32] hw/input/tsc2005: Use qemu_log_mask(GUEST_ERROR) instead of fprintf, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 03/32] aspeed/smc: rename aspeed_smc_flash_send_addr() to aspeed_smc_flash_setup(), Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 06/32] MAINTAINERS: Add ASPEED BMCs, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 04/32] MAINTAINERS: Adopt the Gumstix computers-on-module machines, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 18/32] hw/net/stellaris_enet: Use qemu_log_mask(GUEST_ERROR) instead of hw_error, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 21/32] hw/arm/stellaris: Fix gptm_write() error message, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 15/32] hw/arm/omap: Use qemu_log_mask(GUEST_ERROR) instead of fprintf, Peter Maydell, 2018/06/26
- [Qemu-devel] [PULL 16/32] hw/arm/stellaris: Use qemu_log_mask(UNIMP) instead of fprintf, Peter Maydell, 2018/06/26