diff --git a/target/linux/ramips/dts/mt7621_zte_e8820s.dts b/target/linux/ramips/dts/mt7621_zte_e8820s.dts index c247a1229b..c8db1d14a2 100644 --- a/target/linux/ramips/dts/mt7621_zte_e8820s.dts +++ b/target/linux/ramips/dts/mt7621_zte_e8820s.dts @@ -10,10 +10,10 @@ model = "ZTE E8820S"; aliases { - led-boot = &led_sys; - led-failsafe = &led_sys; - led-running = &led_power; - led-upgrade = &led_power; + led-boot = &power_led; + led-failsafe = &system_led; + led-running = &system_led; + led-upgrade = &system_led; label-mac-device = &gmac0; }; @@ -21,69 +21,63 @@ bootargs = "console=ttyS0,115200"; }; - leds { + gpio-leds { compatible = "gpio-leds"; - led_power: power { + power_led: led-power { label = "white:power"; gpios = <&gpio 16 GPIO_ACTIVE_LOW>; }; - led_sys: sys { - label = "white:sys"; + system_led: led-system { + label = "white:system"; gpios = <&gpio 3 GPIO_ACTIVE_LOW>; }; - - wlan2g { - label = "white:wlan2g"; - gpios = <&gpio 14 GPIO_ACTIVE_LOW>; - }; - - wlan5g { - label = "white:wlan5g"; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - }; }; - keys { + gpio-keys { compatible = "gpio-keys"; - reset { + button-reset { label = "reset"; - gpios = <&gpio 18 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; linux,code = ; }; - wps { - label = "wps"; - gpios = <&gpio 8 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wifi { + button-wifi { label = "wifi"; gpios = <&gpio 10 GPIO_ACTIVE_LOW>; linux,code = ; }; - }; - ubi-concat { - compatible = "mtd-concat"; - devices = <&ubipart0 &ubipart1>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - ubi@0 { - label = "ubi"; - reg = <0x0 0x79c0000>; - }; + button-wps { + label = "wps"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,code = ; }; }; }; +&gmac0 { + nvmem-cells = <&macaddr_config_12 0>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_config_12 0>; + nvmem-cell-names = "mac-address"; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &nand { status = "okay"; @@ -93,47 +87,51 @@ #size-cells = <1>; partition@0 { - label = "u-boot"; - reg = <0x0 0x80000>; + label = "Bootloader"; + reg = <0x0 0x220000>; read-only; }; partition@80000 { - label = "debug"; - reg = <0x80000 0x80000>; + compatible = "nvmem-cells"; + label = "config"; + reg = <0x220000 0x140000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_12: macaddr@12 { + compatible = "mac-base"; + reg = <0x12 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; - factory: partition@100000 { + factory: partition@360000 { label = "factory"; - reg = <0x100000 0x40000>; + reg = <0x360000 0x140000>; read-only; }; - partition@140000 { + partition@4a0000 { label = "kernel"; - reg = <0x140000 0x400000>; + reg = <0x4a0000 0x400000>; }; - ubipart0: partition@540000 { - label = "ubipart0"; - reg = <0x540000 0x1c80000>; - }; - - partition@21c0000 { - label = "bdinfo"; - reg = <0x21c0000 0x80000>; - read-only; - }; - - ubipart1: partition@2240000 { - label = "ubipart1"; - reg = <0x2240000 0x5d40000>; + partition@8a0000 { + label = "ubi"; + reg = <0x8a0000 0x76e0000>; }; }; }; &pcie { + reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>, + <&gpio 4 GPIO_ACTIVE_LOW>; status = "okay"; }; @@ -141,8 +139,14 @@ wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + mediatek,mtd-eeprom = <&factory 0xf000>; + nvmem-cells = <&macaddr_config_12 0>; + nvmem-cell-names = "mac-address"; ieee80211-freq-limit = <2400000 2500000>; + + led { + led-active-low; + }; }; }; @@ -150,28 +154,15 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + mediatek,mtd-eeprom = <&factory 0xf800>; + nvmem-cells = <&macaddr_config_12 1>; + nvmem-cell-names = "mac-address"; ieee80211-freq-limit = <5000000 6000000>; - }; -}; -&gmac0 { - nvmem-cells = <&macaddr_factory_e006>; - nvmem-cell-names = "mac-address"; -}; - -&gmac1 { - status = "okay"; - label = "wan"; - phy-handle = <ðphy4>; - - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; -}; - -&mdio { - ethphy4: ethernet-phy@4 { - reg = <4>; + led { + led-active-low; + led-sources = <2>; + }; }; }; @@ -205,17 +196,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index b518b12bde..5af36f00f5 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -2846,21 +2846,18 @@ endef TARGET_DEVICES += zio_freezio define Device/zte_e8820s - $(Device/dsa-migration) + $(Device/nand) $(Device/uimage-lzma-loader) - BLOCKSIZE := 128k - PAGESIZE := 2048 - KERNEL_SIZE := 4096k - UBINIZE_OPTS := -E 5 - IMAGE_SIZE := 32768k - IMAGES += factory.bin - IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ - check-size DEVICE_VENDOR := ZTE DEVICE_MODEL := E8820S DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \ - kmod-usb-ledtrig-usbport + kmod-usb-ledtrig-usbport automount + DEVICE_COMPAT_VERSION := 2.0 + DEVICE_COMPAT_MESSAGE := Partition table has changed to fit the new U-Boot + IMAGE_SIZE := 121728k + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ + check-size endef TARGET_DEVICES += zte_e8820s 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 3667f645da..1159e09ee0 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 @@ -241,8 +241,8 @@ yuncore,ax820) ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan" ;; zte,e8820s) - ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "white:wlan2g" "wlan0" - ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "white:wlan5g" "wlan1" + ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "mt76-phy0" "phy0-ap0" + ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "mt76-phy1" "phy1-ap0" ;; zyxel,lte3301-plus) ucidef_set_led_netdev "internet" "internet" "white:internet" "wwan0" diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version b/target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version index 45bef9385b..c3cebf35b7 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version @@ -8,6 +8,9 @@ board_config_update case "$(board_name)" in + zte,e8820s) + ucidef_set_compat_version "2.0" + ;; *) ucidef_set_compat_version "1.1" ;; 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 0cebd37fb3..f0862539f5 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -117,6 +117,7 @@ platform_do_upgrade() { xiaomi,mi-router-cr6608|\ xiaomi,mi-router-cr6609|\ xiaomi,redmi-router-ac2100|\ + zte,e8820s|\ zyxel,nwa50ax|\ zyxel,nwa55axe) nand_do_upgrade "$1"