mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Birger Koblitz <mail@birger-koblitz.de>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-spi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, bert@biot.com, sander@svanheule.net
Subject: Re: [PATCH RFC v1] spi: realtek-rtl: Fix clearing some register bits
Date: Mon, 25 Jul 2022 22:19:46 +0200	[thread overview]
Message-ID: <be60acab-7dfe-6841-b176-4bd1e875d52e@birger-koblitz.de> (raw)
In-Reply-To: <20220725193547.1038414-1-martin.blumenstingl@googlemail.com>

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

  reply	other threads:[~2022-07-25 21:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 19:35 Martin Blumenstingl
2022-07-25 20:19 ` Birger Koblitz [this message]
2022-07-28 15:27   ` Martin Blumenstingl
2022-07-29  8:20     ` Birger Koblitz
2022-07-31 20:14       ` Martin Blumenstingl
2022-08-01  6:12         ` Subject: [PATCH 0/7] new SoC support and further improvements Birger Koblitz
2022-07-26  9:03 ` [PATCH RFC v1] spi: realtek-rtl: Fix clearing some register bits Sander Vanheule
2022-07-27 19:13   ` Martin Blumenstingl
2022-07-28  7:14     ` Sander Vanheule

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=be60acab-7dfe-6841-b176-4bd1e875d52e@birger-koblitz.de \
    --to=mail@birger-koblitz.de \
    --cc=bert@biot.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=sander@svanheule.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®