Devicetree
 help / color / mirror / Atom feed
* [PATCH 1/4] dt-bindings: mmc: atmel,sama5d2-sdhci: add LAN969x compatible
@ 2026-08-24 10:56 Robert Marko
  2026-08-24 10:56 ` [PATCH 2/4] arm64: dts: microchip: lan969x: add SDMMC nodes Robert Marko
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Robert Marko @ 2026-08-24 10:56 UTC (permalink / raw)
  To: ulfh, robh, krzk+dt, conor+dt, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, aubin.constans, linux-mmc, devicetree,
	linux-arm-kernel, linux-kernel
  Cc: luka.perkov, Robert Marko

The SDHCI controller in the LAN969x family is compatible with the
SAM9X60 implementation. Add the microchip,lan9691-sdhci compatible
with microchip,sam9x60-sdhci as its fallback.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
 Documentation/devicetree/bindings/mmc/atmel,sama5d2-sdhci.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/mmc/atmel,sama5d2-sdhci.yaml b/Documentation/devicetree/bindings/mmc/atmel,sama5d2-sdhci.yaml
index ba75623b7778..af1c66a1f882 100644
--- a/Documentation/devicetree/bindings/mmc/atmel,sama5d2-sdhci.yaml
+++ b/Documentation/devicetree/bindings/mmc/atmel,sama5d2-sdhci.yaml
@@ -21,6 +21,7 @@ properties:
           - microchip,sam9x60-sdhci
       - items:
           - enum:
+              - microchip,lan9691-sdhci
               - microchip,sam9x7-sdhci
               - microchip,sama7d65-sdhci
               - microchip,sama7g5-sdhci
-- 
2.55.0


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

* [PATCH 2/4] arm64: dts: microchip: lan969x: add SDMMC nodes
  2026-08-24 10:56 [PATCH 1/4] dt-bindings: mmc: atmel,sama5d2-sdhci: add LAN969x compatible Robert Marko
@ 2026-08-24 10:56 ` Robert Marko
  2026-08-24 11:17   ` sashiko-bot
  2026-08-25 17:14   ` Aubin Constans
  2026-08-24 10:56 ` [PATCH 3/4] arm64: dts: microchip: ev23x71a: enable QSPI Robert Marko
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 7+ messages in thread
From: Robert Marko @ 2026-08-24 10:56 UTC (permalink / raw)
  To: ulfh, robh, krzk+dt, conor+dt, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, aubin.constans, linux-mmc, devicetree,
	linux-arm-kernel, linux-kernel
  Cc: luka.perkov, Robert Marko

Add nodes for both SDMMC controllers.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
 arch/arm64/boot/dts/microchip/lan9691.dtsi | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/arch/arm64/boot/dts/microchip/lan9691.dtsi b/arch/arm64/boot/dts/microchip/lan9691.dtsi
index a8541c6a098d..2d943ea75768 100644
--- a/arch/arm64/boot/dts/microchip/lan9691.dtsi
+++ b/arch/arm64/boot/dts/microchip/lan9691.dtsi
@@ -414,6 +414,30 @@ qspi0: spi@e0804000 {
 			status = "disabled";
 		};
 
+		sdmmc0: mmc@e0830000 {
+			compatible = "microchip,lan9691-sdhci",
+				     "microchip,sam9x60-sdhci";
+			reg = <0xe0830000 0x00000300>;
+			interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clks GCK_ID_SDMMC0>, <&clks GCK_ID_SDMMC0>;
+			clock-names = "hclock", "multclk";
+			assigned-clocks = <&clks GCK_ID_SDMMC0>;
+			assigned-clock-rates = <100000000>;
+			status = "disabled";
+		};
+
+		sdmmc1: mmc@e0838000 {
+			compatible = "microchip,lan9691-sdhci",
+				     "microchip,sam9x60-sdhci";
+			reg = <0xe0838000 0x00000300>;
+			interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clks GCK_ID_SDMMC1>, <&clks GCK_ID_SDMMC1>;
+			clock-names = "hclock", "multclk";
+			assigned-clocks = <&clks GCK_ID_SDMMC1>;
+			assigned-clock-rates = <45000000>;
+			status = "disabled";
+		};
+
 		qspi2: spi@e0834000 {
 			compatible = "microchip,lan9691-qspi";
 			reg = <0xe0834000 0x00000100>,
-- 
2.55.0


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

* [PATCH 3/4] arm64: dts: microchip: ev23x71a: enable QSPI
  2026-08-24 10:56 [PATCH 1/4] dt-bindings: mmc: atmel,sama5d2-sdhci: add LAN969x compatible Robert Marko
  2026-08-24 10:56 ` [PATCH 2/4] arm64: dts: microchip: lan969x: add SDMMC nodes Robert Marko
