]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
spi: cadence: Ensure data lines set to low during dummy-cycle period
authorWitold Sadowski <wsadowski@marvell.com>
Wed, 29 May 2024 07:40:32 +0000 (00:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Jul 2024 10:51:23 +0000 (12:51 +0200)
commitae5db98a264809819dc3c8ee2ab3271a8b872dfd
tree3a625ba2fbf8717332d217028a201774c146f655
parent22a72c1c10f43ca645a98725e0faff34592f4d08
spi: cadence: Ensure data lines set to low during dummy-cycle period

[ Upstream commit 4a69c1264ff41bc5bf7c03101ada0454fbf08868 ]

During dummy-cycles xSPI will switch GPIO into Hi-Z mode. In that dummy
period voltage on data lines will slowly drop, what can cause
unintentional modebyte transmission. Value send to SPI memory chip will
depend on last address, and clock frequency.
To prevent unforeseen consequences of that behaviour, force send
single modebyte(0x00).
Modebyte will be send only if number of dummy-cycles is not equal
to 0. Code must also reduce dummycycle byte count by one - as one byte
is send as modebyte.

Signed-off-by: Witold Sadowski <wsadowski@marvell.com>
Link: https://msgid.link/r/20240529074037.1345882-2-wsadowski@marvell.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-cadence-xspi.c