From 3c510baf470508f340a11600edd4296813b54687 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Fri, 1 May 2020 22:37:45 +0800 Subject: [PATCH] ramips: fix support for Redmi AC2100 (#4500) This commit fix switch and image config for Redmi AC2100. Signed-off-by: AmadeusGhost --- package/boot/uboot-envtools/files/ath79 | 3 --- package/boot/uboot-envtools/files/ramips | 1 + .../ramips/dts/mt7621_xiaomi_redmi-router-ac2100.dts | 7 ++----- target/linux/ramips/image/mt7621.mk | 5 ++--- .../ramips/mt7621/base-files/etc/board.d/02_network | 9 ++++++--- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index aebfeca85..63f02975e 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -45,9 +45,6 @@ yuncore,xd4200) buffalo,wzr-hp-ag300h) ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000" ;; -domywifi,dw33d) - ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x10000" "0x10000" - ;; glinet,gl-ar150) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000" ;; diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 5c4730670..b81ad91bd 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -35,6 +35,7 @@ zbtlink,zbt-wg2626) ;; xiaomi,mir3p|\ xiaomi,mir3g|\ +xiaomi,miwifi-r3|\ xiaomi,redmi-router-ac2100) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" ;; 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 d5669b584..7b17a9b38 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_redmi-router-ac2100.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_redmi-router-ac2100.dts @@ -15,7 +15,6 @@ led-failsafe = &led_status_amber; led-running = &led_status_white; led-upgrade = &led_status_white; - label-mac-device = &gmac0; }; chosen { @@ -55,10 +54,8 @@ linux,code = ; }; }; - }; - &nand { status = "okay"; @@ -152,7 +149,7 @@ &state_default { gpio { - groups = "uart2", "uart3", "wdt"; - function = "gpio"; + ralink,group = "uart2", "uart3", "wdt"; + ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 72e0c5898..72a231c64 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -893,7 +893,6 @@ endef TARGET_DEVICES += xiaomi_mir3p define Device/xiaomi_redmi-router-ac2100 - $(Device/uimage-lzma-loader) BLOCKSIZE := 128k PAGESIZE := 2048 KERNEL_SIZE := 4096k @@ -901,11 +900,11 @@ define Device/xiaomi_redmi-router-ac2100 UBINIZE_OPTS := -E 5 IMAGES += kernel1.bin rootfs0.bin IMAGE/kernel1.bin := append-kernel - IMAGE/rootfs0.bin := append-ubi | check-size + IMAGE/rootfs0.bin := append-ubi | check-size $$$$(IMAGE_SIZE) IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata DEVICE_VENDOR := Xiaomi DEVICE_MODEL := Redmi Router AC2100 - DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e wpad-basic uboot-envtools + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e wpad-openssl uboot-envtools endef TARGET_DEVICES += xiaomi_redmi-router-ac2100 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 c49969846..43d3b1a9a 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 @@ -109,8 +109,6 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "4:lan" "6@eth0" ;; - xiaomi,mir3p|\ - xiaomi,redmi-router-ac2100|\ hiwifi,hc5962) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" @@ -153,6 +151,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0" ;; + xiaomi,redmi-router-ac2100) + ucidef_add_switch "switch0" \ + "1:lan:2" "2:lan:3" "3:lan:4" "0:wan" "6@eth0" + ;; *) ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" ;; @@ -236,7 +238,8 @@ ramips_setup_macs() ;; iodata,wn-ax1167gr2|\ iodata,wn-dx1167r|\ - xiaomi,mir3g-v2) + xiaomi,mir3g-v2|\ + xiaomi,redmi-router-ac2100) wan_mac=$(mtd_get_mac_binary factory 0xe006) label_mac=$wan_mac ;;