@ 2026-08-24 10:56 ` Robert Marko
  2026-08-24 10:56 ` [PATCH 4/4] arm64: dts: microchip: ev23x71a: enable eMMC Robert Marko
  2026-08-24 16:27 ` [PATCH 1/4] dt-bindings: mmc: atmel,sama5d2-sdhci: add LAN969x compatible Conor Dooley
  3 siblings, 0 replies; 7+ messages in thread
From: Robert Marko @ 2026-08-24 10:56 UTC (permalink / raw)
  To: ulfh, robh, krzk+dt, conor+dt, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, aubin.constans, linux-mmc, devicetree,
	linux-arm-kernel, linux-kernel
  Cc: luka.perkov, Robert Marko

Enable the QSPI controller and describe the onboard SPI NOR flash.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
 .../arm64/boot/dts/microchip/lan9696-ev23x71a.dts | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm64/boot/dts/microchip/lan9696-ev23x71a.dts b/arch/arm64/boot/dts/microchip/lan9696-ev23x71a.dts
index 4012ea7d07bb..985ca31e74e7 100644
--- a/arch/arm64/boot/dts/microchip/lan9696-ev23x71a.dts
+++ b/arch/arm64/boot/dts/microchip/lan9696-ev23x71a.dts
@@ -463,6 +463,21 @@ phy27: phy@27 {
 	};
 };
 
+&qspi0 {
+	status = "okay";
+
+	flash@0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <100000000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		spi-tx-bus-width = <1>;
+		spi-rx-bus-width = <4>;
+		m25p,fast-read;
+	};
+};
+
 &serdes {
 	status = "okay";
 };
-- 
2.55.0


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

* [PATCH 4/4] arm64: dts: microchip: ev23x71a: enable eMMC
  2026-08-24 10:56 [PATCH 1/4] dt-bindings: mmc: atmel,sama5d2-sdhci: add LAN969x compatible Robert Marko
  2026-08-24 10:56 ` [PATCH 2/4] arm64: dts: microchip: lan969x: add SDMMC nodes Robert Marko
  2026-08-24 10:56 ` [PATCH 3/4] arm64: dts: microchip: ev23x71a: enable QSPI Robert Marko
@ 2026-08-24 10:56 ` Robert Marko
  2026-08-24 16:27 ` [PATCH 1/4] dt-bindings: mmc: atmel,sama5d2-sdhci: add LAN969x compatible Conor Dooley
  3 siblings, 0 replies; 7+ messages in thread
From: Robert Marko @ 2026-08-24 10:56 UTC (permalink / raw)
  To: ulfh, robh, krzk+dt, conor+dt, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, aubin.constans, linux-mmc, devicetree,
	linux-arm-kernel, linux-kernel
  Cc: luka.perkov, Robert Marko

Enable the eMMC connected to SDMMC0 in 8-bit DDR mode.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
 arch/arm64/boot/dts/microchip/lan9696-ev23x71a.dts | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/microchip/lan9696-ev23x71a.dts b/arch/arm64/boot/dts/microchip/lan9696-ev23x71a.dts
index 985ca31e74e7..89a161b87d6f 100644
--- a/arch/arm64/boot/dts/microchip/lan9696-ev23x71a.dts
+++ b/arch/arm64/boot/dts/microchip/lan9696-ev23x71a.dts
@@ -478,6 +478,16 @@ flash@0 {
 	};
 };
 
+&sdmmc0 {
+	pinctrl-0 = <&emmc_sd_pins>;
+	pinctrl-names = "default";
+	bus-width = <8>;
+	mmc-ddr-1_8v;
+	non-removable;
+	disable-wp;
+	status = "okay";
+};
+
 &serdes {
 	status = "okay";
 };
-- 
2.55.0


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

* Re: [PATCH 2/4] arm64: dts: microchip: lan969x: add SDMMC nodes
  2026-08-24 10:56 ` [PATCH 2/4] arm64: dts: microchip: lan969x: add SDMMC nodes Robert Marko
