From: Yao Zi <me@ziyao.cc>
To: Eric Chung <eric.chung@riscstar.com>, Yao Zi <me@ziyao.cc>
Cc: Raymond Mao <raymondmaoca@gmail.com>,
u-boot@lists.denx.de, uboot@riscstar.com,
u-boot-spacemit@groups.io, raymond.mao@riscstar.com,
rick@andestech.com, ycliang@andestech.com, trini@konsulko.com,
lukma@denx.de, hs@nabladev.com, jh80.chung@samsung.com,
peng.fan@nxp.com, xypron.glpk@gmx.de, randolph@andestech.com,
dlan@gentoo.org, junhui.liu@pigmoral.tech,
neil.armstrong@linaro.org, quentin.schulz@cherry.de,
samuel@sholland.org, Guodong Xu <guodong@riscstar.com>,
Scott Bambrough <scott@riscstar.com>
Subject: Re: [PATCH 2/8] mmc: k1: add sdhci platform driver
Date: Wed, 24 Jun 2026 04:46:50 +0000 [thread overview]
Message-ID: <ajthOhWTPVMIyMfH@pie> (raw)
In-Reply-To: <CAH22mJwsH9gPo6xTrX6G+9weAbaV2pk6XGqi=Xshng4XuaNvcg@mail.gmail.com>
On Wed, Jun 24, 2026 at 10:23:35AM +0800, Eric Chung wrote:
> On Sat, Jun 13, 2026 at 2:44 PM 'Yao Zi' via uboot <uboot@riscstar.com> wrote:
> >
> > On Fri, Jun 12, 2026 at 04:18:55PM -0400, Raymond Mao wrote:
> > > From: Guodong Xu <guodong@riscstar.com>
> > >
> > > Add SDHCI platform driver support for SpacemiT K1 SoC. This driver
> > > implements the necessary platform-specific operations for the SDHCI
> > > controller, enabling MMC/SD card functionality on K1-based platforms.
> >
> > Is there any reason not to re-use Linux-side K1 MMC driver,
> > sdhci-of-k1.c, and its companion ABI? Since Linux commit e9cb83c10071
> > (mmc: sdhci-of-k1: add comprehensive SDR tuning support, 2026-05-11)
> > it is now capable of operating on SD cards, too.
> >
> Excuse me. Is there any ABI breakage in this SD/eMMC device?
Yes, I only take a brief look, and at least the names for pinctrl states
differ from Linux upstream, as mentioned below.
So are there any reasons not to re-use it? This driver has been
carefully reviewed in Linux side, has the expected ABI, which would
reduce your work of upstreaming.
> > > Signed-off-by: Guodong Xu <guodong@riscstar.com>
> > > Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
> > > ---
> > > drivers/mmc/Kconfig | 7 +
> > > drivers/mmc/Makefile | 1 +
> > > drivers/mmc/spacemit_sdhci.c | 934 +++++++++++++++++++++++++++++++++++
> > > 3 files changed, 942 insertions(+)
> > > create mode 100644 drivers/mmc/spacemit_sdhci.c
> >
> > ...
> >
> > > diff --git a/drivers/mmc/spacemit_sdhci.c b/drivers/mmc/spacemit_sdhci.c
> > > new file mode 100644
> > > index 00000000000..392ca389fa9
> > > --- /dev/null
> > > +++ b/drivers/mmc/spacemit_sdhci.c
...
> > > +static void spacemit_sdhci_set_control_reg(struct sdhci_host *host)
> > > +{
> >
> > ...
> >
> > > + /* Set pinctrl state */
> > > + if (IS_ENABLED(CONFIG_PINCTRL)) {
> > > + if (mmc->clock >= 200000000)
> > > + pinctrl_select_state(mmc->dev, "fast");
> > > + else
> > > + pinctrl_select_state(mmc->dev, "default");
> > > + }
> >
> > This doesn't match Linux side ABI, where when card operates in UHS mode,
> > pinctrl state "uhs" is selected.
> >
> OK. Switch to "uhs". By the way, the upstream DTS file hasn't been
> synced into uboot yet. This is not easy to find.
I'm not sure what do you mean by "not easy to find". You could always
refer to the dt-bindings maintained by Linux side for ABI description,
and we want to keep aligned with it in U-Boot side as long as possible
to reduce maintenance burden and improve interoperability.
> > Regards,
> > Yao Zi
> >
> > [1]: https://lore.kernel.org/linux-riscv/aUDwDkd8k_4gD1yc@pie/
> > [2]: https://lore.kernel.org/linux-riscv/20260108-kx-pinctrl-aib-io-pwr-domain-v2-0-6bcb46146e53@linux.spacemit.com
Regards,
Yao Zi
next prev parent reply other threads:[~2026-06-24 4:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-12 20:18 [PATCH 0/8] Add SD card and eMMC support for SpacemiT K1 Raymond Mao
2026-06-12 20:18 ` [PATCH 1/8] spacemit: k1: select boot device via config registers Raymond Mao
2026-06-13 3:50 ` Yao Zi
2026-06-24 0:46 ` Eric Chung
2026-06-24 4:35 ` Yao Zi
2026-06-24 7:25 ` Eric Chung
2026-06-12 20:18 ` [PATCH 2/8] mmc: k1: add sdhci platform driver Raymond Mao
2026-06-13 6:43 ` Yao Zi
2026-06-24 2:23 ` Eric Chung
2026-06-24 4:46 ` Yao Zi [this message]
2026-06-24 7:34 ` Eric Chung
2026-06-24 8:15 ` Peng Fan
2026-06-12 20:18 ` [PATCH 3/8] dts: k1: add SD card support in u-boot overlay Raymond Mao
2026-06-12 20:18 ` [PATCH 4/8] configs: k1: enable SD and eMMC support Raymond Mao
2026-06-12 20:18 ` [PATCH 5/8] doc: spacemit: flash on K1 SoC based boards Raymond Mao
2026-06-12 20:18 ` [PATCH 6/8] cmd: meminfo: widen memory map addresses to phys_addr_t Raymond Mao
2026-06-12 20:19 ` [PATCH 7/8] cmd: meminfo: fix the lmb info for large DRAM Raymond Mao
2026-06-12 20:19 ` [PATCH 8/8] cmd: tlv_eeprom: fix accessing invalid parameter Raymond Mao
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=ajthOhWTPVMIyMfH@pie \
--to=me@ziyao.cc \
--cc=dlan@gentoo.org \
--cc=eric.chung@riscstar.com \
--cc=guodong@riscstar.com \
--cc=hs@nabladev.com \
--cc=jh80.chung@samsung.com \
--cc=junhui.liu@pigmoral.tech \
--cc=lukma@denx.de \
--cc=neil.armstrong@linaro.org \
--cc=peng.fan@nxp.com \
--cc=quentin.schulz@cherry.de \
--cc=randolph@andestech.com \
--cc=raymond.mao@riscstar.com \
--cc=raymondmaoca@gmail.com \
--cc=rick@andestech.com \
--cc=samuel@sholland.org \
--cc=scott@riscstar.com \
--cc=trini@konsulko.com \
--cc=u-boot-spacemit@groups.io \
--cc=u-boot@lists.denx.de \
--cc=uboot@riscstar.com \
--cc=xypron.glpk@gmx.de \
--cc=ycliang@andestech.com \
/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