• Srinivas Goud's avatar
    spi: spi-cadence: Add support for Slave mode · b1b90514
    Srinivas Goud authored
    Currently SPI Cadence controller works only in Master mode.
    Updated interrupt handler for Full duplex transfer in Slave mode.
    Interrupt handler rely on the TX empty interrupt even for Slave mode
    transfer due to below HW limitation.
    
    HW limitation:
    AR 65885 - SPI Controller Might Not Update RX_NEMPTY Flag, Showing
    Incorrect Status Of The Receive FIFO
    
    SPI Slave mode works in the following manner:
    1.      One transfer can be finished only after all transfer->len
    data been transferred to master device.
    2.      Slave device only accepts transfer->len data. Any data longer
    than this from master device will be dropped. Any data shorter than
    this from master will cause SPI to be stuck due to the above behavior.
    3.      The stale data present in RXFIFO will be dropped in unprepared
    hardware transfer function.
    Signed-off-by: default avatarSrinivas Goud <srinivas.goud@amd.com>
    Link: https://lore.kernel.org/r/1681825625-10265-3-git-send-email-srinivas.goud@amd.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    b1b90514
spi-cadence.c 24.5 KB