qemu/hw/ssi
Bin Meng 6ed924823c hw/ssi: imx_spi: Correct the burst length > 32 bit transfer logic
For the ECSPIx_CONREG register BURST_LENGTH field, the manual says:

0x020 A SPI burst contains the 1 LSB in first word and all 32 bits in second word.
0x021 A SPI burst contains the 2 LSB in first word and all 32 bits in second word.

Current logic uses either s->burst_length or 32, whichever smaller,
to determine how many bits it should read from the tx fifo each time.
For example, for a 48 bit burst length, current logic transfers the
first 32 bit from the first word in the tx fifo, followed by a 16
bit from the second word in the tx fifo, which is wrong. The correct
logic should be: transfer the first 16 bit from the first word in
the tx fifo, followed by a 32 bit from the second word in the tx fifo.

With this change, SPI flash can be successfully probed by U-Boot on
imx6 sabrelite board.

  => sf probe
  SF: Detected sst25vf016b with page size 256 Bytes, erase size 4 KiB, total 2 MiB

Fixes: c906a3a015 ("i.MX: Add the Freescale SPI Controller")
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20210129132323.30946-10-bmeng.cn@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-02-02 17:00:55 +00:00
..
aspeed_smc.c hw/ssi/aspeed_smc: Rename 'max_slaves' variable as 'max_peripherals' 2020-12-10 12:15:03 -05:00
imx_spi.c hw/ssi: imx_spi: Correct the burst length > 32 bit transfer logic 2021-02-02 17:00:55 +00:00
Kconfig ssi: express dependencies with kconfig 2019-03-07 21:45:53 +01:00
meson.build hw/ssi: NPCM7xx Flash Interface Unit device model 2020-09-14 14:24:59 +01:00
mss-spi.c ssi: ssi_auto_connect_slaves() never does anything, drop 2020-06-15 22:05:28 +02:00
npcm7xx_fiu.c hw/*: Use type casting for SysBusDevice in NPCM7XX 2021-01-12 21:19:02 +00:00
omap_spi.c Include hw/irq.h a lot less 2019-08-16 13:31:52 +02:00
pl022.c hw/ssi: Rename SSI 'slave' as 'peripheral' 2020-12-10 12:15:03 -05:00
ssi.c hw/ssi: Rename SSI 'slave' as 'peripheral' 2020-12-10 12:15:03 -05:00
stm32f2xx_spi.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
trace-events hw/ssi/npcm7xx_fiu: Fix handling of unsigned integer 2020-10-08 15:24:32 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
xilinx_spi.c ssi: Fix bad printf format specifiers 2020-11-10 11:03:47 +00:00
xilinx_spips.c hw/core/stream: Rename StreamSlave as StreamSink 2020-12-10 12:15:04 -05:00