Skip to content

Commit

Permalink
hw/ssi: Fix Linux driver init issue with xilinx_spi
Browse files Browse the repository at this point in the history
The problem is that the Linux driver expects the master transaction inhibit
bit(R_SPICR_MTI) to be set during driver initialization so that it can
detect the fifo size but QEMU defaults it to zero out of reset.  The
datasheet indicates this bit is active on reset.

See page 25, SPI Control Register section:
https://www.xilinx.com/content/dam/xilinx/support/documents/ip_documentation/axi_quad_spi/v3_2/pg153-axi-quad-spi.pdf

Signed-off-by: Chris Rauer <crauer@google.com>
Message-id: 20230323182811.2641044-1-crauer@google.com
Reviewed-by: Edgar E. Iglesias <edgar@zeroasic.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
chrisrauer authored and pm215 committed Apr 3, 2023
1 parent 782781e commit a0eaa12
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hw/ssi/xilinx_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ static void xlx_spi_do_reset(XilinxSPI *s)
txfifo_reset(s);

s->regs[R_SPISSR] = ~0;
s->regs[R_SPICR] = R_SPICR_MTI;
xlx_spi_update_irq(s);
xlx_spi_update_cs(s);
}
Expand Down

0 comments on commit a0eaa12

Please sign in to comment.