kirkwood: switch from swconfig to dsa
authorPawel Dembicki <paweldembicki@gmail.com>
Mon, 20 Apr 2020 08:06:36 +0000 (10:06 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Tue, 28 Apr 2020 14:49:31 +0000 (16:49 +0200)
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 <paweldembicki@gmail.com>
[minor commit title/message adjustments, remove swconfig package
for devices]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/kirkwood/base-files/etc/board.d/02_network
target/linux/kirkwood/config-5.4
target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-linksys-audi.dts
target/linux/kirkwood/image/Makefile
target/linux/kirkwood/patches-5.4/105-ea4500.patch
target/linux/kirkwood/profiles/00-default.mk

index 15e51d88f2f840966f5ab310cc21f96b1c02e7e6..df01b0bb1bfe056f87878d433b38c155f1d55e00 100755 (executable)
@@ -26,8 +26,8 @@ case "$board" in
        ;;
 "linksys,audi"|\
 "linksys,viper")
        ;;
 "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")
        ;;
 "zyxel,nsa310b"|\
 "zyxel,nsa325")
index e149631f0ea1bcdcbcd640270dbb7e3e1571e87b..c14ca3778f37c05ad205a827acb53cfd148be26d 100644 (file)
@@ -245,10 +245,17 @@ CONFIG_MVEBU_MBUS=y
 CONFIG_MVMDIO=y
 # CONFIG_MVNETA is not set
 # CONFIG_MVPP2 is not set
 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_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
 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_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
 # 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_SRAM=y
 CONFIG_SRAM_EXEC=y
 CONFIG_SRCU=y
-CONFIG_SWCONFIG=y
 CONFIG_SWPHY=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_THERMAL=y
 CONFIG_SWPHY=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_THERMAL=y
index eff9102d33ca06931797838fcf37e3def4be4230..90250fefc896aa62107c5da50a9f66e7acc73da4 100644 (file)
                        default-state = "on";
                };
        };
                        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 {
 };
 
 &pinctrl {
        };
 };
 
        };
 };
 
+&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 = <&eth0port>;
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+               };
+       };
+};
+
 &nand {
        status = "okay";
 
 &nand {
        status = "okay";
 
 };
 
 /* eth1 is connected to the switch at port 6. However DSA only supports a
 };
 
 /* 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.
  */
 &eth1 {
  */
 &eth1 {
-       status = "okay";
-
-       ethernet1-port@0 {
-               speed = <1000>;
-               duplex = <1>;
-       };
+       status = "disabled";
 };
 
 /* There is no battery on the board, so the RTC does not keep
 };
 
 /* There is no battery on the board, so the RTC does not keep
index 865122ae19eea7c5432dcf330c85b6f310ba45ed..4ba9f9a1b2e1226cd7ffe20b902260e789fb208b 100644 (file)
@@ -82,7 +82,7 @@ TARGET_DEVICES += iom_ix2-200
 define Device/linksys_audi
   DEVICE_VENDOR := Linksys
   DEVICE_MODEL := EA3500 (Audi)
 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
   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)
 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
   KERNEL_SIZE := 2688k
   KERNEL_IN_UBI :=
   UBINIZE_OPTS := -E 5
index 73027230296a35180f063945f7b8fcb4ad04d347..0d97ad14a2a8f157880e47af5e9377724e7fa520 100644 (file)
                };
  
                white-pulse {
                };
  
                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 {
                };
  
                partition@200000 {
                        reg = <0x1EA0000 0x1760000>;
                };
  
                        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.
-  */
- &eth1 {
--      status = "disabled";
-+      status = "okay";
-+      ethernet1-port@0 {
-+              speed = <1000>;
-+              duplex = <1>;
-+      };
- };
- /* There is no battery on the board, so the RTC does not keep
index 002751714e74d7d2083fa0c52849a44c8d608ec2..bfc2154c487792481cb71a7597fda9c9848668d0 100644 (file)
@@ -7,7 +7,7 @@
 
 define Profile/Default
        NAME:=Default Profile
 
 define Profile/Default
        NAME:=Default Profile
-       PACKAGES:=kmod-mwl8k swconfig wpad-basic
+       PACKAGES:=kmod-mwl8k wpad-basic
        PRIORITY:=1
 endef
 
        PRIORITY:=1
 endef