qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 10/12] i.MX: Add the Freescale SPI Controller


From: Jean-Christophe DUBOIS
Subject: Re: [Qemu-devel] [PATCH v3 10/12] i.MX: Add the Freescale SPI Controller
Date: Thu, 10 Mar 2016 20:26:13 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

Le 10/03/2016 11:31, Peter Maydell a écrit :
On 2 March 2016 at 05:27, Jean-Christophe Dubois <address@hidden> wrote:
Signed-off-by: Jean-Christophe Dubois <address@hidden>
---

+
+static void imx_spi_reset(DeviceState *dev)
+{
+    IMXSPIState *s = IMX_SPI(dev);
+    int i;
+
+    DPRINTF("\n");
+
+    memset(s->regs, 0, sizeof(s->regs));
+
+    s->regs[ECSPI_STATREG] = 0x00000003;
+
+    imx_spi_rxfifo_reset(s);
+    imx_spi_txfifo_reset(s);
+
+    imx_spi_update_irq(s);
+
+    s->burst_length = 0;
+
+    for (i = 0; i < 4; i++) {
+        qemu_set_irq(s->cs_lines[i], 0);
+    }
Calling qemu_set_irq() from a reset function is generally
a bad idea.

Could I assume that all irq lines are set automatically to 0 on reset?


+}
Otherwise
Reviewed-by: Peter Maydell <address@hidden>

thanks
-- PMM





reply via email to

[Prev in Thread] Current Thread [Next in Thread]