[openwrt/openwrt] mvebu: backport Turris Omnia DTS changes to 5.10

LEDE Commits lede-commits at lists.infradead.org
Sun Aug 8 11:34:10 PDT 2021


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b3b855191b08baf88ecf0255839164ac1863726e

commit b3b855191b08baf88ecf0255839164ac1863726e
Author: Klaus Kudielka <klaus.kudielka at gmail.com>
AuthorDate: Sat Jul 17 19:31:44 2021 +0200

    mvebu: backport Turris Omnia DTS changes to 5.10
    
    Kernel 5.10 receives the complete set of improvements from 5.11/5.12.
    While we are at it, move the patches accepted upstream to the 0xx series.
    
    Signed-off-by: Klaus Kudielka <klaus.kudielka at gmail.com>
---
 ...ts-turris-omnia-add-comphy-handle-to-eth2.patch |  37 +++++
 ...ts-turris-omnia-describe-switch-interrupt.patch |  61 ++++++++
 ...5-v5.11-ARM-dts-turris-omnia-add-SFP-node.patch |  90 ++++++++++++
 ...-dts-turris-omnia-add-LED-controller-node.patch | 160 +++++++++++++++++++++
 ...-update-ethernet-phy-node-and-handle-name.patch |  52 +++++++
 ...ris-omnia-fix-hardware-buffer-management.patch} |  14 +-
 6 files changed, 410 insertions(+), 4 deletions(-)

