diff --git a/target/linux/ramips/dts/mt7621_jcg_nand_128m.dtsi b/target/linux/ramips/dts/mt7621_jcg_nand_128m.dtsi deleted file mode 100644 index a92d64776..000000000 --- a/target/linux/ramips/dts/mt7621_jcg_nand_128m.dtsi +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT - -#include "mt7621.dtsi" - -#include -#include - -/ { - chosen { - bootargs = "console=ttyS0,115200"; - }; - - leds { - compatible = "gpio-leds"; - - led_status_red: status_red { - label = "red:status"; - gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; - }; - - led_status_blue: status_blue { - label = "blue:status"; - gpios = <&gpio 15 GPIO_ACTIVE_LOW>; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio 18 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wps { - label = "wps"; - gpios = <&gpio 16 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; -}; - -&pcie { - status = "okay"; -}; - -&pcie1 { - wifi@0,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; - }; -}; - -&state_default { - gpio { - groups = "jtag", "wdt"; - function = "gpio"; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_jcg_q20-ubootmod.dts b/target/linux/ramips/dts/mt7621_jcg_q20-ubootmod.dts deleted file mode 100644 index 638dd3af1..000000000 --- a/target/linux/ramips/dts/mt7621_jcg_q20-ubootmod.dts +++ /dev/null @@ -1,86 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT - -#include "mt7621_jcg_nand_128m.dtsi" - -/ { - compatible = "jcg,q20-ubootmod", "mediatek,mt7621-soc"; - model = "JCG Q20 (U-Boot mod)"; - - aliases { - led-boot = &led_status_red; - led-failsafe = &led_status_red; - led-running = &led_status_blue; - led-upgrade = &led_status_blue; - label-mac-device = ðernet; - }; -}; - -ðernet { - compatible = "mediatek,ralink-mt7621-eth"; - mediatek,switch = <&gsw>; - mtd-mac-address = <&factory 0x3fff4>; -}; - -&switch0 { - /delete-property/ compatible; - phy-mode = "rgmii"; -}; - -&gsw { - compatible = "mediatek,ralink-mt7621-gsw"; -}; - -&nand { - status = "okay"; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "Bootloader"; - reg = <0x0 0x80000>; - }; - - partition@80000 { - label = "Nvram"; - reg = <0x80000 0x40000>; - read-only; - }; - - partition@c0000 { - label = "Bdata"; - reg = <0xc0000 0x40000>; - read-only; - }; - - factory: partition@100000 { - label = "Factory"; - reg = <0x100000 0x80000>; - read-only; - }; - - partition@180000 { - label = "crash"; - reg = <0x180000 0x40000>; - read-only; - }; - - partition@1c0000 { - label = "crash_log"; - reg = <0x1c0000 0x40000>; - read-only; - }; - - partition@200000 { - label = "kernel"; - reg = <0x200000 0x400000>; - }; - - partition@600000 { - label = "ubi"; - reg = <0x600000 0x7980000>; - }; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_jcg_q20.dts b/target/linux/ramips/dts/mt7621_jcg_q20.dts index f74f20008..c9bf648a3 100644 --- a/target/linux/ramips/dts/mt7621_jcg_q20.dts +++ b/target/linux/ramips/dts/mt7621_jcg_q20.dts @@ -1,6 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7621_jcg_nand_128m.dtsi" +#include "mt7621.dtsi" + +#include +#include / { compatible = "jcg,q20", "mediatek,mt7621-soc"; @@ -14,6 +17,40 @@ label-mac-device = &gmac0; }; + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_status_red: status_red { + label = "red:status"; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + }; + + led_status_blue: status_blue { + label = "blue:status"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + ubi-concat { compatible = "mtd-concat"; devices = <&ubiconcat0 &ubiconcat1>; @@ -94,8 +131,21 @@ }; }; +&pcie { + status = "okay"; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + }; +}; + &gmac0 { - mtd-mac-address = <&factory 0x3fff4>; + nvmem-cells = <&macaddr_factory_3fff4>; + nvmem-cell-names = "mac-address"; }; &switch0 { @@ -103,7 +153,8 @@ port@0 { status = "okay"; label = "wan"; - mtd-mac-address = <&factory 0x3fffa>; + nvmem-cells = <&macaddr_factory_3fffa>; + nvmem-cell-names = "mac-address"; }; port@1 { @@ -117,3 +168,24 @@ }; }; }; + +&state_default { + gpio { + groups = "jtag", "wdt"; + 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/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 4cdb5523a..dcc5d1231 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -851,12 +851,6 @@ define Device/jcg_q20 endef TARGET_DEVICES += jcg_q20 -define Device/jcg_q20-ubootmod - $(Device/jcg_q20) - DEVICE_VARIANT := U-Boot mod -endef -TARGET_DEVICES += jcg_q20-ubootmod - define Device/jcg_y2 $(Device/dsa-migration) $(Device/uimage-lzma-loader) 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 bb5caefaf..44a2ef16f 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 @@ -61,10 +61,6 @@ ramips_setup_interfaces() gnubee,gb-pc2) ucidef_set_interface_lan "lan1 lan2" ;; - jcg,q20-ubootmod) - ucidef_add_switch "switch0" \ - "1:lan" "4:lan" "0:wan" "6@eth0" - ;; linksys,re6500|\ netgear,wac104) ucidef_set_interface_lan "lan1 lan2 lan3 lan4" @@ -167,10 +163,6 @@ ramips_setup_macs() [ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address) wan_mac=$(macaddr_add "$lan_mac" 1) ;; - jcg,q20-ubootmod) - lan_mac=$(cat /sys/class/net/eth0/address) - wan_mac=$(mtd_get_mac_binary factory 0x3fffa) - ;; iodata,wnpr2600g) wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) label_mac=$wan_mac 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 index 6262ba8a8..bb66c1e6a 100644 --- 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 @@ -25,8 +25,7 @@ case "$board" in [ "$PHYNBR" = "1" ] && \ macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1 > /sys${DEVPATH}/macaddress ;; - jcg,q20|\ - jcg,q20-ubootmod) + jcg,q20) [ "$PHYNBR" = "1" ] && \ macaddr_setbit_la "$(mtd_get_mac_binary Factory 0x4)" > /sys${DEVPATH}/macaddress ;; 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 f260399e1..27b8793ef 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -61,7 +61,6 @@ platform_do_upgrade() { dlink,dir-853-a3|\ hiwifi,hc5962|\ jcg,q20|\ - jcg,q20-ubootmod|\ linksys,e5600|\ linksys,ea7300-v1|\ linksys,ea7300-v2|\