All of lore.kernel.org
 help / color / mirror / Atom feed
* [QEMU][PATCH v2] ssi: xilinx_spips: Skip update of cs and fifo releated to spips in gqspi
@ 2019-10-17 10:17 Sai Pavan Boddu
  2019-10-17 10:31 ` Philippe Mathieu-Daudé
  2019-10-17 13:35 ` Francisco Iglesias
  0 siblings, 2 replies; 4+ messages in thread
From: Sai Pavan Boddu @ 2019-10-17 10:17 UTC (permalink / raw)
  To: Alistair Francis; +Cc: edgar.iglesias, Peter Maydell, qemu-devel

GQSPI handles chip selects and fifos in a different way compared to
spips. So skip update of cs and fifos related to spips in gqspi mode.

Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
---
Changes for V2:
    Just skip update of spips cs and fifos
    Update commit message accordingly

 hw/ssi/xilinx_spips.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c
index a309c71..27154b0 100644
--- a/hw/ssi/xilinx_spips.c
+++ b/hw/ssi/xilinx_spips.c
@@ -1022,6 +1022,13 @@ static void xilinx_spips_write(void *opaque, hwaddr addr,
     }
     s->regs[addr] = (s->regs[addr] & ~mask) | (value & mask);
 no_reg_update:
+    /* In GQSPI mode skip update of CS and fifo's related to spips */
+    if (object_dynamic_cast(OBJECT(s), TYPE_XLNX_ZYNQMP_QSPIPS)) {
+        XlnxZynqMPQSPIPS *ss = XLNX_ZYNQMP_QSPIPS(s);
+        if (ARRAY_FIELD_EX32(ss->regs, GQSPI_SELECT, GENERIC_QSPI_EN)) {
+            return;
+        }
+    }
     xilinx_spips_update_cs_lines(s);
     xilinx_spips_check_flush(s);
     xilinx_spips_update_cs_lines(s);
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [QEMU][PATCH v2] ssi: xilinx_spips: Skip update of cs and fifo releated to spips in gqspi
  2019-10-17 10:17 [QEMU][PATCH v2] ssi: xilinx_spips: Skip update of cs and fifo releated to spips in gqspi Sai Pavan Boddu
@ 2019-10-17 10:31 ` Philippe Mathieu-Daudé
  2019-10-17 13:35 ` Francisco Iglesias
  1 sibling, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-17 10:31 UTC (permalink / raw)
  To: Sai Pavan Boddu, Alistair Francis
  Cc: edgar.iglesias, Peter Maydell, qemu-devel

Hi,

On 10/17/19 12:17 PM, Sai Pavan Boddu wrote:
> GQSPI handles chip selects and fifos in a different way compared to
> spips. So skip update of cs and fifos related to spips in gqspi mode.
> 
> Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
> ---
> Changes for V2:
>      Just skip update of spips cs and fifos
>      Update commit message accordingly
> 
>   hw/ssi/xilinx_spips.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c
> index a309c71..27154b0 100644
> --- a/hw/ssi/xilinx_spips.c
> +++ b/hw/ssi/xilinx_spips.c
> @@ -1022,6 +1022,13 @@ static void xilinx_spips_write(void *opaque, hwaddr addr,
>       }
>       s->regs[addr] = (s->regs[addr] & ~mask) | (value & mask);
>   no_reg_update:
> +    /* In GQSPI mode skip update of CS and fifo's related to spips */
> +    if (object_dynamic_cast(OBJECT(s), TYPE_XLNX_ZYNQMP_QSPIPS)) {

object_dynamic_cast() is expensive, please add a 'bool is_qpspi' in 
XilinxQSPIPS and set it in xlnx_zynqmp_qspips_init().

> +        XlnxZynqMPQSPIPS *ss = XLNX_ZYNQMP_QSPIPS(s);
> +        if (ARRAY_FIELD_EX32(ss->regs, GQSPI_SELECT, GENERIC_QSPI_EN)) {
> +            return;
> +        }
> +    }
>       xilinx_spips_update_cs_lines(s);
>       xilinx_spips_check_flush(s);
>       xilinx_spips_update_cs_lines(s);
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [QEMU][PATCH v2] ssi: xilinx_spips: Skip update of cs and fifo releated to spips in gqspi
  2019-10-17 10:17 [QEMU][PATCH v2] ssi: xilinx_spips: Skip update of cs and fifo releated to spips in gqspi Sai Pavan Boddu
  2019-10-17 10:31 ` Philippe Mathieu-Daudé
@ 2019-10-17 13:35 ` Francisco Iglesias
  2019-10-18  8:37   ` Sai Pavan Boddu
  1 sibling, 1 reply; 4+ messages in thread
From: Francisco Iglesias @ 2019-10-17 13:35 UTC (permalink / raw)
  To: Sai Pavan Boddu
  Cc: edgar.iglesias, Peter Maydell, Alistair Francis, qemu-devel

Hi Sai,

On [2019 Oct 17] Thu 15:47:54, Sai Pavan Boddu wrote:
> GQSPI handles chip selects and fifos in a different way compared to
> spips. So skip update of cs and fifos related to spips in gqspi mode.
> 
> Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
> ---
> Changes for V2:
>     Just skip update of spips cs and fifos
>     Update commit message accordingly
> 
>  hw/ssi/xilinx_spips.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c
> index a309c71..27154b0 100644
> --- a/hw/ssi/xilinx_spips.c
> +++ b/hw/ssi/xilinx_spips.c
> @@ -1022,6 +1022,13 @@ static void xilinx_spips_write(void *opaque, hwaddr addr,
>      }
>      s->regs[addr] = (s->regs[addr] & ~mask) | (value & mask);
>  no_reg_update:
> +    /* In GQSPI mode skip update of CS and fifo's related to spips */
> +    if (object_dynamic_cast(OBJECT(s), TYPE_XLNX_ZYNQMP_QSPIPS)) {
> +        XlnxZynqMPQSPIPS *ss = XLNX_ZYNQMP_QSPIPS(s);
> +        if (ARRAY_FIELD_EX32(ss->regs, GQSPI_SELECT, GENERIC_QSPI_EN)) {
> +            return;
> +        }
> +    }

Above corrects the issue for the zynqmp but not for the other two models
(below functions shouldn't be called when writing the mentioned config
regs for them either), would it be ok for you to expand to the switch
cases you had in v1 (into the switch in this function and return after
updating the reg values)? (the correction will then spawn all three
models)

Best regards,
Francisco Iglesias

>      xilinx_spips_update_cs_lines(s);
>      xilinx_spips_check_flush(s);
>      xilinx_spips_update_cs_lines(s);
> -- 
> 2.7.4
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [QEMU][PATCH v2] ssi: xilinx_spips: Skip update of cs and fifo releated to spips in gqspi
  2019-10-17 13:35 ` Francisco Iglesias
