mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
* [PATCH v3 0/2] arm64: dts: amlogic: s4: mmc clock fixups
@ 2026-01-14 10:43 Jerome Brunet
  2026-01-14 10:43 ` [PATCH v3 1/2] arm64: dts: amlogic: s4: assign mmc b clock to 24MHz Jerome Brunet
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jerome Brunet @ 2026-01-14 10:43 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Martin Blumenstingl, Xianwei Zhao, Nick Xie
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel, Jerome Brunet

The patchset aims to address the issue raised here [1] for MMC B.

While checking this issue, I've found that MMC A and C also appear to be
improperly described in this platform's DT. The 2nd change fixes that.

To be on the safe side, the MMC clock should also be assigned on the other
SoCs. More changes will follow once things are sorted out for s4.

[1]: https://lore.kernel.org/linux-amlogic/20260113011931.40424-1-nick@khadas.com/

Changes in v3:
- Dropped useless assigned-clock-parents
- Link to v2: https://lore.kernel.org/r/20260114-amlogic-s4-mmc-fixup-v2-0-7e9ab5f12286@baylibre.com

Changes in v2:
- Collect Tested-by from Nick
- Fix some typos in the commit description
- Link to v1: https://lore.kernel.org/r/20260113-amlogic-s4-mmc-fixup-v1-0-1ab1fca0fb2f@baylibre.com

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
Jerome Brunet (2):
      arm64: dts: amlogic: s4: assign mmc b clock to 24MHz
      arm64: dts: amlogic: s4: fix mmc clock assignment

 arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20260113-amlogic-s4-mmc-fixup-92ad8b90b7be

Best regards,
-- 
Jerome


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 1/2] arm64: dts: amlogic: s4: assign mmc b clock to 24MHz
  2026-01-14 10:43 [PATCH v3 0/2] arm64: dts: amlogic: s4: mmc clock fixups Jerome Brunet
@ 2026-01-14 10:43 ` Jerome Brunet
  2026-01-14 10:43 ` [PATCH v3 2/2] arm64: dts: amlogic: s4: fix mmc clock assignment Jerome Brunet
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jerome Brunet @ 2026-01-14 10:43 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Martin Blumenstingl, Xianwei Zhao, Nick Xie
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel, Jerome Brunet

The amlogic MMC driver operate with the assumption that MMC clock
is configured to provide 24MHz. It uses this path for low
rates such as 400kHz.

This assumption did hold true until but it now, but it is apparently
not the case with s4. The clock has been reported to provide 1GHz
instead. This is most likely due to how the bootloader is using the MMC
clock on this platform.

Regardless of why the MMC clock rate is 1GHz, if the MMC driver expects
24MHz, the clock should be properly assigned, so assign it.

Reported-by: Nick Xie <nick@khadas.com>
Closes: https://lore.kernel.org/linux-amlogic/20260113011931.40424-1-nick@khadas.com/
Fixes: 3ab9d54b5d84 ("arm64: dts: amlogic: enable some device nodes for S4")
Tested-by: Nick Xie <nick@khadas.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
index 9d99ed2994df..f314f07062ab 100644
--- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
@@ -838,6 +838,9 @@ sd: mmc@fe08a000 {
 			clock-names = "core", "clkin0", "clkin1";
 			resets = <&reset RESET_SD_EMMC_B>;
 			status = "disabled";
+
+			assigned-clocks = <&clkc_periphs CLKID_SD_EMMC_B>;
+			assigned-clock-rates = <24000000>;
 		};
 
 		emmc: mmc@fe08c000 {

-- 
2.47.3


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 2/2] arm64: dts: amlogic: s4: fix mmc clock assignment
  2026-01-14 10:43 [PATCH v3 0/2] arm64: dts: amlogic: s4: mmc clock fixups Jerome Brunet
  2026-01-14 10:43 ` [PATCH v3 1/2] arm64: dts: amlogic: s4: assign mmc b clock to 24MHz Jerome Brunet
