aboutsummaryrefslogtreecommitdiff
path: root/hw/ssi
diff options
context:
space:
mode:
authorBin Meng <bin.meng@windriver.com>2021-01-29 21:23:15 +0800
committerPeter Maydell <peter.maydell@linaro.org>2021-02-02 17:00:54 +0000
commit3c9829e57468f3a53078aa2e10d35afde3208b36 (patch)
tree480da368237748909ee2195d4e6dd914defdee70 /hw/ssi
parent1da79ecc7a299a6f3633876c8e49e5418ae37fcf (diff)
hw/ssi: imx_spi: Remove imx_spi_update_irq() in imx_spi_reset()
Usually the approach is that the device on the other end of the line is going to reset its state anyway, so there's no need to actively signal an irq line change during the reset hook. Move imx_spi_update_irq() out of imx_spi_reset(), to a new function imx_spi_soft_reset() that is called when the controller is disabled. Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20210129132323.30946-3-bmeng.cn@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/ssi')
-rw-r--r--hw/ssi/imx_spi.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c
index e605049a21..4d488b159a 100644
--- a/hw/ssi/imx_spi.c
+++ b/hw/ssi/imx_spi.c
@@ -241,11 +241,16 @@ static void imx_spi_reset(DeviceState *dev)
imx_spi_rxfifo_reset(s);
imx_spi_txfifo_reset(s);
- imx_spi_update_irq(s);
-
s->burst_length = 0;
}
+static void imx_spi_soft_reset(IMXSPIState *s)
+{
+ imx_spi_reset(DEVICE(s));
+
+ imx_spi_update_irq(s);
+}
+
static uint64_t imx_spi_read(void *opaque, hwaddr offset, unsigned size)
{
uint32_t value = 0;
@@ -351,8 +356,9 @@ static void imx_spi_write(void *opaque, hwaddr offset, uint64_t value,
s->regs[ECSPI_CONREG] = value;
if (!imx_spi_is_enabled(s)) {
- /* device is disabled, so this is a reset */
- imx_spi_reset(DEVICE(s));
+ /* device is disabled, so this is a soft reset */
+ imx_spi_soft_reset(s);
+
return;
}