u-boot/drivers/spi
Dhruva Gole 53f4ef0a4b spi: cadence_qspi: use STIG mode for small reads
Fix the issue where some flash chips like cypress S25HS256T return the
value of the same register over and over in DAC mode.

For example in the TI K3-AM62x Processors refer [0] Technical Reference
Manual there is a layer of digital logic in front of the QSPI/OSPI
Drive when used in DAC mode. This is part of the Flash Subsystem (FSS)
which provides access to external Flash devices.

The FSS0_0_SYSCONFIG Register (Offset = 4h) has a BIT Field for
OSPI_32B_DISABLE_MODE which has a Reset value = 0. This means, OSPI 32bit
mode enabled by default.

Thus, by default controller operates in 32 bit mode causing it to always
align all data to 4 bytes from a 4byte aligned address. In some flash
chips like cypress for example if we try to read some regs in DAC mode
then it keeps sending the value of the first register that was requested
and inorder to read the next reg, we have to stop and re-initiate a new
transaction.

This causes wrong register values to be read than what is desired when
registers are read in DAC mode. Hence if the data.nbytes is very less
then prefer STIG mode for such small reads.

[0] https://www.ti.com/lit/ug/spruiv7a/spruiv7a.pdf

Tested-by: Vaishnav Achath <vaishnav.a@ti.com>
Signed-off-by: Dhruva Gole <d-gole@ti.com>
[jagan: add tab space for comments]
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2023-01-26 21:01:56 +05:30
..
altera_spi.c
apple_spi.c
atcspi200_spi.c
ath79_spi.c
atmel-quadspi.c spi: atmel-quadspi: Fix the buswidth adjustment between spi-mem and controller 2022-04-26 09:54:41 +03:00
atmel_spi.c
atmel_spi.h
bcm63xx_hsspi.c drivers: spi: fix some typos 2023-01-26 20:53:20 +05:30
bcm63xx_spi.c
bcmstb_spi.c
ca_sflash.c
cadence_ospi_versal.c spi: cadence-qspi: Fix compilation error in mini u-boot flash reset 2022-11-22 15:02:07 +01:00
cadence_qspi.c spi: cadence_qspi: use STIG mode for small reads 2023-01-26 21:01:56 +05:30
cadence_qspi.h spi: cadence-qspi: Use priv instead of plat across the driver 2022-09-13 11:32:48 +02:00
cadence_qspi_apb.c spi: cadence_qspi: setup ADDR Bits in cmd reads 2023-01-26 21:01:01 +05:30
cf_spi.c cf_spi.c: Rename CONFIG_SPI_IDLE_VAL to SPI_IDLE_VAL 2022-12-23 13:01:13 -05:00
davinci_spi.c global: Move remaining CONFIG_SYS_* to CFG_SYS_* 2022-12-05 16:06:08 -05:00
designware_spi.c
exynos_spi.c
fsl_dspi.c drivers: spi: fix some typos 2023-01-26 20:53:20 +05:30
fsl_espi.c global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
fsl_qspi.c
gxp_spi.c spi: gxp_spi: Add GXP SPI controller driver 2022-06-22 21:30:05 -04:00
ich.c
ich.h
iproc_qspi.c
Kconfig spi: Add Socionext F_OSPI SPI flash controller driver 2023-01-26 20:53:20 +05:30
kirkwood_spi.c global: Move remaining CONFIG_SYS_* to CFG_SYS_* 2022-12-05 16:06:08 -05:00
Makefile spi: Add Socionext F_OSPI SPI flash controller driver 2023-01-26 20:53:20 +05:30
meson_spifc.c
microchip_coreqspi.c spi: Add Microchip PolarFire SoC QSPI driver 2022-11-03 13:27:56 +08:00
mpc8xx_spi.c
mpc8xxx_spi.c
mscc_bb_spi.c
mt7620_spi.c
mt7621_spi.c
mtk_snfi_spi.c drivers: spi: fix some typos 2023-01-26 20:53:20 +05:30
mtk_snor.c
mtk_spim.c mediatek: Include <linux/sizes.h> where needed 2022-11-10 10:08:55 -05:00
mvebu_a3700_spi.c drivers: spi: fix some typos 2023-01-26 20:53:20 +05:30
mxc_spi.c global: Finish CONFIG -> CFG migration 2023-01-20 12:27:24 -05:00
mxs_spi.c
npcm_fiu_spi.c spi: npcm-fiu: add NPCM7xx FIU controller driver 2022-05-03 17:49:48 +05:30
npcm_pspi.c spi: nuvoton: add NPCM PSPI controller driver 2022-10-27 12:41:36 +05:30
nxp_fspi.c spi: nxp_fspi: Fix clock imbalance 2022-06-15 11:34:38 +02:00
octeon_spi.c cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00
omap3_spi.c drivers: spi: fix some typos 2023-01-26 20:53:20 +05:30
pic32_spi.c
pl022_spi.c stm32mp1: fix reference for STMicroelectronics 2022-06-17 14:12:27 +02:00
renesas_rpc_spi.c renesas: Fix RPC-IF compatible values 2022-09-02 13:25:01 +02:00
rk_spi.c drivers: spi: fix some typos 2023-01-26 20:53:20 +05:30
rk_spi.h
rockchip_sfc.c
sandbox_spi.c cf_spi.c: Rename CONFIG_SPI_IDLE_VAL to SPI_IDLE_VAL 2022-12-23 13:01:13 -05:00
sh_qspi.c drivers: spi: sh_qspi.c: Use log_warning() instead of printf() 2023-01-26 20:53:20 +05:30
soft_spi.c
spi-aspeed-smc.c drivers: spi: fix some typos 2023-01-26 20:53:20 +05:30
spi-emul-uclass.c
spi-mem-nodm.c
spi-mem.c spi-mem: Add dirmap API from Linux 2022-09-13 12:08:40 -04:00
spi-mxic.c
spi-qup.c drivers: spi: fix some typos 2023-01-26 20:53:20 +05:30
spi-sifive.c drivers: spi: fix some typos 2023-01-26 20:53:20 +05:30
spi-sn-f-ospi.c spi: Add Socionext F_OSPI SPI flash controller driver 2023-01-26 20:53:20 +05:30
spi-sunxi.c spi: sunxi: Add support for F1C100s SPI controller 2022-07-18 11:34:22 +01:00
spi-synquacer.c spi: synquacer: simplify tx completion checking 2022-06-10 13:37:32 -04:00
spi-uclass.c spi: Implement spi_set_speed 2022-10-16 12:23:22 +02:00
spi.c
stm32_qspi.c cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00
stm32_spi.c
tegra20_sflash.c
tegra20_slink.c
tegra114_spi.c
tegra210_qspi.c
tegra_spi.h
ti_qspi.c
uniphier_spi.c
xilinx_spi.c spi: xilinx_spi: Add support ops to axi qspi driver 2022-07-26 09:34:21 +02:00
zynq_qspi.c spi: zynq_qspi: Fix programming qspi speed 2022-07-26 09:34:21 +02:00
zynq_spi.c
zynqmp_gqspi.c spi: zynqmp_qspi: Add support for 64-bit read/write 2022-12-05 08:55:54 +01:00