@ 2026-01-14 10:43 ` Jerome Brunet
  2026-01-14 12:07 ` [PATCH v3 0/2] arm64: dts: amlogic: s4: mmc clock fixups Neil Armstrong
  2026-01-14 12:11 ` Neil Armstrong
  3 siblings, 0 replies; 5+ messages in thread
From: Jerome Brunet @ 2026-01-14 10:43 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Martin Blumenstingl, Xianwei Zhao, Nick Xie
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel, Jerome Brunet

MMC A and C are mis-represented as having their "clkin0" input connected to
xtal while it is actually connected to the MMC clock, probably in an
attempt to provide 24MHz to the device on this input.

Fix this and assign the clock to 24MHz to actually provide the required
rate.

Fixes: 3ab9d54b5d84 ("arm64: dts: amlogic: enable some device nodes for S4")
Tested-by: Nick Xie <nick@khadas.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
index f314f07062ab..dfc0a30a6e61 100644
--- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
@@ -819,13 +819,16 @@ sdio: mmc@fe088000 {
 			reg = <0x0 0xfe088000 0x0 0x800>;
 			interrupts = <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&clkc_periphs CLKID_SDEMMC_A>,
-				 <&xtal>,
+				 <&clkc_periphs CLKID_SD_EMMC_A>,
 				 <&clkc_pll CLKID_FCLK_DIV2>;
 			clock-names = "core", "clkin0", "clkin1";
 			resets = <&reset RESET_SD_EMMC_A>;
 			cap-sdio-irq;
 			keep-power-in-suspend;
 			status = "disabled";
+
+			assigned-clocks = <&clkc_periphs CLKID_SD_EMMC_A>;
+			assigned-clock-rates = <24000000>;
 		};
 
 		sd: mmc@fe08a000 {
@@ -848,13 +851,16 @@ emmc: mmc@fe08c000 {
 			reg = <0x0 0xfe08c000 0x0 0x800>;
 			interrupts = <GIC_SPI 178 IRQ_TYPE_EDGE_RISING>;
 			clocks = <&clkc_periphs CLKID_NAND>,
-				 <&xtal>,
+				 <&clkc_periphs CLKID_SD_EMMC_C>,
 				 <&clkc_pll CLKID_FCLK_DIV2>;
 			clock-names = "core", "clkin0", "clkin1";
 			resets = <&reset RESET_NAND_EMMC>;
 			no-sdio;
 			no-sd;
 			status = "disabled";
+
+			assigned-clocks = <&clkc_periphs CLKID_SD_EMMC_C>;
+			assigned-clock-rates = <24000000>;
 		};
 	};
 };

-- 
2.47.3


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 0/2] arm64: dts: amlogic: s4: mmc clock fixups
  2026-01-14 10:43 [PATCH v3 0/2] arm64: dts: amlogic: s4: mmc clock fixups Jerome Brunet
  2026-01-14 10:43 ` [PATCH v3 1/2] arm64: dts: amlogic: s4: assign mmc b clock to 24MHz Jerome Brunet
  2026-01-14 10:43 ` [PATCH v3 2/2] arm64: dts: amlogic: s4: fix mmc clock assignment Jerome Brunet
@ 2026-01-14 12:07 ` Neil Armstrong
  2026-01-14 12:11 ` Neil Armstrong
  3 siblings, 0 replies; 5+ messages in thread
From: Neil Armstrong @ 2026-01-14 12:07 UTC (permalink / raw)
  To: Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Kevin Hilman, Martin Blumenstingl, Xianwei Zhao, Nick Xie
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel

On 1/14/26 11:43, Jerome Brunet wrote:
> The patchset aims to address the issue raised here [1] for MMC B.
> 
> While checking this issue, I've found that MMC A and C also appear to be
> improperly described in this platform's DT. The 2nd change fixes that.
> 
> To be on the safe side, the MMC clock should also be assigned on the other
> SoCs. More changes will follow once things are sorted out for s4.
> 
> [1]: https://lore.kernel.org/linux-amlogic/20260113011931.40424-1-nick@khadas.com/
> 
> Changes in v3:
> - Dropped useless assigned-clock-parents
> - Link to v2: https://lore.kernel.org/r/20260114-amlogic-s4-mmc-fixup-v2-0-7e9ab5f12286@baylibre.com
> 
> Changes in v2:
> - Collect Tested-by from Nick
> - Fix some typos in the commit description
> - Link to v1: https://lore.kernel.org/r/20260113-amlogic-s4-mmc-fixup-v1-0-1ab1fca0fb2f@baylibre.com
> 
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
> Jerome Brunet (2):
>        arm64: dts: amlogic: s4: assign mmc b clock to 24MHz
>        arm64: dts: amlogic: s4: fix mmc clock assignment
> 
>   arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
> ---
> base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
> change-id: 20260113-amlogic-s4-mmc-fixup-92ad8b90b7be
> 
> Best regards,

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 0/2] arm64: dts: amlogic: s4: mmc clock fixups
  2026-01-14 10:43 [PATCH v3 0/2] arm64: dts: amlogic: s4: mmc clock fixups Jerome Brunet
                   ` (2 preceding siblings ...)
  2026-01-14 12:07 ` [PATCH v3 0/2] arm64: dts: amlogic: s4: mmc clock fixups Neil Armstrong
@ 2026-01-14 12:11 ` Neil Armstrong
  3 siblings, 0 replies; 5+ messages in thread
