Skip to contentSkip to conversation

ARM: dts: at91: sama7g5: fixes for sama7g5

PATCH In review Claudiu Beznea 2 participants 4 messages Sep 15, 2021 – Oct 4, 2021

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

cover ARM: dts: at91: sama7g5: fixes for sama7g5

Hi,

The following patches fixes slew rate settings for SAMA7G5's GMACs and SDMMCs.

Thank you,
Claudiu Beznea

Claudiu Beznea (2):
ARM: dts: at91: sama7g5ek: use proper slew-rate settings for GMACs
ARM: dts: at91: sama7g5ek: to not touch slew-rate for SDMMC pins

 arch/arm/boot/dts/at91-sama7g5ek.dts | 34 +++++++++++++++++++++++-----
 1 file changed, 28 insertions(+), 6 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/2 ARM: dts: at91: sama7g5ek: use proper slew-rate settings for GMACs

Datasheet chapter "EMAC Timings" specifies that while in 3.3V domain GMAC's MDIO pins should be configured with slew-rate enabled, while the data + signaling pins should be configured with slew-rate disabled when GMAC works in RGMII or RMII modes. The pin controller for SAMA7G5 sets the slew-rate as enabled for all pins. Adapt the device tree to comply with these.

Fixes 7540629e2fc7 ("ARM: dts: at91: add sama7g5 SoC DT and sama7g5-ek")
---
 arch/arm/boot/dts/at91-sama7g5ek.dts | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)
