ramips: cr660x add switch support

This commit is contained in:
coolsnowwolf 2021-07-30 23:46:39 +08:00
parent d8f3d5efb3
commit 90810371f9
4 changed files with 17 additions and 27 deletions

View File

@ -14,7 +14,7 @@
led-failsafe = &led_sys_yellow;
led-running = &led_sys_blue;
led-upgrade = &led_sys_yellow;
label-mac-device = &gmac0;
label-mac-device = &ethernet;
};
chosen {
@ -129,33 +129,19 @@
};
};
&gmac0 {
&ethernet {
compatible = "mediatek,ralink-mt7621-eth";
mediatek,switch = <&gsw>;
mtd-mac-address = <&factory 0x3fff4>;
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "lan1";
};
/delete-property/ compatible;
phy-mode = "rgmii";
};
port@1 {
status = "okay";
label = "lan2";
};
port@2 {
status = "okay";
label = "lan3";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x3fffa>;
};
};
&gsw {
compatible = "mediatek,ralink-mt7621-gsw";
};
&state_default {

View File

@ -1560,7 +1560,6 @@ endef
TARGET_DEVICES += xiaomi_mi-router-ac2100
define Device/xiaomi_mi-router-cr660x
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
BLOCKSIZE := 128k
PAGESIZE := 2048
@ -1575,6 +1574,7 @@ define Device/xiaomi_mi-router-cr660x
DEVICE_MODEL := Mi Router CR660x
DEVICE_PACKAGES += kmod-mt7915e wpad-openssl uboot-envtools
SUPPORTED_DEVICES += xiaomi,mi-router-cr6606
DEVICE_COMPAT_VERSION := 1.1
endef
TARGET_DEVICES += xiaomi_mi-router-cr660x

View File

@ -38,7 +38,7 @@ dlink,dir-853-a3)
;;
dlink,dir-853-r1|\
xiaomi,mi-router-cr660x)
ucidef_set_led_netdev "internet" "internet" "blue:net" "wan"
ucidef_set_led_switch "wan" "wan" "blue:net" "switch0" "0x10"
;;
dlink,dir-860l-b1|\
dlink,dir-867-a1|\

View File

@ -23,8 +23,7 @@ ramips_setup_interfaces()
;;
ampedwireless,ally-r1900k|\
hiwifi,hc5962|\
xiaomi,mi-router-3-pro|\
xiaomi,mi-router-cr660x)
xiaomi,mi-router-3-pro)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
;;
asiarf,ap7621-001|\
@ -86,6 +85,11 @@ ramips_setup_interfaces()
"2:lan:1" "3:lan:2" "4:lan:3" "0:wan" "6@eth0"
ucidef_set_interface_lan "eth0.1 ra0 rai0"
;;
xiaomi,mi-router-cr660x)
ucidef_add_switch "switch0" \
"0:lan:1" "1:lan:2" "2:lan:3" "4:wan" "6@eth0"
ucidef_set_interface_lan "eth0.1"
;;
zyxel,nr7101)
ucidef_set_interfaces_lan_wan "lan" "wan"
;;