From d63a4cb792abde50c5326ea63fe4e7466f9e1664 Mon Sep 17 00:00:00 2001 From: lean Date: Wed, 24 Aug 2022 01:11:02 +0800 Subject: [PATCH 1/9] mt76: mt7921e: add firmware for mt7922 devices --- package/kernel/mt76/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 13f52e85d..ffe540d0d 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -478,6 +478,8 @@ define KernelPackage/mt7921e/install cp \ $(PKG_BUILD_DIR)/firmware/WIFI_MT7961_patch_mcu_1_2_hdr.bin \ $(PKG_BUILD_DIR)/firmware/WIFI_RAM_CODE_MT7961_1.bin \ + $(PKG_BUILD_DIR)/firmware/WIFI_MT7922_patch_mcu_1_1_hdr.bin \ + $(PKG_BUILD_DIR)/firmware/WIFI_RAM_CODE_MT7922_1.bin \ $(1)/lib/firmware/mediatek endef From 1d2998c2aee74f490f29f363173b0ffcee8cc265 Mon Sep 17 00:00:00 2001 From: aakkll <94471752+aakkll@users.noreply.github.com> Date: Tue, 30 Aug 2022 11:14:51 +0800 Subject: [PATCH 2/9] kernel: bump 5.19 to 5.19.5 --- include/kernel-5.19 | 4 +-- ...k-events-support-multiple-registrant.patch | 34 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/kernel-5.19 b/include/kernel-5.19 index 18f2ab6f6..db88c1187 100644 --- a/include/kernel-5.19 +++ b/include/kernel-5.19 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.19 = .4 -LINUX_KERNEL_HASH-5.19.4 = a9214b97085af98dfcaaa8c2e8eff4858c1d53dccd6c58931cf7b0455ff9bf87 +LINUX_VERSION-5.19 = .5 +LINUX_KERNEL_HASH-5.19.5 = 8c3f1cc4f93e50056bb0a8c15a41a8eb6acc7fd71bff6de60b1ef8c4532537bd diff --git a/target/linux/generic/hack-5.19/952-add-net-conntrack-events-support-multiple-registrant.patch b/target/linux/generic/hack-5.19/952-add-net-conntrack-events-support-multiple-registrant.patch index d412b22b8..7698e80e7 100644 --- a/target/linux/generic/hack-5.19/952-add-net-conntrack-events-support-multiple-registrant.patch +++ b/target/linux/generic/hack-5.19/952-add-net-conntrack-events-support-multiple-registrant.patch @@ -22,7 +22,7 @@ Signed-off-by: Zhi Chen --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h -@@ -65,9 +65,14 @@ +@@ -65,9 +65,14 @@ struct nf_ct_event_notifier { int (*exp_event)(unsigned int events, const struct nf_exp_event *item); }; @@ -38,7 +38,7 @@ Signed-off-by: Zhi Chen void nf_ct_deliver_cached_events(struct nf_conn *ct); int nf_conntrack_eventmask_report(unsigned int eventmask, struct nf_conn *ct, -@@ -98,11 +103,13 @@ +@@ -98,11 +103,13 @@ static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) { #ifdef CONFIG_NF_CONNTRACK_EVENTS @@ -53,7 +53,7 @@ Signed-off-by: Zhi Chen e = nf_ct_ecache_find(ct); if (e == NULL) -@@ -117,20 +124,34 @@ +@@ -117,20 +124,34 @@ nf_conntrack_event_report(enum ip_conntr u32 portid, int report) { #ifdef CONFIG_NF_CONNTRACK_EVENTS @@ -94,9 +94,9 @@ Signed-off-by: Zhi Chen #ifdef CONFIG_NF_CONNTRACK_EVENTS --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h -@@ -113,6 +113,9 @@ struct netns_ct { +@@ -107,6 +107,9 @@ struct netns_ct { + u8 sysctl_checksum; - struct ct_pcpu __percpu *pcpu_lists; struct ip_conntrack_stat __percpu *stat; +#ifdef CONFIG_NF_CONNTRACK_CHAIN_EVENTS + struct atomic_notifier_head nf_conntrack_chain; @@ -106,7 +106,7 @@ Signed-off-by: Zhi Chen #if defined(CONFIG_NF_CONNTRACK_LABELS) --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig -@@ -151,6 +151,14 @@ config NF_CONNTRACK_EVENTS +@@ -162,6 +162,14 @@ config NF_CONNTRACK_EVENTS If unsure, say `N'. @@ -123,7 +123,7 @@ Signed-off-by: Zhi Chen depends on NETFILTER_ADVANCED --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c -@@ -2878,6 +2878,10 @@ int nf_conntrack_init_net(struct net *ne +@@ -2802,6 +2802,10 @@ int nf_conntrack_init_net(struct net *ne nf_conntrack_helper_pernet_init(net); nf_conntrack_proto_pernet_init(net); @@ -136,9 +136,9 @@ Signed-off-by: Zhi Chen err_expect: --- a/net/netfilter/nf_conntrack_ecache.c +++ b/net/netfilter/nf_conntrack_ecache.c -@@ -18,6 +18,9 @@ +@@ -17,6 +17,9 @@ + #include #include - #include #include +#ifdef CONFIG_NF_CONNTRACK_CHAIN_EVENTS +#include @@ -146,7 +146,7 @@ Signed-off-by: Zhi Chen #include #include #include -@@ -167,6 +170,35 @@ static int __nf_conntrack_eventmask_repo +@@ -162,6 +165,35 @@ static int __nf_conntrack_eventmask_repo return ret; } @@ -182,7 +182,7 @@ Signed-off-by: Zhi Chen int nf_conntrack_eventmask_report(unsigned int events, struct nf_conn *ct, u32 portid, int report) { -@@ -203,10 +235,52 @@ int nf_conntrack_eventmask_report(unsign +@@ -197,10 +229,52 @@ int nf_conntrack_eventmask_report(unsign return ret; } @@ -235,7 +235,7 @@ Signed-off-by: Zhi Chen void nf_ct_deliver_cached_events(struct nf_conn *ct) { struct nf_conntrack_ecache *e; -@@ -232,6 +306,7 @@ void nf_ct_deliver_cached_events(struct +@@ -226,6 +300,7 @@ void nf_ct_deliver_cached_events(struct */ __nf_conntrack_eventmask_report(e, events, e->missed, &item); } @@ -243,7 +243,7 @@ Signed-off-by: Zhi Chen EXPORT_SYMBOL_GPL(nf_ct_deliver_cached_events); void nf_ct_expect_event_report(enum ip_conntrack_expect_events event, -@@ -264,20 +339,43 @@ out_unlock: +@@ -258,20 +333,43 @@ out_unlock: rcu_read_unlock(); } @@ -289,7 +289,7 @@ Signed-off-by: Zhi Chen void nf_conntrack_unregister_notifier(struct net *net) { mutex_lock(&nf_ct_ecache_mutex); -@@ -285,6 +383,7 @@ void nf_conntrack_unregister_notifier(st +@@ -279,6 +377,7 @@ void nf_conntrack_unregister_notifier(st mutex_unlock(&nf_ct_ecache_mutex); /* synchronize_rcu() is called after netns pre_exit */ } @@ -299,7 +299,7 @@ Signed-off-by: Zhi Chen void nf_conntrack_ecache_work(struct net *net, enum nf_ct_ecache_state state) --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c -@@ -706,12 +706,19 @@ static size_t ctnetlink_nlmsg_size(const +@@ -712,12 +712,19 @@ static size_t ctnetlink_nlmsg_size(const } static int @@ -319,7 +319,7 @@ Signed-off-by: Zhi Chen struct nf_conn *ct = item->ct; struct sk_buff *skb; unsigned int type; -@@ -3761,11 +3768,17 @@ static int ctnetlink_stat_exp_cpu(struct +@@ -3791,11 +3798,17 @@ static int ctnetlink_stat_exp_cpu(struct } #ifdef CONFIG_NF_CONNTRACK_EVENTS @@ -337,7 +337,7 @@ Signed-off-by: Zhi Chen static const struct nfnl_callback ctnl_cb[IPCTNL_MSG_MAX] = { [IPCTNL_MSG_CT_NEW] = { -@@ -3864,8 +3877,12 @@ static int __net_init ctnetlink_net_init +@@ -3894,8 +3907,12 @@ static int __net_init ctnetlink_net_init static void ctnetlink_net_pre_exit(struct net *net) { #ifdef CONFIG_NF_CONNTRACK_EVENTS From 29706161e3b4a42023af46abaf72e588c260b4e2 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 21 Jul 2021 10:28:50 +0200 Subject: [PATCH 3/9] ramips: fix missing NVMEM subsystem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MAC address retrieval was switched to more generic upstream (5.13) NVMEM based solution in commit 06bb4a5018cd ("ramips: convert mtd-mac-address to nvmem implementation") , but NVMEM subsystem wasn't enabled in the kernel, so fix it now. Fixes: 06bb4a5018cd ("ramips: convert mtd-mac-address to nvmem implementation") Signed-off-by: David Bauer Signed-off-by: Petr Štetiar [commit message] --- target/linux/ramips/mt7620/config-5.10 | 1 + target/linux/ramips/mt7620/config-5.4 | 1 + target/linux/ramips/mt7621/config-5.10 | 1 + target/linux/ramips/mt7621/config-5.4 | 1 + target/linux/ramips/mt76x8/config-5.10 | 1 + target/linux/ramips/mt76x8/config-5.4 | 1 + target/linux/ramips/rt288x/config-5.10 | 1 + target/linux/ramips/rt288x/config-5.4 | 1 + target/linux/ramips/rt305x/config-5.10 | 1 + target/linux/ramips/rt305x/config-5.4 | 1 + target/linux/ramips/rt3883/config-5.10 | 1 + target/linux/ramips/rt3883/config-5.4 | 1 + 12 files changed, 12 insertions(+) diff --git a/target/linux/ramips/mt7620/config-5.10 b/target/linux/ramips/mt7620/config-5.10 index 391449cc5..f91d01bbd 100644 --- a/target/linux/ramips/mt7620/config-5.10 +++ b/target/linux/ramips/mt7620/config-5.10 @@ -129,6 +129,7 @@ CONFIG_NET_RALINK_SOC=y # CONFIG_NET_VENDOR_MEDIATEK is not set CONFIG_NET_VENDOR_RALINK=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_NVMEM=y CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y diff --git a/target/linux/ramips/mt7620/config-5.4 b/target/linux/ramips/mt7620/config-5.4 index c07ba2906..173ab02dc 100644 --- a/target/linux/ramips/mt7620/config-5.4 +++ b/target/linux/ramips/mt7620/config-5.4 @@ -146,6 +146,7 @@ CONFIG_NET_RALINK_SOC=y # CONFIG_NET_VENDOR_MEDIATEK is not set CONFIG_NET_VENDOR_RALINK=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_NVMEM=y CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y diff --git a/target/linux/ramips/mt7621/config-5.10 b/target/linux/ramips/mt7621/config-5.10 index 1442700d5..4da3ac5da 100644 --- a/target/linux/ramips/mt7621/config-5.10 +++ b/target/linux/ramips/mt7621/config-5.10 @@ -196,6 +196,7 @@ CONFIG_NET_VENDOR_MEDIATEK=y CONFIG_NO_HZ_COMMON=y CONFIG_NO_HZ_IDLE=y CONFIG_NR_CPUS=4 +CONFIG_NVMEM=y CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y diff --git a/target/linux/ramips/mt7621/config-5.4 b/target/linux/ramips/mt7621/config-5.4 index b823247d7..922caf7d3 100644 --- a/target/linux/ramips/mt7621/config-5.4 +++ b/target/linux/ramips/mt7621/config-5.4 @@ -192,6 +192,7 @@ CONFIG_NET_SWITCHDEV=y # CONFIG_NET_VENDOR_RALINK is not set CONFIG_NET_VENDOR_RAW_MEDIATEK=y CONFIG_NR_CPUS=4 +CONFIG_NVMEM=y CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y diff --git a/target/linux/ramips/mt76x8/config-5.10 b/target/linux/ramips/mt76x8/config-5.10 index 3a42a5770..fd1e03685 100644 --- a/target/linux/ramips/mt76x8/config-5.10 +++ b/target/linux/ramips/mt76x8/config-5.10 @@ -124,6 +124,7 @@ CONFIG_NET_RALINK_SOC=y # CONFIG_NET_VENDOR_MEDIATEK is not set CONFIG_NET_VENDOR_RALINK=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_NVMEM=y CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y diff --git a/target/linux/ramips/mt76x8/config-5.4 b/target/linux/ramips/mt76x8/config-5.4 index 64068e6fe..0e20a743d 100644 --- a/target/linux/ramips/mt76x8/config-5.4 +++ b/target/linux/ramips/mt76x8/config-5.4 @@ -126,6 +126,7 @@ CONFIG_NET_RALINK_SOC=y # CONFIG_NET_VENDOR_MEDIATEK is not set CONFIG_NET_VENDOR_RALINK=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_NVMEM=y CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y diff --git a/target/linux/ramips/rt288x/config-5.10 b/target/linux/ramips/rt288x/config-5.10 index 88d06266b..03b38fcad 100644 --- a/target/linux/ramips/rt288x/config-5.10 +++ b/target/linux/ramips/rt288x/config-5.10 @@ -112,6 +112,7 @@ CONFIG_NET_RALINK_SOC=y CONFIG_NET_VENDOR_RALINK=y CONFIG_NLS=m CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_NVMEM=y CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y diff --git a/target/linux/ramips/rt288x/config-5.4 b/target/linux/ramips/rt288x/config-5.4 index ad269ff5b..d3412f488 100644 --- a/target/linux/ramips/rt288x/config-5.4 +++ b/target/linux/ramips/rt288x/config-5.4 @@ -112,6 +112,7 @@ CONFIG_NET_RALINK_SOC=y CONFIG_NET_VENDOR_RALINK=y CONFIG_NLS=m CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_NVMEM=y CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y diff --git a/target/linux/ramips/rt305x/config-5.10 b/target/linux/ramips/rt305x/config-5.10 index 1704accf9..a67b525f8 100644 --- a/target/linux/ramips/rt305x/config-5.10 +++ b/target/linux/ramips/rt305x/config-5.10 @@ -114,6 +114,7 @@ CONFIG_NET_RALINK_RT3050=y CONFIG_NET_RALINK_SOC=y CONFIG_NET_VENDOR_RALINK=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_NVMEM=y CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y diff --git a/target/linux/ramips/rt305x/config-5.4 b/target/linux/ramips/rt305x/config-5.4 index 6ab68f9d5..699a52441 100644 --- a/target/linux/ramips/rt305x/config-5.4 +++ b/target/linux/ramips/rt305x/config-5.4 @@ -114,6 +114,7 @@ CONFIG_NET_RALINK_RT3050=y CONFIG_NET_RALINK_SOC=y CONFIG_NET_VENDOR_RALINK=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_NVMEM=y CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y diff --git a/target/linux/ramips/rt3883/config-5.10 b/target/linux/ramips/rt3883/config-5.10 index 16d6fc32f..664d93f45 100644 --- a/target/linux/ramips/rt3883/config-5.10 +++ b/target/linux/ramips/rt3883/config-5.10 @@ -113,6 +113,7 @@ CONFIG_NET_RALINK_RT3883=y CONFIG_NET_RALINK_SOC=y CONFIG_NET_VENDOR_RALINK=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_NVMEM=y CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y diff --git a/target/linux/ramips/rt3883/config-5.4 b/target/linux/ramips/rt3883/config-5.4 index 577743e79..d9bec399f 100644 --- a/target/linux/ramips/rt3883/config-5.4 +++ b/target/linux/ramips/rt3883/config-5.4 @@ -114,6 +114,7 @@ CONFIG_NET_RALINK_RT3883=y CONFIG_NET_RALINK_SOC=y CONFIG_NET_VENDOR_RALINK=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_NVMEM=y CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y From a9d71837e956d61d0fb79f38db7ea0cdc333c740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= Date: Tue, 5 Jul 2022 17:10:43 +0300 Subject: [PATCH 4/9] ramips: fix GB-PC1 and GB-PC2 device support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change switch port labels to ethblack & ethblue. Change lan1 & lan2 LEDs to ethblack_act & ethblue_act and fix GPIO pins. Add the external phy with ethyellow label on the GB-PC2 devicetree. Do not claim rgmii2 as gpio, it's used for ethernet with rgmii2 function. Enable ICPlus PHY driver for IP1001 which GB-PC2 has got. Update interface name and change netdev function. Enable lzma compression to make up for the increased size of the kernel. Make spi flash bindings on par with mainline Linux to fix read errors. Tested on GB-PC2 by Petr. Tested-by: Petr Louda Signed-off-by: Arınç ÜNAL --- .../linux/ramips/dts/mt7621_gnubee_gb-pc1.dts | 67 +++++++++-------- .../linux/ramips/dts/mt7621_gnubee_gb-pc2.dts | 75 ++++++++++--------- target/linux/ramips/image/mt7621.mk | 2 + .../mt7621/base-files/etc/board.d/01_leds | 4 +- .../mt7621/base-files/etc/board.d/02_network | 6 +- target/linux/ramips/mt7621/config-5.10 | 1 + target/linux/ramips/mt7621/config-5.4 | 1 + 7 files changed, 84 insertions(+), 72 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts b/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts index 4291fc248..95dc635b2 100644 --- a/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts +++ b/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts @@ -8,10 +8,10 @@ model = "GB-PC1"; aliases { - led-boot = &led_status; - led-failsafe = &led_status; - led-running = &led_status; - led-upgrade = &led_status; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; }; keys { @@ -27,24 +27,26 @@ leds { compatible = "gpio-leds"; - system { - label = "green:system"; + ethblack_act { + label = "green:ethblack_act"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + ethblue_act { + label = "green:ethblue_act"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + power { + label = "green:power"; gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + linux,default-trigger = "default-on"; }; - led_status: status { - label = "green:status"; + led_system: system { + label = "green:system"; gpios = <&gpio 8 GPIO_ACTIVE_LOW>; - }; - - lan1 { - label = "green:lan1"; - gpios = <&gpio 24 GPIO_ACTIVE_LOW>; - }; - - lan2 { - label = "green:lan2"; - gpios = <&gpio 25 GPIO_ACTIVE_LOW>; + linux,default-trigger = "disk-activity"; }; }; }; @@ -59,9 +61,8 @@ flash@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <80000000>; + spi-max-frequency = <50000000>; broken-flash-reset; - m25p,fast-read; partitions { compatible = "fixed-partitions"; @@ -99,31 +100,35 @@ status = "okay"; }; -ðernet { - pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; -}; - &gmac0 { mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "ethblue"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe000>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { status = "okay"; - label = "lan1"; - }; - - port@4 { - status = "okay"; - label = "lan2"; + label = "ethblack"; }; }; }; &state_default { gpio { - groups = "jtag", "rgmii2", "uart3", "wdt"; + groups = "jtag", "uart3", "wdt"; function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts index a5e63c5f4..7820206ef 100644 --- a/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts +++ b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts @@ -8,10 +8,10 @@ model = "GB-PC2"; aliases { - led-boot = &led_status; - led-failsafe = &led_status; - led-running = &led_status; - led-upgrade = &led_status; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; }; keys { @@ -27,34 +27,26 @@ leds { compatible = "gpio-leds"; - system { - label = "green:system"; + ethblack_act { + label = "green:ethblack_act"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + ethblue_act { + label = "green:ethblue_act"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + power { + label = "green:power"; gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + linux,default-trigger = "default-on"; }; - led_status: status { - label = "green:status"; + led_system: system { + label = "green:system"; gpios = <&gpio 8 GPIO_ACTIVE_LOW>; - }; - - lan1 { - label = "green:lan1"; - gpios = <&gpio 24 GPIO_ACTIVE_LOW>; - }; - - lan2 { - label = "green:lan2"; - gpios = <&gpio 25 GPIO_ACTIVE_LOW>; - }; - - lan3-yellow { - label = "yellow:lan3"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - }; - - lan3-green { - label = "green:lan3"; - gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,default-trigger = "disk-activity"; }; }; }; @@ -69,9 +61,8 @@ flash@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <80000000>; + spi-max-frequency = <50000000>; broken-flash-reset; - m25p,fast-read; partitions { compatible = "fixed-partitions"; @@ -109,31 +100,41 @@ status = "okay"; }; -ðernet { - pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; -}; - &gmac0 { mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "ethyellow"; + phy-handle = <ðphy5>; + mtd-mac-address = <&factory 0xe000>; +}; + +&mdio { + ethphy5: ethernet-phy@5 { + reg = <5>; + phy-mode = "rgmii-rxid"; + }; +}; + &switch0 { ports { port@0 { status = "okay"; - label = "lan1"; + label = "ethblack"; }; port@4 { status = "okay"; - label = "lan2"; + label = "ethblue"; }; }; }; &state_default { gpio { - groups = "jtag", "rgmii2", "uart3", "wdt"; + groups = "jtag", "uart3", "wdt"; function = "gpio"; }; }; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index fd6eb8798..e2402fc97 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -721,6 +721,7 @@ TARGET_DEVICES += glinet_gl-mt1300 define Device/gnubee_gb-pc1 $(Device/dsa-migration) + $(Device/uimage-lzma-loader) DEVICE_VENDOR := GnuBee DEVICE_MODEL := Personal Cloud One DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 -wpad-openssl @@ -730,6 +731,7 @@ TARGET_DEVICES += gnubee_gb-pc1 define Device/gnubee_gb-pc2 $(Device/dsa-migration) + $(Device/uimage-lzma-loader) DEVICE_VENDOR := GnuBee DEVICE_MODEL := Personal Cloud Two DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 -wpad-openssl diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index bfcf64184..ffc57fa8e 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -55,8 +55,8 @@ gehua,ghl-r-001) ;; gnubee,gb-pc1|\ gnubee,gb-pc2) - ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "lan1" - ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "lan2" + ucidef_set_led_netdev "ethblack_act" "ethblack act" "green:ethblack_act" "ethblack" "tx rx" + ucidef_set_led_netdev "ethblue_act" "ethblue act" "green:ethblue_act" "ethblue" "tx rx" ;; linksys,e5600) ucidef_set_led_netdev "wan" "wan link" "blue:wan" "wan" "link" diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 7502a9134..250210a47 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -53,9 +53,11 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "4:wan" "6u@eth0" "5u@eth1" ;; - gnubee,gb-pc1|\ + gnubee,gb-pc1) + ucidef_set_interface_lan "ethblack ethblue" + ;; gnubee,gb-pc2) - ucidef_set_interface_lan "lan1 lan2" + ucidef_set_interface_lan "ethblack ethblue ethyellow" ;; hatlab,gateboard-one) ucidef_set_interfaces_lan_wan "eth0 eth1 eth2 eth3 eth4" "eth5" diff --git a/target/linux/ramips/mt7621/config-5.10 b/target/linux/ramips/mt7621/config-5.10 index 4da3ac5da..86b44c579 100644 --- a/target/linux/ramips/mt7621/config-5.10 +++ b/target/linux/ramips/mt7621/config-5.10 @@ -104,6 +104,7 @@ CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y CONFIG_I2C_GPIO=y CONFIG_I2C_MT7621=y +CONFIG_ICPLUS_PHY=y CONFIG_INITRAMFS_SOURCE="" CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y diff --git a/target/linux/ramips/mt7621/config-5.4 b/target/linux/ramips/mt7621/config-5.4 index 922caf7d3..35ef59e09 100644 --- a/target/linux/ramips/mt7621/config-5.4 +++ b/target/linux/ramips/mt7621/config-5.4 @@ -105,6 +105,7 @@ CONFIG_I2C_ALGOBIT=y CONFIG_I2C_BOARDINFO=y CONFIG_I2C_GPIO=y CONFIG_I2C_MT7621=y +CONFIG_ICPLUS_PHY=y CONFIG_INITRAMFS_SOURCE="" CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y From 9483e6d8a9343be9a1230e03b92ec4ca47bfd740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= Date: Sun, 14 Aug 2022 10:44:12 +0300 Subject: [PATCH 5/9] ramips: mt7621-dts: do not claim rgmii2 group as gpio for certain devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These devices do not use rgmii2 as gpio, therefore remove rgmii2 pin group from state-default. Remove overwriting the ethernet node for these devices. Move claiming the rgmii2 group from mt7621_zyxel_nwa-ax.dtsi to mt7621_zyxel_nwa50ax.dts as it's only the latter using rgmii2 pins as gpio. Remove duplicate ethernet overwrite from mt7621_tplink_archer-x6-v3.dtsi. Claim rgmii2 group as gpio on mt7621_bolt_arion.dts as it uses an rgmii2 pin, 26, as gpio. Signed-off-by: Arınç ÜNAL --- target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts | 6 +----- target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts | 6 +----- target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts | 6 +----- .../linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts | 6 +----- target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts | 5 ----- target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi | 5 ----- target/linux/ramips/dts/mt7621_zyxel_nr7101.dts | 6 +----- 7 files changed, 5 insertions(+), 35 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts index 74d8fbe1d..5a259e154 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts @@ -152,10 +152,6 @@ }; }; -ðernet { - pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; -}; - &switch0 { ports { port@0 { @@ -187,7 +183,7 @@ &state_default { gpio { - groups = "i2c", "uart2", "uart3", "rgmii2", "sdhci"; + groups = "i2c", "uart2", "uart3", "sdhci"; function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts index 04ec3ab49..3436757e1 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts @@ -149,7 +149,7 @@ &state_default { gpio { - groups = "i2c", "uart2", "uart3", "rgmii2", "sdhci"; + groups = "i2c", "uart2", "uart3", "sdhci"; function = "gpio"; }; }; @@ -172,10 +172,6 @@ }; }; -ðernet { - pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; -}; - &gmac0 { mtd-mac-address = <&factory 0x4>; }; diff --git a/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts b/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts index 6d94e5e52..811b02fe0 100644 --- a/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts +++ b/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts @@ -32,7 +32,7 @@ &state_default { gpio { - groups = "uart2", "rgmii2"; + groups = "uart2"; function = "gpio"; }; }; @@ -112,10 +112,6 @@ status = "okay"; }; -ðernet { - pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; -}; - &gmac0 { mtd-mac-address = <&factory 0x5>; }; diff --git a/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts b/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts index ce627d662..dcdcc261b 100644 --- a/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts +++ b/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts @@ -39,10 +39,6 @@ status = "okay"; }; -ðernet { - pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; -}; - &switch0 { ports { port@0 { @@ -74,7 +70,7 @@ &state_default { gpio { - groups = "i2c", "uart2", "uart3", "rgmii2", "sdhci"; + groups = "i2c", "uart2", "uart3", "sdhci"; function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts index 7d38b7b09..01f338186 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts @@ -161,11 +161,6 @@ }; }; -ðernet { - pinctrl-names = "default"; - pinctrl-0 = <&rgmii1_pins &mdio_pins>; -}; - &gmac0 { mtd-mac-address = <&config 0x8>; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi b/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi index 76d9908fb..b6d0c1e53 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi +++ b/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi @@ -120,11 +120,6 @@ }; }; -ðernet { - pinctrl-names = "default"; - pinctrl-0 = <&rgmii1_pins &mdio_pins>; -}; - &pcie { status = "okay"; }; diff --git a/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts b/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts index affc99b8c..86b39b991 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts @@ -143,10 +143,6 @@ }; }; -ðernet { - pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; -}; - &gmac0 { mtd-mac-address = <&factory 0xe000>; }; @@ -162,7 +158,7 @@ &state_default { gpio { - groups = "i2c", "rgmii2", "uart3", "jtag", "wdt"; + groups = "i2c", "uart3", "jtag", "wdt"; function = "gpio"; }; }; From a28334d8b8dfa58dccd6fce369f5ee87e5b5a703 Mon Sep 17 00:00:00 2001 From: ?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= Date: Wed, 6 Jul 2022 01:20:32 +0300 Subject: [PATCH 6/9] ramips: mt7621-dts: mux phy0/4 to gmac1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mux the MT7530 switch's phy0/4 to the SoC's gmac1 on devices where RGMII2 pins are available. This achieves 2 Gbps total bandwidth to the CPU using the second RGMII. The ports called "wan" are muxed where possible. On a minority of devices, this is not possible. Those cases: mt7621_ampedwireless_ally-r1900k.dts: lan3 mt7621_ubnt_edgerouter-x.dts: eth0 mt7621_gnubee_gb-pc1.dts: ethblue mt7621_linksys_re6500.dts: lan1 mt7621_netgear_wac104.dts: lan4 mt7621_tplink_eap235-wall-v1.dts: lan0 mt7621_tplink_eap615-wall-v1.dts: lan0 mt7621_ubnt_usw-flex.dts: lan1 The "wan" port is just what the vendor designated on the board/plastic chasis of the device. On a technical level, there is no difference between a lan and wan port on MT7621AT, MT7621DAT and MT7621ST SoCs. Prefer connecting to WAN via the port described above for these devices to benefit the feature brought with this patch. mt7621_d-team_newifi-d2.dts cannot benefit this feature, although it looks like it should, because the rgmii2 pins are wired to unused components. Tested on a range of devices documented on the GitHub PR. Signed-off-by: Arınç ÜNAL --- target/linux/ramips/dts/mt7621_adslr_g7.dts | 20 ++++++---- .../ramips/dts/mt7621_afoundry_ew1200.dts | 20 ++++++---- .../ramips/dts/mt7621_asiarf_ap7621-001.dts | 22 +++++++---- .../ramips/dts/mt7621_asiarf_ap7621-nv1.dts | 22 +++++++---- .../linux/ramips/dts/mt7621_asus_rt-ac57u.dts | 19 +++++++--- .../ramips/dts/mt7621_asus_rt-acx5p.dtsi | 19 +++++++--- .../ramips/dts/mt7621_asus_rt-n56u-b1.dts | 21 +++++++---- .../ramips/dts/mt7621_buffalo_wsr-1166dhp.dts | 17 ++++++--- .../dts/mt7621_buffalo_wsr-2533dhpl.dts | 20 +++++++--- .../ramips/dts/mt7621_buffalo_wsr-600dhp.dts | 18 ++++++--- .../linux/ramips/dts/mt7621_cudy_wr1300.dts | 22 +++++++---- .../linux/ramips/dts/mt7621_cudy_wr2100.dts | 23 ++++++++---- .../ramips/dts/mt7621_dlink_dir-853-a3.dts | 19 +++++++--- .../ramips/dts/mt7621_dlink_dir-853-r1.dts | 24 ++++++++---- .../ramips/dts/mt7621_dlink_dir-860l-b1.dts | 18 ++++++--- .../ramips/dts/mt7621_dlink_dir-8xx.dtsi | 19 +++++++--- .../ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi | 19 +++++++--- .../linux/ramips/dts/mt7621_edimax_rx21s.dtsi | 18 ++++++--- .../dts/mt7621_elecom_wrc-1167ghbk2-s.dts | 19 +++++++--- .../dts/mt7621_elecom_wrc-1167gs2-b.dts | 2 +- .../ramips/dts/mt7621_elecom_wrc-1167gst2.dts | 2 +- .../dts/mt7621_elecom_wrc-2533ghbk-i.dts | 17 ++++++--- .../ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi | 2 +- .../ramips/dts/mt7621_elecom_wrc-gs.dtsi | 19 +++++++--- .../ramips/dts/mt7621_glinet_gl-mt1300.dts | 21 +++++++---- .../ramips/dts/mt7621_hilink_hlk-7621a.dts | 19 +++++++--- .../linux/ramips/dts/mt7621_hiwifi_hc5962.dts | 17 ++++++--- .../ramips/dts/mt7621_iodata_wn-ax1167gr.dts | 22 +++++++---- .../ramips/dts/mt7621_iodata_wn-dx1200gr.dts | 21 +++++++---- .../ramips/dts/mt7621_iodata_wn-gx300gr.dts | 22 +++++++---- .../ramips/dts/mt7621_iodata_wn-xx-xr.dtsi | 22 +++++++---- .../ramips/dts/mt7621_iodata_wnpr2600g.dts | 19 +++++++--- .../linux/ramips/dts/mt7621_iptime_a6ns-m.dts | 20 +++++++--- .../linux/ramips/dts/mt7621_iptime_a8004t.dts | 20 +++++++--- .../ramips/dts/mt7621_jcg_jhr-ac876m.dts | 16 +++++++- .../ramips/dts/mt7621_jcg_jhr-ac945m.dts | 19 +++++++--- target/linux/ramips/dts/mt7621_jcg_q20.dts | 37 +++++++------------ .../ramips/dts/mt7621_lenovo_newifi-d1.dts | 19 +++++++--- .../linux/ramips/dts/mt7621_linksys_e5600.dts | 17 ++++++--- .../ramips/dts/mt7621_linksys_ea7xxx.dtsi | 17 ++++++--- .../ramips/dts/mt7621_linksys_re6500.dts | 19 +++++++--- .../dts/mt7621_mediatek_ap-mt7621a-v60.dts | 22 +++++++---- .../dts/mt7621_mediatek_mt7621-eval-board.dts | 17 ++++++--- .../mt7621_mikrotik_routerboard-750gr3.dts | 20 ++++++++++ .../dts/mt7621_mikrotik_routerboard-m33g.dts | 17 ++++++--- .../linux/ramips/dts/mt7621_mqmaker_witi.dts | 22 +++++++---- .../dts/mt7621_netgear_sercomm_ayx.dtsi | 22 +++++++---- .../dts/mt7621_netgear_sercomm_bzv.dtsi | 22 +++++++---- .../dts/mt7621_netgear_sercomm_chj.dtsi | 22 +++++++---- .../linux/ramips/dts/mt7621_netis_wf2881.dts | 19 +++++++--- .../linux/ramips/dts/mt7621_oraybox_x3a.dts | 24 ++++++++---- .../linux/ramips/dts/mt7621_planex_vr500.dts | 19 +++++++--- .../dts/mt7621_samknows_whitebox-v8.dts | 19 +++++++--- .../dts/mt7621_storylink_sap-g3200u3.dts | 22 +++++++---- .../ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts | 21 +++++++---- .../ramips/dts/mt7621_totolink_a7000r.dts | 22 +++++++---- .../ramips/dts/mt7621_totolink_x5000r.dts | 19 +++++++--- .../dts/mt7621_tplink_archer-c6u-v1.dts | 22 +++++++---- .../ramips/dts/mt7621_ubnt_edgerouter-x.dts | 22 +++++++++++ .../ramips/dts/mt7621_unielec_u7621-06.dtsi | 22 +++++++---- .../dts/mt7621_xiaomi_mi-router-3-pro.dts | 19 +++++++--- .../ramips/dts/mt7621_xiaomi_mi-router-4.dts | 19 +++++++--- .../dts/mt7621_xiaomi_mi-router-4a-3g-v2.dtsi | 24 ++++++++---- .../ramips/dts/mt7621_youhua_wr1200js.dts | 19 +++++++--- .../linux/ramips/dts/mt7621_youku_yk-l2.dts | 19 +++++++--- .../ramips/dts/mt7621_zbtlink_zbt-we1326.dts | 19 +++++++--- .../ramips/dts/mt7621_zbtlink_zbt-we3526.dts | 19 +++++++--- 67 files changed, 898 insertions(+), 403 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_adslr_g7.dts b/target/linux/ramips/dts/mt7621_adslr_g7.dts index 3290a5e71..1b9e35b7e 100644 --- a/target/linux/ramips/dts/mt7621_adslr_g7.dts +++ b/target/linux/ramips/dts/mt7621_adslr_g7.dts @@ -104,6 +104,19 @@ mtd-mac-address = <&factory 0xe00c>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe00c>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -125,13 +138,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe00c>; - mtd-mac-address-increment = <1>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts b/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts index ed9e9852d..a7200c19c 100644 --- a/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts +++ b/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts @@ -109,6 +109,19 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe000>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -130,13 +143,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe000>; - mtd-mac-address-increment = <1>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts b/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts index cf91dc031..eb9d10b3b 100644 --- a/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts +++ b/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts @@ -7,18 +7,26 @@ model = "AsiaRF AP7621-001"; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + mtd-mac-address = <&factory 0xe000>; + mtd-mac-address-increment = <1>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { status = "okay"; label = "lan"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe000>; - mtd-mac-address-increment = <1>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts b/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts index 5a4c03fb7..e23b5190a 100644 --- a/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts +++ b/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts @@ -7,15 +7,23 @@ model = "AsiaRF AP7621-NV1"; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + + mtd-mac-address = <&factory 0xe000>; + mtd-mac-address-increment = <1>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe000>; - mtd-mac-address-increment = <1>; - }; - port@2 { status = "okay"; label = "lan1"; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ac57u.dts b/target/linux/ramips/dts/mt7621_asus_rt-ac57u.dts index 78f5584b4..a860b3cc7 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-ac57u.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-ac57u.dts @@ -133,14 +133,21 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; - port@1 { status = "okay"; label = "lan1"; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi b/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi index b5e8655cb..63d5c612b 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi +++ b/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi @@ -134,13 +134,22 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + + mtd-mac-address = <&factory 0xe000>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - }; - port@1 { status = "okay"; label = "lan1"; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts b/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts index b78e594ff..2d4145423 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts @@ -10,7 +10,7 @@ model = "ASUS RT-N56U B1"; aliases { - label-mac-device = &wan; + label-mac-device = &gmac1; led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -143,6 +143,19 @@ mtd-mac-address = <&factory 0x8004>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0x4>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -164,12 +177,6 @@ status = "okay"; label = "lan1"; }; - - wan: port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0x4>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts index 5a259e154..a8d76b544 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts @@ -152,6 +152,18 @@ }; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -173,11 +185,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts index 048eac5a3..376490113 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts @@ -168,13 +168,23 @@ mtd-mac-address-increment = <(-1)>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + + mtd-mac-address = <&factory 0x4>; + mtd-mac-address-increment = <(-1)>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - }; - port@1 { status = "okay"; label = "lan4"; diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts index 3436757e1..8c85f775e 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts @@ -176,6 +176,19 @@ mtd-mac-address = <&factory 0x4>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0x4>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -197,11 +210,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr1300.dts b/target/linux/ramips/dts/mt7621_cudy_wr1300.dts index a66ce942a..609cd8581 100644 --- a/target/linux/ramips/dts/mt7621_cudy_wr1300.dts +++ b/target/linux/ramips/dts/mt7621_cudy_wr1300.dts @@ -156,6 +156,21 @@ mtd-mac-address = <&bdinfo 0xde00>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + mtd-mac-address = <&bdinfo 0xde00>; + mtd-mac-address-increment = <1>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -177,13 +192,6 @@ status = "okay"; label = "lan1"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&bdinfo 0xde00>; - mtd-mac-address-increment = <1>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr2100.dts b/target/linux/ramips/dts/mt7621_cudy_wr2100.dts index 692c94da5..142a50afb 100644 --- a/target/linux/ramips/dts/mt7621_cudy_wr2100.dts +++ b/target/linux/ramips/dts/mt7621_cudy_wr2100.dts @@ -81,6 +81,21 @@ mtd-mac-address = <&bdinfo 0xde00>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + mtd-mac-address = <&bdinfo 0xde00>; + mtd-mac-address-increment = <1>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &pcie { status = "okay"; }; @@ -189,13 +204,5 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - - mtd-mac-address = <&bdinfo 0xde00>; - mtd-mac-address-increment = <1>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts b/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts index 738bcdc7d..972a31895 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts @@ -166,6 +166,19 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -187,12 +200,6 @@ status = "okay"; label = "lan1"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts index 09e46b011..0819d66ea 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts @@ -12,7 +12,7 @@ model = "D-Link DIR-853 R1"; aliases { - label-mac-device = &wan; + label-mac-device = &gmac1; led-boot = &led_power_orange; led-failsafe = &led_power_blue; led-running = &led_power_blue; @@ -105,6 +105,21 @@ mtd-mac-address-increment = <(-1)>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + mtd-mac-address = <&factory 0x4>; + mtd-mac-address-increment = <(-2)>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -126,13 +141,6 @@ status = "okay"; label = "lan1"; }; - - wan: port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0x4>; - mtd-mac-address-increment = <(-2)>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts index f843f6280..ac5758596 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts @@ -112,13 +112,21 @@ mtd-mac-address = <&radio 0x4>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + mtd-mac-address = <&radio 0x4>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - }; - port@1 { status = "okay"; label = "lan4"; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi index 7ab0e8bd5..f6fc9caab 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi @@ -95,6 +95,19 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -116,12 +129,6 @@ status = "okay"; label = "lan1"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi index a54b2be4f..4c367eeb1 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi @@ -155,6 +155,19 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -176,12 +189,6 @@ status = "okay"; label = "lan1"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi b/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi index 3f3bae43f..bc138ee73 100644 --- a/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi +++ b/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi @@ -121,13 +121,21 @@ mtd-mac-address = <&factory 0x4>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + mtd-mac-address = <&factory 0x4>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - }; - port@1 { status = "okay"; label = "lan4"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts index b6a738355..936076fd7 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts @@ -70,14 +70,21 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; - port@1 { status = "okay"; label = "lan4"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts index 6349fd487..c367cf130 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts @@ -11,7 +11,7 @@ mtd-mac-address = <&factory 0xfff4>; }; -&wan { +&gmac1 { mtd-mac-address = <&factory 0xfffa>; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts index 11b782488..a7d2dabb7 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts @@ -11,7 +11,7 @@ mtd-mac-address = <&factory 0xe000>; }; -&wan { +&gmac1 { mtd-mac-address = <&factory 0xe006>; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk-i.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk-i.dts index a5436d55d..8da1099dc 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk-i.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk-i.dts @@ -136,13 +136,20 @@ }; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - }; - port@1 { status = "okay"; label = "lan4"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi index 642724da1..412bd73ba 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi @@ -6,7 +6,7 @@ mtd-mac-address = <&factory 0xe000>; }; -&wan { +&gmac1 { mtd-mac-address = <&factory 0xe006>; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi index 9cf2b666b..acd3004eb 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi @@ -11,7 +11,7 @@ led-failsafe = &led_power_green; led-running = &led_power_green; led-upgrade = &led_power_green; - label-mac-device = &wan; + label-mac-device = &gmac1; }; leds: leds { @@ -83,13 +83,20 @@ }; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - wan: port@0 { - status = "okay"; - label = "wan"; - }; - port@1 { status = "okay"; label = "lan4"; diff --git a/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts b/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts index 20f63902a..e3f12386b 100644 --- a/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts +++ b/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts @@ -14,7 +14,7 @@ led-failsafe = &led_run; led-running = &led_run; led-upgrade = &led_run; - label-mac-device = &wan; + label-mac-device = &gmac1; }; chosen { @@ -119,6 +119,19 @@ mtd-mac-address-increment = <1>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0x4000>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@2 { @@ -130,12 +143,6 @@ status = "okay"; label = "lan2"; }; - - wan: port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0x4000>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_hilink_hlk-7621a.dts b/target/linux/ramips/dts/mt7621_hilink_hlk-7621a.dts index ccb771d1b..307fd73c4 100644 --- a/target/linux/ramips/dts/mt7621_hilink_hlk-7621a.dts +++ b/target/linux/ramips/dts/mt7621_hilink_hlk-7621a.dts @@ -73,11 +73,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - }; }; }; @@ -85,6 +80,18 @@ mtd-mac-address = <&factory 0x8004>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &state_default { gpio { groups = "rgmii2", "jtag"; @@ -110,4 +117,4 @@ &i2c { status = "okay"; -}; \ No newline at end of file +}; diff --git a/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts index 774fb93d9..d9ca1012c 100644 --- a/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts +++ b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts @@ -129,6 +129,18 @@ }; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@1 { @@ -145,11 +157,6 @@ status = "okay"; label = "lan3"; }; - - port@4 { - status = "okay"; - label = "wan"; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts index 879fb68c8..5e3859786 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts @@ -131,15 +131,23 @@ mtd-mac-address = <&iNIC_rf 0x4>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + + mtd-mac-address = <&factory 0x4>; + mtd-mac-address-increment = <1>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0x4>; - mtd-mac-address-increment = <1>; - }; - port@1 { status = "okay"; label = "lan4"; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts index 055c1abde..ab28797ed 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts @@ -14,7 +14,7 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - label-mac-device = &wan; + label-mac-device = &gmac1; }; leds { @@ -130,14 +130,21 @@ mtd-mac-address = <&factory 0x1e000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + mtd-mac-address = <&factory 0x1e006>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - wan: port@0 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0x1e006>; - }; - port@1 { status = "okay"; label = "lan4"; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts index 06d024e9a..ad215dafa 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts @@ -131,15 +131,23 @@ mtd-mac-address = <&factory 0x4>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + + mtd-mac-address = <&factory 0x4>; + mtd-mac-address-increment = <1>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0x4>; - mtd-mac-address-increment = <1>; - }; - port@1 { status = "okay"; label = "lan4"; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi b/target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi index ff9e525ae..6f8e75e6d 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi +++ b/target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi @@ -11,7 +11,7 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - label-mac-device = &wan; + label-mac-device = &gmac1; }; leds { @@ -121,14 +121,22 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - wan: port@0 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; - port@1 { status = "okay"; label = "lan4"; diff --git a/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts b/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts index 0e808f689..572293ce9 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts @@ -123,13 +123,22 @@ mtd-mac-address = <&factory 0x4>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + + mtd-mac-address = <&factory 0x4>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - }; - port@1 { status = "okay"; label = "lan4"; diff --git a/target/linux/ramips/dts/mt7621_iptime_a6ns-m.dts b/target/linux/ramips/dts/mt7621_iptime_a6ns-m.dts index 4ebd98052..5aa4b350c 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a6ns-m.dts +++ b/target/linux/ramips/dts/mt7621_iptime_a6ns-m.dts @@ -114,14 +114,22 @@ mtd-mac-address = <&uboot 0x1fc20>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + + mtd-mac-address = <&uboot 0x1fc40>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&uboot 0x1fc40>; - }; - port@1 { status = "okay"; label = "lan1"; diff --git a/target/linux/ramips/dts/mt7621_iptime_a8004t.dts b/target/linux/ramips/dts/mt7621_iptime_a8004t.dts index df6aed664..04134beec 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a8004t.dts +++ b/target/linux/ramips/dts/mt7621_iptime_a8004t.dts @@ -98,14 +98,22 @@ mtd-mac-address = <&uboot 0x1fc20>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + + mtd-mac-address = <&uboot 0x1fc40>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&uboot 0x1fc40>; - }; - port@1 { status = "okay"; label = "lan4"; diff --git a/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts b/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts index ae312fcc5..99dc6d0ba 100644 --- a/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts +++ b/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts @@ -14,7 +14,7 @@ led-failsafe = &led_wps; led-running = &led_wps; led-upgrade = &led_wps; - label-mac-device = &wan; + label-mac-device = &gmac1; }; leds { @@ -132,6 +132,19 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0x4>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -156,7 +169,6 @@ wan: port@4 { status = "okay"; label = "wan"; - mtd-mac-address = <&factory 0x4>; }; }; }; diff --git a/target/linux/ramips/dts/mt7621_jcg_jhr-ac945m.dts b/target/linux/ramips/dts/mt7621_jcg_jhr-ac945m.dts index c604bca1c..c67455a28 100644 --- a/target/linux/ramips/dts/mt7621_jcg_jhr-ac945m.dts +++ b/target/linux/ramips/dts/mt7621_jcg_jhr-ac945m.dts @@ -93,6 +93,19 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -114,12 +127,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_jcg_q20.dts b/target/linux/ramips/dts/mt7621_jcg_q20.dts index c9bf648a3..5464ca06c 100644 --- a/target/linux/ramips/dts/mt7621_jcg_q20.dts +++ b/target/linux/ramips/dts/mt7621_jcg_q20.dts @@ -144,19 +144,24 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_3fff4>; - nvmem-cell-names = "mac-address"; + mtd-mac-address = <&factory 0x3fff4>; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + mtd-mac-address = <&factory 0x3fffa>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; }; &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - nvmem-cells = <&macaddr_factory_3fffa>; - nvmem-cell-names = "mac-address"; - }; - port@1 { status = "okay"; label = "lan1"; @@ -175,17 +180,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_3fff4: macaddr@3fff4 { - reg = <0x3fff4 0x6>; - }; - - macaddr_factory_3fffa: macaddr@3fffa { - reg = <0x3fffa 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts b/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts index fa2690072..b506457de 100644 --- a/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts +++ b/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts @@ -135,6 +135,19 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@1 { @@ -146,12 +159,6 @@ status = "okay"; label = "lan1"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_linksys_e5600.dts b/target/linux/ramips/dts/mt7621_linksys_e5600.dts index 91db31591..3b23a25f8 100644 --- a/target/linux/ramips/dts/mt7621_linksys_e5600.dts +++ b/target/linux/ramips/dts/mt7621_linksys_e5600.dts @@ -148,6 +148,18 @@ }; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -169,11 +181,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_linksys_ea7xxx.dtsi b/target/linux/ramips/dts/mt7621_linksys_ea7xxx.dtsi index ecff6406d..848223a1d 100644 --- a/target/linux/ramips/dts/mt7621_linksys_ea7xxx.dtsi +++ b/target/linux/ramips/dts/mt7621_linksys_ea7xxx.dtsi @@ -173,13 +173,20 @@ }; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - }; - port@1 { status = "okay"; label = "lan1"; diff --git a/target/linux/ramips/dts/mt7621_linksys_re6500.dts b/target/linux/ramips/dts/mt7621_linksys_re6500.dts index 319d0d7fb..3a2e42e77 100644 --- a/target/linux/ramips/dts/mt7621_linksys_re6500.dts +++ b/target/linux/ramips/dts/mt7621_linksys_re6500.dts @@ -116,13 +116,22 @@ mtd-mac-address = <&factory 0x2e>; }; +&gmac1 { + status = "okay"; + label = "lan1"; + phy-handle = <ðphy0>; + + mtd-mac-address = <&factory 0x2e>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "lan1"; - }; - port@1 { status = "okay"; label = "lan2"; diff --git a/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts b/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts index 811b02fe0..ae6d89fbb 100644 --- a/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts +++ b/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts @@ -116,6 +116,21 @@ mtd-mac-address = <&factory 0x5>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + mtd-mac-address = <&factory 0x5>; + mtd-mac-address-increment = <1>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -137,13 +152,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0x5>; - mtd-mac-address-increment = <1>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts b/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts index dcdcc261b..2da7f983a 100644 --- a/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts +++ b/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts @@ -39,6 +39,18 @@ status = "okay"; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -60,11 +72,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-750gr3.dts b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-750gr3.dts index 7f329b235..aad8a6776 100644 --- a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-750gr3.dts +++ b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-750gr3.dts @@ -35,3 +35,23 @@ function = "gpio"; }; }; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +&switch0 { + ports { + port@0 { + status = "disabled"; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts index d457c4342..223d03b9f 100644 --- a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts +++ b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts @@ -90,13 +90,20 @@ }; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - }; - port@1 { status = "okay"; label = "lan1"; diff --git a/target/linux/ramips/dts/mt7621_mqmaker_witi.dts b/target/linux/ramips/dts/mt7621_mqmaker_witi.dts index 45901474d..275baf5c7 100644 --- a/target/linux/ramips/dts/mt7621_mqmaker_witi.dts +++ b/target/linux/ramips/dts/mt7621_mqmaker_witi.dts @@ -97,6 +97,21 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + mtd-mac-address = <&factory 0xe000>; + mtd-mac-address-increment = <1>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -118,13 +133,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe000>; - mtd-mac-address-increment = <1>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi index 1a19cd048..96c7e001a 100644 --- a/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi @@ -110,6 +110,21 @@ mtd-mac-address = <&factory 0x4>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + mtd-mac-address = <&factory 0x4>; + mtd-mac-address-increment = <1>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -131,13 +146,6 @@ status = "okay"; label = "lan1"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0x4>; - mtd-mac-address-increment = <1>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi index 71c95e75b..de695b467 100644 --- a/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi @@ -165,6 +165,21 @@ mtd-mac-address = <&factory 0x4>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + mtd-mac-address = <&factory 0x4>; + mtd-mac-address-increment = <2>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -186,13 +201,6 @@ status = "okay"; label = "lan1"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0x4>; - mtd-mac-address-increment = <2>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi index 7a15cd1f6..36909015b 100644 --- a/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi @@ -99,6 +99,21 @@ mtd-mac-address = <&factory 0x4>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + mtd-mac-address = <&factory 0x4>; + mtd-mac-address-increment = <2>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -120,13 +135,6 @@ status = "okay"; label = "lan1"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0x4>; - mtd-mac-address-increment = <2>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_netis_wf2881.dts b/target/linux/ramips/dts/mt7621_netis_wf2881.dts index 7dfd133a4..902e765c8 100644 --- a/target/linux/ramips/dts/mt7621_netis_wf2881.dts +++ b/target/linux/ramips/dts/mt7621_netis_wf2881.dts @@ -125,6 +125,19 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -146,12 +159,6 @@ status = "okay"; label = "lan1"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_oraybox_x3a.dts b/target/linux/ramips/dts/mt7621_oraybox_x3a.dts index a97b0900a..fd7a8e6ec 100644 --- a/target/linux/ramips/dts/mt7621_oraybox_x3a.dts +++ b/target/linux/ramips/dts/mt7621_oraybox_x3a.dts @@ -128,6 +128,22 @@ nvmem-cell-names = "mac-address"; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_bdinfo_9>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@2 { @@ -139,14 +155,6 @@ status = "okay"; label = "lan1"; }; - - port@4 { - status = "okay"; - label = "wan"; - nvmem-cells = <&macaddr_bdinfo_9>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_planex_vr500.dts b/target/linux/ramips/dts/mt7621_planex_vr500.dts index 5f8f190a9..a75e2d375 100644 --- a/target/linux/ramips/dts/mt7621_planex_vr500.dts +++ b/target/linux/ramips/dts/mt7621_planex_vr500.dts @@ -78,6 +78,19 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -99,12 +112,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts b/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts index 9561c97b7..ec9f74381 100644 --- a/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts +++ b/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts @@ -109,6 +109,19 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -130,12 +143,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts b/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts index d44960a9a..b6f3a9489 100644 --- a/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts +++ b/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts @@ -105,6 +105,21 @@ mtd-mac-address = <&factory 0xe006>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + mtd-mac-address = <&factory 0xe006>; + mtd-mac-address-increment = <1>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -126,13 +141,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - mtd-mac-address-increment = <1>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts b/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts index ef0d48b8c..3768dd3b5 100644 --- a/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts +++ b/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts @@ -14,7 +14,7 @@ led-failsafe = &led_red; led-running = &led_blue; led-upgrade = &led_red; - label-mac-device = &wan_port; + label-mac-device = &gmac1; }; chosen { @@ -112,14 +112,21 @@ mtd-mac-address = <&factory 0x4>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + mtd-mac-address = <&factory 0x28>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - wan_port: port@0 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0x28>; - }; - port@1 { status = "okay"; label = "lan1"; diff --git a/target/linux/ramips/dts/mt7621_totolink_a7000r.dts b/target/linux/ramips/dts/mt7621_totolink_a7000r.dts index d0e38f172..396df1c4e 100644 --- a/target/linux/ramips/dts/mt7621_totolink_a7000r.dts +++ b/target/linux/ramips/dts/mt7621_totolink_a7000r.dts @@ -103,6 +103,21 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + mtd-mac-address = <&factory 0xe000>; + mtd-mac-address-increment = <1>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -124,13 +139,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe000>; - mtd-mac-address-increment = <1>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_totolink_x5000r.dts b/target/linux/ramips/dts/mt7621_totolink_x5000r.dts index ef491087e..5d9552baf 100644 --- a/target/linux/ramips/dts/mt7621_totolink_x5000r.dts +++ b/target/linux/ramips/dts/mt7621_totolink_x5000r.dts @@ -100,6 +100,19 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -121,12 +134,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts index 01f338186..634e07de2 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts @@ -165,15 +165,23 @@ mtd-mac-address = <&config 0x8>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + + mtd-mac-address = <&config 0x8>; + mtd-mac-address-increment = <1>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&config 0x8>; - mtd-mac-address-increment = <1>; - }; - port@1 { status = "okay"; label = "lan1"; diff --git a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dts b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dts index bca7c6169..18eb7d1c3 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dts @@ -4,3 +4,25 @@ model = "Ubiquiti EdgeRouter X"; compatible = "ubnt,edgerouter-x", "mediatek,mt7621-soc"; }; + +&gmac1 { + status = "okay"; + label = "eth0"; + phy-handle = <ðphy0>; + + mtd-mac-address = <&factory 0x22>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +&switch0 { + ports { + port@0 { + status = "disabled"; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi b/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi index 3b149df85..d976c0981 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi @@ -77,6 +77,21 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + mtd-mac-address = <&factory 0xe000>; + mtd-mac-address-increment = <1>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -98,13 +113,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe000>; - mtd-mac-address-increment = <1>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts index e8f3a50db..19eee423b 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts @@ -179,6 +179,19 @@ mtd-mac-address = <&factory 0xe006>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe000>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@1 { @@ -195,12 +208,6 @@ status = "okay"; label = "lan1"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe000>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4.dts index 18cbe0c01..589a3ee2d 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4.dts @@ -68,6 +68,19 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@1 { @@ -79,12 +92,6 @@ status = "okay"; label = "lan1"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-3g-v2.dtsi b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-3g-v2.dtsi index 4c469a283..a0ee79ae2 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-3g-v2.dtsi +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-3g-v2.dtsi @@ -11,7 +11,7 @@ led-failsafe = &led_status_yellow; led-running = &led_status_blue; led-upgrade = &led_status_yellow; - label-mac-device = &wan; + label-mac-device = &gmac1; }; chosen { @@ -135,6 +135,21 @@ nvmem-cell-names = "mac-address"; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_factory_e006>; + nvmem-cell-names = "mac-address"; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@2 { @@ -146,13 +161,6 @@ status = "okay"; label = "lan1"; }; - - wan: port@4 { - status = "okay"; - label = "wan"; - nvmem-cells = <&macaddr_factory_e006>; - nvmem-cell-names = "mac-address"; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts b/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts index a77d13c71..d1752d190 100644 --- a/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts +++ b/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts @@ -128,14 +128,21 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &switch0 { ports { - port@0 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; - port@1 { status = "okay"; label = "lan1"; diff --git a/target/linux/ramips/dts/mt7621_youku_yk-l2.dts b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts index 627188873..092848a3b 100644 --- a/target/linux/ramips/dts/mt7621_youku_yk-l2.dts +++ b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts @@ -136,6 +136,19 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -157,12 +170,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts index cd71166f4..75847c59f 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts @@ -77,6 +77,19 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -98,12 +111,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts index 10e08cd3d..82b3afa93 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts @@ -99,6 +99,19 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + mtd-mac-address = <&factory 0xe006>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &switch0 { ports { port@0 { @@ -120,12 +133,6 @@ status = "okay"; label = "lan4"; }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; }; }; From 1ccc3bfd54f7d9a2a2a02f2cb2b062452ea8d830 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Mon, 29 Aug 2022 23:15:56 +0800 Subject: [PATCH 7/9] ramips: mt7621: fixes dsa hnat support --- target/linux/ramips/dts/mt7621.dtsi | 14 ++++---------- target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts | 7 +++++++ .../ramips/dts/mt7621_hatlab_gateboard-one.dts | 14 +++++++++----- target/linux/ramips/dts/mt7621_jcg_q20.dts | 4 ++++ target/linux/ramips/dts/mt7621_jcg_y2.dts | 7 +++++++ target/linux/ramips/dts/mt7621_phicomm_k2p.dts | 7 +++++++ .../ramips/dts/mt7621_raisecom_msg1500-x-00.dts | 7 +++++++ .../ramips/dts/mt7621_xiaomi_mi-router-cr660x.dts | 7 +++++++ .../ramips/dts/mt7621_xiaomi_router-ac2100.dtsi | 7 +++++++ target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts | 7 +++++++ .../files/drivers/net/ethernet/mtk/mtk_eth_soc.c | 4 ++++ 11 files changed, 70 insertions(+), 15 deletions(-) diff --git a/target/linux/ramips/dts/mt7621.dtsi b/target/linux/ramips/dts/mt7621.dtsi index d25c1b2b9..ff29244ca 100644 --- a/target/linux/ramips/dts/mt7621.dtsi +++ b/target/linux/ramips/dts/mt7621.dtsi @@ -490,13 +490,7 @@ compatible = "mediatek,eth-mac"; reg = <1>; status = "disabled"; - phy-mode = "rgmii"; - - fixed-link { - speed = <1000>; - full-duplex; - pause; - }; + phy-mode = "rgmii-rxid"; }; mdio: mdio-bus { @@ -563,8 +557,8 @@ hnat: hnat@1e100000 { compatible = "mediatek,mtk-hnat_v1"; - /* ext-devices = "apcli0", "apclii0","apclix0", - "ra0", "rai0", "rax0", "wlan0", "wlan1"; */ + ext-devices = "apcli0", "apclii0","apclix0", + "ra0", "rai0", "rax0", "wlan0", "wlan1"; reg = <0x1e100000 0x3000>; resets = <ðsys 0>; @@ -573,7 +567,7 @@ mtketh-wan = "wan"; mtketh-ppd = "lan"; mtketh-lan = "lan"; - mtketh-max-gmac = <1>; + mtketh-max-gmac = <2>; mtkdsa-wan-port = <4>; }; diff --git a/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts b/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts index 50e47a543..7d3573a71 100644 --- a/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts +++ b/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts @@ -113,7 +113,14 @@ &gmac1 { mtd-mac-address = <&factory 0xe000>; mtd-mac-address-increment = <1>; + phy-mode = "rgmii"; status = "okay"; + + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; }; &gsw { diff --git a/target/linux/ramips/dts/mt7621_hatlab_gateboard-one.dts b/target/linux/ramips/dts/mt7621_hatlab_gateboard-one.dts index 3fa75d9f8..4592bb030 100644 --- a/target/linux/ramips/dts/mt7621_hatlab_gateboard-one.dts +++ b/target/linux/ramips/dts/mt7621_hatlab_gateboard-one.dts @@ -61,11 +61,11 @@ cpu_fan: cpu_fan { compatible = "gpio-fan"; gpios = <&gpio 13 GPIO_ACTIVE_HIGH - &gpio 14 GPIO_ACTIVE_HIGH>; - gpio-fan,speed-map = < 0 0 - 2000 1 - 4000 2 - 6000 3>; + &gpio 14 GPIO_ACTIVE_HIGH>; + gpio-fan,speed-map = < 0 0 + 2000 1 + 4000 2 + 6000 3>; #cooling-cells = <2>; }; @@ -214,6 +214,10 @@ mtd-mac-address-increment = <6>; }; +&hnat { + mtketh-wan = "eth5"; +}; + &switch0 { ports { port@0 { diff --git a/target/linux/ramips/dts/mt7621_jcg_q20.dts b/target/linux/ramips/dts/mt7621_jcg_q20.dts index 5464ca06c..3f4978c72 100644 --- a/target/linux/ramips/dts/mt7621_jcg_q20.dts +++ b/target/linux/ramips/dts/mt7621_jcg_q20.dts @@ -160,6 +160,10 @@ }; }; +&hnat { + mtkdsa-wan-port = <0>; +}; + &switch0 { ports { port@1 { diff --git a/target/linux/ramips/dts/mt7621_jcg_y2.dts b/target/linux/ramips/dts/mt7621_jcg_y2.dts index bd88923f7..ccbe9f8c1 100644 --- a/target/linux/ramips/dts/mt7621_jcg_y2.dts +++ b/target/linux/ramips/dts/mt7621_jcg_y2.dts @@ -94,7 +94,14 @@ &gmac1 { mtd-mac-address = <&factory 0xe006>; + phy-mode = "rgmii"; status = "okay"; + + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; }; &gsw { diff --git a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts index ad64ee5d5..01fb5e866 100644 --- a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts +++ b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts @@ -107,7 +107,14 @@ &gmac1 { mtd-mac-address = <&factory 0xe006>; + phy-mode = "rgmii"; status = "okay"; + + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; }; &gsw { diff --git a/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts b/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts index f38f150be..5b55487b7 100644 --- a/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts +++ b/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts @@ -115,7 +115,14 @@ }; &gmac1 { + phy-mode = "rgmii"; status = "okay"; + + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; }; &gsw { diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dts index 2057deca9..b5d2d9a19 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dts @@ -135,7 +135,14 @@ &gmac1 { mtd-mac-address = <&factory 0x3fffa>; + phy-mode = "rgmii"; status = "okay"; + + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; }; &gsw { diff --git a/target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi b/target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi index 9d6b5428a..7df108072 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi +++ b/target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi @@ -30,7 +30,14 @@ &gmac1 { mtd-mac-address = <&factory 0xe006>; + phy-mode = "rgmii"; status = "okay"; + + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; }; &gsw { diff --git a/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts b/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts index 57e6cc42a..5bda61cbc 100644 --- a/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts +++ b/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts @@ -91,7 +91,14 @@ &gmac1 { mtd-mac-address = <&factory 0x4>; mtd-mac-address-increment = <1>; + phy-mode = "rgmii"; status = "okay"; + + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; }; &gsw { diff --git a/target/linux/ramips/files/drivers/net/ethernet/mtk/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/mtk/mtk_eth_soc.c index c811c7006..12cfc089e 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/mtk/mtk_eth_soc.c +++ b/target/linux/ramips/files/drivers/net/ethernet/mtk/mtk_eth_soc.c @@ -3400,6 +3400,7 @@ static const struct net_device_ops mtk_netdev_ops = { static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) { + const char *name = of_get_property(np, "label", NULL); const __be32 *_id = of_get_property(np, "reg", NULL); struct phylink *phylink; int phy_mode, id, err; @@ -3490,6 +3491,9 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) eth->netdev[id]->irq = eth->irq[0]; eth->netdev[id]->dev.of_node = np; + if (name) + strlcpy(eth->netdev[id]->name, name, IFNAMSIZ); + return 0; free_netdev: From 4e90e9afc851d336bae70af1faec7407d00922a7 Mon Sep 17 00:00:00 2001 From: Alex <93376818+sashashura@users.noreply.github.com> Date: Mon, 29 Aug 2022 20:33:26 +0100 Subject: [PATCH 8/9] github workflows: security hardening This PR adds explicit permissions section to workflows. This is a security best practice because by default workflows run with extended set of permissions (except from on: pull_request from external forks). By specifying any permission explicitly all others are set to none. By using the principle of least privilege the damage a compromised workflow can do (because of an injection or compromised third party tool or action) is restricted. It is recommended to have most strict permissions on the top level and grant write permissions on job level case by case. --- .github/workflows/openwrt-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/openwrt-ci.yml b/.github/workflows/openwrt-ci.yml index 8677e5250..00a4d6000 100644 --- a/.github/workflows/openwrt-ci.yml +++ b/.github/workflows/openwrt-ci.yml @@ -12,11 +12,17 @@ on: - cron: 0 20 * * * release: types: [published] + +permissions: + contents: read jobs: build_openwrt: + permissions: + contents: write # for release creation + name: Build OpenWrt firmware runs-on: ubuntu-latest From 0e14f147653461e7d9ffd30291c4f109171a532d Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 27 Aug 2022 23:11:30 +0200 Subject: [PATCH 9/9] mbedtls: update to version 2.28.1 Changelog: https://github.com/Mbed-TLS/mbedtls/releases/tag/v2.28.1 This release of Mbed TLS provides bug fixes and minor enhancements. This release includes fixes for security issues. Signed-off-by: Hauke Mehrtens --- package/libs/mbedtls/Makefile | 4 +- .../mbedtls/patches/100-fix-compile.patch | 22 ++++++++++ package/libs/mbedtls/patches/200-config.patch | 44 +++++++++---------- 3 files changed, 46 insertions(+), 24 deletions(-) create mode 100644 package/libs/mbedtls/patches/100-fix-compile.patch diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index 5a37a8a1e..99d6330b6 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mbedtls -PKG_VERSION:=2.28.0 +PKG_VERSION:=2.28.1 PKG_RELEASE:=$(AUTORELEASE) PKG_USE_MIPS16:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=6519579b836ed78cc549375c7c18b111df5717e86ca0eeff4cb64b2674f424cc +PKG_HASH:=6797a7b6483ef589deeab8d33d401ed235d7be25eeecda1be8ddfed406d40ff4 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0-or-later diff --git a/package/libs/mbedtls/patches/100-fix-compile.patch b/package/libs/mbedtls/patches/100-fix-compile.patch new file mode 100644 index 000000000..c3b26ac9c --- /dev/null +++ b/package/libs/mbedtls/patches/100-fix-compile.patch @@ -0,0 +1,22 @@ +Fix a compile problem introduced in commit 331c3421d1f0 ("Address review comments") + +Bug report: https://github.com/Mbed-TLS/mbedtls/issues/6243 + +--- a/programs/ssl/ssl_server2.c ++++ b/programs/ssl/ssl_server2.c +@@ -2511,7 +2511,6 @@ int main( int argc, char *argv[] ) + } + key_cert_init2 = 2; + #endif /* MBEDTLS_ECDSA_C */ +- } + + #if defined(MBEDTLS_USE_PSA_CRYPTO) + if( opt.key_opaque != 0 ) +@@ -2540,6 +2539,7 @@ int main( int argc, char *argv[] ) + } + #endif /* MBEDTLS_USE_PSA_CRYPTO */ + #endif /* MBEDTLS_CERTS_C */ ++ } + + mbedtls_printf( " ok (key types: %s - %s)\n", mbedtls_pk_get_name( &pkey ), mbedtls_pk_get_name( &pkey2 ) ); + #endif /* MBEDTLS_X509_CRT_PARSE_C */ diff --git a/package/libs/mbedtls/patches/200-config.patch b/package/libs/mbedtls/patches/200-config.patch index faf5bb5db..54d4cf431 100644 --- a/package/libs/mbedtls/patches/200-config.patch +++ b/package/libs/mbedtls/patches/200-config.patch @@ -1,6 +1,6 @@ --- a/include/mbedtls/config.h +++ b/include/mbedtls/config.h -@@ -665,14 +665,14 @@ +@@ -670,14 +670,14 @@ * * Enable Output Feedback mode (OFB) for symmetric ciphers. */ @@ -17,7 +17,7 @@ /** * \def MBEDTLS_CIPHER_NULL_CIPHER -@@ -790,20 +790,20 @@ +@@ -795,20 +795,20 @@ * Comment macros to disable the curve and functions for it */ /* Short Weierstrass curves (supporting ECP, ECDH, ECDSA) */ @@ -47,7 +47,7 @@ /** * \def MBEDTLS_ECP_NIST_OPTIM -@@ -956,7 +956,7 @@ +@@ -961,7 +961,7 @@ * See dhm.h for more details. * */ @@ -56,7 +56,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED -@@ -976,7 +976,7 @@ +@@ -981,7 +981,7 @@ * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA */ @@ -65,7 +65,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED -@@ -1001,7 +1001,7 @@ +@@ -1006,7 +1006,7 @@ * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA */ @@ -74,7 +74,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED -@@ -1135,7 +1135,7 @@ +@@ -1140,7 +1140,7 @@ * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 */ @@ -83,7 +83,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED -@@ -1159,7 +1159,7 @@ +@@ -1164,7 +1164,7 @@ * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 */ @@ -92,7 +92,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED -@@ -1263,7 +1263,7 @@ +@@ -1268,7 +1268,7 @@ * This option is only useful if both MBEDTLS_SHA256_C and * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used. */ @@ -101,7 +101,7 @@ /** * \def MBEDTLS_ENTROPY_NV_SEED -@@ -1478,14 +1478,14 @@ +@@ -1483,14 +1483,14 @@ * Uncomment this macro to disable the use of CRT in RSA. * */ @@ -118,7 +118,7 @@ /** * \def MBEDTLS_SHA256_SMALLER -@@ -1756,7 +1756,7 @@ +@@ -1761,7 +1761,7 @@ * configuration of this extension). * */ @@ -127,7 +127,7 @@ /** * \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO -@@ -2017,7 +2017,7 @@ +@@ -2022,7 +2022,7 @@ * * Comment this macro to disable support for truncated HMAC in SSL */ @@ -136,7 +136,7 @@ /** * \def MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT -@@ -2185,7 +2185,7 @@ +@@ -2201,7 +2201,7 @@ * * Comment this to disable run-time checking and save ROM space */ @@ -145,7 +145,7 @@ /** * \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 -@@ -2534,7 +2534,7 @@ +@@ -2550,7 +2550,7 @@ * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 */ @@ -154,7 +154,7 @@ /** * \def MBEDTLS_ARIA_C -@@ -2600,7 +2600,7 @@ +@@ -2616,7 +2616,7 @@ * This module enables the AES-CCM ciphersuites, if other requisites are * enabled as well. */ @@ -163,7 +163,7 @@ /** * \def MBEDTLS_CERTS_C -@@ -2612,7 +2612,7 @@ +@@ -2628,7 +2628,7 @@ * * This module is used for testing (ssl_client/server). */ @@ -172,7 +172,7 @@ /** * \def MBEDTLS_CHACHA20_C -@@ -2725,7 +2725,7 @@ +@@ -2741,7 +2741,7 @@ * \warning DES is considered a weak cipher and its use constitutes a * security risk. We recommend considering stronger ciphers instead. */ @@ -181,7 +181,7 @@ /** * \def MBEDTLS_DHM_C -@@ -2890,7 +2890,7 @@ +@@ -2906,7 +2906,7 @@ * This module adds support for the Hashed Message Authentication Code * (HMAC)-based key derivation function (HKDF). */ @@ -190,7 +190,7 @@ /** * \def MBEDTLS_HMAC_DRBG_C -@@ -3203,7 +3203,7 @@ +@@ -3219,7 +3219,7 @@ * * This module enables abstraction of common (libc) functions. */ @@ -199,7 +199,7 @@ /** * \def MBEDTLS_POLY1305_C -@@ -3279,7 +3279,7 @@ +@@ -3295,7 +3295,7 @@ * Caller: library/md.c * */ @@ -208,7 +208,7 @@ /** * \def MBEDTLS_RSA_C -@@ -3486,7 +3486,7 @@ +@@ -3506,7 +3506,7 @@ * * This module provides run-time version information. */ @@ -217,12 +217,12 @@ /** * \def MBEDTLS_X509_USE_C -@@ -3596,7 +3596,7 @@ +@@ -3616,7 +3616,7 @@ * Module: library/xtea.c * Caller: */ -#define MBEDTLS_XTEA_C +//#define MBEDTLS_XTEA_C - /* \} name SECTION: mbed TLS modules */ + /** \} name SECTION: mbed TLS modules */