@ 2026-08-24 11:17   ` sashiko-bot
  2026-08-25 17:14   ` Aubin Constans
  1 sibling, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-08-24 11:17 UTC (permalink / raw)
  To: Robert Marko; +Cc: devicetree, conor+dt, robh

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [High] Potential clock calculation truncation bug with `45000000` rate in `sdmmc1` leading to an out-of-spec initialization clock.
- [Medium] Identical clocks assigned to `hclock` and `multclk` in `sdmmc` nodes incorrectly model the hardware.
- [Low] Child nodes are not sorted alphanumerically by their unit-address.
- [Low] The compatible string 'microchip,lan9691-sdhci' is undocumented.
--

--- Patch [2]: [PATCH 2/4] arm64: dts: microchip: lan969x: add SDMMC nodes ---
commit 3b81135d2fb8590ea896af2a6f1a054ed2baf2c4
Author: Robert Marko <robert.marko@sartura.hr>

arm64: dts: microchip: lan969x: add SDMMC nodes

Add nodes for both SDMMC controllers.

> diff --git a/arch/arm64/boot/dts/microchip/lan9691.dtsi b/arch/arm64/boot/dts/microchip/lan9691.dtsi
> index a8541c6a098d1..2d943ea757689 100644
> --- a/arch/arm64/boot/dts/microchip/lan9691.dtsi
> +++ b/arch/arm64/boot/dts/microchip/lan9691.dtsi
> @@ -414,6 +414,30 @@ qspi0: spi@e0804000 {
>  			status = "disabled";
>  		};
>  
> +		sdmmc0: mmc@e0830000 {
> +			compatible = "microchip,lan9691-sdhci",
> +				     "microchip,sam9x60-sdhci";

[Severity: Low]
Is this new compatible string "microchip,lan9691-sdhci" documented in the
device tree bindings?

Running make dtbs_check might result in warnings if the string is missing from
the dt-bindings schemas.

> +			reg = <0xe0830000 0x00000300>;
> +			interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
> +			clocks = <&clks GCK_ID_SDMMC0>, <&clks GCK_ID_SDMMC0>;
> +			clock-names = "hclock", "multclk";

[Severity: Medium]
Are these clock assignments correct for hclock and multclk?

In AT91/Microchip SoC bindings, hclock typically points to the system peripheral
bus clock (AHB), while multclk points to the generated core clock.

By specifying the generated clock (GCK_ID_SDMMC0) for both, the driver will
never manage the actual AHB clock state, which could lead to power management
issues.

> +			assigned-clocks = <&clks GCK_ID_SDMMC0>;
> +			assigned-clock-rates = <100000000>;
> +			status = "disabled";
> +		};
> +
> +		sdmmc1: mmc@e0838000 {

[Severity: Low]
Should this node be placed after qspi2: spi@e0834000 to maintain alphanumeric
sorting by unit-address?

The address 0xe0838000 is greater than 0xe0834000.

> +			compatible = "microchip,lan9691-sdhci",
> +				     "microchip,sam9x60-sdhci";
> +			reg = <0xe0838000 0x00000300>;
> +			interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
> +			clocks = <&clks GCK_ID_SDMMC1>, <&clks GCK_ID_SDMMC1>;
> +			clock-names = "hclock", "multclk";
> +			assigned-clocks = <&clks GCK_ID_SDMMC1>;
> +			assigned-clock-rates = <45000000>;

[Severity: High]
Does this 45MHz rate cause SD card initialization to fail due to exceeding the
400kHz limit?

During SDHCI probe, sdhci-of-at91 computes the base clock by dividing the
gck_rate by 2 and truncating to integer MHz (22.5 MHz -> 22 MHz). It writes 22
to the capabilities register with a multiplier of 2, so the core thinks the max
clock is 44 MHz.

When requesting a 400 kHz initialization clock, the core calculates a divider
of 110 (44,000,000 / 110 = 400,000).

However, the actual programmable clock source is exactly 45 MHz. Applying the
110 divider to the real 45 MHz source yields an actual initialization clock of
409,090 Hz, which exceeds the strict 400 kHz SD specification maximum.

Could we use a clock rate that divides cleanly into an integer MHz (like
48 MHz) to avoid this truncation issue?

> +			status = "disabled";
> +		};
> +
>  		qspi2: spi@e0834000 {

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260824110432.1074136-1-robert.marko@sartura.hr?part=2

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

* Re: [PATCH 1/4] dt-bindings: mmc: atmel,sama5d2-sdhci: add LAN969x compatible
  2026-08-24 10:56 [PATCH 1/4] dt-bindings: mmc: atmel,sama5d2-sdhci: add LAN969x compatible Robert Marko
                   ` (2 preceding siblings ...)
  2026-08-24 10:56 ` [PATCH 4/4] arm64: dts: microchip: ev23x71a: enable eMMC Robert Marko
@ 2026-08-24 16:27 ` Conor Dooley
  3 siblings, 0 replies; 7+ messages in thread
From: Conor Dooley @ 2026-08-24 16:27 UTC (permalink / raw)
  To: Robert Marko
  Cc: ulfh, robh, krzk+dt, conor+dt, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, aubin.constans, linux-mmc, devicetree,
	linux-arm-kernel, linux-kernel, luka.perkov

[-- Attachment #1: Type: text/plain, Size: 75 bytes --]

Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH 2/4] arm64: dts: microchip: lan969x: add SDMMC nodes
  2026-08-24 10:56 ` [PATCH 2/4] arm64: dts: microchip: lan969x: add SDMMC nodes Robert Marko
  2026-08-24 11:17   ` sashiko-bot
@ 2026-08-25 17:14   ` Aubin Constans
  1 sibling, 0 replies; 7+ messages in thread
From: Aubin Constans @ 2026-08-25 17:14 UTC (permalink / raw)
  To: Robert Marko, ulfh, robh, krzk+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linux-mmc, devicetree,
	linux-arm-kernel, linux-kernel
  Cc: luka.perkov

On 24/08/2026 12:56, Robert Marko wrote:
> Add nodes for both SDMMC controllers.
> 
> Signed-off-by: Robert Marko <robert.marko@sartura.hr>
> ---
>   arch/arm64/boot/dts/microchip/lan9691.dtsi | 24 ++++++++++++++++++++++
>   1 file changed, 24 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/microchip/lan9691.dtsi b/arch/arm64/boot/dts/microchip/lan9691.dtsi
> index a8541c6a098d..2d943ea75768 100644
> --- a/arch/arm64/boot/dts/microchip/lan9691.dtsi
> +++ b/arch/arm64/boot/dts/microchip/lan9691.dtsi
> @@ -414,6 +414,30 @@ qspi0: spi@e0804000 {
>                          status = "disabled";
>                  };
> 
> +               sdmmc0: mmc@e0830000 {
> +                       compatible = "microchip,lan9691-sdhci",
> +                                    "microchip,sam9x60-sdhci";
> +                       reg = <0xe0830000 0x00000300>;
> +                       interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
> +                       clocks = <&clks GCK_ID_SDMMC0>, <&clks GCK_ID_SDMMC0>;
> +                       clock-names = "hclock", "multclk";
> +                       assigned-clocks = <&clks GCK_ID_SDMMC0>;
> +                       assigned-clock-rates = <100000000>;

If always targeting an e.MMC, capped at the High Speed DDR mode, one might consider
a multiple of 52 MHz here.

> +                       status = "disabled";
> +               };
> +
> +               sdmmc1: mmc@e0838000 {
> +                       compatible = "microchip,lan9691-sdhci",
> +                                    "microchip,sam9x60-sdhci";
> +                       reg = <0xe0838000 0x00000300>;
> +                       interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
> +                       clocks = <&clks GCK_ID_SDMMC1>, <&clks GCK_ID_SDMMC1>;
> +                       clock-names = "hclock", "multclk";
> +                       assigned-clocks = <&clks GCK_ID_SDMMC1>;
> +                       assigned-clock-rates = <45000000>;
> +                       status = "disabled";
> +               };
> +
>                  qspi2: spi@e0834000 {
>                          compatible = "microchip,lan9691-qspi";
>                          reg = <0xe0834000 0x00000100>,
> --
> 2.55.0
> 


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

end of thread, other threads:[~2026-08-25 17:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-24 10:56 [PATCH 1/4] dt-bindings: mmc: atmel,sama5d2-sdhci: add LAN969x compatible Robert Marko
2026-08-24 10:56 ` [PATCH 2/4] arm64: dts: microchip: lan969x: add SDMMC nodes Robert Marko
2026-08-24 11:17   ` sashiko-bot
2026-08-25 17:14   ` Aubin Constans
2026-08-24 10:56 ` [PATCH 3/4] arm64: dts: microchip: ev23x71a: enable QSPI Robert Marko
2026-08-24 10:56 ` [PATCH 4/4] arm64: dts: microchip: ev23x71a: enable eMMC Robert Marko
2026-08-24 16:27 ` [PATCH 1/4] dt-bindings: mmc: atmel,sama5d2-sdhci: add LAN969x compatible Conor Dooley

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