Skip to contentSkip to conversation

ssi: xilinx_spips: Skip update of cs and fifo releated to spips in gqspi

PATCH In review Sai Pavan Boddu 4 participants 4 messages Oct 17, 2019 – Oct 18, 2019 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ssi: xilinx_spips: Skip update of cs and fifo releated to spips in gqspi

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.

---
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(+)
hw/ssi/xilinx_spips.c +7 -0
index a309c71..27154b0 100644
@@ -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);
Signature · 1 line
2.7.4
#1 lore raw

Hi,

Quoted 17 lines · Sai Pavan Boddu

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.

---
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(+)
hw/ssi/xilinx_spips.c +0 -0
index a309c71..27154b0 100644

hw/ssi/xilinx_spips.c static void xilinx_spips_write(void *opaque, hwaddr addr, · line 1026

Quoted 5 lines
hw/ssi/xilinx_spips.c +2 -0
@@ -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().

Quoted 9 lines
hw/ssi/xilinx_spips.c +5 -0
+        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 lore raw
In reply to Sai Pavan Boddu

Hi Sai,

Quoted 17 lines · Sai Pavan Boddu

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.

---
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(+)
hw/ssi/xilinx_spips.c +0 -0
index a309c71..27154b0 100644

hw/ssi/xilinx_spips.c static void xilinx_spips_write(void *opaque, hwaddr addr, · line 1031

Quoted 10 lines
hw/ssi/xilinx_spips.c +7 -0
@@ -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

Quoted 7 lines
hw/ssi/xilinx_spips.c +0 -0
     xilinx_spips_update_cs_lines(s);
     xilinx_spips_check_flush(s);
     xilinx_spips_update_cs_lines(s);
Signature · 1 line
2.7.4
#3 lore raw

Hi Francisco,

Thanks I will send a V3 following your suggestion.

Regards,
Sai Pavan

Quoted 60 lines

-----Original Message-----
From: Francisco Iglesias <[email protected]>
Sent: Thursday, October 17, 2019 7:05 PM
To: Sai Pavan Boddu <[email protected]>
Cc: Alistair Francis <[email protected]>; Edgar Iglesias <[email protected]>; Peter Maydell <[email protected]>; qemu- [email protected]
Subject: Re: [QEMU][PATCH v2] ssi: xilinx_spips: Skip update of cs and fifo releated to spips in gqspi

Hi Sai,

hw/ssi/xilinx_spips.c static void xilinx_spips_write(void *opaque,

Quoted 17 lines · Sai Pavan Boddu

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.

---
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(+)
hw/ssi/xilinx_spips.c index renamed from hw/ssi/xilinx_spips.c +0 -0

a309c71..27154b0 100644

hw/ssi/xilinx_spips.c +0 -0
@@ -1022,6 +1022,13 @@ static void xilinx_spips_write(void *opaque,

hwaddr addr,

hw/ssi/xilinx_spips.c static void xilinx_spips_write(void *opaque, hwaddr addr,

Quoted 7 lines
hw/ssi/xilinx_spips.c +4 -0
     }
     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))

{

hw/ssi/xilinx_spips.c static void xilinx_spips_write(void *opaque, hwaddr addr, · line 1031

Quoted 3 lines
hw/ssi/xilinx_spips.c +3 -0
+            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

Quoted 7 lines
hw/ssi/xilinx_spips.c +0 -1
     xilinx_spips_update_cs_lines(s);
     xilinx_spips_check_flush(s);
     xilinx_spips_update_cs_lines(s);
--

2.7.4