From 4fd7e539e4f90128bdd7cb71c729a4b32f5de86e Mon Sep 17 00:00:00 2001 From: Pawel Dembicki Date: Mon, 20 Apr 2020 10:06:36 +0200 Subject: [PATCH] kirkwood: switch from swconfig to dsa This patch removes support for swconfig and switches to dsa driver. swconfig and switch drivers are removed. DSA driver is enabled and configuration is adjusted. In kirkwood only two devices have switches: Linksys EA3500 and EA4500. WAN MAC configuration in 02_network is required because otherwise WAN would have the same MAC address as lan interfaces. In swconfig solution the WAN address was assigned in u-Boot to eth1. Now, as eth1 is disabled and wan is part of the switch, we have to set it manually. Compile tested: EA3500, EA4500 Run tested: EA4500 Signed-off-by: Pawel Dembicki [minor commit title/message adjustments, remove swconfig package for devices] Signed-off-by: Adrian Schmutzler --- .../base-files/etc/board.d/02_network | 4 +- target/linux/kirkwood/config-5.4 | 11 ++- .../arm/boot/dts/kirkwood-linksys-audi.dts | 71 ++++++++++++++----- target/linux/kirkwood/image/Makefile | 4 +- .../kirkwood/patches-5.4/105-ea4500.patch | 45 +----------- target/linux/kirkwood/profiles/00-default.mk | 2 +- 6 files changed, 68 insertions(+), 69 deletions(-) diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network b/target/linux/kirkwood/base-files/etc/board.d/02_network index 15e51d88f2..df01b0bb1b 100755 --- a/target/linux/kirkwood/base-files/etc/board.d/02_network +++ b/target/linux/kirkwood/base-files/etc/board.d/02_network @@ -26,8 +26,8 @@ case "$board" in ;; "linksys,audi"|\ "linksys,viper") - ucidef_add_switch "switch0" \ - "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0" "6@eth1" + ucidef_set_interfaces_lan_wan "ethernet1 ethernet2 ethernet3 ethernet4" "internet" + ucidef_set_interface_macaddr "wan" $( mtd_get_mac_ascii u_env eth1addr ) ;; "zyxel,nsa310b"|\ "zyxel,nsa325") diff --git a/target/linux/kirkwood/config-5.4 b/target/linux/kirkwood/config-5.4 index e149631f0e..c14ca3778f 100644 --- a/target/linux/kirkwood/config-5.4 +++ b/target/linux/kirkwood/config-5.4 @@ -245,10 +245,17 @@ CONFIG_MVEBU_MBUS=y CONFIG_MVMDIO=y # CONFIG_MVNETA is not set # CONFIG_MVPP2 is not set -CONFIG_MVSW61XX_PHY=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_KUSER_HELPERS=y CONFIG_NEED_PER_CPU_KM=y +CONFIG_NET_DEVLINK=y +CONFIG_NET_DSA=y +CONFIG_NET_DSA_MV88E6XXX=y +CONFIG_NET_DSA_MV88E6XXX_GLOBAL2=y +# CONFIG_NET_DSA_MV88E6XXX_PTP is not set +CONFIG_NET_DSA_TAG_DSA=y +CONFIG_NET_DSA_TAG_EDSA=y +CONFIG_NET_SWITCHDEV=y CONFIG_NLS=y CONFIG_NVMEM=y # CONFIG_NVMEM_REBOOT_MODE is not set @@ -276,6 +283,7 @@ CONFIG_PCI_MVEBU=y CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 CONFIG_PHYLIB=y +CONFIG_PHYLINK=y # CONFIG_PHY_MVEBU_A3700_UTMI is not set # CONFIG_PHY_MVEBU_A38X_COMPHY is not set CONFIG_PHY_MVEBU_SATA=y @@ -317,7 +325,6 @@ CONFIG_SPLIT_PTLOCK_CPUS=999999 CONFIG_SRAM=y CONFIG_SRAM_EXEC=y CONFIG_SRCU=y -CONFIG_SWCONFIG=y CONFIG_SWPHY=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y CONFIG_THERMAL=y diff --git a/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-linksys-audi.dts b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-linksys-audi.dts index eff9102d33..90250fefc8 100644 --- a/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-linksys-audi.dts +++ b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-linksys-audi.dts @@ -66,17 +66,6 @@ default-state = "on"; }; }; - - mvsw61xx { - compatible = "marvell,88e6171"; - status = "okay"; - reg = <0x10>; - - mii-bus = <&mdio>; - cpu-port-0 = <5>; - cpu-port-1 = <6>; - is-indirect; - }; }; &pinctrl { @@ -96,6 +85,57 @@ }; }; +&mdio { + status = "okay"; + + switch@10 { + compatible = "marvell,mv88e6085"; + #address-cells = <1>; + #size-cells = <0>; + reg = <16>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "ethernet1"; + }; + + port@1 { + reg = <1>; + label = "ethernet2"; + }; + + port@2 { + reg = <2>; + label = "ethernet3"; + }; + + port@3 { + reg = <3>; + label = "ethernet4"; + }; + + port@4 { + reg = <4>; + label = "internet"; + }; + + port@5 { + reg = <5>; + label = "cpu"; + ethernet = <ð0port>; + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; + }; +}; + &nand { status = "okay"; @@ -188,15 +228,10 @@ }; /* eth1 is connected to the switch at port 6. However DSA only supports a - * single CPU port. Upstream uses DSA so they disable this port to avoid confusion. + * single CPU port. This port is disabled to avoid confusion. */ ð1 { - status = "okay"; - - ethernet1-port@0 { - speed = <1000>; - duplex = <1>; - }; + status = "disabled"; }; /* There is no battery on the board, so the RTC does not keep diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index 865122ae19..4ba9f9a1b2 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -82,7 +82,7 @@ TARGET_DEVICES += iom_ix2-200 define Device/linksys_audi DEVICE_VENDOR := Linksys DEVICE_MODEL := EA3500 (Audi) - DEVICE_PACKAGES := kmod-mwl8k swconfig wpad-basic kmod-gpio-button-hotplug + DEVICE_PACKAGES := kmod-mwl8k wpad-basic kmod-gpio-button-hotplug PAGESIZE := 512 SUBPAGESIZE := 256 BLOCKSIZE := 16k @@ -97,7 +97,7 @@ TARGET_DEVICES += linksys_audi define Device/linksys_viper DEVICE_VENDOR := Linksys DEVICE_MODEL := E4200v2 / EA4500 (Viper) - DEVICE_PACKAGES := kmod-mwl8k swconfig wpad-basic kmod-gpio-button-hotplug + DEVICE_PACKAGES := kmod-mwl8k wpad-basic kmod-gpio-button-hotplug KERNEL_SIZE := 2688k KERNEL_IN_UBI := UBINIZE_OPTS := -E 5 diff --git a/target/linux/kirkwood/patches-5.4/105-ea4500.patch b/target/linux/kirkwood/patches-5.4/105-ea4500.patch index 7302723029..0d97ad14a2 100644 --- a/target/linux/kirkwood/patches-5.4/105-ea4500.patch +++ b/target/linux/kirkwood/patches-5.4/105-ea4500.patch @@ -23,25 +23,7 @@ }; white-pulse { -@@ -66,6 +71,17 @@ - gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; - }; - }; -+ -+ mvsw61xx@10 { -+ compatible = "marvell,88e6171"; -+ status = "okay"; -+ reg = <0x10>; -+ -+ mii-bus = <&mdio>; -+ cpu-port-0 = <5>; -+ cpu-port-1 = <6>; -+ is-indirect; -+ }; - }; - - &pinctrl { -@@ -114,22 +130,22 @@ +@@ -114,22 +119,22 @@ }; partition@200000 { @@ -68,28 +50,3 @@ reg = <0x1EA0000 0x1760000>; }; -@@ -162,6 +178,7 @@ - status = "okay"; - - switch@10 { -+ status = "disabled"; - compatible = "marvell,mv88e6085"; - #address-cells = <1>; - #size-cells = <0>; -@@ -225,10 +242,14 @@ - }; - - /* eth1 is connected to the switch at port 6. However DSA only supports a -- * single CPU port. So leave this port disabled to avoid confusion. -+ * single CPU port. Upstream uses DSA so they disable this port to avoid confusion. - */ - ð1 { -- status = "disabled"; -+ status = "okay"; -+ ethernet1-port@0 { -+ speed = <1000>; -+ duplex = <1>; -+ }; - }; - - /* There is no battery on the board, so the RTC does not keep diff --git a/target/linux/kirkwood/profiles/00-default.mk b/target/linux/kirkwood/profiles/00-default.mk index 002751714e..bfc2154c48 100644 --- a/target/linux/kirkwood/profiles/00-default.mk +++ b/target/linux/kirkwood/profiles/00-default.mk @@ -7,7 +7,7 @@ define Profile/Default NAME:=Default Profile - PACKAGES:=kmod-mwl8k swconfig wpad-basic + PACKAGES:=kmod-mwl8k wpad-basic PRIORITY:=1 endef -- 2.30.2