arch/arm/boot/dts/at91-sama7g5ek.dts +22 -6
index 8b13b031a167..0bed8207d498 100644
@@ -353,7 +353,10 @@ &gmac0 {
 	#address-cells = <1>;
 	#size-cells = <0>;
 	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_gmac0_default &pinctrl_gmac0_txck_default &pinctrl_gmac0_phy_irq>;
+	pinctrl-0 = <&pinctrl_gmac0_default
+		     &pinctrl_gmac0_mdio_default
+		     &pinctrl_gmac0_txck_default
+		     &pinctrl_gmac0_phy_irq>;
 	phy-mode = "rgmii-id";
 	status = "okay";
 
@@ -368,7 +371,9 @@ &gmac1 {
 	#address-cells = <1>;
 	#size-cells = <0>;
 	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_gmac1_default &pinctrl_gmac1_phy_irq>;
+	pinctrl-0 = <&pinctrl_gmac1_default
+		     &pinctrl_gmac1_mdio_default
+		     &pinctrl_gmac1_phy_irq>;
 	phy-mode = "rmii";
 	status = "okay";
 
@@ -423,14 +428,20 @@ pinctrl_gmac0_default: gmac0_default {
 			 <PIN_PA15__G0_TXEN>,
 			 <PIN_PA30__G0_RXCK>,
 			 <PIN_PA18__G0_RXDV>,
-			 <PIN_PA22__G0_MDC>,
-			 <PIN_PA23__G0_MDIO>,
 			 <PIN_PA25__G0_125CK>;
+		slew-rate = <0>;
+		bias-disable;
+	};
+
+	pinctrl_gmac0_mdio_default: gmac0_mdio_default {
+		pinmux = <PIN_PA22__G0_MDC>,
+			 <PIN_PA23__G0_MDIO>;
 		bias-disable;
 	};
 
 	pinctrl_gmac0_txck_default: gmac0_txck_default {
 		pinmux = <PIN_PA24__G0_TXCK>;
+		slew-rate = <0>;
 		bias-pull-up;
 	};
 
@@ -447,8 +458,13 @@ pinctrl_gmac1_default: gmac1_default {
 			 <PIN_PD25__G1_RX0>,
 			 <PIN_PD26__G1_RX1>,
 			 <PIN_PD27__G1_RXER>,
-			 <PIN_PD24__G1_RXDV>,
-			 <PIN_PD28__G1_MDC>,
+			 <PIN_PD24__G1_RXDV>;
+		slew-rate = <0>;
+		bias-disable;
+	};
+
+	pinctrl_gmac1_mdio_default: gmac1_mdio_default {
+		pinmux = <PIN_PD28__G1_MDC>,
 			 <PIN_PD29__G1_MDIO>;
 		bias-disable;
 	};
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/2 ARM: dts: at91: sama7g5ek: to not touch slew-rate for SDMMC pins

In reply to Claudiu Beznea

With commit c709135e576b ("pinctrl: at91-pio4: add support for slew-rate") and commit cbde6c823bfa ("pinctrl: at91-pio4: Fix slew rate disablement") the slew-rate is enabled by default for each configured pin. The datasheet specifies at chapter "Output Driver AC Characteristics" that HSIO drivers (use in SDMMCx and QSPI0 peripherals), don't have a slewrate setting but are rather calibrated against an external 1% resistor mounted on the SDMMCx_CAL or QSPI0_CAL pins. Depending on the target signal frequency and the external load, it is possible to adjust their target output impedance. Thus set slew-rate = <0> for SDMMC (QSPI is not enabled at the moment in device tree).

Fixes 7540629e2fc7 ("ARM: dts: at91: add sama7g5 SoC DT and sama7g5-ek")
---
 arch/arm/boot/dts/at91-sama7g5ek.dts | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/at91-sama7g5ek.dts +6 -0
index 0bed8207d498..624162fec223 100644
@@ -556,6 +556,7 @@ cmd_data {
 				 <PIN_PA8__SDMMC0_DAT5>,
 				 <PIN_PA9__SDMMC0_DAT6>,
 				 <PIN_PA10__SDMMC0_DAT7>;
+			slew-rate = <0>;
 			bias-pull-up;
 		};
 
@@ -563,6 +564,7 @@ ck_cd_rstn_vddsel {
 			pinmux = <PIN_PA0__SDMMC0_CK>,
 				 <PIN_PA2__SDMMC0_RSTN>,
 				 <PIN_PA11__SDMMC0_DS>;
+			slew-rate = <0>;
 			bias-pull-up;
 		};
 	};
@@ -574,6 +576,7 @@ cmd_data {
 				 <PIN_PC0__SDMMC1_DAT1>,
 				 <PIN_PC1__SDMMC1_DAT2>,
 				 <PIN_PC2__SDMMC1_DAT3>;
+			slew-rate = <0>;
 			bias-pull-up;
 		};
 
@@ -582,6 +585,7 @@ ck_cd_rstn_vddsel {
 				 <PIN_PB28__SDMMC1_RSTN>,
 				 <PIN_PC5__SDMMC1_1V8SEL>,
 				 <PIN_PC4__SDMMC1_CD>;
+			slew-rate = <0>;
 			bias-pull-up;
 		};
 	};
@@ -593,11 +597,13 @@ cmd_data {
 				 <PIN_PD6__SDMMC2_DAT1>,
 				 <PIN_PD7__SDMMC2_DAT2>,
 				 <PIN_PD8__SDMMC2_DAT3>;
+			slew-rate = <0>;
 			bias-pull-up;
 		};
 
 		ck {
 			pinmux = <PIN_PD4__SDMMC2_CK>;
+			slew-rate = <0>;
 			bias-pull-up;
 		};
 	};
Signature · 1 line
2.25.1
maintainer Acked-by on the v1 series
#3 lore raw
In reply to Claudiu Beznea
Quoted 11 lines · Claudiu Beznea

Hi,

The following patches fixes slew rate settings for SAMA7G5's GMACs and SDMMCs.

Thank you,
Claudiu Beznea

Claudiu Beznea (2):
ARM: dts: at91: sama7g5ek: use proper slew-rate settings for GMACs
ARM: dts: at91: sama7g5ek: to not touch slew-rate for SDMMC pins

For both of them:

And queued in at91-fixes for second batch of fixes for 5.15.

Best regards,
Nicolas

Quoted 3 lines
  arch/arm/boot/dts/at91-sama7g5ek.dts | 34 +++++++++++++++++++++++-----
  1 file changed, 28 insertions(+), 6 deletions(-)
Signature · 1 line
Nicolas Ferre