diff --git a/target/linux/mvebu/patches-5.10/003-v5.11-ARM-dts-turris-omnia-add-comphy-handle-to-eth2.patch b/target/linux/mvebu/patches-5.10/003-v5.11-ARM-dts-turris-omnia-add-comphy-handle-to-eth2.patch
new file mode 100644
index 0000000000..99ed07e13b
--- /dev/null
+++ b/target/linux/mvebu/patches-5.10/003-v5.11-ARM-dts-turris-omnia-add-comphy-handle-to-eth2.patch
@@ -0,0 +1,37 @@
+From 9ec25ef84832209a8326f9a71fe3ba14f4bcf301 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <kabel at kernel.org>
+Date: Sun, 15 Nov 2020 14:59:18 +0100
+Subject: ARM: dts: turris-omnia: add comphy handle to eth2
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The eth2 controller on Turris Omnia is connected to SerDes. For SFP to
+be able to switch between 1G and 2.5G modes the comphy link has to be
+defined.
+
+Signed-off-by: Marek Behún <kabel at kernel.org>
+Fixes: f3a6a9f3704a ("ARM: dts: add description for Armada 38x ...")
+Reviewed-by: Andrew Lunn <andrew at lunn.ch>
+Reviewed-by: Andreas Färber <afaerber at suse.de>
+Cc: linux-arm-kernel at lists.infradead.org
+Cc: Uwe Kleine-König <uwe at kleine-koenig.org>
+Cc: Jason Cooper <jason at lakedaemon.net>
+Cc: Gregory CLEMENT <gregory.clement at bootlin.com>
+Cc: Rob Herring <robh+dt at kernel.org>
+Cc: devicetree at vger.kernel.org
+Signed-off-by: Gregory CLEMENT <gregory.clement at bootlin.com>
+---
+ arch/arm/boot/dts/armada-385-turris-omnia.dts | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
+@@ -129,6 +129,7 @@
+ 	status = "okay";
+ 	phy-mode = "sgmii";
+ 	phy = <&phy1>;
++	phys = <&comphy5 2>;
+ 	buffer-manager = <&bm>;
+ 	bm,pool-long = <2>;
+ 	bm,pool-short = <3>;
diff --git a/target/linux/mvebu/patches-5.10/004-v5.11-ARM-dts-turris-omnia-describe-switch-interrupt.patch b/target/linux/mvebu/patches-5.10/004-v5.11-ARM-dts-turris-omnia-describe-switch-interrupt.patch
new file mode 100644
index 0000000000..4bbd80aac4
--- /dev/null
+++ b/target/linux/mvebu/patches-5.10/004-v5.11-ARM-dts-turris-omnia-describe-switch-interrupt.patch
@@ -0,0 +1,61 @@
+From d29b67c220caf5f4905e1f1576e71bcb6de4af9e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <kabel at kernel.org>
+Date: Sun, 15 Nov 2020 14:59:19 +0100
+Subject: ARM: dts: turris-omnia: describe switch interrupt
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Describe switch interrupt for Turris Omnia so that the CPU does not have
+to poll the switch. We also need to to set mpp45 pin to gpio function
+for this.
+
+Signed-off-by: Marek Behún <kabel at kernel.org>
+Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia")
+Cc: linux-arm-kernel at lists.infradead.org
+Cc: Uwe Kleine-König <uwe at kleine-koenig.org>
+Cc: Jason Cooper <jason at lakedaemon.net>
+Cc: Gregory CLEMENT <gregory.clement at bootlin.com>
+Cc: Andreas Färber <afaerber at suse.de>
+Cc: Andrew Lunn <andrew at lunn.ch>
+Cc: Rob Herring <robh+dt at kernel.org>
+Cc: devicetree at vger.kernel.org
+Signed-off-by: Gregory CLEMENT <gregory.clement at bootlin.com>
+---
+ arch/arm/boot/dts/armada-385-turris-omnia.dts | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
+@@ -261,13 +261,18 @@
+ 
+ 	/* Switch MV88E6176 at address 0x10 */
+ 	switch at 10 {
++		pinctrl-names = "default";
++		pinctrl-0 = <&swint_pins>;
+ 		compatible = "marvell,mv88e6085";
+ 		#address-cells = <1>;
+ 		#size-cells = <0>;
+-		dsa,member = <0 0>;
+ 
++		dsa,member = <0 0>;
+ 		reg = <0x10>;
+ 
++		interrupt-parent = <&gpio1>;
++		interrupts = <13 IRQ_TYPE_LEVEL_LOW>;
++
+ 		ports {
+ 			#address-cells = <1>;
+ 			#size-cells = <0>;
+@@ -320,6 +325,11 @@
+ 		marvell,function = "gpio";
+ 	};
+ 
++	swint_pins: swint-pins {
++		marvell,pins = "mpp45";
++		marvell,function = "gpio";
++	};
++
+ 	spi0cs0_pins: spi0cs0-pins {
+ 		marvell,pins = "mpp25";
+ 		marvell,function = "spi0";
diff --git a/target/linux/mvebu/patches-5.10/005-v5.11-ARM-dts-turris-omnia-add-SFP-node.patch b/target/linux/mvebu/patches-5.10/005-v5.11-ARM-dts-turris-omnia-add-SFP-node.patch
new file mode 100644
index 0000000000..2447a4e240
--- /dev/null
+++ b/target/linux/mvebu/patches-5.10/005-v5.11-ARM-dts-turris-omnia-add-SFP-node.patch
@@ -0,0 +1,90 @@
+From add2d65962977caf23ca2fa21a2457d31b636574 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <kabel at kernel.org>
+Date: Mon, 16 Nov 2020 13:24:22 +0100
+Subject: ARM: dts: turris-omnia: add SFP node
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Turris Omnia has an SFP cage that, together with WAN PHY, is connected
+to eth2 SerDes via a SerDes multiplexor. When a SFP module is present,
+the multiplexor switches the SerDes signal from PHY to SFP.
+
+Describe the SFP cage, but leave it disabled. Until phylink has support
+for such configuration, we are leaving it to U-Boot to enable SFP and
+disable WAN PHY at boot time depending on whether a SFP module is
+present.
+
+Signed-off-by: Marek Behún <kabel at kernel.org>
+Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia")
+Reviewed-by: Andrew Lunn <andrew at lunn.ch>
+Cc: Russell King - ARM Linux admin <linux at armlinux.org.uk>
+Cc: linux-arm-kernel at lists.infradead.org
+Cc: Uwe Kleine-König <uwe at kleine-koenig.org>
+Cc: Jason Cooper <jason at lakedaemon.net>
+Cc: Gregory CLEMENT <gregory.clement at bootlin.com>
+Cc: Andreas Färber <afaerber at suse.de>
+Cc: Rob Herring <robh+dt at kernel.org>
+Cc: devicetree at vger.kernel.org
+Signed-off-by: Gregory CLEMENT <gregory.clement at bootlin.com>
+---
+ arch/arm/boot/dts/armada-385-turris-omnia.dts | 30 ++++++++++++++++++++++++++-
+ 1 file changed, 29 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
+@@ -82,6 +82,24 @@
+ 			};
+ 		};
+ 	};
++
++	sfp: sfp {
++		compatible = "sff,sfp";
++		i2c-bus = <&sfp_i2c>;
++		tx-fault-gpios = <&pcawan 0 GPIO_ACTIVE_HIGH>;
++		tx-disable-gpios = <&pcawan 1 GPIO_ACTIVE_HIGH>;
++		rate-select0-gpios = <&pcawan 2 GPIO_ACTIVE_HIGH>;
++		los-gpios = <&pcawan 3 GPIO_ACTIVE_HIGH>;
++		mod-def0-gpios = <&pcawan 4 GPIO_ACTIVE_LOW>;
++		maximum-power-milliwatt = <3000>;
++
++		/*
++		 * For now this has to be enabled at boot time by U-Boot when
++		 * a SFP module is present. Read more in the comment in the
++		 * eth2 node below.
++		 */
++		status = "disabled";
++	};
+ };
+ 
+ &bm {
+@@ -126,10 +144,20 @@
+ 
+ /* WAN port */
+ &eth2 {
++	/*
++	 * eth2 is connected via a multiplexor to both the SFP cage and to
++	 * ethernet-phy at 1. The multiplexor switches the signal to SFP cage when
++	 * a SFP module is present, as determined by the mode-def0 GPIO.
++	 *
++	 * Until kernel supports this configuration properly, in case SFP module
++	 * is present, U-Boot has to enable the sfp node above, remove phy
++	 * handle and add managed = "in-band-status" property.
++	 */
+ 	status = "okay";
+ 	phy-mode = "sgmii";
+ 	phy = <&phy1>;
+ 	phys = <&comphy5 2>;
++	sfp = <&sfp>;
+ 	buffer-manager = <&bm>;
+ 	bm,pool-long = <2>;
+ 	bm,pool-short = <3>;
+@@ -195,7 +223,7 @@
+ 			/* routed to PCIe2 connector (CN62A) */
+ 		};
+ 
+-		i2c at 4 {
++		sfp_i2c: i2c at 4 {
+ 			#address-cells = <1>;
+ 			#size-cells = <0>;
+ 			reg = <4>;
diff --git a/target/linux/mvebu/patches-5.10/006-v5.11-ARM-dts-turris-omnia-add-LED-controller-node.patch b/target/linux/mvebu/patches-5.10/006-v5.11-ARM-dts-turris-omnia-add-LED-controller-node.patch
new file mode 100644
index 0000000000..c69067dbdc
--- /dev/null
+++ b/target/linux/mvebu/patches-5.10/006-v5.11-ARM-dts-turris-omnia-add-LED-controller-node.patch
@@ -0,0 +1,160 @@
+From 91dd42d0e30fdbb250c61d1192af569f07e6ada4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <kabel at kernel.org>
+Date: Sun, 15 Nov 2020 14:59:21 +0100
+Subject: ARM: dts: turris-omnia: add LED controller node
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Linux now has incomplete support for the LED controller on Turris Omnia:
+it can set brightness and colors for each LED.
+
+The controller can also put these LEDs into HW controlled mode, in which
+the LEDs are controlled by HW: for example the WAN LED is connected via
+MCU to the WAN PHY LED pin.
+
+The driver does not support these HW controlled modes yet, and on probe
+puts the LEDs into SW controlled mode.
+
+Add node describing the LED controller, but disable it for now.
+
+Signed-off-by: Marek Behún <kabel at kernel.org>
+Cc: linux-arm-kernel at lists.infradead.org
+Cc: Uwe Kleine-König <uwe at kleine-koenig.org>
+Cc: Jason Cooper <jason at lakedaemon.net>
+Cc: Gregory CLEMENT <gregory.clement at bootlin.com>
+Cc: Andreas Färber <afaerber at suse.de>
+Cc: Rob Herring <robh+dt at kernel.org>
+Cc: devicetree at vger.kernel.org
+Signed-off-by: Gregory CLEMENT <gregory.clement at bootlin.com>
+---
+ arch/arm/boot/dts/armada-385-turris-omnia.dts | 111 +++++++++++++++++++++++++-
+ 1 file changed, 110 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
+@@ -12,6 +12,7 @@
+ 
+ #include <dt-bindings/gpio/gpio.h>
+ #include <dt-bindings/input/input.h>
++#include <dt-bindings/leds/common.h>
+ #include "armada-385.dtsi"
+ 
+ / {
+@@ -181,7 +182,115 @@
+ 			reg = <0>;
+ 
+ 			/* STM32F0 command interface at address 0x2a */
+-			/* leds device (in STM32F0) at address 0x2b */
++
++			led-controller at 2b {
++				compatible = "cznic,turris-omnia-leds";
++				reg = <0x2b>;
++				#address-cells = <1>;
++				#size-cells = <0>;
++
++				/*
++				 * LEDs are controlled by MCU (STM32F0) at
++				 * address 0x2b.
++				 *
++				 * The driver does not support HW control mode
++				 * for the LEDs yet. Disable the LEDs for now.
++				 *
++				 * Also LED functions are not stable yet:
++				 * - there are 3 LEDs connected via MCU to PCIe
++				 *   ports. One of these ports supports mSATA.
++				 *   There is no mSATA nor PCIe function.
++				 *   For now we use LED_FUNCTION_WLAN, since
++				 *   in most cases users have wifi cards in
++				 *   these slots
++				 * - there are 2 LEDs dedicated for user: A and
++				 *   B. Again there is no such function defined.
++				 *   For now we use LED_FUNCTION_INDICATOR
++				 */
++				status = "disabled";
++
++				multi-led at 0 {
++					reg = <0x0>;
++					color = <LED_COLOR_ID_RGB>;
++					function = LED_FUNCTION_INDICATOR;
++					function-enumerator = <2>;
++				};
++
++				multi-led at 1 {
++					reg = <0x1>;
++					color = <LED_COLOR_ID_RGB>;
++					function = LED_FUNCTION_INDICATOR;
++					function-enumerator = <1>;
++				};
++
++				multi-led at 2 {
++					reg = <0x2>;
++					color = <LED_COLOR_ID_RGB>;
++					function = LED_FUNCTION_WLAN;
++					function-enumerator = <3>;
++				};
++
++				multi-led at 3 {
++					reg = <0x3>;
++					color = <LED_COLOR_ID_RGB>;
++					function = LED_FUNCTION_WLAN;
++					function-enumerator = <2>;
++				};
++
++				multi-led at 4 {
++					reg = <0x4>;
++					color = <LED_COLOR_ID_RGB>;
++					function = LED_FUNCTION_WLAN;
++					function-enumerator = <1>;
++				};
++
++				multi-led at 5 {
++					reg = <0x5>;
++					color = <LED_COLOR_ID_RGB>;
++					function = LED_FUNCTION_WAN;
++				};
++
++				multi-led at 6 {
++					reg = <0x6>;
++					color = <LED_COLOR_ID_RGB>;
++					function = LED_FUNCTION_LAN;
++					function-enumerator = <4>;
++				};
++
++				multi-led at 7 {
++					reg = <0x7>;
++					color = <LED_COLOR_ID_RGB>;
++					function = LED_FUNCTION_LAN;
++					function-enumerator = <3>;
++				};
++
++				multi-led at 8 {
++					reg = <0x8>;
++					color = <LED_COLOR_ID_RGB>;
++					function = LED_FUNCTION_LAN;
++					function-enumerator = <2>;
++				};
++
++				multi-led at 9 {
++					reg = <0x9>;
++					color = <LED_COLOR_ID_RGB>;
++					function = LED_FUNCTION_LAN;
++					function-enumerator = <1>;
++				};
++
++				multi-led at a {
++					reg = <0xa>;
++					color = <LED_COLOR_ID_RGB>;
++					function = LED_FUNCTION_LAN;
++					function-enumerator = <0>;
++				};
++
++				multi-led at b {
++					reg = <0xb>;
++					color = <LED_COLOR_ID_RGB>;
++					function = LED_FUNCTION_POWER;
++				};
++			};
+ 
+ 			eeprom at 54 {
+ 				compatible = "atmel,24c64";
diff --git a/target/linux/mvebu/patches-5.10/007-v5.11-ARM-dts-turris-omnia-update-ethernet-phy-node-and-handle-name.patch b/target/linux/mvebu/patches-5.10/007-v5.11-ARM-dts-turris-omnia-update-ethernet-phy-node-and-handle-name.patch
new file mode 100644
index 0000000000..603a29106b
--- /dev/null
+++ b/target/linux/mvebu/patches-5.10/007-v5.11-ARM-dts-turris-omnia-update-ethernet-phy-node-and-handle-name.patch
@@ -0,0 +1,52 @@
+From 8ee4a5f4f40da60bb85e13d9dd218a3c9197e3e3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <kabel at kernel.org>
+Date: Sun, 15 Nov 2020 14:59:22 +0100
+Subject: ARM: dts: turris-omnia: update ethernet-phy node and handle name
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Use property name `phy-handle` instead of the deprecated `phy` to
+connect eth2 to the PHY.
+Rename the node from "phy at 1" to "ethernet-phy at 1", since "phy at 1" is
+incorrect according to device-tree bindings documentation.
+Also remove the "ethernet-phy-id0141.0DD1" compatible string, it is not
+needed. Kernel can read the PHY identifier itself.
+
+Signed-off-by: Marek Behún <kabel at kernel.org>
+Reviewed-by: Andrew Lunn <andrew at lunn.ch>
+Cc: linux-arm-kernel at lists.infradead.org
+Cc: Uwe Kleine-König <uwe at kleine-koenig.org>
+Cc: Jason Cooper <jason at lakedaemon.net>
+Cc: Gregory CLEMENT <gregory.clement at bootlin.com>
+Cc: Andreas Färber <afaerber at suse.de>
+Cc: Rob Herring <robh+dt at kernel.org>
+Cc: devicetree at vger.kernel.org
+Signed-off-by: Gregory CLEMENT <gregory.clement at bootlin.com>
+---
+ arch/arm/boot/dts/armada-385-turris-omnia.dts | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
+@@ -156,7 +156,7 @@
+ 	 */
+ 	status = "okay";
+ 	phy-mode = "sgmii";
+-	phy = <&phy1>;
++	phy-handle = <&phy1>;
+ 	phys = <&comphy5 2>;
+ 	sfp = <&sfp>;
+ 	buffer-manager = <&bm>;
+@@ -387,9 +387,9 @@
+ 	pinctrl-0 = <&mdio_pins>;
+ 	status = "okay";
+ 
+-	phy1: phy at 1 {
++	phy1: ethernet-phy at 1 {
+ 		status = "okay";
+-		compatible = "ethernet-phy-id0141.0DD1", "ethernet-phy-ieee802.3-c22";
++		compatible = "ethernet-phy-ieee802.3-c22";
+ 		reg = <1>;
+ 		marvell,reg-init = <3 18 0 0x4985>;
+ 
diff --git a/target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch b/target/linux/mvebu/patches-5.10/008-v5.12-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
similarity index 66%
rename from target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
rename to target/linux/mvebu/patches-5.10/008-v5.12-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
index a3f41fb5cb..7f5322e7f3 100644
--- a/target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
+++ b/target/linux/mvebu/patches-5.10/008-v5.12-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
@@ -1,7 +1,10 @@
-From 9704292ed3230ee19dc4dd64f7484301b728ffb7 Mon Sep 17 00:00:00 2001
+From 5b2c7e0ae762fff2b172caf16b2766cc3e1ad859 Mon Sep 17 00:00:00 2001
 From: Rui Salvaterra <rsalvaterra at gmail.com>
-Date: Wed, 17 Feb 2021 15:19:30 +0000
-Subject: [PATCH] ARM: dts: turris-omnia: fix hardware buffer management
+Date: Wed, 17 Feb 2021 15:30:38 +0000
+Subject: ARM: dts: turris-omnia: fix hardware buffer management
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
 
 Hardware buffer management has never worked on the Turris Omnia, as the
 required MBus window hadn't been reserved. Fix thusly.
@@ -9,13 +12,16 @@ required MBus window hadn't been reserved. Fix thusly.
 Fixes: 018b88eee1a2 ("ARM: dts: turris-omnia: enable HW buffer management")
 
 Signed-off-by: Rui Salvaterra <rsalvaterra at gmail.com>
+Reviewed-by: Marek Behún <kabel at kernel.org>
+Tested-by: Klaus Kudielka <klaus.kudielka at gmail.com>
+Signed-off-by: Gregory CLEMENT <gregory.clement at bootlin.com>
 ---
  arch/arm/boot/dts/armada-385-turris-omnia.dts | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 --- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
 +++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
-@@ -31,7 +31,8 @@
+@@ -32,7 +32,8 @@
  		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
  			  MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
  			  MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000



More information about the lede-commits mailing list