From: Krzysztof Kozlowski <krzk@kernel.org>
To: Alexey Charkov <alchark@gmail.com>, Rob Herring <robh@kernel.org>
Cc: "Andi Shyti" <andi.shyti@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Ulf Hansson" <ulf.hansson@linaro.org>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Uwe Kleine-König" <ukleinek@kernel.org>,
"Daniel Lezcano" <daniel.lezcano@linaro.org>,
linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mmc@vger.kernel.org, netdev@vger.kernel.org,
linux-pwm@vger.kernel.org
Subject: Re: [PATCH 03/13] dt-bindings: mmc: vt8500-sdmmc: Convert to YAML
Date: Tue, 22 Apr 2025 10:08:43 +0200 [thread overview]
Message-ID: <14de236b-e2a7-4bde-986d-1e5ffddd01b4@kernel.org> (raw)
In-Reply-To: <CABjd4Yxi4SLqsAk_fb9C=1BW6XjnZ8LQ_JKYu6KZ3TtMS0fnhg@mail.gmail.com>
On 18/04/2025 14:38, Alexey Charkov wrote:
>>
>>>> +
>>>> + reg:
>>>> + maxItems: 1
>>>> +
>>>> + clocks:
>>>> + maxItems: 1
>>>> +
>>>> + interrupts:
>>>> + items:
>>>> + - description: SDMMC controller interrupt
>>>> + - description: SDMMC controller DMA interrupt
>>>> +
>>>> + sdon-inverted:
>>>> + type: boolean
>>>> + description: SD_ON bit is inverted on the controller
>>>
>>> This implies I know what the non-inverted state is. If you know, please
>>> state that here.
>>
>> This is a tricky one. The only answer I have is "it's inverted in
>> later versions vs. the first version I saw in the wild, and I'm not
>> sure if it's board related or IP version related - nor if the original
>> was active low or high". No docs, no schematics, no vendor left around
>> to chase for answers.
>>
>> Will dig around some more and update the description if I succeed in
>> uncovering any further clues :)
>
> I've found some extra clues and would like to consult on the best way forward.
>
> It turns out (if my understanding of the decompiled binary-only WM8505
> vendor driver is correct) that all chips before (not including) WM8505
> rev. A2 treated their "clock stop" bit (register offset 0x08 a.k.a.
> SDMMC_BUSMODE, bit 0x10 a.k.a. BM_CST in vendor sources, BM_SD_OFF in
> mainline) as "set 1 to disable SD clock", while all the later versions
> treated it as "set 0 to disable SD clock". Which means that there are
> WM8505 based systems that rely on either of those behaviours, while
> any later chips need "set 0 to disable". This is not a board related
> quirk but an on-chip SDMMC controller revision related quirk.
>
> I'd love to switch to a compatible-based logic and drop the
> "sdon-inverted" flag altogether from the binding I'm writing, but here
> are my doubts where I'd love to consult.
>
> * Looks like WM8505 rev. A2 needs a separate compatible string vs.
> prior WM8505. Can we have something like "wm,wm8505a2-sdhc" and
> "wm,wm8505-sdhc" respectively? WM8505a2 not being an actual chip name,
> but something discoverable by reading its hardware ID from a system
> configuration register at runtime
Then maybe it can be fully detected runtime? E.g. via soc_id driver (see
drivers/soc/)?
> * If I introduce new compatible strings for "wm,wm8650-sdhc",
> "wm,wm8750-sdhc", "wm,wm8850-sdhc" and "wm,wm8880-sdhc" in bindings,
> DTS and driver code, then the new driver and new DTB should work fine,
> and the DTS should pass schema checks. New driver code won't work with
> older DTB unless I keep the logic to parse "sdon-inverted" which
> wouldn't be part of the binding. Old driver code would not work with
> newer DTB except for pre-A2 versions of WM8505. Is that acceptable?
> * Existing DTS doesn't differentiate between pre-A2 vs. post-A2
> revisions of WM8505 and is bound to fail on the latter
That's an old platform, so we should not break the ABI, thus drivers
must fully support old DTBs.
>
> I realize that breaking backward/forward compatibility is undesirable,
> but frankly these systems seem to have few mainline users, and those
> people who do run mainline on them ought to be compiling the kernel
> and its DTB at the same time, because the firmware doesn't know
There might be other users of DTS and anyway what would be exactly the
benefit? This hardware aspect is already documented via sdon-inverted
property.
> anything about DT and any modern kernel can only be booted in
> "appended DTB" mode. I also don't know of any non-Linux code that
> might be using these device trees.
>
> Any guidance would be much appreciated.
>
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-04-22 8:08 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-16 8:21 [PATCH 00/13] ARM: vt8500: DT bindings and dts updates Alexey Charkov
2025-04-16 8:21 ` [PATCH 01/13] dt-bindings: i2c: i2c-wmt: Convert to YAML Alexey Charkov
2025-04-23 11:50 ` Alexey Charkov
2025-04-25 11:42 ` Krzysztof Kozlowski
2025-04-16 8:21 ` [PATCH 02/13] dt-bindings: interrupt-controller: via,vt8500-intc: " Alexey Charkov
2025-04-16 20:10 ` Rob Herring
2025-04-17 6:15 ` Alexey Charkov
2025-04-16 8:21 ` [PATCH 03/13] dt-bindings: mmc: vt8500-sdmmc: " Alexey Charkov
2025-04-16 20:14 ` Rob Herring
2025-04-17 6:25 ` Alexey Charkov
2025-04-18 12:38 ` Alexey Charkov
2025-04-22 8:08 ` Krzysztof Kozlowski [this message]
2025-04-22 9:01 ` Alexey Charkov
2025-04-16 8:21 ` [PATCH 04/13] dt-bindings: net: via-rhine: " Alexey Charkov
2025-04-23 11:49 ` Alexey Charkov
2025-04-16 8:21 ` [PATCH 05/13] dt-bindings: pwm: vt8500-pwm: " Alexey Charkov
2025-04-16 20:15 ` Rob Herring
2025-04-17 6:27 ` Alexey Charkov
2025-04-16 8:21 ` [PATCH 06/13] dt-bindings: timer: via,vt8500-timer: " Alexey Charkov
2025-04-16 20:16 ` Rob Herring
2025-04-17 6:34 ` Alexey Charkov
2025-04-16 8:21 ` [PATCH 07/13] dt-bindings: arm: vt8500: Add VIA APC Rock/Paper boards Alexey Charkov
2025-04-16 20:17 ` Rob Herring
2025-04-16 8:21 ` [PATCH 08/13] ARM: dts: vt8500: Add node address and reg in CPU nodes Alexey Charkov
2025-04-16 8:21 ` [PATCH 09/13] ARM: dts: vt8500: Move memory nodes to board dts and fix addr/size Alexey Charkov
2025-04-16 8:21 ` [PATCH 10/13] ARM: dts: vt8500: Use generic compatibles for EHCI Alexey Charkov
2025-04-17 5:34 ` Krzysztof Kozlowski
2025-04-17 5:54 ` Alexey Charkov
2025-04-16 8:21 ` [PATCH 11/13] ARM: dts: vt8500: Use generic node name for the SD/MMC controller Alexey Charkov
2025-04-16 8:21 ` [PATCH 12/13] ARM: dts: vt8500: Add VIA APC Rock/Paper board Alexey Charkov
2025-04-17 5:36 ` Krzysztof Kozlowski
2025-04-17 6:01 ` Alexey Charkov
2025-04-17 6:07 ` Krzysztof Kozlowski
2025-04-16 8:21 ` [PATCH 13/13] ARM: dts: vt8500: Add L2 cache controller on WM8850/WM8950 Alexey Charkov
2025-04-16 15:54 ` [PATCH 00/13] ARM: vt8500: DT bindings and dts updates Rob Herring
2025-04-16 18:55 ` Alexey Charkov
2025-04-16 20:09 ` Rob Herring
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=14de236b-e2a7-4bde-986d-1e5ffddd01b4@kernel.org \
--to=krzk@kernel.org \
--cc=alchark@gmail.com \
--cc=andi.shyti@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=tglx@linutronix.de \
--cc=ukleinek@kernel.org \
--cc=ulf.hansson@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).