diff mbox series

[v2,2/3] ARM: dts: sun7i: add support for A20-olinuxino-lime2 Revisions G/G1/G2

Message ID 20220315095244.29718-3-ynezz@true.cz (mailing list archive)
State New, archived
Headers show
Series [v2,1/3] Revert "ARM: dts: sun7i: A20-olinuxino-lime2: Fix ethernet phy-mode" | expand

Commit Message

Petr Štetiar March 15, 2022, 9:52 a.m. UTC
Lime2 HW first public revisions G/G1/G2 used RTL8211E PHYs. Later public
revision K and newest are using KSZ9031 PHYs. Up to commit bbc4d71d6354
("net: phy: realtek: fix rtl8211e rx/tx delay config") it was possible
to use same DTS for A20-olinuxino-lime2 with either KSZ9031 or RTL8211E
PHYs, thus on all HW revisions.

Having commit bbc4d71d6354 ("net: phy: realtek: fix rtl8211e rx/tx delay
config") applied, Bastien found out, that his board using RTL8211E PHY
doesn't work anymore and tried to fix it by providing proper `phy-mode`
in commit 55dd7e059098 ("ARM: dts: sun7i: A20-olinuxino-lime2: Fix
ethernet phy-mode") with following reasoning:

 Commit bbc4d71d6354 ("net: phy: realtek: fix rtl8211e rx/tx delay
 config") sets the RX/TX delay according to the phy-mode property in the
 device tree. For the A20-olinuxino-lime2 board this is "rgmii", which is
 the wrong setting.

Indeed, the settings were likely wrong, but only for boards with G/G1/G2
revisions using RTL8211E PHY. Those settings were still correct on
boards with HW revisions K and later with KSZ9031 PHY, so this fix was
incorrect.

So fix it properly by introducing separate DTS for boards with G/G1/G2
revisions using proper PHY mode for RTL8211E PHY.

Cc: stable@vger.kernel.org
Cc: Bastien Roucariès <rouca@debian.org>
References: https://github.com/OLIMEX/OLINUXINO/blob/master/HARDWARE/A20-OLinuXino-LIME2/hardware_revision_changes_log.txt
Signed-off-by: Petr Štetiar <ynezz@true.cz>
---
 arch/arm/boot/dts/Makefile                            |  2 ++
 .../boot/dts/sun7i-a20-olinuxino-lime2-emmc-revG.dts  | 11 +++++++++++
 arch/arm/boot/dts/sun7i-a20-olinuxino-lime2-revG.dts  | 11 +++++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun7i-a20-olinuxino-lime2-emmc-revG.dts
 create mode 100644 arch/arm/boot/dts/sun7i-a20-olinuxino-lime2-revG.dts
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index e41eca79c950..241a1a229f0f 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -1244,7 +1244,9 @@  dtb-$(CONFIG_MACH_SUN7I) += \
 	sun7i-a20-olinuxino-lime.dtb \
 	sun7i-a20-olinuxino-lime-emmc.dtb \
 	sun7i-a20-olinuxino-lime2.dtb \
+	sun7i-a20-olinuxino-lime2-revG.dtb \
 	sun7i-a20-olinuxino-lime2-emmc.dtb \
+	sun7i-a20-olinuxino-lime2-emmc-revG.dtb \
 	sun7i-a20-olinuxino-micro.dtb \
 	sun7i-a20-olinuxino-micro-emmc.dtb \
 	sun7i-a20-orangepi.dtb \
diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2-emmc-revG.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2-emmc-revG.dts
new file mode 100644
index 000000000000..1e29f973614d
--- /dev/null
+++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2-emmc-revG.dts
@@ -0,0 +1,11 @@ 
+// SPDX-License-Identifier: GPL-2.0+
+#include "sun7i-a20-olinuxino-lime2-emmc.dts"
+
+/ {
+	model = "Olimex A20-OLinuXino-LIME2-eMMC (Rev G/G1/G2)";
+	compatible = "olimex,a20-olinuxino-lime2-emmc-revG", "allwinner,sun7i-a20";
+};
+
+&gmac {
+	phy-mode = "rgmii-id";
+};
diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2-revG.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2-revG.dts
new file mode 100644
index 000000000000..7122dc99810a
--- /dev/null
+++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2-revG.dts
@@ -0,0 +1,11 @@ 
+// SPDX-License-Identifier: GPL-2.0+
+#include "sun7i-a20-olinuxino-lime2.dts"
+
+/ {
+	model = "Olimex A20-OLinuXino-LIME2 (Rev G/G1/G2)";
+	compatible = "olimex,a20-olinuxino-lime2-revG", "allwinner,sun7i-a20";
+};
+
+&gmac {
+	phy-mode = "rgmii-id";
+};