mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
* [PATCH 0/2] arm64: dts: amlogic: s4: mmc clock fixups
@ 2026-01-13 10:39 Jerome Brunet
  2026-01-13 10:39 ` [PATCH 1/2] arm64: dts: amlogic: s4: assign mmc b clock to 24MHz Jerome Brunet
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jerome Brunet @ 2026-01-13 10:39 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, I've found that MMC A and C also appear to be
improperly described in this platform's DT. The 2nd change fixes that.

I do not have an s4 platform available with me, so these changes have only
been compile tested but assigning the clock was actually tested on sm1.

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/

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 | 16 ++++++++++++++--
 1 file changed, 14 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] 8+ messages in thread

* [PATCH 1/2] arm64: dts: amlogic: s4: assign mmc b clock to 24MHz
  2026-01-13 10:39 [PATCH 0/2] arm64: dts: amlogic: s4: mmc clock fixups Jerome Brunet
@ 2026-01-13 10:39 ` Jerome Brunet
  2026-01-14  3:52   ` 回复: " Nick Xie
  2026-01-13 10:39 ` [PATCH 2/2] arm64: dts: amlogic: s4: fix mmc clock assignment Jerome Brunet
  2026-01-14 12:11 ` [PATCH 0/2] arm64: dts: amlogic: s4: mmc clock fixups Neil Armstrong
  2 siblings, 1 reply; 8+ messages in thread
From: Jerome Brunet @ 2026-01-13 10:39 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 operate with the assumption that MMC clock
is configured to provide 24MHz. It uses that path for low
rates such as 400kHz.

This assumption did hold true until but it now, but it 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 is set to 1GHz, if the MMC driver expects
24MHz, we should make sure it does get that, so assign the clock.

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")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
index 9d99ed2994dfa27ca5808da7ae0825e9af255417..62538fd9db6b1ffb33a88e12628aadefbaa453ec 100644
--- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
@@ -838,6 +838,10 @@ 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-parents = <0>;
+			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] 8+ messages in thread

* [PATCH 2/2] arm64: dts: amlogic: s4: fix mmc clock assignment
  2026-01-13 10:39 [PATCH 0/2] arm64: dts: amlogic: s4: mmc clock fixups Jerome Brunet
  2026-01-13 10:39 ` [PATCH 1/2] arm64: dts: amlogic: s4: assign mmc b clock to 24MHz Jerome Brunet
@ 2026-01-13 10:39 ` Jerome Brunet
  2026-01-14  2:48   ` Chuan Liu
  2026-01-14  3:58   ` 回复: " Nick Xie
  2026-01-14 12:11 ` [PATCH 0/2] arm64: dts: amlogic: s4: mmc clock fixups Neil Armstrong
  2 siblings, 2 replies; 8+ messages in thread
From: Jerome Brunet @ 2026-01-13 10:39 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, mostly 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")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
index 62538fd9db6b1ffb33a88e12628aadefbaa453ec..6324d1eb5994009df5b09923cce373a87229f4b8 100644
--- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
@@ -819,13 +819,17 @@ 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-parents = <0>;
+			assigned-clock-rates = <24000000>;
 		};
 
 		sd: mmc@fe08a000 {
@@ -849,13 +853,17 @@ 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-parents = <0>;
+			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] 8+ messages in thread

* Re: [PATCH 2/2] arm64: dts: amlogic: s4: fix mmc clock assignment
  2026-01-13 10:39 ` [PATCH 2/2] arm64: dts: amlogic: s4: fix mmc clock assignment Jerome Brunet
@ 2026-01-14  2:48   ` Chuan Liu
  2026-01-14  9:05     ` Neil Armstrong
  2026-01-14  3:58   ` 回复: " Nick Xie
  1 sibling, 1 reply; 8+ messages in thread
From: Chuan Liu @ 2026-01-14  2:48 UTC (permalink / raw)
  To: Jerome Brunet, 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

hi Jerome,

On 1/13/2026 6:39 PM, Jerome Brunet wrote:
> [ EXTERNAL EMAIL ]
> 
> MMC A and C are mis-represented as having their "clkin0" input connected to
> xtal while it is actually connected to the MMC clock, mostly in an attempt
> to provide 24MHz to the device on this input.

Right.

> 
> 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")
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>   arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 12 ++++++++++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
> index 62538fd9db6b1ffb33a88e12628aadefbaa453ec..6324d1eb5994009df5b09923cce373a87229f4b8 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
> @@ -819,13 +819,17 @@ 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-parents = <0>;

Is it possible to remove assigned-clock-parent?

> +                       assigned-clock-rates = <24000000>;
>                  };
> 
>                  sd: mmc@fe08a000 {
> @@ -849,13 +853,17 @@ 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-parents = <0>;
> +                       assigned-clock-rates = <24000000>;
>                  };
>          };
>   };
> 
> --
> 2.47.3
> 
> 
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic


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

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

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

Hello Jerome,

I checked this patch on Amlogic S4 S905Y4, the SD card works.

root@Khadas:~# uname -a
Linux Khadas 6.19.0-rc5+ #26 SMP PREEMPT Tue Jan 13 16:01:18 CST 2026 aarch64 aarch64 aarch64 GNU/Linux
root@Khadas:~# dmesg | grep mmc
[    0.297480] meson-gx-mmc fe08a000.mmc: Got CD GPIO
[    0.392463] mmc1: new UHS-I speed SDR104 SDHC card at address aaaa
[    0.393219] mmcblk1: mmc1:aaaa SP32G 29.7 GiB
[    0.395788]  mmcblk1: p1 p2
[    3.155360] EXT4-fs (mmcblk1p2): mounted filesystem 43b6881a-483c-4ca7-9dcd-f4575e665a8b r/w with writeback data mode. Quota mode: none.
[    4.640503] EXT4-fs (mmcblk1p2): re-mounted 43b6881a-483c-4ca7-9dcd-f4575e665a8b.
[    5.777682] EXT4-fs (mmcblk1p1): mounted filesystem f20cabae-bbc6-457e-9bb3-bac6eef01af5 r/w with ordered data mode. Quota mode: none.

Tested-by: Nick Xie <nick@khadas.com>

--
Best Regards
Nick 谢奇
Amazing Khadas, Always Amazes You




________________________________________
发件人: Jerome Brunet <jbrunet@baylibre.com>
已发送: 2026 年 1 月 13 日 星期二 18:39
收件人: Rob Herring <robh@kernel.org>; Krzysztof Kozlowski <krzk+dt@kernel.org>; Conor Dooley <conor+dt@kernel.org>; Neil Armstrong <neil.armstrong@linaro.org>; Kevin Hilman <khilman@baylibre.com>; Martin Blumenstingl <martin.blumenstingl@googlemail.com>; Xianwei Zhao <xianwei.zhao@amlogic.com>; Nick Xie <nick@khadas.com>
抄送: devicetree@vger.kernel.org <devicetree@vger.kernel.org>; linux-arm-kernel@lists.infradead.org <linux-arm-kernel@lists.infradead.org>; linux-amlogic@lists.infradead.org <linux-amlogic@lists.infradead.org>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>; Jerome Brunet <jbrunet@baylibre.com>
主题: [PATCH 1/2] arm64: dts: amlogic: s4: assign mmc b clock to 24MHz


The amlogic MMC operate with the assumption that MMC clock

is configured to provide 24MHz. It uses that path for low

rates such as 400kHz.



This assumption did hold true until but it now, but it 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 is set to 1GHz, if the MMC driver expects

24MHz, we should make sure it does get that, so assign the clock.



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")

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>

---

 arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 4 ++++

 1 file changed, 4 insertions(+)



diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi

index 9d99ed2994dfa27ca5808da7ae0825e9af255417..62538fd9db6b1ffb33a88e12628aadefbaa453ec 100644

--- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi

+++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi

@@ -838,6 +838,10 @@ 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-parents = <0>;

+                       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] 8+ messages in thread

* 回复: [PATCH 2/2] arm64: dts: amlogic: s4: fix mmc clock assignment
  2026-01-13 10:39 ` [PATCH 2/2] arm64: dts: amlogic: s4: fix mmc clock assignment Jerome Brunet
  2026-01-14  2:48   ` Chuan Liu
@ 2026-01-14  3:58   ` Nick Xie
  1 sibling, 0 replies; 8+ messages in thread
From: Nick Xie @ 2026-01-14  3:58 UTC (permalink / raw)
  To: Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Neil Armstrong, Kevin Hilman, Martin Blumenstingl, Xianwei Zhao
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel

Hello Jerome,

I checked this patch on Amlogic S4 S905Y4, the eMMC & SDIO card also works.

root@Khadas:~# uname -a
Linux Khadas 6.19.0-rc5+ #26 SMP PREEMPT Tue Jan 13 16:01:18 CST 2026 aarch64 aarch64 aarch64 GNU/Linux
root@Khadas:~# dmesg | grep mmc
[    0.301186] meson-gx-mmc fe08a000.mmc: Got CD GPIO
[    0.302028] meson-gx-mmc fe08c000.mmc: allocated mmc-pwrseq
[    0.392252] mmc1: new UHS-I speed SDR104 SDHC card at address aaaa
[    0.393414] mmcblk1: mmc1:aaaa SP32G 29.7 GiB
[    0.395724]  mmcblk1: p1 p2
[    0.473691] mmc0: new HS200 MMC card at address 0001
[    0.474417] mmcblk0: mmc0:0001 AJTD4R 14.6 GiB
[    0.475852]  mmcblk0: p1 p2
[    0.476413] mmcblk0boot0: mmc0:0001 AJTD4R 4.00 MiB
[    0.478143] mmcblk0boot1: mmc0:0001 AJTD4R 4.00 MiB
[    0.479716] mmcblk0rpmb: mmc0:0001 AJTD4R 4.00 MiB, chardev (239:0)
[    3.243664] EXT4-fs (mmcblk1p2): mounted filesystem 43b6881a-483c-4ca7-9dcd-f4575e665a8b r/w with writeback data mode. Quota mode: none.
[    4.706154] EXT4-fs (mmcblk1p2): re-mounted 43b6881a-483c-4ca7-9dcd-f4575e665a8b.
[    5.900986] EXT4-fs (mmcblk1p1): mounted filesystem f20cabae-bbc6-457e-9bb3-bac6eef01af5 r/w with ordered data mode. Quota mode: none.
[    6.283608] meson-gx-mmc fe088000.mmc: allocated mmc-pwrseq
[    6.484310] mmc2: new UHS-I speed SDR104 SDIO card at address 0001

Tested-by: Nick Xie <nick@khadas.com>

Best Regards
Nick





________________________________________
发件人: Jerome Brunet <jbrunet@baylibre.com>
已发送: 2026 年 1 月 13 日 星期二 18:39
收件人: Rob Herring <robh@kernel.org>; Krzysztof Kozlowski <krzk+dt@kernel.org>; Conor Dooley <conor+dt@kernel.org>; Neil Armstrong <neil.armstrong@linaro.org>; Kevin Hilman <khilman@baylibre.com>; Martin Blumenstingl <martin.blumenstingl@googlemail.com>; Xianwei Zhao <xianwei.zhao@amlogic.com>; Nick Xie <nick@khadas.com>
抄送: devicetree@vger.kernel.org <devicetree@vger.kernel.org>; linux-arm-kernel@lists.infradead.org <linux-arm-kernel@lists.infradead.org>; linux-amlogic@lists.infradead.org <linux-amlogic@lists.infradead.org>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>; Jerome Brunet <jbrunet@baylibre.com>
主题: [PATCH 2/2] arm64: dts: amlogic: s4: fix mmc clock assignment


MMC A and C are mis-represented as having their "clkin0" input connected to

xtal while it is actually connected to the MMC clock, mostly 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")

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>

---

 arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 12 ++++++++++--

 1 file changed, 10 insertions(+), 2 deletions(-)



diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi

index 62538fd9db6b1ffb33a88e12628aadefbaa453ec..6324d1eb5994009df5b09923cce373a87229f4b8 100644

--- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi

+++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi

@@ -819,13 +819,17 @@ 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-parents = <0>;

+                       assigned-clock-rates = <24000000>;

                 };

 

                 sd: mmc@fe08a000 {

@@ -849,13 +853,17 @@ 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-parents = <0>;

+                       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] 8+ messages in thread

* Re: [PATCH 2/2] arm64: dts: amlogic: s4: fix mmc clock assignment
  2026-01-14  2:48   ` Chuan Liu
@ 2026-01-14  9:05     ` Neil Armstrong
  0 siblings, 0 replies; 8+ messages in thread
From: Neil Armstrong @ 2026-01-14  9:05 UTC (permalink / raw)
  To: Chuan Liu, 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 03:48, Chuan Liu wrote:
> hi Jerome,
> 
> On 1/13/2026 6:39 PM, Jerome Brunet wrote:
>> [ EXTERNAL EMAIL ]
>>
>> MMC A and C are mis-represented as having their "clkin0" input connected to
>> xtal while it is actually connected to the MMC clock, mostly in an attempt
>> to provide 24MHz to the device on this input.
> 
> Right.
> 
>>
>> 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")
>> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
>> ---
>>   arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 12 ++++++++++--
>>   1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
>> index 62538fd9db6b1ffb33a88e12628aadefbaa453ec..6324d1eb5994009df5b09923cce373a87229f4b8 100644
>> --- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
>> +++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
>> @@ -819,13 +819,17 @@ 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-parents = <0>;
> 
> Is it possible to remove assigned-clock-parent?

Yes it's not necessary to keep it.

Neil

> 
>> +                       assigned-clock-rates = <24000000>;
>>                  };
>>
>>                  sd: mmc@fe08a000 {
>> @@ -849,13 +853,17 @@ 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-parents = <0>;
>> +                       assigned-clock-rates = <24000000>;
>>                  };
>>          };
>>   };
>>
>> -- 
>> 2.47.3
>>
>>
>> _______________________________________________
>> linux-amlogic mailing list
>> linux-amlogic@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-amlogic
> 


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

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

* Re: [PATCH 0/2] arm64: dts: amlogic: s4: mmc clock fixups
  2026-01-13 10:39 [PATCH 0/2] arm64: dts: amlogic: s4: mmc clock fixups Jerome Brunet
  2026-01-13 10:39 ` [PATCH 1/2] arm64: dts: amlogic: s4: assign mmc b clock to 24MHz Jerome Brunet
  2026-01-13 10:39 ` [PATCH 2/2] arm64: dts: amlogic: s4: fix mmc clock assignment Jerome Brunet
@ 2026-01-14 12:11 ` Neil Armstrong
  2 siblings, 0 replies; 8+ 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 Tue, 13 Jan 2026 11:39:51 +0100, Jerome Brunet wrote:
> The patchset aims to address the issue raised here [1] for MMC B.
> 
> While checking this, I've found that MMC A and C also appear to be
> improperly described in this platform's DT. The 2nd change fixes that.
> 
> I do not have an s4 platform available with me, so these changes have only
> been compile tested but assigning the clock was actually tested on sm1.
> 
> [...]

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] 8+ messages in thread

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-13 10:39 [PATCH 0/2] arm64: dts: amlogic: s4: mmc clock fixups Jerome Brunet
2026-01-13 10:39 ` [PATCH 1/2] arm64: dts: amlogic: s4: assign mmc b clock to 24MHz Jerome Brunet
2026-01-14  3:52   ` 回复: " Nick Xie
2026-01-13 10:39 ` [PATCH 2/2] arm64: dts: amlogic: s4: fix mmc clock assignment Jerome Brunet
2026-01-14  2:48   ` Chuan Liu
2026-01-14  9:05     ` Neil Armstrong
2026-01-14  3:58   ` 回复: " Nick Xie
2026-01-14 12:11 ` [PATCH 0/2] arm64: dts: amlogic: s4: mmc clock fixups Neil Armstrong

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