From: "Troy Mitchell" <troy.mitchell@linux.dev>
To: "Iker Pedrosa" <ikerpedrosam@gmail.com>,
"Troy Mitchell" <troy.mitchell@linux.dev>
Cc: "Ulf Hansson" <ulf.hansson@linaro.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Adrian Hunter" <adrian.hunter@intel.com>,
"Paul Walmsley" <pjw@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>, "Yixun Lan" <dlan@kernel.org>,
"Michael Opdenacker" <michael.opdenacker@rootcommit.com>,
"Javier Martinez Canillas" <javierm@redhat.com>,
<linux-mmc@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-riscv@lists.infradead.org>, <spacemit@lists.linux.dev>,
<linux-kernel@vger.kernel.org>,
"Anand Moon" <linux.amoon@gmail.com>,
"Trevor Gamblin" <tgamblin@baylibre.com>
Subject: Re: [PATCH v5 5/9] riscv: dts: spacemit: k1: add SD card controller and pinctrl support
Date: Thu, 02 Apr 2026 19:21:34 +0800 [thread overview]
Message-ID: <DHIMOCFZSFXX.2XZEQBRXLISKN@linux.dev> (raw)
In-Reply-To: <CABdCQ=MFcDPnzcYUEkbQyu_0qZt=aDD04p1kyxCMuVt7Av_P1Q@mail.gmail.com>
On Wed Apr 1, 2026 at 4:53 PM CST, Iker Pedrosa wrote:
> El lun, 30 mar 2026 a las 11:08, Troy Mitchell
> (<troy.mitchell@linux.dev>) escribió:
>>
>> On Mon, Mar 30, 2026 at 16:38:06 CST, Iker Pedrosa wrote:
>> > Add SD card controller infrastructure for SpacemiT K1 SoC with complete
>> > pinctrl support for both standard and UHS modes.
>> >
>> > - Add sdhci0 controller definition with clocks, resets and interrupts
>> > - Add mmc1_cfg pinctrl for 3.3V standard SD operation
>> > - Add mmc1_uhs_cfg pinctrl for 1.8V UHS high-speed operation
>> > - Configure appropriate drive strength and power-source properties
>> >
>> > This provides complete SD card infrastructure that K1-based boards can
>> > enable.
>> >
>> > Tested-by: Anand Moon <linux.amoon@gmail.com>
>> > Tested-by: Trevor Gamblin <tgamblin@baylibre.com>
>> > Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
>> > ---
>> > arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 40 ++++++++++++++++++++++++++++
>> > arch/riscv/boot/dts/spacemit/k1.dtsi | 13 +++++++++
>> > 2 files changed, 53 insertions(+)
>> >
>> > diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
>> > index b13dcb10f4d66022d27307de73a6ea3287e97441..8d82011f1af666fb78c282a2abcc0cb88f962053 100644
>> > --- a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
>> > +++ b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
>> > @@ -570,4 +570,44 @@ pwm14-1-pins {
>> > drive-strength = <32>;
>> > };
>> > };
>> > +
>> > + mmc1_cfg: mmc1-cfg {
>> > + mmc1-data-cmd-pins {
>> > + pinmux = <K1_PADCONF(104, 0)>, /* mmc1_d3 */
>> > + <K1_PADCONF(105, 0)>, /* mmc1_d2 */
>> > + <K1_PADCONF(106, 0)>, /* mmc1_d1 */
>> > + <K1_PADCONF(107, 0)>, /* mmc1_d0 */
>> > + <K1_PADCONF(108, 0)>; /* mmc1_cmd */
>> > + bias-pull-up = <1>;
>> > + drive-strength = <7>;
>> I'm a bit concerned about this value. Looking at the downstream 6.6 code, 3.3V uses DS4,
>> which equals 13mA. Since 7mA maps to DS0, what's the reasoning for using it here?
^^^^ wrong current
>> Do we have any documentation or measurement to back this up?
>
> Thank you for catching this! You're absolutely right to question these
> drive strength values.
>
> Looking back at my development process, I remember hitting signal
> integrity issues in the early stages of this driver development. As a
> quick solution, I lowered the drive strength values, which seemed to
> resolve the immediate problems, and I moved on without revisiting the
> electrical characteristics.
>
> After your feedback, I investigated this properly by comparing with
> the vendor kernel. It uses:
> - 3.3V mode: PAD_3V_DS4 (19mA)
> - 1.8V UHS mode: PAD_1V8_DS3 (42mA)
>
> My original values were indeed backwards from both electrical theory
> and proven vendor implementation. Testing with the corrected values
> (19mA/42mA) confirms SD card is working.
>
> I'll send v6 with the corrected drive strength values: drive-strength
> = <19> for 3.3V and drive-strength = <42> for 1.8V UHS modes.
Yes, 19mA for 3.3V and 42mA for 1.8V are correct.
I realized I cited an incorrect value in my previous message (the 13mA).
Please CC me when you send v6.
- Troy
next prev parent reply other threads:[~2026-04-02 11:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 8:38 [PATCH v5 0/9] riscv: spacemit: enable SD card support with UHS modes for OrangePi RV2 Iker Pedrosa
2026-03-30 8:38 ` [PATCH v5 1/9] dt-bindings: mmc: spacemit,sdhci: add pinctrl support for voltage switching Iker Pedrosa
2026-03-31 6:48 ` Krzysztof Kozlowski
2026-03-31 10:58 ` Ulf Hansson
2026-03-31 11:11 ` Krzysztof Kozlowski
2026-03-31 11:26 ` Ulf Hansson
2026-03-30 8:38 ` [PATCH v5 2/9] mmc: sdhci-of-k1: enable essential clock infrastructure for SD operation Iker Pedrosa
2026-03-30 9:11 ` Troy Mitchell
2026-03-30 8:38 ` [PATCH v5 3/9] mmc: sdhci-of-k1: add regulator and pinctrl voltage switching support Iker Pedrosa
2026-03-30 9:15 ` Troy Mitchell
2026-03-30 8:38 ` [PATCH v5 4/9] mmc: sdhci-of-k1: add comprehensive SDR tuning support Iker Pedrosa
2026-03-30 8:38 ` [PATCH v5 5/9] riscv: dts: spacemit: k1: add SD card controller and pinctrl support Iker Pedrosa
2026-03-30 9:08 ` Troy Mitchell
2026-04-01 8:53 ` Iker Pedrosa
2026-04-02 11:21 ` Troy Mitchell [this message]
2026-03-30 8:38 ` [PATCH v5 6/9] riscv: dts: spacemit: k1-orangepi-rv2: add PMIC and power infrastructure Iker Pedrosa
2026-03-30 8:38 ` [PATCH v5 7/9] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes Iker Pedrosa
2026-03-30 8:38 ` [PATCH v5 8/9] riscv: dts: spacemit: k1-bananapi-f3: " Iker Pedrosa
2026-03-30 8:38 ` [PATCH v5 9/9] riscv: dts: spacemit: k1-musepi-pro: " Iker Pedrosa
2026-03-30 9:19 ` [PATCH v5 0/9] riscv: spacemit: enable SD card support with UHS modes for OrangePi RV2 Michael Opdenacker
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=DHIMOCFZSFXX.2XZEQBRXLISKN@linux.dev \
--to=troy.mitchell@linux.dev \
--cc=adrian.hunter@intel.com \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlan@kernel.org \
--cc=ikerpedrosam@gmail.com \
--cc=javierm@redhat.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux.amoon@gmail.com \
--cc=michael.opdenacker@rootcommit.com \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=robh@kernel.org \
--cc=spacemit@lists.linux.dev \
--cc=tgamblin@baylibre.com \
--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