ramips: improve support for dlink and xiaomi devices (#7370)

* ramips: dlink_dir-8xx-a1: switch to breed partition

* ramips: improve support for cr660x
This commit is contained in:
AmadeusGhost 2021-07-13 21:11:06 +08:00 committed by GitHub
parent 811525694b
commit 5e34f40296
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 24 additions and 32 deletions

View File

@ -58,7 +58,7 @@ xiaomi,mi-router-ac2100|\
xiaomi,redmi-router-ac2100) xiaomi,redmi-router-ac2100)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
;; ;;
xiaomi,mi-router-cr6606) xiaomi,mi-router-cr660x)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000" ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
;; ;;
zyxel,nr7101) zyxel,nr7101)

View File

@ -27,15 +27,14 @@
factory: partition@40000 { factory: partition@40000 {
label = "factory"; label = "factory";
reg = <0x40000 0x20000>; reg = <0x40000 0x10000>;
read-only; read-only;
}; };
partition@60000 { partition@50000 {
compatible = "openwrt,uimage", "denx,uimage"; compatible = "denx,uimage";
openwrt,padding = <96>;
label = "firmware"; label = "firmware";
reg = <0x60000 0xfa0000>; reg = <0x50000 0xfb0000>;
}; };
}; };
}; };

View File

