From: Tom Rini <trini@konsulko.com>
To: Peng Fan <peng.fan@nxp.com>
Cc: "Andre Przywara" <andre.przywara@arm.com>,
"Jaehoon Chung" <jh80.chung@samsung.com>,
"Simon Glass" <sjg@chromium.org>,
"Kuba Szczodrzyński" <kuba@szczodrzynski.pl>,
"Jernej Skrabec" <jernej.skrabec@gmail.com>,
"Icenowy Zheng" <icenowy@aosc.io>,
"u-boot@lists.denx.de" <u-boot@lists.denx.de>,
"linux-sunxi@lists.linux.dev" <linux-sunxi@lists.linux.dev>
Subject: Re: [PATCH 1/2] sunxi: mmc: Fix T113-s3 MMC clock divider
Date: Wed, 26 Feb 2025 20:23:30 -0600 [thread overview]
Message-ID: <20250227022330.GR2640854@bill-the-cat> (raw)
In-Reply-To: <PAXPR04MB8459D3EB1E61A160A2C2D78188CD2@PAXPR04MB8459.eurprd04.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 1623 bytes --]
On Thu, Feb 27, 2025 at 12:31:59AM +0000, Peng Fan wrote:
> Hi Andre,
>
> > Subject: [PATCH 1/2] sunxi: mmc: Fix T113-s3 MMC clock divider
> >
> > On the Allwinner D1/R528/T113-s3 SoCs the MMC clock source
> > selected by mux value 1 is PLL_PERIPH0(1x), not (2x), as in the other
> > SoCs.
> > But we have still the hidden divisor of 2 in the MMC mod clock, so
> > need to explicitly compensate for that on those SoCs.
> >
> > This leads to the actually programmed clock rate to be double
> > compared to before, which increases the MMC performance on those
> > SoCs.
> >
> > Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> > Reported-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
> > ---
> > drivers/mmc/sunxi_mmc.c | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
> > index 0b56d1405be..8f72d758e46 100644
> > --- a/drivers/mmc/sunxi_mmc.c
> > +++ b/drivers/mmc/sunxi_mmc.c
> > @@ -92,6 +92,13 @@ static int mmc_set_mod_clk(struct
> > sunxi_mmc_priv *priv, unsigned int hz)
> > pll = CCM_MMC_CTRL_PLL6;
> > pll_hz = clock_get_pll6();
> > #endif
> > + /*
> > + * On the D1/R528/T113 mux source 1 refers to
> > PLL_PERIPH0(1x),
> > + * like for the older SoCs. However we still have the
> > hidden
> > + * divider of 2x, so compensate for that here.
> > + */
> > + if (IS_ENABLED(CONFIG_MACH_SUN8I_R528))
>
> Use CONFIG_IS_ENABLED(MACH_SUN8I_R528)?
No, either is fine, IS_ENABLED(CONFIG_FOO) is less confusing for the
case where there's never a CONFIG_xPL_FOO.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2025-02-27 2:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-26 11:37 [PATCH 0/2] sunxi: clk/mmc: Fix T113-s3 MMC performance Andre Przywara
2025-02-26 11:37 ` [PATCH 1/2] sunxi: mmc: Fix T113-s3 MMC clock divider Andre Przywara
2025-02-26 15:54 ` Jernej Škrabec
2025-02-27 0:31 ` Peng Fan
2025-02-27 2:23 ` Tom Rini [this message]
2025-02-27 2:25 ` Peng Fan
2025-02-26 11:37 ` [PATCH 2/2] sunxi: sun50i_h6: clock: fix PLL_PERIPH0 rate calculation Andre Przywara
2025-02-26 15:54 ` Jernej Škrabec
2025-02-27 0:33 ` Peng Fan
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=20250227022330.GR2640854@bill-the-cat \
--to=trini@konsulko.com \
--cc=andre.przywara@arm.com \
--cc=icenowy@aosc.io \
--cc=jernej.skrabec@gmail.com \
--cc=jh80.chung@samsung.com \
--cc=kuba@szczodrzynski.pl \
--cc=linux-sunxi@lists.linux.dev \
--cc=peng.fan@nxp.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/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