From: Neil Armstrong @ 2026-01-14 12:11 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Kevin Hilman,
	Martin Blumenstingl, Xianwei Zhao, Nick Xie, Jerome Brunet
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel

Hi,

On Wed, 14 Jan 2026 11:43:10 +0100, Jerome Brunet wrote:
> The patchset aims to address the issue raised here [1] for MMC B.
> 
> While checking this issue, I've found that MMC A and C also appear to be
> improperly described in this platform's DT. The 2nd change fixes that.
> 
> To be on the safe side, the MMC clock should also be assigned on the other
> SoCs. More changes will follow once things are sorted out for s4.
> 
> [...]

Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v6.20/arm64-dt)

[1/2] arm64: dts: amlogic: s4: assign mmc b clock to 24MHz
      https://git.kernel.org/amlogic/c/86124a8becb43eed3103f2459399daee8af2c99d
[2/2] arm64: dts: amlogic: s4: fix mmc clock assignment
      https://git.kernel.org/amlogic/c/3a115d42922cffc91b303992eadf220111d66c31

These changes has been applied on the intermediate git tree [1].

The v6.20/arm64-dt branch will then be sent via a formal Pull Request to the Linux SoC maintainers
for inclusion in their intermediate git branches in order to be sent to Linus during
the next merge window, or sooner if it's a set of fixes.

In the cases of fixes, those will be merged in the current release candidate
kernel and as soon they appear on the Linux master branch they will be
backported to the previous Stable and Long-Stable kernels [2].

The intermediate git branches are merged daily in the linux-next tree [3],
people are encouraged testing these pre-release kernels and report issues on the
relevant mailing-lists.

If problems are discovered on those changes, please submit a signed-off-by revert
patch followed by a corrective changeset.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

-- 
Neil


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-01-14 12:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-14 10:43 [PATCH v3 0/2] arm64: dts: amlogic: s4: mmc clock fixups Jerome Brunet
2026-01-14 10:43 ` [PATCH v3 1/2] arm64: dts: amlogic: s4: assign mmc b clock to 24MHz Jerome Brunet
2026-01-14 10:43 ` [PATCH v3 2/2] arm64: dts: amlogic: s4: fix mmc clock assignment Jerome Brunet
2026-01-14 12:07 ` [PATCH v3 0/2] arm64: dts: amlogic: s4: mmc clock fixups Neil Armstrong
2026-01-14 12:11 ` Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox