Skip to contentSkip to conversation

Fix emmc hs400 mode on mt7986

PATCH In review Frank Wunderlich 5 participants 7 messages Jun 29, 2023 – Oct 3, 2023

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v2 cover Fix emmc hs400 mode on mt7986

From: Frank Wunderlich <[email protected]>

Eric boots linux directly from ATF without using uboot. In this corner case clocks for emmc hs400 mode are not correctly setup.

Fix this by adding assigned-clocks and assigned.clock-parents to mmc node.

Eric Woudstra (1):
arm64: dts: mt7986: fix emmc hs400 mode without uboot initialization

Frank Wunderlich (1):
dt-bindings: mmc: mtk-sd: drop assigned-clocks/clock-parents

 Documentation/devicetree/bindings/mmc/mtk-sd.yaml | 10 ----------
 arch/arm64/boot/dts/mediatek/mt7986a.dtsi         |  4 ++++
 2 files changed, 4 insertions(+), 10 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/2 dt-bindings: mmc: mtk-sd: drop assigned-clocks/clock-parents

From: Frank Wunderlich <[email protected]>

MT7986 has 2 clock-parents and these properties are not needed in driver binding. So drop them completely.

---
v2:
- drop assigned-clock* completely based on discussion with Krzysztof in v1

---
 Documentation/devicetree/bindings/mmc/mtk-sd.yaml | 10 ----------
 1 file changed, 10 deletions(-)
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +0 -10
index 46eefdd19a2c..3fffa467e4e1 100644
@@ -91,16 +91,6 @@ properties:
       should switch dat1 pin to GPIO mode.
     maxItems: 1
 
-  assigned-clocks:
-    description:
-      PLL of the source clock.
-    maxItems: 1
-
-  assigned-clock-parents:
-    description:
-      parent of source clock, used for HS400 mode to get 400Mhz source clock.
-    maxItems: 1
-
   hs400-ds-delay:
     $ref: /schemas/types.yaml#/definitions/uint32
     description:
Signature · 1 line
2.34.1
#3 lore raw

Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: drop assigned-clocks/clock-parents

In reply to Frank Wunderlich
Quoted 7 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

MT7986 has 2 clock-parents and these properties are not needed in driver binding. So drop them completely.

Applied for next, thanks!

Kind regards
Uffe

Quoted 31 lines

---
v2:
- drop assigned-clock* completely based on discussion with Krzysztof in v1

---
 Documentation/devicetree/bindings/mmc/mtk-sd.yaml | 10 ----------
 1 file changed, 10 deletions(-)
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +0 -11
index 46eefdd19a2c..3fffa467e4e1 100644
@@ -91,16 +91,6 @@ properties:
       should switch dat1 pin to GPIO mode.
     maxItems: 1
 
-  assigned-clocks:
-    description:
-      PLL of the source clock.
-    maxItems: 1
-
-  assigned-clock-parents:
-    description:
-      parent of source clock, used for HS400 mode to get 400Mhz source clock.
-    maxItems: 1
-
   hs400-ds-delay:
     $ref: /schemas/types.yaml#/definitions/uint32
     description:
--

2.34.1

#4 lore raw

PATCH v2 2/2 arm64: dts: mt7986: fix emmc hs400 mode without uboot initialization

In reply to Frank Wunderlich

From: Eric Woudstra <[email protected]>

Eric reports errors on emmc with hs400 mode when booting linux on bpi-r3 without uboot [1]. Booting with uboot does not show this because clocks seem to be initialized by uboot.

Fix this by adding assigned-clocks and assigned-clock-parents like it's done in uboot [2].

[1] https://forum.banana-pi.org/t/bpi-r3-kernel-fails-setting-emmc-clock-to-416m-depends-on-u-boot/15170
[2] https://github.com/u-boot/u-boot/blob/master/arch/arm/dts/mt7986.dtsi#L287

Fixes 513b49d19b34 ("arm64: dts: mt7986: add mmc related device nodes")
---
 arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/mediatek/mt7986a.dtsi +4 -0
