lkml.org 
[lkml]   [2022]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH RFC v1] spi: realtek-rtl: Fix clearing some register bits
From
Hi Martin,

On 25/07/2022 21:35, Martin Blumenstingl wrote:
> The code seemingly tries to clear RTL_SPI_SFCSR_LEN_MASK (before then
> setting either RTL_SPI_SFCSR_LEN1 or RTL_SPI_SFCSR_LEN4) and
> RTL_SPI_SFCSR_CS. What it actually does is only keeping these bits and
> clearing all other bits, even the ones which were just set before. Fix
> the operation to clear the bits in the selected mask and keep all other
> ones.
>
> Fixes: a8af5cc2ff1e80 ("spi: realtek-rtl: Add support for Realtek RTL838x/RTL839x SPI controllers")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
> I stumbled across this while reading the driver. This patch is untested
> because I don't have any hardware with this controller.
I believe your fix is correct. In the meantime, more information has been
learned about this hardware, in particular, newer SoC versions and the possibility
to have parallel IO and hardware which uses different chip selects.
I came up with the following patch for supporting this, and it achieves
what you also propose:
https://github.com/bkobl/openwrt/blob/rtl8214qf_merge/target/linux/realtek/patches-5.10/317-spi-cs-support-for-spi-realtek-rtl.patch
It is still is a bit rough, reading it I immediately saw 2 things that
would need to be fixed, but it also improves e.g. that RTL_SPI_SFCSR
is now configured independently of what u-boot did to it.

Cheers,
Birger

\
 
 \ /
  Last update: 2022-07-25 23:20    [W:0.253 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site