Skip to contentSkip to conversation

xilinx_spips dummy bytes fix

PATCH New Sai Pavan Boddu 1 participant 2 messages Apr 17, 2018 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xilinx_spips dummy bytes fix

For zynq-7000 boards, we saw issues when u-boot/linux accessing the qspi.
Issue is due to wrong dummy byte transfers for few of un-handled commands ex: 0x9F, 0x6, 0xe9, 0x4, 0x18, etc There are many unhandled commands which do not require dummy bytes but they can be followed by address cycles.

To fix this issue for above commands, the next upcoming tx bytes are not considered dummies rather sent to slave directly.

Sai Pavan Boddu (1):
xilinx_spips: send dummy only if cmd requires it

 hw/ssi/xilinx_spips.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 xilinx_spips: send dummy only if cmd requires it

For all the commands, which do not have an entry in xilinx_spips_num_dummies, present logic sends dummy byte when ever we are in SNOOP_NONE state, fix it to send only if cmd requires them.

Only transmit max of 1 dummy byte(i.e 8 cycles) is a single snoop cycle. And also convert dummy bytes to cycles (required by m25p80).

---
 hw/ssi/xilinx_spips.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
hw/ssi/xilinx_spips.c +10 -3
index 426f971..8278930 100644
@@ -627,10 +627,17 @@ static void xilinx_spips_flush_txfifo(XilinxSPIPS *s)
                 tx_rx[i] = tx;
             }
         } else {
-            /* Extract a dummy byte and generate dummy cycles according to the
-             * link state */
             tx = fifo8_pop(&s->tx_fifo);
-            dummy_cycles = 8 / s->link_state;
+            if (s->cmd_dummies > 0) {
+                /* Extract a dummy byte and generate dummy cycles according to
+                 * the link state */
+                 dummy_cycles = (s->cmd_dummies ? 1 : 0) * 8 / s->link_state;
+                 s->cmd_dummies--;
+            } else {
+                for (i = 0; i < num_effective_busses(s); ++i) {
+                    tx_rx[i] = tx;
+                }
+            }
         }
 
         for (i = 0; i < num_effective_busses(s); ++i) {
Signature · 1 line
2.7.4