@ -1,5 +1,4 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7621.dtsi" #include "mt7621.dtsi"
@ -7,8 +6,8 @@
#include <dt-bindings/input/input.h> #include <dt-bindings/input/input.h>
/ { / {
compatible = "xiaomi,mi-router-cr6606", "mediatek,mt7621-soc"; compatible = "xiaomi,mi-router-cr660x", "mediatek,mt7621-soc";
model = "Xiaomi Mi Router CR6606/CR6608/CR6609"; model = "Xiaomi Mi Router CR660x";
aliases { aliases {
led-boot = &led_sys_yellow; led-boot = &led_sys_yellow;
@ -26,22 +25,22 @@
compatible = "gpio-leds"; compatible = "gpio-leds";
led_sys_yellow: sys_yellow { led_sys_yellow: sys_yellow {
label = "mi-router-cr6606:yellow:sys"; label = "yellow:sys";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>; gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
}; };
led_sys_blue: sys_blue { led_sys_blue: sys_blue {
label = "mi-router-cr6606:blue:sys"; label = "blue:sys";
gpios = <&gpio 16 GPIO_ACTIVE_LOW>; gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
}; };
net_yellow { net_yellow {
label = "mi-router-cr6606:yellow:net"; label = "yellow:net";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>; gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
}; };
net_blue { net_blue {
label = "mi-router-cr6606:blue:net"; label = "blue:net";
gpios = <&gpio 15 GPIO_ACTIVE_LOW>; gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
}; };
}; };
@ -74,7 +73,6 @@
partition@0 { partition@0 {
label = "Bootloader"; label = "Bootloader";
reg = <0x0 0x80000>; reg = <0x0 0x80000>;
read-only;
}; };
partition@80000 { partition@80000 {

View File

@ -283,15 +283,9 @@ TARGET_DEVICES += cudy_wr2100
define Device/dlink_dir-8xx-a1 define Device/dlink_dir-8xx-a1
$(Device/dsa-migration) $(Device/dsa-migration)
IMAGE_SIZE := 16000k IMAGE_SIZE := 16064k
DEVICE_VENDOR := D-Link DEVICE_VENDOR := D-Link
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware
KERNEL_INITRAMFS := $$(KERNEL) | uimage-padhdr 96
IMAGES += factory.bin
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | uimage-padhdr 96 |\
pad-rootfs | check-size | append-metadata
IMAGE/factory.bin := append-kernel | append-rootfs | uimage-padhdr 96 |\
check-size
endef endef
define Device/dlink_dir-8xx-r1 define Device/dlink_dir-8xx-r1
@ -1162,7 +1156,7 @@ define Device/phicomm_k2p
DEVICE_VENDOR := Phicomm DEVICE_VENDOR := Phicomm
DEVICE_MODEL := K2P DEVICE_MODEL := K2P
SUPPORTED_DEVICES += k2p SUPPORTED_DEVICES += k2p
DEVICE_PACKAGES := -luci-newapi -wpad-openssl kmod-mt7615d_dbdc luci-app-adbyby-plus xray-core UnblockNeteaseMusicGo DEVICE_PACKAGES := kmod-mt7615d_dbdc -luci-newapi -wpad-openssl
endef endef
TARGET_DEVICES += phicomm_k2p TARGET_DEVICES += phicomm_k2p
@ -1567,7 +1561,8 @@ define Device/xiaomi_mi-router-ac2100
endef endef
TARGET_DEVICES += xiaomi_mi-router-ac2100 TARGET_DEVICES += xiaomi_mi-router-ac2100
define Device/xiaomi_mi-router-cr6606 define Device/xiaomi_mi-router-cr660x
$(Device/dsa-migration)
$(Device/uimage-lzma-loader) $(Device/uimage-lzma-loader)
BLOCKSIZE := 128k BLOCKSIZE := 128k
PAGESIZE := 2048 PAGESIZE := 2048
@ -1576,12 +1571,14 @@ define Device/xiaomi_mi-router-cr6606
IMAGE_SIZE := 128512k IMAGE_SIZE := 128512k
IMAGES += factory.bin IMAGES += factory.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
check-size
DEVICE_VENDOR := Xiaomi DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := Mi Router CR6606/CR6608/CR6609 DEVICE_MODEL := Mi Router CR660x
DEVICE_PACKAGES += kmod-mt7915e wpad-openssl uboot-envtools DEVICE_PACKAGES += kmod-mt7915e wpad-openssl uboot-envtools
SUPPORTED_DEVICES += xiaomi,mi-router-cr6606
endef endef
TARGET_DEVICES += xiaomi_mi-router-cr6606 TARGET_DEVICES += xiaomi_mi-router-cr660x
define Device/xiaomi_redmi-router-ac2100 define Device/xiaomi_redmi-router-ac2100
$(Device/xiaomi_nand_separate) $(Device/xiaomi_nand_separate)

View File

@ -37,7 +37,8 @@ dlink,dir-2660-a1)
dlink,dir-853-a3) dlink,dir-853-a3)
ucidef_set_led_netdev "wan" "wan" "blue:net" "wan" ucidef_set_led_netdev "wan" "wan" "blue:net" "wan"
;; ;;
dlink,dir-853-r1) dlink,dir-853-r1|\
xiaomi,mi-router-cr660x)
ucidef_set_led_netdev "internet" "internet" "blue:net" "wan" ucidef_set_led_netdev "internet" "internet" "blue:net" "wan"
;; ;;
dlink,dir-860l-b1|\ dlink,dir-860l-b1|\
@ -116,9 +117,6 @@ tplink,re650-v1)
xiaomi,mi-router-ac2100) xiaomi,mi-router-ac2100)
ucidef_set_led_netdev "wan-blue" "WAN (blue)" "blue:wan" "wan" ucidef_set_led_netdev "wan-blue" "WAN (blue)" "blue:wan" "wan"
;; ;;
xiaomi,mi-router-cr6606)
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:net" "wan"
;;
xiaomi,redmi-router-ac2100) xiaomi,redmi-router-ac2100)
ucidef_set_led_netdev "wan" "wan" "white:wan" "wan" ucidef_set_led_netdev "wan" "wan" "white:wan" "wan"
;; ;;

View File

@ -26,7 +26,7 @@ ramips_setup_interfaces()
hiwifi,hc5962|\ hiwifi,hc5962|\
xiaomi,mi-router-3-pro|\ xiaomi,mi-router-3-pro|\
xiaomi,mi-router-ac2100|\ xiaomi,mi-router-ac2100|\
xiaomi,mi-router-cr6606|\ xiaomi,mi-router-cr660x|\
xiaomi,redmi-router-ac2100) xiaomi,redmi-router-ac2100)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
;; ;;

View File

@ -79,7 +79,7 @@ platform_do_upgrade() {
xiaomi,mi-router-3-pro|\ xiaomi,mi-router-3-pro|\
xiaomi,mi-router-4|\ xiaomi,mi-router-4|\
xiaomi,mi-router-ac2100|\ xiaomi,mi-router-ac2100|\
xiaomi,mi-router-cr6606|\ xiaomi,mi-router-cr660x|\
xiaomi,redmi-router-ac2100) xiaomi,redmi-router-ac2100)
nand_do_upgrade "$1" nand_do_upgrade "$1"
;; ;;