Hi,
Am 17.10.2023 um 05:31 schrieb Venkatesh Yadav Abbarapu:
Add support for parallel memories in zynq_qspi.c driver. In case of
parallel memories STRIPE bit is set and sent to the qspi ip, which will
send data bits to both the flashes in parallel. However for few commands
we should not use stripe, instead send same data to both the flashes.
Those commands are exclueded by using zynqmp_qspi_update_stripe().
Also update copyright info for this file.
Signed-off-by: Ashok Reddy Soma <[email protected]>
Signed-off-by: Venkatesh Yadav Abbarapu <[email protected]>
---
drivers/spi/zynq_qspi.c | 140 ++++++++++++++++++++++++++++++++++++----
include/spi.h | 4 ++
2 files changed, 131 insertions(+), 13 deletions(-)
diff --git a/drivers/spi/zynq_qspi.c b/drivers/spi/zynq_qspi.c
index 069d2a77de..3471c301bf 100644
--- a/drivers/spi/zynq_qspi.c
+++ b/drivers/spi/zynq_qspi.c
[snip]
@@ -688,6 +788,11 @@ static int zynq_qspi_exec_op(struct spi_slave *slave,
}
op_len = op->cmd.nbytes + op->addr.nbytes + op->dummy.nbytes;
+ if (op->dummy.nbytes) {
+ op_len = op->cmd.nbytes + op->addr.nbytes +
+ op->dummy.nbytes / op->dummy.buswidth;
+ dummy_bytes = op->dummy.nbytes / op->dummy.buswidth;
+ }
u8 op_buf[op_len];
@@ -701,8 +806,11 @@ static int zynq_qspi_exec_op(struct spi_slave *slave,
pos += op->addr.nbytes;
}
- if (op->dummy.nbytes)
- memset(op_buf + pos, 0xff, op->dummy.nbytes);
+ if (dummy_bytes)
+ memset(op_buf + pos, 0xff, dummy_bytes);
This changes look unrelated and were reverted the last time because they
were wrong.
Regards
Stefan