mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 04:46:01 +01:00
spi: zynq_qspi: Use dummy buswidth in dummy byte calculation
Fix dummy bytes calculation incase of valid dummy bytes when dummy buswidth is > 1. Current dummy bytes calculation does not provide correct dummy values for dummy buswidth > 1. Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com> Link: https://lore.kernel.org/r/1657893679-20039-3-git-send-email-ashok.reddy.soma@xilinx.com Signed-off-by: Michal Simek <michal.simek@amd.com>
This commit is contained in:
parent
1acb70393f
commit
e097847286
@ -679,6 +679,7 @@ static int zynq_qspi_exec_op(struct spi_slave *slave,
|
|||||||
const struct spi_mem_op *op)
|
const struct spi_mem_op *op)
|
||||||
{
|
{
|
||||||
int op_len, pos = 0, ret, i;
|
int op_len, pos = 0, ret, i;
|
||||||
|
u32 dummy_bytes = 0;
|
||||||
unsigned int flag = 0;
|
unsigned int flag = 0;
|
||||||
const u8 *tx_buf = NULL;
|
const u8 *tx_buf = NULL;
|
||||||
u8 *rx_buf = NULL;
|
u8 *rx_buf = NULL;
|
||||||
@ -691,6 +692,11 @@ static int zynq_qspi_exec_op(struct spi_slave *slave,
|
|||||||
}
|
}
|
||||||
|
|
||||||
op_len = op->cmd.nbytes + op->addr.nbytes + op->dummy.nbytes;
|
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];
|
u8 op_buf[op_len];
|
||||||
|
|
||||||
@ -704,8 +710,8 @@ static int zynq_qspi_exec_op(struct spi_slave *slave,
|
|||||||
pos += op->addr.nbytes;
|
pos += op->addr.nbytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (op->dummy.nbytes)
|
if (dummy_bytes)
|
||||||
memset(op_buf + pos, 0xff, op->dummy.nbytes);
|
memset(op_buf + pos, 0xff, dummy_bytes);
|
||||||
|
|
||||||
/* 1st transfer: opcode + address + dummy cycles */
|
/* 1st transfer: opcode + address + dummy cycles */
|
||||||
/* Make sure to set END bit if no tx or rx data messages follow */
|
/* Make sure to set END bit if no tx or rx data messages follow */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user