[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH for-2.9 15/30] aspeed/smc: introduce a aspeed_smc_flas
From: |
Cédric Le Goater |
Subject: |
[Qemu-arm] [PATCH for-2.9 15/30] aspeed/smc: introduce a aspeed_smc_flash_update_cs() helper |
Date: |
Tue, 29 Nov 2016 16:43:53 +0100 |
aspeed_smc_update_cs() was uselessly looping on all CS to update their
status.
Signed-off-by: Cédric Le Goater <address@hidden>
Reviewed-by: Joel Stanley <address@hidden>
Reviewed-by: Andrew Jeffery <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/ssi/aspeed_smc.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index 66622f198a2f..1c6c5089f265 100644
--- a/hw/ssi/aspeed_smc.c
+++ b/hw/ssi/aspeed_smc.c
@@ -414,15 +414,6 @@ static void aspeed_smc_flash_update_cs(AspeedSMCFlash *fl)
qemu_set_irq(s->cs_lines[fl->id], aspeed_smc_is_ce_stop_active(fl));
}
-static void aspeed_smc_update_cs(const AspeedSMCState *s)
-{
- int i;
-
- for (i = 0; i < s->num_cs; ++i) {
- aspeed_smc_flash_update_cs(&s->flashes[i]);
- }
-}
-
static void aspeed_smc_reset(DeviceState *d)
{
AspeedSMCState *s = ASPEED_SMC(d);
@@ -436,6 +427,7 @@ static void aspeed_smc_reset(DeviceState *d)
/* Unselect all slaves */
for (i = 0; i < s->num_cs; ++i) {
s->regs[s->r_ctrl0 + i] |= CTRL_CE_STOP_ACTIVE;
+ qemu_set_irq(s->cs_lines[i], true);
}
/* setup default segment register values for all */
@@ -443,8 +435,6 @@ static void aspeed_smc_reset(DeviceState *d)
s->regs[R_SEG_ADDR0 + i] =
aspeed_smc_segment_to_reg(&s->ctrl->segments[i]);
}
-
- aspeed_smc_update_cs(s);
}
static uint64_t aspeed_smc_read(void *opaque, hwaddr addr, unsigned int size)
@@ -494,8 +484,9 @@ static void aspeed_smc_write(void *opaque, hwaddr addr,
uint64_t data,
addr == s->r_ce_ctrl) {
s->regs[addr] = value;
} else if (addr >= s->r_ctrl0 && addr < s->r_ctrl0 + s->num_cs) {
+ int cs = addr - s->r_ctrl0;
s->regs[addr] = value;
- aspeed_smc_update_cs(s);
+ aspeed_smc_flash_update_cs(&s->flashes[cs]);
} else if (addr >= R_SEG_ADDR0 &&
addr < R_SEG_ADDR0 + s->ctrl->max_slaves) {
int cs = addr - R_SEG_ADDR0;
--
2.7.4
- [Qemu-arm] [PATCH for-2.9 05/30] aspeed: attach the second SPI controller object to the SoC, (continued)
- [Qemu-arm] [PATCH for-2.9 05/30] aspeed: attach the second SPI controller object to the SoC, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 06/30] aspeed: extend the board configuration with flash models, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 07/30] aspeed: add support for the romulus-bmc board, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 08/30] aspeed: add a memory region for SRAM, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 09/30] aspeed: add the definitions for the AST2400 A1 SoC, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 10/30] aspeed: change SoC revision of the palmetto-bmc machine, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 11/30] aspeed/scu: fix SCU region size, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 12/30] aspeed/smc: improve segment register support, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 13/30] aspeed/smc: set the number of flash modules for the FMC controller, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 14/30] aspeed/smc: rework the prototype of the AspeedSMCFlash helper routines, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 15/30] aspeed/smc: introduce a aspeed_smc_flash_update_cs() helper,
Cédric Le Goater <=
- [Qemu-arm] [PATCH for-2.9 16/30] aspeed/smc: autostrap CE0/1 configuration, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 17/30] aspeed/smc: handle SPI flash Command mode, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 18/30] aspeed/smc: extend tests for Command mode, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 19/30] aspeed/smc: unfold the AspeedSMCController array, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 20/30] aspeed/smc: add a 'sdram_base' property, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 21/30] aspeed/smc: add support for DMAs, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 22/30] aspeed/smc: handle dummy bytes when doing fast reads, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 23/30] aspeed/smc: adjust the size of the register region, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 24/30] aspeed: use first SPI flash as a boot ROM, Cédric Le Goater, 2016/11/29
- [Qemu-arm] [PATCH for-2.9 25/30] block: add a model option for MTD devices, Cédric Le Goater, 2016/11/29