@ 2019-10-18  8:37   ` Sai Pavan Boddu
  0 siblings, 0 replies; 4+ messages in thread
From: Sai Pavan Boddu @ 2019-10-18  8:37 UTC (permalink / raw)
  To: Francisco Iglesias
  Cc: Peter Maydell, Edgar Iglesias, Alistair Francis, qemu-devel

Hi Francisco,

Thanks I will send a V3 following your suggestion.

Regards,
Sai Pavan

> -----Original Message-----
> From: Francisco Iglesias <frasse.iglesias@gmail.com>
> Sent: Thursday, October 17, 2019 7:05 PM
> To: Sai Pavan Boddu <saipava@xilinx.com>
> Cc: Alistair Francis <alistair@alistair23.me>; Edgar Iglesias
> <edgari@xilinx.com>; Peter Maydell <peter.maydell@linaro.org>; qemu-
> devel@nongnu.org
> Subject: Re: [QEMU][PATCH v2] ssi: xilinx_spips: Skip update of cs and fifo
> releated to spips in gqspi
> 
> Hi Sai,
> 
> On [2019 Oct 17] Thu 15:47:54, Sai Pavan Boddu wrote:
> > GQSPI handles chip selects and fifos in a different way compared to
> > spips. So skip update of cs and fifos related to spips in gqspi mode.
> >
> > Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
> > ---
> > Changes for V2:
> >     Just skip update of spips cs and fifos
> >     Update commit message accordingly
> >
> >  hw/ssi/xilinx_spips.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c index
> > a309c71..27154b0 100644
> > --- a/hw/ssi/xilinx_spips.c
> > +++ b/hw/ssi/xilinx_spips.c
> > @@ -1022,6 +1022,13 @@ static void xilinx_spips_write(void *opaque,
> hwaddr addr,
> >      }
> >      s->regs[addr] = (s->regs[addr] & ~mask) | (value & mask);
> >  no_reg_update:
> > +    /* In GQSPI mode skip update of CS and fifo's related to spips */
> > +    if (object_dynamic_cast(OBJECT(s), TYPE_XLNX_ZYNQMP_QSPIPS)) {
> > +        XlnxZynqMPQSPIPS *ss = XLNX_ZYNQMP_QSPIPS(s);
> > +        if (ARRAY_FIELD_EX32(ss->regs, GQSPI_SELECT, GENERIC_QSPI_EN))
> {
> > +            return;
> > +        }
> > +    }
> 
> Above corrects the issue for the zynqmp but not for the other two models
> (below functions shouldn't be called when writing the mentioned config regs
> for them either), would it be ok for you to expand to the switch cases you
> had in v1 (into the switch in this function and return after updating the reg
> values)? (the correction will then spawn all three
> models)
> 
> Best regards,
> Francisco Iglesias
> 
> >      xilinx_spips_update_cs_lines(s);
> >      xilinx_spips_check_flush(s);
> >      xilinx_spips_update_cs_lines(s);
> > --
> > 2.7.4
> >
> >


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-18  8:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-17 10:17 [QEMU][PATCH v2] ssi: xilinx_spips: Skip update of cs and fifo releated to spips in gqspi Sai Pavan Boddu
2019-10-17 10:31 ` Philippe Mathieu-Daudé
2019-10-17 13:35 ` Francisco Iglesias
2019-10-18  8:37   ` Sai Pavan Boddu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.