* [PATCH] hw/ssi: Fix Linux driver init issue with xilinx_spi
@ 2023-03-23 18:28 Chris Rauer
2023-03-30 9:51 ` Peter Maydell
2023-03-31 10:09 ` Edgar E. Iglesias
0 siblings, 2 replies; 4+ messages in thread
From: Chris Rauer @ 2023-03-23 18:28 UTC (permalink / raw)
To: alistair, peter.maydell; +Cc: qemu-devel, Chris Rauer
The problem is that the Linux driver expects the master transaction inhibit
bit(R_SPICR_MTI) to be set during driver initialization so that it can
detect the fifo size but QEMU defaults it to zero out of reset. The
datasheet indicates this bit is active on reset.
See page 25, SPI Control Register section:
https://www.xilinx.com/content/dam/xilinx/support/documents/ip_documentation/axi_quad_spi/v3_2/pg153-axi-quad-spi.pdf
Signed-off-by: Chris Rauer <crauer@google.com>
---
hw/ssi/xilinx_spi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c
index 552927622f..d4de2e7aab 100644
--- a/hw/ssi/xilinx_spi.c
+++ b/hw/ssi/xilinx_spi.c
@@ -156,6 +156,7 @@ static void xlx_spi_do_reset(XilinxSPI *s)
txfifo_reset(s);
s->regs[R_SPISSR] = ~0;
+ s->regs[R_SPICR] = R_SPICR_MTI;
xlx_spi_update_irq(s);
xlx_spi_update_cs(s);
}
--
2.40.0.348.gf938b09366-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/ssi: Fix Linux driver init issue with xilinx_spi
2023-03-23 18:28 [PATCH] hw/ssi: Fix Linux driver init issue with xilinx_spi Chris Rauer
@ 2023-03-30 9:51 ` Peter Maydell
2023-03-31 10:09 ` Edgar E. Iglesias
1 sibling, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2023-03-30 9:51 UTC (permalink / raw)
To: Chris Rauer; +Cc: alistair, qemu-devel, Edgar E. Iglesias
Ping to the Xilinx folks, do you want to review this?
thanks
-- PMM
On Thu, 23 Mar 2023 at 18:28, Chris Rauer <crauer@google.com> wrote:
>
> The problem is that the Linux driver expects the master transaction inhibit
> bit(R_SPICR_MTI) to be set during driver initialization so that it can
> detect the fifo size but QEMU defaults it to zero out of reset. The
> datasheet indicates this bit is active on reset.
>
> See page 25, SPI Control Register section:
> https://www.xilinx.com/content/dam/xilinx/support/documents/ip_documentation/axi_quad_spi/v3_2/pg153-axi-quad-spi.pdf
>
> Signed-off-by: Chris Rauer <crauer@google.com>
> ---
> hw/ssi/xilinx_spi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c
> index 552927622f..d4de2e7aab 100644
> --- a/hw/ssi/xilinx_spi.c
> +++ b/hw/ssi/xilinx_spi.c
> @@ -156,6 +156,7 @@ static void xlx_spi_do_reset(XilinxSPI *s)
> txfifo_reset(s);
>
> s->regs[R_SPISSR] = ~0;
> + s->regs[R_SPICR] = R_SPICR_MTI;
> xlx_spi_update_irq(s);
> xlx_spi_update_cs(s);
> }
> --
> 2.40.0.348.gf938b09366-goog
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/ssi: Fix Linux driver init issue with xilinx_spi
2023-03-23 18:28 [PATCH] hw/ssi: Fix Linux driver init issue with xilinx_spi Chris Rauer
2023-03-30 9:51 ` Peter Maydell
@ 2023-03-31 10:09 ` Edgar E. Iglesias
2023-03-31 10:11 ` Peter Maydell
1 sibling, 1 reply; 4+ messages in thread
From: Edgar E. Iglesias @ 2023-03-31 10:09 UTC (permalink / raw)
To: Chris Rauer; +Cc: alistair, peter.maydell, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1212 bytes --]
On Thu, Mar 23, 2023 at 7:29 PM Chris Rauer <crauer@google.com> wrote:
> The problem is that the Linux driver expects the master transaction inhibit
> bit(R_SPICR_MTI) to be set during driver initialization so that it can
> detect the fifo size but QEMU defaults it to zero out of reset. The
> datasheet indicates this bit is active on reset.
>
> See page 25, SPI Control Register section:
>
> https://www.xilinx.com/content/dam/xilinx/support/documents/ip_documentation/axi_quad_spi/v3_2/pg153-axi-quad-spi.pdf
>
>
Yes, MTI should be set when the device comes out of reset.
Reviewed-by: Edgar E. Iglesias <edgar@zeroasic.com>
> Signed-off-by: Chris Rauer <crauer@google.com>
> ---
> hw/ssi/xilinx_spi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c
> index 552927622f..d4de2e7aab 100644
> --- a/hw/ssi/xilinx_spi.c
> +++ b/hw/ssi/xilinx_spi.c
> @@ -156,6 +156,7 @@ static void xlx_spi_do_reset(XilinxSPI *s)
> txfifo_reset(s);
>
> s->regs[R_SPISSR] = ~0;
> + s->regs[R_SPICR] = R_SPICR_MTI;
> xlx_spi_update_irq(s);
> xlx_spi_update_cs(s);
> }
> --
> 2.40.0.348.gf938b09366-goog
>
>
>
[-- Attachment #2: Type: text/html, Size: 2068 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/ssi: Fix Linux driver init issue with xilinx_spi
2023-03-31 10:09 ` Edgar E. Iglesias
@ 2023-03-31 10:11 ` Peter Maydell
0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2023-03-31 10:11 UTC (permalink / raw)
To: Edgar E. Iglesias; +Cc: Chris Rauer, alistair, qemu-devel
On Fri, 31 Mar 2023 at 11:09, Edgar E. Iglesias
<edgar.iglesias@gmail.com> wrote:
>
>
> On Thu, Mar 23, 2023 at 7:29 PM Chris Rauer <crauer@google.com> wrote:
>>
>> The problem is that the Linux driver expects the master transaction inhibit
>> bit(R_SPICR_MTI) to be set during driver initialization so that it can
>> detect the fifo size but QEMU defaults it to zero out of reset. The
>> datasheet indicates this bit is active on reset.
>>
>> See page 25, SPI Control Register section:
>> https://www.xilinx.com/content/dam/xilinx/support/documents/ip_documentation/axi_quad_spi/v3_2/pg153-axi-quad-spi.pdf
>>
>
> Yes, MTI should be set when the device comes out of reset.
>
> Reviewed-by: Edgar E. Iglesias <edgar@zeroasic.com>
Thanks; applied to target-arm.next for 8.0.
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-03-31 10:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-23 18:28 [PATCH] hw/ssi: Fix Linux driver init issue with xilinx_spi Chris Rauer
2023-03-30 9:51 ` Peter Maydell
2023-03-31 10:09 ` Edgar E. Iglesias
2023-03-31 10:11 ` Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).