From 24e564d327943a32181db4568fff43cc18d93b13 Mon Sep 17 00:00:00 2001 From: Klaus Kudielka Date: Sat, 17 Jul 2021 19:32:57 +0200 Subject: mvebu: backport Turris Omnia DTS changes to 5.4 Kernel 5.4 receives a reduced set, just to make the SFP cage work. While we are at it, move the patches accepted upstream to the 0xx series. Reviewed-by: Noci Reviewed-by: Justin van Steijn Reviewed-by: Nico Rikken Reviewed-by: Julius Schwartzenberg Signed-off-by: Klaus Kudielka (cherry picked from commit 8138cb8737d1475e6e8d57393500f30384e75a82) --- ...-turris-omnia-enable-HW-buffer-management.patch | 74 ++++++++++++++++++ ...ts-turris-omnia-add-comphy-handle-to-eth2.patch | 37 +++++++++ ...ts-turris-omnia-describe-switch-interrupt.patch | 61 +++++++++++++++ .../032-ARM-dts-turris-omnia-add-SFP-node.patch | 90 ++++++++++++++++++++++ ...-update-ethernet-phy-node-and-handle-name.patch | 52 +++++++++++++ ...rris-omnia-fix-hardware-buffer-management.patch | 33 ++++++++ ...-turris-omnia-enable-HW-buffer-management.patch | 74 ------------------ ...rris-omnia-fix-hardware-buffer-management.patch | 27 ------- 8 files changed, 347 insertions(+), 101 deletions(-) create mode 100644 target/linux/mvebu/patches-5.4/029-ARM-dts-turris-omnia-enable-HW-buffer-management.patch create mode 100644 target/linux/mvebu/patches-5.4/030-ARM-dts-turris-omnia-add-comphy-handle-to-eth2.patch create mode 100644 target/linux/mvebu/patches-5.4/031-ARM-dts-turris-omnia-describe-switch-interrupt.patch create mode 100644 target/linux/mvebu/patches-5.4/032-ARM-dts-turris-omnia-add-SFP-node.patch create mode 100644 target/linux/mvebu/patches-5.4/033-ARM-dts-turris-omnia-update-ethernet-phy-node-and-handle-name.patch create mode 100644 target/linux/mvebu/patches-5.4/034-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch delete mode 100644 target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch delete mode 100644 target/linux/mvebu/patches-5.4/318-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch (limited to 'target') diff --git a/target/linux/mvebu/patches-5.4/029-ARM-dts-turris-omnia-enable-HW-buffer-management.patch b/target/linux/mvebu/patches-5.4/029-ARM-dts-turris-omnia-enable-HW-buffer-management.patch new file mode 100644 index 0000000000..7a4b511998 --- /dev/null +++ b/target/linux/mvebu/patches-5.4/029-ARM-dts-turris-omnia-enable-HW-buffer-management.patch @@ -0,0 +1,74 @@ +From 018b88eee1a2efda26ed2f09aab33ccdc40ef18f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Sun, 15 Nov 2020 14:59:17 +0100 +Subject: ARM: dts: turris-omnia: enable HW buffer management +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The buffer manager is available on Turris Omnia but needs to be +described in device-tree to be used. + +Signed-off-by: Marek Behún +Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia") +Cc: linux-arm-kernel@lists.infradead.org +Cc: Uwe Kleine-König +Cc: Jason Cooper +Cc: Gregory CLEMENT +Cc: Andreas Färber +Cc: Andrew Lunn +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: Gregory CLEMENT +--- + arch/arm/boot/dts/armada-385-turris-omnia.dts | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +(limited to 'arch/arm/boot/dts/armada-385-turris-omnia.dts') + +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -84,12 +84,23 @@ + }; + }; + ++&bm { ++ status = "okay"; ++}; ++ ++&bm_bppi { ++ status = "okay"; ++}; ++ + /* Connected to 88E6176 switch, port 6 */ + ð0 { + pinctrl-names = "default"; + pinctrl-0 = <&ge0_rgmii_pins>; + status = "okay"; + phy-mode = "rgmii"; ++ buffer-manager = <&bm>; ++ bm,pool-long = <0>; ++ bm,pool-short = <3>; + + fixed-link { + speed = <1000>; +@@ -103,6 +114,9 @@ + pinctrl-0 = <&ge1_rgmii_pins>; + status = "okay"; + phy-mode = "rgmii"; ++ buffer-manager = <&bm>; ++ bm,pool-long = <1>; ++ bm,pool-short = <3>; + + fixed-link { + speed = <1000>; +@@ -115,6 +129,9 @@ + status = "okay"; + phy-mode = "sgmii"; + phy = <&phy1>; ++ buffer-manager = <&bm>; ++ bm,pool-long = <2>; ++ bm,pool-short = <3>; + }; + + &i2c0 { diff --git a/target/linux/mvebu/patches-5.4/030-ARM-dts-turris-omnia-add-comphy-handle-to-eth2.patch b/target/linux/mvebu/patches-5.4/030-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.4/030-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?= +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 +Fixes: f3a6a9f3704a ("ARM: dts: add description for Armada 38x ...") +Reviewed-by: Andrew Lunn +Reviewed-by: Andreas Färber +Cc: linux-arm-kernel@lists.infradead.org +Cc: Uwe Kleine-König +Cc: Jason Cooper +Cc: Gregory CLEMENT +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: Gregory CLEMENT +--- + 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.4/031-ARM-dts-turris-omnia-describe-switch-interrupt.patch b/target/linux/mvebu/patches-5.4/031-ARM-dts-turris-omnia-describe-switch-interrupt.patch new file mode 100644 index 0000000000..4bbd80aac4 --- /dev/null +++ b/target/linux/mvebu/patches-5.4/031-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?= +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 +Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia") +Cc: linux-arm-kernel@lists.infradead.org +Cc: Uwe Kleine-König +Cc: Jason Cooper +Cc: Gregory CLEMENT +Cc: Andreas Färber +Cc: Andrew Lunn +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: Gregory CLEMENT +--- + 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@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.4/032-ARM-dts-turris-omnia-add-SFP-node.patch b/target/linux/mvebu/patches-5.4/032-ARM-dts-turris-omnia-add-SFP-node.patch new file mode 100644 index 0000000000..2447a4e240 --- /dev/null +++ b/target/linux/mvebu/patches-5.4/032-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?= +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 +Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia") +Reviewed-by: Andrew Lunn +Cc: Russell King - ARM Linux admin +Cc: linux-arm-kernel@lists.infradead.org +Cc: Uwe Kleine-König +Cc: Jason Cooper +Cc: Gregory CLEMENT +Cc: Andreas Färber +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: Gregory CLEMENT +--- + 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 */ + ð2 { ++ /* ++ * eth2 is connected via a multiplexor to both the SFP cage and to ++ * ethernet-phy@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@4 { ++ sfp_i2c: i2c@4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; diff --git a/target/linux/mvebu/patches-5.4/033-ARM-dts-turris-omnia-update-ethernet-phy-node-and-handle-name.patch b/target/linux/mvebu/patches-5.4/033-ARM-dts-turris-omnia-update-ethernet-phy-node-and-handle-name.patch new file mode 100644 index 0000000000..5ceef5dc46 --- /dev/null +++ b/target/linux/mvebu/patches-5.4/033-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?= +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@1" to "ethernet-phy@1", since "phy@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 +Reviewed-by: Andrew Lunn +Cc: linux-arm-kernel@lists.infradead.org +Cc: Uwe Kleine-König +Cc: Jason Cooper +Cc: Gregory CLEMENT +Cc: Andreas Färber +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: Gregory CLEMENT +--- + 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 +@@ -155,7 +155,7 @@ + */ + status = "okay"; + phy-mode = "sgmii"; +- phy = <&phy1>; ++ phy-handle = <&phy1>; + phys = <&comphy5 2>; + sfp = <&sfp>; + buffer-manager = <&bm>; +@@ -278,9 +278,9 @@ + pinctrl-0 = <&mdio_pins>; + status = "okay"; + +- phy1: phy@1 { ++ phy1: ethernet-phy@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.4/034-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch b/target/linux/mvebu/patches-5.4/034-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch new file mode 100644 index 0000000000..4283a61341 --- /dev/null +++ b/target/linux/mvebu/patches-5.4/034-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch @@ -0,0 +1,33 @@ +From 5b2c7e0ae762fff2b172caf16b2766cc3e1ad859 Mon Sep 17 00:00:00 2001 +From: Rui Salvaterra +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. + +Fixes: 018b88eee1a2 ("ARM: dts: turris-omnia: enable HW buffer management") + +Signed-off-by: Rui Salvaterra +Reviewed-by: Marek Behún +Tested-by: Klaus Kudielka +Signed-off-by: Gregory CLEMENT +--- + 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 @@ + ranges = ; ++ MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000 ++ MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>; + + internal-regs { + diff --git a/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch b/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch deleted file mode 100644 index 7a4b511998..0000000000 --- a/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 018b88eee1a2efda26ed2f09aab33ccdc40ef18f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marek=20Beh=C3=BAn?= -Date: Sun, 15 Nov 2020 14:59:17 +0100 -Subject: ARM: dts: turris-omnia: enable HW buffer management -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The buffer manager is available on Turris Omnia but needs to be -described in device-tree to be used. - -Signed-off-by: Marek Behún -Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia") -Cc: linux-arm-kernel@lists.infradead.org -Cc: Uwe Kleine-König -Cc: Jason Cooper -Cc: Gregory CLEMENT -Cc: Andreas Färber -Cc: Andrew Lunn -Cc: Rob Herring -Cc: devicetree@vger.kernel.org -Signed-off-by: Gregory CLEMENT ---- - arch/arm/boot/dts/armada-385-turris-omnia.dts | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -(limited to 'arch/arm/boot/dts/armada-385-turris-omnia.dts') - ---- a/arch/arm/boot/dts/armada-385-turris-omnia.dts -+++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts -@@ -84,12 +84,23 @@ - }; - }; - -+&bm { -+ status = "okay"; -+}; -+ -+&bm_bppi { -+ status = "okay"; -+}; -+ - /* Connected to 88E6176 switch, port 6 */ - ð0 { - pinctrl-names = "default"; - pinctrl-0 = <&ge0_rgmii_pins>; - status = "okay"; - phy-mode = "rgmii"; -+ buffer-manager = <&bm>; -+ bm,pool-long = <0>; -+ bm,pool-short = <3>; - - fixed-link { - speed = <1000>; -@@ -103,6 +114,9 @@ - pinctrl-0 = <&ge1_rgmii_pins>; - status = "okay"; - phy-mode = "rgmii"; -+ buffer-manager = <&bm>; -+ bm,pool-long = <1>; -+ bm,pool-short = <3>; - - fixed-link { - speed = <1000>; -@@ -115,6 +129,9 @@ - status = "okay"; - phy-mode = "sgmii"; - phy = <&phy1>; -+ buffer-manager = <&bm>; -+ bm,pool-long = <2>; -+ bm,pool-short = <3>; - }; - - &i2c0 { diff --git a/target/linux/mvebu/patches-5.4/318-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch b/target/linux/mvebu/patches-5.4/318-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch deleted file mode 100644 index a3f41fb5cb..0000000000 --- a/target/linux/mvebu/patches-5.4/318-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 9704292ed3230ee19dc4dd64f7484301b728ffb7 Mon Sep 17 00:00:00 2001 -From: Rui Salvaterra -Date: Wed, 17 Feb 2021 15:19:30 +0000 -Subject: [PATCH] ARM: dts: turris-omnia: fix hardware buffer management - -Hardware buffer management has never worked on the Turris Omnia, as the -required MBus window hadn't been reserved. Fix thusly. - -Fixes: 018b88eee1a2 ("ARM: dts: turris-omnia: enable HW buffer management") - -Signed-off-by: Rui Salvaterra ---- - 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 @@ - ranges = ; -+ MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000 -+ MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>; - - internal-regs { - -- cgit v1.2.3