diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index b81ad91bdf..4988a4f6de 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -33,6 +33,7 @@ xiaomi,miwifi-nano|\ zbtlink,zbt-wg2626) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000" ;; +linksys,ea7500-v2|\ xiaomi,mir3p|\ xiaomi,mir3g|\ xiaomi,miwifi-r3|\ diff --git a/package/system/mtd/src/Makefile b/package/system/mtd/src/Makefile index 375dc97df4..4fd17b0dc7 100644 --- a/package/system/mtd/src/Makefile +++ b/package/system/mtd/src/Makefile @@ -11,7 +11,7 @@ obj.brcm = trx.o obj.bcm47xx = $(obj.brcm) obj.bcm53xx = $(obj.brcm) $(obj.seama) obj.bcm63xx = imagetag.o -obj.ramips = $(obj.seama) $(obj.wrg) +obj.ramips = $(obj.seama) $(obj.wrg) linksys_bootcount.o obj.mvebu = linksys_bootcount.o obj.kirkwood = linksys_bootcount.o obj.ipq806x = linksys_bootcount.o diff --git a/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts b/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts index a65654e78b..2afaf52fd7 100644 --- a/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts +++ b/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts @@ -106,6 +106,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts b/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts index 95bd9b57da..329d78f481 100644 --- a/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts +++ b/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts @@ -80,10 +80,12 @@ }; ðernet { - mtd-mac-address = <&factory 0x28>; - mediatek,portmap = "llllw"; pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + + mtd-mac-address = <&factory 0x28>; + + mediatek,portmap = "llllw"; }; &gpio1 { diff --git a/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts b/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts index eb19f7da99..eccbdee717 100644 --- a/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts +++ b/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts @@ -1,9 +1,6 @@ /dts-v1/; -#include "mt7620a.dtsi" - -#include -#include +#include "mt7620a_asus_rt-ac5x.dtsi" / { compatible = "asus,rt-ac51u", "ralink,mt7620a-soc"; @@ -38,93 +35,10 @@ linux,default-trigger = "phy1tpt"; }; }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wps { - label = "wps"; - gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; -}; - -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0xfb0000>; - }; - }; - }; -}; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - -&gpio0 { - enable-leds { - gpio-hog; - line-name = "enable-leds"; - output-low; - gpios = <10 GPIO_ACTIVE_HIGH>; - }; -}; - -&gpio3 { - status = "okay"; }; ðernet { - status = "okay"; mtd-mac-address = <&factory 0x28>; - mediatek,portmap = "wllll"; -}; - -&wmac { - ralink,mtd-eeprom = <&factory 0x0>; }; &state_default { @@ -134,10 +48,6 @@ }; }; -&pcie { - status = "okay"; -}; - &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; diff --git a/target/linux/ramips/dts/mt7620a_asus_rt-ac54u.dts b/target/linux/ramips/dts/mt7620a_asus_rt-ac54u.dts new file mode 100644 index 0000000000..f7e64994d8 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_asus_rt-ac54u.dts @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7620a_asus_rt-ac5x.dtsi" + +/ { + compatible = "asus,rt-ac54u", "ralink,mt7620a-soc"; + model = "Asus RT-AC54U"; + + aliases { + label-mac-device = ðernet; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "rt-ac54u:blue:power"; + gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "rt-ac54u:blue:usb"; + gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + trigger-sources = <&ohci_port1>, <&ehci_port1>; + linux,default-trigger = "usbport"; + }; + + wifi2g { + label = "rt-ac54u:blue:wifi2g"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; +}; + +&state_default { + gpio { + groups = "i2c", "wled", "uartf"; + function = "gpio"; + }; +}; + +&pcie0 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + + led { + led-sources = <2>; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi b/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi new file mode 100644 index 0000000000..3813efaa53 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi @@ -0,0 +1,97 @@ +#include "mt7620a.dtsi" + +#include +#include + +/ { + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + + spi-max-frequency = <50000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +&gpio0 { + enable-leds { + gpio-hog; + line-name = "enable-leds"; + output-low; + gpios = <10 GPIO_ACTIVE_HIGH>; + }; +}; + +&gpio3 { + status = "okay"; +}; + +ðernet { + mediatek,portmap = "wllll"; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0x0>; +}; + +&pcie { + status = "okay"; +}; diff --git a/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts b/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts index 878c720c39..c9ecf78573 100644 --- a/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts +++ b/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts @@ -123,6 +123,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts index c35abf241e..927a150743 100644 --- a/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts +++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts @@ -140,7 +140,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts index e95daf9b34..fd36f160a4 100644 --- a/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts +++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts @@ -140,7 +140,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dir-810l.dts b/target/linux/ramips/dts/mt7620a_dlink_dir-810l.dts index 9e60b42f71..8f6bf971ec 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dir-810l.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dir-810l.dts @@ -126,6 +126,7 @@ ðernet { mtd-mac-address = <&factory 0x28>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts index a01ef25bfa..17df95b374 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts @@ -155,7 +155,6 @@ }; ðernet { - status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts index d795c06b50..c54c85c420 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts @@ -153,11 +153,11 @@ }; ðernet { - status = "okay"; - mediatek,portmap = "wllll"; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &mdio_pins>; + mediatek,portmap = "wllll"; + port@4 { status = "okay"; phy-handle = <&phy0>; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-960.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-960.dts index 71ed648d41..ee8a48a08d 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-960.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-960.dts @@ -91,10 +91,9 @@ }; ðernet { - status = "okay"; - pinctrl-names = "default"; pinctrl-0 = <&rgmii2_pins &mdio_pins>; + mediatek,portmap = "wllll"; port@5 { diff --git a/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts b/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts index ed98c605f8..6eab114fa5 100644 --- a/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts +++ b/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts @@ -112,9 +112,9 @@ }; ðernet { - status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; + mediatek,portmap = "llllw"; port@4 { diff --git a/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts index 1c9ffc8dfc..977f0aa356 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts @@ -138,10 +138,11 @@ }; ðernet { - status = "okay"; - mtd-mac-address = <&factory 0x4>; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; + + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; port@5 { diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts index d50a770968..966c47b465 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts @@ -123,10 +123,11 @@ }; ðernet { - status = "okay"; - mtd-mac-address = <&factory 0x4>; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; + + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; port@5 { diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi index 11cf9bb291..4f2745286d 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi @@ -115,13 +115,11 @@ }; ðernet { - status = "okay"; - - mtd-mac-address = <&factory 0x4>; - pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &mdio_pins &phy_reset_pins>; + mtd-mac-address = <&factory 0x4>; + mediatek,mdio-mode = <1>; phy-reset-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; diff --git a/target/linux/ramips/dts/mt7620a_engenius_esr600.dts b/target/linux/ramips/dts/mt7620a_engenius_esr600.dts index d7dbb1bfa4..92d9008c69 100644 --- a/target/linux/ramips/dts/mt7620a_engenius_esr600.dts +++ b/target/linux/ramips/dts/mt7620a_engenius_esr600.dts @@ -136,9 +136,9 @@ }; ðernet { - status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &mdio_pins>; + mtd-mac-address = <&iNIC_rf 0x4>; port@5 { diff --git a/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts index 6fad06d116..f414e3108c 100644 --- a/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts +++ b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts @@ -138,6 +138,7 @@ ðernet { mtd-mac-address = <&factory 0x4000>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts index 693a6bfa6f..281ba366f1 100644 --- a/target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts +++ b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts @@ -129,6 +129,7 @@ ðernet { mtd-mac-address = <&factory 0x4000>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts b/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts index 4e9616367a..a772bca605 100644 --- a/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts +++ b/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts @@ -133,6 +133,7 @@ ðernet { mtd-mac-address = <&factory 0x4000>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts b/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts index abc13ee7d0..e52a564213 100644 --- a/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts +++ b/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts @@ -122,12 +122,11 @@ }; ðernet { - status = "okay"; - - mtd-mac-address = <&factory 0x4>; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; + mtd-mac-address = <&factory 0x4>; + port@4 { status = "okay"; phy-handle = <&phy4>; diff --git a/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts b/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts index 83a3a67ed0..8951044f63 100644 --- a/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts @@ -71,10 +71,11 @@ }; ðernet { - status = "okay"; - mtd-mac-address = <&factory 0x4>; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &mdio_pins>; + + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; port@5 { diff --git a/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi b/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi index e3494f9cb6..0676c6f84b 100644 --- a/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi @@ -111,7 +111,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts b/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts index 1cc59e4bb6..60a67c6eac 100644 --- a/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts +++ b/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts @@ -139,6 +139,7 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &mdio_pins>; + mtd-mac-address = <&factory 0x4>; port@5 { diff --git a/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts b/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts index 098aaa007f..02f620fbf3 100644 --- a/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts +++ b/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts @@ -147,6 +147,7 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins>; + mtd-mac-address = <&factory 0x4>; port@5 { diff --git a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts index c1406503eb..b05a7a89b4 100644 --- a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts +++ b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts @@ -110,7 +110,6 @@ }; ðernet { - status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; diff --git a/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts b/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts new file mode 100644 index 0000000000..641b5ad7b1 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts @@ -0,0 +1,172 @@ +// SPDX-License-Identifier: GPL-2.0 + +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "lb-link,bl-w1200", "ralink,mt7620a-soc"; + model = "LB-Link BL-W1200"; + + aliases { + led-boot = &led_wps; + led-failsafe = &led_wps; + led-upgrade = &led_wps; + }; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + keys { + compatible = "gpio-keys"; + + reset_wps { + label = "reset_wps"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_wps: wps { + label = "bl-w1200:green:wps"; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "uartf", "spi refclk"; + function = "gpio"; + }; +}; + +ðernet { + pinctrl-names = "default"; + pinctrl-0 = <&rgmii2_pins &mdio_pins>; + + mtd-mac-address = <&factory 0x28>; + + mediatek,portmap = "wllll"; + + port@5 { + status = "okay"; + mediatek,fixed-link = <1000 1 1 1>; + phy-mode = "rgmii"; + }; + + mdio-bus { + status = "okay"; + + ethernet-phy@0 { + reg = <0>; + phy-mode = "rgmii"; + }; + + ethernet-phy@1 { + reg = <1>; + phy-mode = "rgmii"; + }; + + ethernet-phy@2 { + reg = <2>; + phy-mode = "rgmii"; + }; + + ethernet-phy@3 { + reg = <3>; + phy-mode = "rgmii"; + }; + + ethernet-phy@4 { + reg = <4>; + phy-mode = "rgmii"; + }; + + ethernet-phy@1f { + reg = <0x1f>; + phy-mode = "rgmii"; + }; + }; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0x0>; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <5000000 6000000>; + mediatek,mtd-eeprom = <&factory 0x8000>; + + led { + led-sources = <2>; + led-active-low; + }; + }; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; diff --git a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts index 2b98d6c55f..88c747e2d6 100644 --- a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts +++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts @@ -54,6 +54,8 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x28>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts index de01b480e5..60cd501aeb 100644 --- a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts +++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts @@ -78,10 +78,11 @@ }; ðernet { - status = "okay"; - mtd-mac-address = <&factory 0x28>; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; + + mtd-mac-address = <&factory 0x28>; + mediatek,portmap = "wllll"; port@4 { diff --git a/target/linux/ramips/dts/mt7620a_linksys_e1700.dts b/target/linux/ramips/dts/mt7620a_linksys_e1700.dts index ed74068c80..2eb3033b44 100644 --- a/target/linux/ramips/dts/mt7620a_linksys_e1700.dts +++ b/target/linux/ramips/dts/mt7620a_linksys_e1700.dts @@ -105,11 +105,11 @@ }; ðernet { - status = "okay"; - mtd-mac-address = <&factory 0x28>; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; + mtd-mac-address = <&factory 0x28>; + port@5 { status = "okay"; mediatek,fixed-link = <1000 1 1 1>; diff --git a/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts b/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts index 037a8858f7..b432bcf9f1 100644 --- a/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts +++ b/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts @@ -89,7 +89,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_netis_wf2770.dts b/target/linux/ramips/dts/mt7620a_netis_wf2770.dts new file mode 100644 index 0000000000..a0e9cfff10 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_netis_wf2770.dts @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "netis,wf2770", "ralink,mt7620a-soc"; + model = "NETIS WF2770"; + + leds { + compatible = "gpio-leds"; + + wlan { + label = "wf2770:blue:wlan"; + gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + rfkill { + label = "rfkill"; + gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + led-toggle { + label = "led-toggle"; + gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uartf"; + function = "gpio"; + }; +}; + +ðernet { + pinctrl-names = "default"; + pinctrl-0 = <&rgmii1_pins &mdio_pins>; + + mtd-mac-address = <&factory 0x4>; + + port@5 { + status = "okay"; + mediatek,fixed-link = <1000 1 1 1>; + phy-mode = "rgmii"; + }; + + mdio-bus { + status = "okay"; + + ethernet-phy@0 { + reg = <0>; + phy-mode = "rgmii"; + }; + + ethernet-phy@1 { + reg = <1>; + phy-mode = "rgmii"; + }; + + ethernet-phy@2 { + reg = <2>; + phy-mode = "rgmii"; + }; + + ethernet-phy@3 { + reg = <3>; + phy-mode = "rgmii"; + }; + + ethernet-phy@4 { + reg = <4>; + phy-mode = "rgmii"; + }; + + ethernet-phy@1f { + reg = <0x1f>; + phy-mode = "rgmii"; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0x0>; +}; diff --git a/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts b/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts index 4a2006da07..9992bb8b01 100644 --- a/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts +++ b/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts @@ -103,7 +103,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x28>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_phicomm_k2g.dts b/target/linux/ramips/dts/mt7620a_phicomm_k2g.dts index 382a1d7913..a878c43054 100644 --- a/target/linux/ramips/dts/mt7620a_phicomm_k2g.dts +++ b/target/linux/ramips/dts/mt7620a_phicomm_k2g.dts @@ -103,7 +103,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&rgmii2_pins &mdio_pins>; + mtd-mac-address = <&factory 0x28>; + mediatek,portmap = "llllw"; port@5 { diff --git a/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts b/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts index 5ed0724259..a0c7fe91bc 100644 --- a/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts +++ b/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts @@ -99,7 +99,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_phicomm_psg1218a.dts b/target/linux/ramips/dts/mt7620a_phicomm_psg1218a.dts index 0d9ef767c4..71cf56c554 100644 --- a/target/linux/ramips/dts/mt7620a_phicomm_psg1218a.dts +++ b/target/linux/ramips/dts/mt7620a_phicomm_psg1218a.dts @@ -44,7 +44,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x28>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_phicomm_psg1218b.dts b/target/linux/ramips/dts/mt7620a_phicomm_psg1218b.dts index 7f9fea2b07..2932b5a3dc 100644 --- a/target/linux/ramips/dts/mt7620a_phicomm_psg1218b.dts +++ b/target/linux/ramips/dts/mt7620a_phicomm_psg1218b.dts @@ -44,6 +44,8 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x28>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts b/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts index 4466c56fd4..77a48e8ec1 100644 --- a/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts +++ b/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts @@ -130,7 +130,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts b/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts index c38d1e55dd..29b235d24c 100644 --- a/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts +++ b/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts @@ -90,7 +90,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts index dde751901e..87a6f29944 100644 --- a/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts @@ -110,7 +110,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts index 6eb3e85f2c..05478f5960 100644 --- a/target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts @@ -130,7 +130,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts index 13a3ecdf83..a5e44cff0b 100644 --- a/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts @@ -135,7 +135,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts index 4a3de47edb..fbdec1b5c5 100644 --- a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts +++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts @@ -74,9 +74,9 @@ }; ðernet { - status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; + mediatek,portmap = "llllw"; port@4 { diff --git a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts index 89c5aedcce..ba1d41545a 100644 --- a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts +++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts @@ -55,9 +55,9 @@ }; ðernet { - status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; + mediatek,portmap = "llllw"; port@5 { diff --git a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts index a589179121..0660047ead 100644 --- a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts +++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts @@ -71,9 +71,9 @@ }; ðernet { - status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts index ee148dbde3..1baa3a7331 100644 --- a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts +++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts @@ -68,9 +68,9 @@ }; ðernet { - status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; + mediatek,portmap = "llllw"; port@4 { diff --git a/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts b/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts index 52d4477f57..79649a5990 100644 --- a/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts +++ b/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts @@ -170,6 +170,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620a_sercomm_na930.dts b/target/linux/ramips/dts/mt7620a_sercomm_na930.dts index 9313e6259f..e90f5a440b 100644 --- a/target/linux/ramips/dts/mt7620a_sercomm_na930.dts +++ b/target/linux/ramips/dts/mt7620a_sercomm_na930.dts @@ -139,9 +139,9 @@ }; ðernet { - status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &mdio_pins>; + mediatek,portmap = "llllw"; port@4 { diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts index 9681964cd2..c0b2c1ae92 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts @@ -129,11 +129,11 @@ }; ðernet { - status = "okay"; - mtd-mac-address = <&rom 0xf100>; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; + mtd-mac-address = <&rom 0xf100>; + port@5 { status = "okay"; mediatek,fixed-link = <1000 1 1 1>; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi b/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi index 74908e05aa..184627b9f4 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi +++ b/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi @@ -91,7 +91,9 @@ ðernet { pinctrl-names = "default"; + mtd-mac-address = <&rom 0xf100>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts b/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts index 3857c4a954..f3340b9f5e 100644 --- a/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts +++ b/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts @@ -130,7 +130,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x28>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_youku_yk1.dts b/target/linux/ramips/dts/mt7620a_youku_yk1.dts index ee7bb37d2c..f14b70d407 100644 --- a/target/linux/ramips/dts/mt7620a_youku_yk1.dts +++ b/target/linux/ramips/dts/mt7620a_youku_yk1.dts @@ -119,7 +119,9 @@ ðernet { pinctrl-names = "default"; + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_yukai_bocco.dts b/target/linux/ramips/dts/mt7620a_yukai_bocco.dts index e0a568f3b1..b05fb17197 100644 --- a/target/linux/ramips/dts/mt7620a_yukai_bocco.dts +++ b/target/linux/ramips/dts/mt7620a_yukai_bocco.dts @@ -149,7 +149,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts index 959fce350e..4aa404542f 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts @@ -111,7 +111,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi index 6cb67d40de..9ebd10bbb0 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi @@ -75,6 +75,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620a_zte_q7.dts b/target/linux/ramips/dts/mt7620a_zte_q7.dts index 0303e3fe3e..6933a86f60 100644 --- a/target/linux/ramips/dts/mt7620a_zte_q7.dts +++ b/target/linux/ramips/dts/mt7620a_zte_q7.dts @@ -98,6 +98,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts b/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts index 2f648a2700..4d4e5878eb 100644 --- a/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts +++ b/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts @@ -136,10 +136,10 @@ }; ðernet { - status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&rgmii2_pins &mdio_pins>; - mtd-mac-address = <&factory 0x00004>; + + mtd-mac-address = <&factory 0x4>; port@4 { status = "okay"; diff --git a/target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts b/target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts index e77615a9f5..5e610be862 100644 --- a/target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts +++ b/target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts @@ -109,6 +109,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts b/target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts index 423641d833..76f728ea65 100644 --- a/target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts +++ b/target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts @@ -122,6 +122,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts b/target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts index 986903b601..f84dda3bf8 100644 --- a/target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts +++ b/target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts @@ -98,6 +98,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620n_dlink_dwr-116-a1.dts b/target/linux/ramips/dts/mt7620n_dlink_dwr-116-a1.dts index 1c45c8e8cc..3f75c763f7 100644 --- a/target/linux/ramips/dts/mt7620n_dlink_dwr-116-a1.dts +++ b/target/linux/ramips/dts/mt7620n_dlink_dwr-116-a1.dts @@ -105,7 +105,8 @@ }; ðernet { - mediatek,portmap = "llllw"; pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts b/target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts index deb16785a0..5a75e5ab96 100644 --- a/target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts +++ b/target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts @@ -119,6 +119,7 @@ ðernet { mtd-mac-address = <&factory 0x2e>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620n_kingston_mlw221.dts b/target/linux/ramips/dts/mt7620n_kingston_mlw221.dts index 2e37fdd884..fbc751fb48 100644 --- a/target/linux/ramips/dts/mt7620n_kingston_mlw221.dts +++ b/target/linux/ramips/dts/mt7620n_kingston_mlw221.dts @@ -114,6 +114,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts b/target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts index 931f0500ba..a4bc5c71bc 100644 --- a/target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts +++ b/target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts @@ -114,6 +114,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi b/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi index 09df87966e..9762472355 100644 --- a/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi +++ b/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi @@ -44,6 +44,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts b/target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts index 09e2cf257d..135e048fca 100644 --- a/target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts +++ b/target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts @@ -82,6 +82,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620n_wrtnode_wrtnode.dts b/target/linux/ramips/dts/mt7620n_wrtnode_wrtnode.dts index 2c905f7f6a..35dc933d99 100644 --- a/target/linux/ramips/dts/mt7620n_wrtnode_wrtnode.dts +++ b/target/linux/ramips/dts/mt7620n_wrtnode_wrtnode.dts @@ -87,6 +87,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts index 341a231daf..eff3842a3e 100644 --- a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts @@ -110,6 +110,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts index 9439b0c28e..7a111ffac5 100644 --- a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts @@ -114,6 +114,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts index f293082e96..e5d3cc0a29 100644 --- a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts @@ -95,6 +95,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts index ee31792ab0..675b42671b 100644 --- a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts @@ -107,7 +107,9 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts index 7846bd995a..00af10b0c7 100644 --- a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts +++ b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts @@ -133,6 +133,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts index 2e7a689e27..cbeabf4ec8 100644 --- a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts +++ b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts @@ -133,6 +133,7 @@ ðernet { mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7621_linksys_ea7500-v2.dts b/target/linux/ramips/dts/mt7621_linksys_ea7500-v2.dts new file mode 100644 index 0000000000..ac13bdd369 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_linksys_ea7500-v2.dts @@ -0,0 +1,207 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "linksys,ea7500-v2", "mediatek,mt7621-soc"; + model = "Linksys EA7500 v2"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + wan_green { + label = "ea7500-v2:green:wan"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + + lan1_green { + label = "ea7500-v2:green:lan1"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + lan2_green { + label = "ea7500-v2:green:lan2"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + + lan3_green { + label = "ea7500-v2:green:lan3"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + lan4_green { + label = "ea7500-v2:green:lan4"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led_power: power { + label = "ea7500-v2:white:power"; + gpios = <&gpio 10 GPIO_ACTIVE_HIGH>; + }; + + wps { + label = "ea7500-v2:green:wps"; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "boot"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "u_env"; + reg = <0x80000 0x40000>; + read-only; + }; + + factory: partition@c0000 { + label = "factory"; + reg = <0xc0000 0x40000>; + read-only; + }; + + partition@100000 { + label = "s_env"; + reg = <0x100000 0x40000>; + }; + + partition@140000 { + label = "devinfo"; + reg = <0x140000 0x40000>; + read-only; + }; + + partition@180000 { + label = "kernel"; + reg = <0x180000 0x400000>; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x2400000>; + }; + + partition@2980000 { + label = "alt_kernel"; + reg = <0x2980000 0x400000>; + read-only; + }; + + partition@2d80000 { + label = "alt_rootfs"; + reg = <0x2d80000 0x2400000>; + read-only; + }; + + partition@5180000 { + label = "sysdiag"; + reg = <0x5180000 0x100000>; + read-only; + }; + + partition@5280000 { + label = "syscfg"; + reg = <0x5280000 0x2d00000>; + read-only; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart2", "uart3", "jtag", "wdt"; + function = "gpio"; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + mt76@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + }; +}; + +&pcie1 { + mt76@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "wan"; + }; + + port@1 { + status = "okay"; + label = "lan1"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan3"; + }; + + port@4 { + status = "okay"; + label = "lan4"; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_redmi-router-ac2100.dts b/target/linux/ramips/dts/mt7621_xiaomi_redmi-router-ac2100.dts index 052ec6f3ab..71b1d0916f 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_redmi-router-ac2100.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_redmi-router-ac2100.dts @@ -26,22 +26,22 @@ compatible = "gpio-leds"; led_status_amber: status_amber { - label = "rm2100:amber:status"; + label = "redmi-router-ac2100:amber:status"; gpios = <&gpio 6 GPIO_ACTIVE_LOW>; }; led_status_white: status_white { - label = "rm2100:white:status"; + label = "redmi-router-ac2100:white:status"; gpios = <&gpio 8 GPIO_ACTIVE_LOW>; }; wan_amber { - label = "rm2100:amber:wan"; + label = "redmi-router-ac2100:amber:wan"; gpios = <&gpio 10 GPIO_ACTIVE_LOW>; }; wan_white { - label = "rm2100:white:wan"; + label = "redmi-router-ac2100:white:wan"; gpios = <&gpio 12 GPIO_ACTIVE_LOW>; }; }; diff --git a/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts b/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts index f189c31c60..86f724e871 100644 --- a/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts +++ b/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts @@ -142,7 +142,7 @@ ðernet { status = "okay"; - mtd-mac-address = <&devdata 0x0d>; + mtd-mac-address = <&devdata 0xd>; port@0 { mediatek,fixed-link = <1000 1 1 1>; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 7d5c484a41..d2e9080dd1 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -25,80 +25,10 @@ KERNEL_LOADADDR := $(loadaddr-y) LOADER_PLATFORM := $(ldrplatform-y) KERNEL_DTB = kernel-bin | append-dtb | lzma -define Device/Default - PROFILES = Default - KERNEL := $(KERNEL_DTB) | uImage lzma - SOC := $(DEFAULT_SOC) - DEVICE_DTS_DIR := ../dts - DEVICE_DTS = $$(SOC)_$(1) - IMAGES := sysupgrade.bin - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) - sysupgrade_bin := append-kernel | append-rootfs | pad-rootfs - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) -endef -define Device/uimage-lzma-loader - LOADER_TYPE := bin - KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | uImage none -endef - -define Device/seama - SEAMA_MTDBLOCK := 2 - IMAGES += factory.bin - - # 64 bytes offset: - # - 28 bytes seama_header - # - 36 bytes of META data (4-bytes aligned) - IMAGE/default := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs - IMAGE/sysupgrade.bin := \ - $$(IMAGE/default) | seama | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) - IMAGE/factory.bin := \ - $$(IMAGE/default) | pad-rootfs -x 64 | seama | seama-seal | check-size $$$$(IMAGE_SIZE) - SEAMA_SIGNATURE := -endef - -define Build/jcg-header - $(STAGING_DIR_HOST)/bin/jcgimage -v $(1) \ - $(if $(JCG_MAXSIZE), -m $$(($(subst k, * 1024,$(JCG_MAXSIZE)))),) \ - -u $@ -o $@.new - mv $@.new $@ -endef - -define Build/trx - $(STAGING_DIR_HOST)/bin/trx $(1) \ - -o $@ \ - -m $$(($(subst k, * 1024,$(IMAGE_SIZE)))) \ - -f $(IMAGE_KERNEL) \ - -a 4 -f $(IMAGE_ROOTFS) -endef - -define Build/loader-common - rm -rf $@.src - $(MAKE) -C lzma-loader \ - PKG_BUILD_DIR="$@.src" \ - TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \ - BOARD="$(BOARDNAME)" PLATFORM="$(LOADER_PLATFORM)" \ - LZMA_TEXT_START=0x82000000 LOADADDR=$(KERNEL_LOADADDR) \ - $(1) compile loader.$(LOADER_TYPE) - mv "$@.$(LOADER_TYPE)" "$@" - rm -rf $@.src -endef - -define Build/loader-kernel - $(call Build/loader-common,LOADER_DATA="$@") -endef - -define Build/relocate-kernel - rm -rf $@.relocate - $(CP) ../../generic/image/relocate $@.relocate - $(MAKE) -C $@.relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS) - ( \ - dd if=$@.relocate/loader.bin bs=32 conv=sync && \ - perl -e '@s = stat("$@"); print pack("V", @s[7])' && \ - cat $@ \ - ) > $@.new - mv $@.new $@ - rm -rf $@.relocate +define Build/edimax-header + $(STAGING_DIR_HOST)/bin/mkedimaximg -i $@ -o $@.new $(1) + @mv $@.new $@ endef define Build/elx-header @@ -121,28 +51,36 @@ define Build/elx-header rm -rf $(KDIR)/tmp/$(DEVICE_NAME).header endef -define Build/umedia-header - fix-u-media-header -T 0x46 -B $(1) -i $@ -o $@.new && mv $@.new $@ -endef - -define Build/edimax-header - $(STAGING_DIR_HOST)/bin/mkedimaximg -i $@ -o $@.new $(1) - @mv $@.new $@ -endef - -define Build/poray-header - $(STAGING_DIR_HOST)/bin/mkporayfw $(1) -f $@ -o $@.new +define Build/fonfxcimage + uimage_padhdr -i $@ -o $@.new mv $@.new $@ endef -define Build/wrg-header - mkwrgimg -i $@ -d "/dev/mtdblock/2" -s $(1) -o $@.new +define Build/jcg-header + $(STAGING_DIR_HOST)/bin/jcgimage -v $(1) \ + $(if $(JCG_MAXSIZE), -m $$(($(subst k, * 1024,$(JCG_MAXSIZE)))),) \ + -u $@ -o $@.new mv $@.new $@ endef +define Build/loader-common + rm -rf $@.src + $(MAKE) -C lzma-loader \ + PKG_BUILD_DIR="$@.src" \ + TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \ + BOARD="$(BOARDNAME)" PLATFORM="$(LOADER_PLATFORM)" \ + LZMA_TEXT_START=0x82000000 LOADADDR=$(KERNEL_LOADADDR) \ + $(1) compile loader.$(LOADER_TYPE) + mv "$@.$(LOADER_TYPE)" "$@" + rm -rf $@.src +endef + +define Build/loader-kernel + $(call Build/loader-common,LOADER_DATA="$@") +endef + # combine kernel and rootfs into one image # mkdlinkfw - define Build/mkdlinkfw -$(STAGING_DIR_HOST)/bin/mkdlinkfw \ -k $(IMAGE_KERNEL) \ @@ -162,8 +100,32 @@ define Build/mkdlinkfw-factory mv $@.new $@ endef -define Build/zyimage - $(STAGING_DIR_HOST)/bin/zyimage $(1) $@ +define Build/netis-tail + echo -n $(1) >> $@ + echo -n $(UIMAGE_NAME)-yun | $(STAGING_DIR_HOST)/bin/mkhash md5 | \ + sed 's/../\\\\x&/g' | xargs echo -ne >> $@ +endef + +define Build/poray-header + $(STAGING_DIR_HOST)/bin/mkporayfw $(1) -f $@ -o $@.new + mv $@.new $@ +endef + +define Build/relocate-kernel + rm -rf $@.relocate + $(CP) ../../generic/image/relocate $@.relocate + $(MAKE) -C $@.relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS) + ( \ + dd if=$@.relocate/loader.bin bs=32 conv=sync && \ + perl -e '@s = stat("$@"); print pack("V", @s[7])' && \ + cat $@ \ + ) > $@.new + mv $@.new $@ + rm -rf $@.relocate +endef + +define Build/sercom-footer + $(call Build/sercom-seal,-f) endef define Build/sercom-seal @@ -175,37 +137,59 @@ define Build/sercom-seal $(1) endef -define Build/sercom-footer - $(call Build/sercom-seal,-f) +define Build/trx + $(STAGING_DIR_HOST)/bin/trx $(1) \ + -o $@ \ + -m $$(($(subst k, * 1024,$(IMAGE_SIZE)))) \ + -f $(IMAGE_KERNEL) \ + -a 4 -f $(IMAGE_ROOTFS) endef -define Build/fonfxcimage - uimage_padhdr -i $@ -o $@.new +define Build/umedia-header + fix-u-media-header -T 0x46 -B $(1) -i $@ -o $@.new && mv $@.new $@ +endef + +define Build/wrg-header + mkwrgimg -i $@ -d "/dev/mtdblock/2" -s $(1) -o $@.new mv $@.new $@ endef -ifeq ($(SUBTARGET),rt288x) -include rt288x.mk -endif +define Build/zyimage + $(STAGING_DIR_HOST)/bin/zyimage $(1) $@ +endef -ifeq ($(SUBTARGET),rt305x) -include rt305x.mk -endif +define Device/Default + PROFILES = Default + KERNEL := $(KERNEL_DTB) | uImage lzma + SOC := $(DEFAULT_SOC) + DEVICE_DTS_DIR := ../dts + DEVICE_DTS = $$(SOC)_$(1) + IMAGES := sysupgrade.bin + SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) + sysupgrade_bin := append-kernel | append-rootfs | pad-rootfs + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) +endef -ifeq ($(SUBTARGET),rt3883) -include rt3883.mk -endif +define Device/seama + SEAMA_MTDBLOCK := 2 + IMAGES += factory.bin -ifeq ($(SUBTARGET),mt7620) -include mt7620.mk -endif + # 64 bytes offset: + # - 28 bytes seama_header + # - 36 bytes of META data (4-bytes aligned) + IMAGE/default := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs + IMAGE/sysupgrade.bin := \ + $$(IMAGE/default) | seama | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) + IMAGE/factory.bin := \ + $$(IMAGE/default) | pad-rootfs -x 64 | seama | seama-seal | check-size $$$$(IMAGE_SIZE) + SEAMA_SIGNATURE := +endef -ifeq ($(SUBTARGET),mt7621) -include mt7621.mk -endif +define Device/uimage-lzma-loader + LOADER_TYPE := bin + KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | uImage none +endef -ifeq ($(SUBTARGET),mt76x8) -include mt76x8.mk -endif +include $(SUBTARGET).mk $(eval $(call BuildImage)) diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 48357832a6..693d47fc48 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -86,6 +86,16 @@ define Device/asus_rt-ac51u endef TARGET_DEVICES += asus_rt-ac51u +define Device/asus_rt-ac54u + SOC := mt7620a + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Asus + DEVICE_MODEL := RT-AC54U + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci \ + kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += asus_rt-ac54u + define Device/asus_rt-n12p SOC := mt7620n IMAGE_SIZE := 16064k @@ -580,6 +590,15 @@ define Device/lava_lr-25g001 endef TARGET_DEVICES += lava_lr-25g001 +define Device/lb-link_bl-w1200 + SOC := mt7620a + DEVICE_VENDOR := LB-Link + DEVICE_MODEL := BL-W1200 + IMAGE_SIZE := 7872k + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76x2 +endef +TARGET_DEVICES += lb-link_bl-w1200 + define Device/lenovo_newifi-y1 SOC := mt7620a IMAGE_SIZE := 16064k @@ -687,6 +706,17 @@ define Device/netgear_wn3000rp-v3 endef TARGET_DEVICES += netgear_wn3000rp-v3 +define Device/netis_wf2770 + SOC := mt7620a + IMAGE_SIZE := 16064k + UIMAGE_NAME := WF2770_0.0.00 + DEVICE_VENDOR := NETIS + DEVICE_MODEL := WF2770 + DEVICE_PACKAGES := kmod-mt76x0e + KERNEL_INITRAMFS := $(KERNEL_DTB) | netis-tail WF2770 | uImage lzma +endef +TARGET_DEVICES += netis_wf2770 + define Device/nexx_wt3020-4m SOC := mt7620n BLOCKSIZE := 4k diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index baf2c5a948..f217ae4fdf 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -24,67 +24,61 @@ define Build/custom-initramfs-uimage endef define Build/elecom-gst-factory - $(eval product=$(word 1,$(1))) - $(eval version=$(word 2,$(1))) - ( $(STAGING_DIR_HOST)/bin/mkhash md5 $@ | tr -d '\n' ) >> $@ - ( \ - echo -n "ELECOM $(product) v$(version)" | \ - dd bs=32 count=1 conv=sync; \ - dd if=$@; \ - ) > $@.new - mv $@.new $@ - echo -n "MT7621_ELECOM_$(product)" >> $@ + $(eval product=$(word 1,$(1))) + $(eval version=$(word 2,$(1))) + ( $(STAGING_DIR_HOST)/bin/mkhash md5 $@ | tr -d '\n' ) >> $@ + ( \ + echo -n "ELECOM $(product) v$(version)" | \ + dd bs=32 count=1 conv=sync; \ + dd if=$@; \ + ) > $@.new + mv $@.new $@ + echo -n "MT7621_ELECOM_$(product)" >> $@ endef define Build/elecom-wrc-factory - $(eval product=$(word 1,$(1))) - $(eval version=$(word 2,$(1))) - $(STAGING_DIR_HOST)/bin/mkhash md5 $@ >> $@ - ( \ - echo -n "ELECOM $(product) v$(version)" | \ - dd bs=32 count=1 conv=sync; \ - dd if=$@; \ - ) > $@.new - mv $@.new $@ + $(eval product=$(word 1,$(1))) + $(eval version=$(word 2,$(1))) + $(STAGING_DIR_HOST)/bin/mkhash md5 $@ >> $@ + ( \ + echo -n "ELECOM $(product) v$(version)" | \ + dd bs=32 count=1 conv=sync; \ + dd if=$@; \ + ) > $@.new + mv $@.new $@ endef define Build/iodata-factory - $(eval fw_size=$(word 1,$(1))) - $(eval fw_type=$(word 2,$(1))) - $(eval product=$(word 3,$(1))) - $(eval factory_bin=$(word 4,$(1))) - if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(fw_size)" ]; then \ - $(CP) $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) $(factory_bin); \ - $(STAGING_DIR_HOST)/bin/mksenaofw \ - -r 0x30a -p $(product) -t $(fw_type) \ - -e $(factory_bin) -o $(factory_bin).new; \ - mv $(factory_bin).new $(factory_bin); \ - $(CP) $(factory_bin) $(BIN_DIR)/; \ + $(eval fw_size=$(word 1,$(1))) + $(eval fw_type=$(word 2,$(1))) + $(eval product=$(word 3,$(1))) + $(eval factory_bin=$(word 4,$(1))) + if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(fw_size)" ]; then \ + $(CP) $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) $(factory_bin); \ + $(STAGING_DIR_HOST)/bin/mksenaofw \ + -r 0x30a -p $(product) -t $(fw_type) \ + -e $(factory_bin) -o $(factory_bin).new; \ + mv $(factory_bin).new $(factory_bin); \ + $(CP) $(factory_bin) $(BIN_DIR)/; \ else \ echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \ fi endef define Build/iodata-mstc-header - ( \ - data_size_crc="$$(dd if=$@ ibs=64 skip=1 2>/dev/null | \ - gzip -c | tail -c 8 | od -An -tx8 --endian little | tr -d ' \n')"; \ - echo -ne "$$(echo $$data_size_crc | sed 's/../\\x&/g')" | \ - dd of=$@ bs=8 count=1 seek=7 conv=notrunc 2>/dev/null; \ - ) - dd if=/dev/zero of=$@ bs=4 count=1 seek=1 conv=notrunc 2>/dev/null - ( \ - header_crc="$$(dd if=$@ bs=64 count=1 2>/dev/null | \ - gzip -c | tail -c 8 | od -An -N4 -tx4 --endian little | tr -d ' \n')"; \ - echo -ne "$$(echo $$header_crc | sed 's/../\\x&/g')" | \ - dd of=$@ bs=4 count=1 seek=1 conv=notrunc 2>/dev/null; \ - ) -endef - -define Build/netis-tail - echo -n $(1) >> $@ - echo -n $(UIMAGE_NAME)-yun | $(STAGING_DIR_HOST)/bin/mkhash md5 | \ - sed 's/../\\\\x&/g' | xargs echo -ne >> $@ + ( \ + data_size_crc="$$(dd if=$@ ibs=64 skip=1 2>/dev/null | gzip -c | \ + tail -c 8 | od -An -tx8 --endian little | tr -d ' \n')"; \ + echo -ne "$$(echo $$data_size_crc | sed 's/../\\x&/g')" | \ + dd of=$@ bs=8 count=1 seek=7 conv=notrunc 2>/dev/null; \ + ) + dd if=/dev/zero of=$@ bs=4 count=1 seek=1 conv=notrunc 2>/dev/null + ( \ + header_crc="$$(dd if=$@ bs=64 count=1 2>/dev/null | gzip -c | \ + tail -c 8 | od -An -N4 -tx4 --endian little | tr -d ' \n')"; \ + echo -ne "$$(echo $$header_crc | sed 's/../\\x&/g')" | \ + dd of=$@ bs=4 count=1 seek=1 conv=notrunc 2>/dev/null; \ + ) endef define Build/ubootpad96 @@ -120,8 +114,8 @@ define Device/afoundry_ew1200 IMAGE_SIZE := 16064k DEVICE_VENDOR := AFOUNDRY DEVICE_MODEL := EW1200 - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-mt7603 \ - kmod-usb3 kmod-usb-ledtrig-usbport wpad-openssl + DEVICE_PACKAGES := kmod-ata-ahci kmod-mt76x2 kmod-mt7603 kmod-usb3 \ + kmod-usb-ledtrig-usbport wpad-openssl SUPPORTED_DEVICES += ew1200 endef TARGET_DEVICES += afoundry_ew1200 @@ -130,8 +124,7 @@ define Device/alfa-network_quad-e4g IMAGE_SIZE := 16064k DEVICE_VENDOR := ALFA Network DEVICE_MODEL := Quad-E4G - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 \ - uboot-envtools + DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 uboot-envtools endef TARGET_DEVICES += alfa-network_quad-e4g @@ -227,8 +220,8 @@ define Device/dlink_dir-860l-b1 BLOCKSIZE := 64k SEAMA_SIGNATURE := wrgac13_dlink.2013gui_dir860lb LOADER_TYPE := bin - KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | \ - relocate-kernel | lzma -a0 | uImage lzma + KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | relocate-kernel | \ + lzma -a0 | uImage lzma IMAGE_SIZE := 16064k DEVICE_VENDOR := D-Link DEVICE_MODEL := DIR-860L @@ -268,8 +261,8 @@ define Device/d-team_pbr-m1 IMAGE_SIZE := 16064k DEVICE_VENDOR := PandoraBox DEVICE_MODEL := PBR-M1 - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-mt7603 kmod-mt76x2 \ - kmod-sdhci-mt7620 kmod-usb3 kmod-usb-ledtrig-usbport wpad-openssl + DEVICE_PACKAGES := kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \ + kmod-usb3 kmod-usb-ledtrig-usbport wpad-openssl SUPPORTED_DEVICES += pbr-m1 endef TARGET_DEVICES += d-team_pbr-m1 @@ -352,7 +345,7 @@ TARGET_DEVICES += gehua_ghl-r-001 define Device/gnubee_gb-pc1 DEVICE_VENDOR := GnuBee DEVICE_MODEL := Personal Cloud One - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 + DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 IMAGE_SIZE := 32448k endef TARGET_DEVICES += gnubee_gb-pc1 @@ -360,7 +353,7 @@ TARGET_DEVICES += gnubee_gb-pc1 define Device/gnubee_gb-pc2 DEVICE_VENDOR := GnuBee DEVICE_MODEL := Personal Cloud Two - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 + DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 IMAGE_SIZE := 32448k endef TARGET_DEVICES += gnubee_gb-pc2 @@ -504,6 +497,24 @@ define Device/lenovo_newifi-d1 endef TARGET_DEVICES += lenovo_newifi-d1 +define Device/linksys_ea7500-v2 + $(Device/uimage-lzma-loader) + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 36864k + DEVICE_VENDOR := Linksys + DEVICE_MODEL := EA7500 + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := kmod-usb3 kmod-mt7615e wpad-openssl uboot-envtools + UBINIZE_OPTS := -E 5 + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata | check-size $$$$(IMAGE_SIZE) + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \ + append-ubi | check-size $$$$(IMAGE_SIZE) | linksys-image type=EA7500v2 +endef +TARGET_DEVICES += linksys_ea7500-v2 + define Device/linksys_re6500 IMAGE_SIZE := 7872k DEVICE_VENDOR := Linksys @@ -536,7 +547,6 @@ define Device/MikroTik IMAGE_SIZE := 16128k DEVICE_PACKAGES := kmod-usb3 LOADER_TYPE := elf - PLATFORM := mt7621 KERNEL := $(KERNEL_DTB) | loader-kernel IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 | \ pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | append-metadata | \ @@ -569,8 +579,8 @@ define Device/mqmaker_witi IMAGE_SIZE := 16064k DEVICE_VENDOR := MQmaker DEVICE_MODEL := WiTi - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-mt76x2 \ - kmod-sdhci-mt7620 kmod-usb3 kmod-usb-ledtrig-usbport wpad-openssl + DEVICE_PACKAGES := kmod-ata-ahci kmod-mt76x2 kmod-sdhci-mt7620 kmod-usb3 \ + kmod-usb-ledtrig-usbport wpad-openssl SUPPORTED_DEVICES += witi mqmaker,witi-256m mqmaker,witi-512m endef TARGET_DEVICES += mqmaker_witi @@ -635,7 +645,7 @@ define Device/netgear_r6260 SERCOMM_HWVER := A001 SERCOMM_SWVER := 0x0052 IMAGE_SIZE := 40960k - DEVICE_PACKAGES += kmod-mt7615e wpad-openssl + DEVICE_PACKAGES += kmod-mt7615e endef TARGET_DEVICES += netgear_r6260 @@ -647,7 +657,7 @@ define Device/netgear_r6350 SERCOMM_HWVER := A001 SERCOMM_SWVER := 0x0052 IMAGE_SIZE := 40960k - DEVICE_PACKAGES += kmod-mt7615e wpad-openssl + DEVICE_PACKAGES += kmod-mt7615e endef TARGET_DEVICES += netgear_r6350 @@ -657,12 +667,16 @@ define Device/netgear_r6700-v2 DEVICE_VARIANT := v2 DEVICE_ALT0_VENDOR := NETGEAR DEVICE_ALT0_MODEL := Nighthawk AC2400 + DEVICE_ALT0_VARIANT := v1 + DEVICE_ALT1_VENDOR := NETGEAR + DEVICE_ALT1_MODEL := R7200 + DEVICE_ALT1_VARIANT := v1 SERCOMM_HWNAME := R6950 SERCOMM_HWID := BZV SERCOMM_HWVER := A001 SERCOMM_SWVER := 0x1032 IMAGE_SIZE := 40960k - DEVICE_PACKAGES += kmod-mt7615e wpad-openssl + DEVICE_PACKAGES += kmod-mt7615e endef TARGET_DEVICES += netgear_r6700-v2 @@ -674,7 +688,7 @@ define Device/netgear_r6800 SERCOMM_HWVER := A001 SERCOMM_SWVER := 0x0062 IMAGE_SIZE := 40960k - DEVICE_PACKAGES += kmod-mt7615e wpad-openssl + DEVICE_PACKAGES += kmod-mt7615e endef TARGET_DEVICES += netgear_r6800 @@ -686,7 +700,7 @@ define Device/netgear_r6850 SERCOMM_HWVER := A001 SERCOMM_SWVER := 0x0052 IMAGE_SIZE := 40960k - DEVICE_PACKAGES += kmod-mt7615e wpad-openssl + DEVICE_PACKAGES += kmod-mt7615e endef TARGET_DEVICES += netgear_r6850 @@ -866,7 +880,7 @@ define Device/unielec_u7621-06-16m DEVICE_VENDOR := UniElec DEVICE_MODEL := U7621-06 DEVICE_VARIANT := 16M - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 + DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 SUPPORTED_DEVICES += u7621-06-256M-16M unielec,u7621-06-256m-16m endef TARGET_DEVICES += unielec_u7621-06-16m @@ -876,7 +890,7 @@ define Device/unielec_u7621-06-64m DEVICE_VENDOR := UniElec DEVICE_MODEL := U7621-06 DEVICE_VARIANT := 64M - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 + DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 SUPPORTED_DEVICES += unielec,u7621-06-512m-64m endef TARGET_DEVICES += unielec_u7621-06-64m @@ -976,7 +990,7 @@ define Device/xiaoyu_xy-c5 IMAGE_SIZE := 32448k DEVICE_VENDOR := XiaoYu DEVICE_MODEL := XY-C5 - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-usb3 + DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 endef TARGET_DEVICES += xiaoyu_xy-c5 @@ -984,8 +998,8 @@ define Device/xzwifi_creativebox-v1 IMAGE_SIZE := 32448k DEVICE_VENDOR := CreativeBox DEVICE_MODEL := v1 - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-mt7603 kmod-mt76x2 \ - kmod-sdhci-mt7620 kmod-usb3 + DEVICE_PACKAGES := kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \ + kmod-usb3 endef TARGET_DEVICES += xzwifi_creativebox-v1 @@ -1030,8 +1044,8 @@ define Device/zbtlink_zbt-wg2626 IMAGE_SIZE := 16064k DEVICE_VENDOR := Zbtlink DEVICE_MODEL := ZBT-WG2626 - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 \ - kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-openssl + DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 \ + kmod-usb-ledtrig-usbport wpad-openssl SUPPORTED_DEVICES += zbt-wg2626 endef TARGET_DEVICES += zbtlink_zbt-wg2626 @@ -1041,8 +1055,8 @@ define Device/zbtlink_zbt-wg3526-16m DEVICE_VENDOR := Zbtlink DEVICE_MODEL := ZBT-WG3526 DEVICE_VARIANT := 16M - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 \ - kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-openssl + DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \ + kmod-usb3 kmod-usb-ledtrig-usbport wpad-openssl SUPPORTED_DEVICES += zbt-wg3526 zbt-wg3526-16M endef TARGET_DEVICES += zbtlink_zbt-wg3526-16m @@ -1052,8 +1066,8 @@ define Device/zbtlink_zbt-wg3526-32m DEVICE_VENDOR := Zbtlink DEVICE_MODEL := ZBT-WG3526 DEVICE_VARIANT := 32M - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 \ - kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-openssl + DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \ + kmod-usb3 kmod-usb-ledtrig-usbport wpad-openssl SUPPORTED_DEVICES += ac1200pro zbt-wg3526-32M endef TARGET_DEVICES += zbtlink_zbt-wg3526-32m diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 5e2edab603..f0462f6cae 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -405,6 +405,7 @@ define Device/tplink_tl-wr840n-v5 TPLINK_HWREVADD := 0x5 IMAGES := sysupgrade.bin SUPPORTED_DEVICES += tl-wr840n-v5 + DEFAULT := n endef TARGET_DEVICES += tplink_tl-wr840n-v5 @@ -433,6 +434,7 @@ define Device/tplink_tl-wr841n-v14 TPLINK_HWREVADD := 0x14 IMAGES := sysupgrade.bin tftp-recovery.bin IMAGE/tftp-recovery.bin := pad-extra 64k | $$(IMAGE/factory.bin) + DEFAULT := n endef TARGET_DEVICES += tplink_tl-wr841n-v14 diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk index 322ddeed57..62eec8cf6a 100644 --- a/target/linux/ramips/image/rt305x.mk +++ b/target/linux/ramips/image/rt305x.mk @@ -2,13 +2,13 @@ # RT305X Profiles # define Build/buffalo-tftp-header - ( \ - echo -n -e "# Airstation FirmWare\nrun u_fw\nreset\n\n" | \ - dd bs=512 count=1 conv=sync; \ - dd if=$@; \ - ) > $@.tmp && \ - $(STAGING_DIR_HOST)/bin/buffalo-tftp -i $@.tmp -o $@.new - mv $@.new $@ + ( \ + echo -n -e "# Airstation FirmWare\nrun u_fw\nreset\n\n" | \ + dd bs=512 count=1 conv=sync; \ + dd if=$@; \ + ) > $@.tmp && \ + $(STAGING_DIR_HOST)/bin/buffalo-tftp -i $@.tmp -o $@.new + mv $@.new $@ endef define Build/dap-header @@ -755,8 +755,7 @@ define Device/nixcore_x1-16m DEVICE_VENDOR := Nixcore DEVICE_MODEL := X1 DEVICE_VARIANT := 16M - DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink \ - kmod-spi-dev + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink kmod-spi-dev SUPPORTED_DEVICES += nixcore-x1 nixcore-x1-16M endef TARGET_DEVICES += nixcore_x1-16m @@ -767,8 +766,7 @@ define Device/nixcore_x1-8m DEVICE_VENDOR := Nixcore DEVICE_MODEL := X1 DEVICE_VARIANT := 8M - DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink \ - kmod-spi-dev + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink kmod-spi-dev SUPPORTED_DEVICES += nixcore-x1 nixcore-x1-8M endef TARGET_DEVICES += nixcore_x1-8m @@ -778,8 +776,7 @@ define Device/olimex_rt5350f-olinuxino IMAGE_SIZE := 7872k DEVICE_VENDOR := OLIMEX DEVICE_MODEL := RT5350F-OLinuXino - DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink \ - kmod-spi-dev + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink kmod-spi-dev SUPPORTED_DEVICES += rt5350f-olinuxino endef TARGET_DEVICES += olimex_rt5350f-olinuxino @@ -789,8 +786,7 @@ define Device/olimex_rt5350f-olinuxino-evb IMAGE_SIZE := 7872k DEVICE_VENDOR := OLIMEX DEVICE_MODEL := RT5350F-OLinuXino-EVB - DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink \ - kmod-spi-dev + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink kmod-spi-dev SUPPORTED_DEVICES += rt5350f-olinuxino-evb endef TARGET_DEVICES += olimex_rt5350f-olinuxino-evb @@ -1146,8 +1142,7 @@ define Device/vocore_vocore-16m DEVICE_VENDOR := VoCore DEVICE_MODEL := VoCore DEVICE_VARIANT := 16M - DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink \ - kmod-spi-dev + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink kmod-spi-dev SUPPORTED_DEVICES += vocore vocore-16M endef TARGET_DEVICES += vocore_vocore-16m @@ -1158,8 +1153,7 @@ define Device/vocore_vocore-8m DEVICE_VENDOR := VoCore DEVICE_MODEL := VoCore DEVICE_VARIANT := 8M - DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink \ - kmod-spi-dev + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink kmod-spi-dev SUPPORTED_DEVICES += vocore vocore-8M endef TARGET_DEVICES += vocore_vocore-8m diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index 5956d24fd7..3d2f50c2de 100755 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -75,6 +75,7 @@ ramips_setup_interfaces() "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0" ;; asus,rt-ac51u|\ + asus,rt-ac54u|\ asus,rt-n14u|\ bdcom,wap2100-sk|\ edimax,ew-7478apc|\ @@ -270,7 +271,8 @@ ramips_setup_macs() wan_mac=$(mtd_get_mac_binary factory 0x2e) label_mac=$(mtd_get_mac_binary factory 0x4) ;; - asus,rt-ac51u) + asus,rt-ac51u|\ + asus,rt-ac54u) lan_mac=$(mtd_get_mac_binary factory 0x22) ;; dlink,dch-m225) @@ -323,6 +325,10 @@ ramips_setup_macs() iptime,a104ns) wan_mac=$(macaddr_add "$(mtd_get_mac_binary u-boot 0x1fc20)" 2) ;; + lb-link,bl-w1200) + wan_mac=$(mtd_get_mac_binary factory 0x2e) + label_mac=$wan_mac + ;; lenovo,newifi-y1|\ lenovo,newifi-y1s|\ ohyeah,oy-0001|\ @@ -332,6 +338,10 @@ ramips_setup_macs() linksys,e1700) wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR) ;; + netis,wf2770) + wan_mac=$(mtd_get_mac_binary factory 0x2e) + label_mac=$wan_mac + ;; tplink,archer-c2-v1|\ tplink,archer-c20-v1|\ tplink,archer-c20i|\ diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/03_gpio_switches b/target/linux/ramips/mt7620/base-files/etc/board.d/03_gpio_switches index f2355fdb97..959991598c 100755 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/03_gpio_switches @@ -22,6 +22,9 @@ head-weblink,hdrm200) ucidef_add_gpio_switch "io4" "I/O 4" "14" ucidef_add_gpio_switch "power_mpcie" "mPCIe power" "21" "1" ;; +lb-link,bl-w1200) + ucidef_add_gpio_switch "eth_leds_enable" "ETH LEDs enable" "10" "1" + ;; zbtlink,zbt-we826-e) ucidef_add_gpio_switch "sim_switch" "SIM slot switch" "13" ucidef_add_gpio_switch "power_mpcie" "mPCIe power" "14" "1" 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 7c7cad98a9..fdfd29d011 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -34,6 +34,13 @@ gnubee,gb-pc2) ucidef_set_led_netdev "lan1" "lan1" "$boardname:green:lan1" "lan1" ucidef_set_led_netdev "lan2" "lan2" "$boardname:green:lan2" "lan2" ;; +linksys,ea7500-v2) + ucidef_set_led_netdev "lan1" "lan1 link" "$boardname:green:lan1" "lan1" "link" + ucidef_set_led_netdev "lan2" "lan2 link" "$boardname:green:lan2" "lan2" "link" + ucidef_set_led_netdev "lan3" "lan3 link" "$boardname:green:lan3" "lan3" "link" + ucidef_set_led_netdev "lan4" "lan4 link" "$boardname:green:lan4" "lan4" "link" + ucidef_set_led_netdev "wan" "wan link" "$boardname:green:wan" "wan" "link" + ;; mikrotik,routerboard-m11g) ucidef_set_rssimon "wlan0" "200000" "1" ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:green:rssi0" "wlan0" "1" "100" 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 2a807d15b8..ba9f7fb7b6 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -92,6 +92,11 @@ ramips_setup_macs() wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) label_mac=$wan_mac ;; + linksys,ea7500-v2) + lan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) + wan_mac=$lan_mac + label_mac=$lan_mac + ;; mikrotik,routerboard-750gr3|\ mikrotik,routerboard-m11g|\ mikrotik,routerboard-m33g) diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac new file mode 100644 index 0000000000..e05078648b --- /dev/null +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -0,0 +1,18 @@ +[ "$ACTION" == "add" ] || exit 0 + +PHYNBR=${DEVPATH##*/phy} + +[ -n $PHYNBR ] || exit 0 + +. /lib/functions.sh +. /lib/functions/system.sh + +board=$(board_name) + +case "$board" in + linksys,ea7500-v2) + hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr) + [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress + ;; +esac diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount index b4d72abafc..e92912bbcc 100755 --- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount @@ -8,6 +8,9 @@ boot() { [ -n "$(fw_printenv bootcount bootchanged 2>/dev/null)" ] &&\ echo -e "bootcount\nbootchanged\n" | /usr/sbin/fw_setenv -s - ;; + linksys,ea7500-v2) + mtd resetbc s_env || true + ;; samknows,whitebox-v8) fw_setenv bootcount 0 ;; diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index f23a4849d4..3cc29b244c 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -45,6 +45,7 @@ platform_do_upgrade() { asus,rt-ac65p|\ asus,rt-ac85p|\ hiwifi,hc5962|\ + linksys,ea7500-v2|\ netgear,r6220|\ netgear,r6260|\ netgear,r6350|\ diff --git a/target/linux/ramips/mt7621/target.mk b/target/linux/ramips/mt7621/target.mk index dc87fa7948..2684ea5b64 100644 --- a/target/linux/ramips/mt7621/target.mk +++ b/target/linux/ramips/mt7621/target.mk @@ -7,7 +7,7 @@ BOARDNAME:=MT7621 based boards FEATURES+=nand ramdisk rtc usb minor CPU_TYPE:=24kc -KERNEL_PATCHVER:5.4 +KERNEL_PATCHVER:=5.4 define Target/Description Build firmware images for Ralink MT7621 based boards. diff --git a/target/linux/ramips/mt76x8/target.mk b/target/linux/ramips/mt76x8/target.mk index 5018dac7b0..238f113032 100644 --- a/target/linux/ramips/mt76x8/target.mk +++ b/target/linux/ramips/mt76x8/target.mk @@ -7,9 +7,8 @@ BOARDNAME:=MT76x8 based boards FEATURES+=usb ramdisk CPU_TYPE:=24kc -KERNEL_PATCHVER:=5.4 - DEFAULT_PACKAGES += kmod-mt7603 wpad-openssl swconfig +KERNEL_PATCHVER:=5.4 define Target/Description Build firmware images for Ralink MT76x8 based boards. diff --git a/target/linux/ramips/patches-4.14/0034-NET-multi-phy-support.patch b/target/linux/ramips/patches-4.14/0034-NET-multi-phy-support.patch index e6583f9791..98ea5f557c 100644 --- a/target/linux/ramips/patches-4.14/0034-NET-multi-phy-support.patch +++ b/target/linux/ramips/patches-4.14/0034-NET-multi-phy-support.patch @@ -11,7 +11,7 @@ Signed-off-by: John Crispin --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c -@@ -980,7 +980,10 @@ void phy_state_machine(struct work_struc +@@ -913,7 +913,10 @@ void phy_state_machine(struct work_struc /* If the link is down, give up on negotiation for now */ if (!phydev->link) { phydev->state = PHY_NOLINK; @@ -23,7 +23,7 @@ Signed-off-by: John Crispin break; } -@@ -1067,7 +1070,10 @@ void phy_state_machine(struct work_struc +@@ -1000,7 +1003,10 @@ void phy_state_machine(struct work_struc phy_link_up(phydev); } else { phydev->state = PHY_NOLINK; @@ -35,7 +35,7 @@ Signed-off-by: John Crispin } if (phy_interrupt_is_valid(phydev)) -@@ -1077,7 +1083,10 @@ void phy_state_machine(struct work_struc +@@ -1010,7 +1016,10 @@ void phy_state_machine(struct work_struc case PHY_HALTED: if (phydev->link) { phydev->link = 0;