Skip to content

Commit

Permalink
spi: zynqmp_gqspi: do not round immediate_data field
Browse files Browse the repository at this point in the history
Immediate_data is 8 bit value in generic FIFO command. When fields data_xfer=1
and exponent=0 this field specifies the absolute number of data bytes to read
into the RXFIFO. Values from range 0xfd to 0xff are rounded up to 0x100. It
causes overwriting the next bit field which is data_xfer. According to Zynq US+
TRM only DMA transfers should be word aligned. So there is no reason to round
up the immediate_data field.
  • Loading branch information
wtatarski committed Mar 21, 2019
1 parent fc6fbe9 commit 915ef6a
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/spi/zynqmp_gqspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,11 +758,6 @@ static int zynqmp_qspi_start_dma(struct zynqmp_qspi_priv *priv,

while (priv->len) {
len = zynqmp_qspi_calc_exp(priv, &gen_fifo_cmd);
if (!(gen_fifo_cmd & GQSPI_GFIFO_EXP_MASK) &&
(len % GQSPI_DMA_ALIGN)) {
gen_fifo_cmd &= ~GENMASK(7, 0);
gen_fifo_cmd |= roundup(len, GQSPI_DMA_ALIGN);
}
zynqmp_qspi_fill_gen_fifo(priv, gen_fifo_cmd);

debug("GFIFO_CMD_RX:0x%x\n", gen_fifo_cmd);
Expand Down

0 comments on commit 915ef6a

Please sign in to comment.