--- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -157,6 +157,65 @@ define Device/nand IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef +define Device/phicomm_k2p-32m + IMAGE_SIZE := 32128k + DEVICE_VENDOR := Phicomm + DEVICE_MODEL := K2P + DEVICE_VARIANT := 32M + SUPPORTED_DEVICES += k2p-32M + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware +endef +TARGET_DEVICES += phicomm_k2p-32m + +define Device/jdcloud_re-sp-01b + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 32448k + DEVICE_VENDOR := JDCloud + DEVICE_MODEL := RE-SP-01B + DEVICE_PACKAGES := kmod-fs-ext4 kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware kmod-sdhci-mt7620 kmod-usb3 + endef + TARGET_DEVICES += jdcloud_re-sp-01b + +define Device/jdcloud_luban + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 15808k + DEVICE_VENDOR := JDCloud + DEVICE_MODEL := Luban 鲁班 + DEVICE_PACKAGES += kmod-mt7915e kmod-mt7915-firmware uboot-envtools kmod-mmc kmod-sdhci kmod-sdhci-mt7620 kmod-fs-ext4 wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server +endef +TARGET_DEVICES += jdcloud_luban + +define Device/zte_e8820s + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 4096k + UBINIZE_OPTS := -E 5 + IMAGE_SIZE := 130304k + 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 uboot-envtools +endef +TARGET_DEVICES += zte_e8820s + +define Device/zte_e8820v2 + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 16064k + DEVICE_VENDOR := ZTE + DEVICE_MODEL := E8820V2 + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb2 \ + kmod-usb-ledtrig-usbport wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server +endef +TARGET_DEVICES += zte_e8820v2 + define Device/adslr_g7 $(Device/dsa-migration) IMAGE_SIZE := 16064k @@ -2427,7 +2486,6 @@ define Device/xiaomi_nand_separate $(Device/nand) $(Device/uimage-lzma-loader) DEVICE_VENDOR := Xiaomi - IMAGES += kernel1.bin rootfs0.bin IMAGE/kernel1.bin := append-kernel IMAGE/rootfs0.bin := append-ubi | check-size endef @@ -2511,30 +2569,14 @@ define Device/xiaomi_mi-router-cr660x $(Device/nand) $(Device/uimage-lzma-loader) DEVICE_VENDOR := Xiaomi + DEVICE_MODEL := Mi Router CR660X / TR60X IMAGE_SIZE := 128512k - IMAGES += firmware.bin - IMAGE/firmware.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ check-size DEVICE_PACKAGES += kmod-mt7915-firmware endef - -define Device/xiaomi_mi-router-cr6606 - $(Device/xiaomi_mi-router-cr660x) - DEVICE_MODEL := Mi Router CR6606 -endef -TARGET_DEVICES += xiaomi_mi-router-cr6606 - -define Device/xiaomi_mi-router-cr6608 - $(Device/xiaomi_mi-router-cr660x) - DEVICE_MODEL := Mi Router CR6608 -endef -TARGET_DEVICES += xiaomi_mi-router-cr6608 - -define Device/xiaomi_mi-router-cr6609 - $(Device/xiaomi_mi-router-cr660x) - DEVICE_MODEL := Mi Router CR6609 -endef -TARGET_DEVICES += xiaomi_mi-router-cr6609 +TARGET_DEVICES += xiaomi_mi-router-cr660x define Device/xiaomi_redmi-router-ac2100 $(Device/xiaomi_nand_separate) --- /dev/null +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_xiaomi_mi-router-cr660x.dtsi" + +/ { + compatible = "xiaomi,mi-router-cr660x", "mediatek,mt7621-soc"; + model = "Xiaomi Mi Router CR6606 / CR6608 / CR6609"; +}; --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -131,9 +131,7 @@ tplink,tl-wpa8631p-v3) xiaomi,mi-router-ac2100) ucidef_set_led_netdev "wan-blue" "WAN (blue)" "blue:wan" "wan" ;; -xiaomi,mi-router-cr6606|\ -xiaomi,mi-router-cr6608|\ -xiaomi,mi-router-cr6609) +xiaomi,mi-router-cr660x) ucidef_set_led_netdev "internet" "Internet" "blue:net" "wan" ;; xiaomi,redmi-router-ac2100) --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -48,9 +48,7 @@ ramips_setup_interfaces() sim,simax1800t|\ xiaomi,mi-router-3-pro|\ xiaomi,mi-router-ac2100|\ - xiaomi,mi-router-cr6606|\ - xiaomi,mi-router-cr6608|\ - xiaomi,mi-router-cr6609|\ + xiaomi,mi-router-cr660x|\ xiaomi,redmi-router-ac2100|\ zyxel,wsm20) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" @@ -68,6 +66,7 @@ ramips_setup_interfaces() iptime,a3002mesh|\ jcg,q20|\ lenovo,newifi-d1|\ + jdcloud,re-sp-01b|\ mikrotik,routerboard-m33g|\ mts,wg430223|\ oraybox,x3a|\ --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -109,9 +109,8 @@ platform_do_upgrade() { xiaomi,mi-router-3-pro|\ xiaomi,mi-router-4|\ xiaomi,mi-router-ac2100|\ - xiaomi,mi-router-cr6606|\ - xiaomi,mi-router-cr6608|\ - xiaomi,mi-router-cr6609|\ + xiaomi,mi-router-cr660x|\ + zte,e8820s|\ xiaomi,redmi-router-ac2100|\ zyxel,nwa50ax|\ zyxel,nwa55axe) --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -73,9 +73,7 @@ zyxel,nr7101) ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000" ;; bolt,arion|\ -xiaomi,mi-router-cr6606|\ -xiaomi,mi-router-cr6608|\ -xiaomi,mi-router-cr6609) +xiaomi,mi-router-cr660x) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000" ;; esac --- /dev/null +++ b/target/linux/ramips/dts/mt7621_jdcloud_re-sp-01b.dts @@ -0,0 +1,150 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "jdcloud,re-sp-01b", "mediatek,mt7621-soc"; + model = "JDCloud RE-SP-01B"; + + aliases { + led-boot = &led_red; + led-failsafe = &led_red; + led-running = &led_green; + led-upgrade = &led_blue; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_red: red { + label = "red:sys"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + panic-indicator; + }; + + led_green: green { + label = "green:sys"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + led_blue: blue { + label = "blue:sys"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&sdhci { + 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; + }; + + config: 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 0x1fb0000>; + }; + }; + }; +}; + +&gmac0 { + mtd-mac-address-ascii = <&config 0x4429>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "wan"; + }; + + port@1 { + status = "okay"; + label = "lan1"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + mtd-mac-address-ascii = <&config 0x4429>; + mediatek,mtd-eeprom = <&factory 0x0>; + }; +}; + +&pcie1 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + mtd-mac-address-ascii = <&config 0x4429>; + mtd-mac-address-increment = <0x80>; + mtd-mac-address-increment-byte = <3>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&state_default { + gpio { + groups = "uart2", "uart3", "wdt"; + function = "gpio"; + }; +};