index 68539ea788df..207510abda89 100644
@@ -374,6 +374,10 @@ mmc0: mmc@11230000 {
 			reg = <0 0x11230000 0 0x1000>,
 			      <0 0x11c20000 0 0x1000>;
 			interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
+			assigned-clocks = <&topckgen CLK_TOP_EMMC_416M_SEL>,
+					  <&topckgen CLK_TOP_EMMC_250M_SEL>;
+			assigned-clock-parents = <&apmixedsys CLK_APMIXED_MPLL>,
+						 <&topckgen CLK_TOP_NET1PLL_D5_D2>;
 			clocks = <&topckgen CLK_TOP_EMMC_416M_SEL>,
 				 <&infracfg CLK_INFRA_MSDC_HCK_CK>,
 				 <&infracfg CLK_INFRA_MSDC_CK>,
Signature · 1 line
2.34.1
#5 lore raw

Aw: [PATCH v2 2/2] arm64: dts: mt7986: fix emmc hs400 mode without uboot initialization

Hi,

just a friendly reminder, patch seems not applied to next.

dt-binding part is reported as applied

regards Frank

Quoted 45 lines

Gesendet: Donnerstag, 29. Juni 2023 um 20:43 Uhr
Von: "Frank Wunderlich" <[email protected]>
An: [email protected]
Cc: "Frank Wunderlich" <[email protected]>, "Chaotian Jing" <[email protected]>, "Ulf Hansson" <[email protected]>, "Rob Herring" <[email protected]>, "Krzysztof Kozlowski" <[email protected]>, "Conor Dooley" <[email protected]>, "Matthias Brugger" <[email protected]>, "AngeloGioacchino Del Regno" <[email protected]>, "Wenbin Mei" <[email protected]>, "Sam Shih" <[email protected]>, [email protected], [email protected], [email protected], [email protected], "Eric Woudstra" <[email protected]>, [email protected]
Betreff: [PATCH v2 2/2] arm64: dts: mt7986: fix emmc hs400 mode without uboot initialization

From: Eric Woudstra <[email protected]>

Eric reports errors on emmc with hs400 mode when booting linux on bpi-r3 without uboot [1]. Booting with uboot does not show this because clocks seem to be initialized by uboot.

Fix this by adding assigned-clocks and assigned-clock-parents like it's done in uboot [2].

[1] https://forum.banana-pi.org/t/bpi-r3-kernel-fails-setting-emmc-clock-to-416m-depends-on-u-boot/15170
[2] https://github.com/u-boot/u-boot/blob/master/arch/arm/dts/mt7986.dtsi#L287

Fixes 513b49d19b34 ("arm64: dts: mt7986: add mmc related device nodes")
---
 arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/mediatek/mt7986a.dtsi +4 -1
index 68539ea788df..207510abda89 100644
@@ -374,6 +374,10 @@ mmc0: mmc@11230000 {
 			reg = <0 0x11230000 0 0x1000>,
 			      <0 0x11c20000 0 0x1000>;
 			interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
+			assigned-clocks = <&topckgen CLK_TOP_EMMC_416M_SEL>,
+					  <&topckgen CLK_TOP_EMMC_250M_SEL>;
+			assigned-clock-parents = <&apmixedsys CLK_APMIXED_MPLL>,
+						 <&topckgen CLK_TOP_NET1PLL_D5_D2>;
 			clocks = <&topckgen CLK_TOP_EMMC_416M_SEL>,
 				 <&infracfg CLK_INFRA_MSDC_HCK_CK>,
 				 <&infracfg CLK_INFRA_MSDC_CK>,
--

2.34.1

maintainer Reviewed-by on v2 2/2
#6 lore raw

Re: [PATCH v2 2/2] arm64: dts: mt7986: fix emmc hs400 mode without uboot initialization

In reply to Frank Wunderlich

Il 29/06/23 20:43, Frank Wunderlich ha scritto:

Quoted 9 lines

From: Eric Woudstra <[email protected]>

Eric reports errors on emmc with hs400 mode when booting linux on bpi-r3 without uboot [1]. Booting with uboot does not show this because clocks seem to be initialized by uboot.

Fix this by adding assigned-clocks and assigned-clock-parents like it's done in uboot [2].

Quoted 7 lines

[1] https://forum.banana-pi.org/t/bpi-r3-kernel-fails-setting-emmc-clock-to-416m-depends-on-u-boot/15170
[2] https://github.com/u-boot/u-boot/blob/master/arch/arm/dts/mt7986.dtsi#L287

Fixes 513b49d19b34 ("arm64: dts: mt7986: add mmc related device nodes")