ramips: Xiaomi MIR3G: detect board name from DTS
- Former "mir3g" board name becomes "xiaomi,mir3g". - Reorder some entries to maintain alphabetical order. - Change DTS so status LEDs (yellow/red/blue) mimic Xiaomi stock firmware: (Section Indicator) <http://files.xiaomi-mi.co.uk/files/router_pro/router%20PRO%20EN.pdf> <http://files.xiaomi-mi.co.uk/files/Mi_WiFi_router_3/MiWiFi_router3_EN.pdf> |Yellow: Update (LED flickering), the launch of the system (steady light); |Blue: during normal operation (steady light); |Red: Safe mode (display flicker), system failure (steady light); Signed-off-by: Ozgur Can Leonard <ozgurcan@gmail.com> [Added link to similar Router 3 model] Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
This commit is contained in:
parent
f22c33b40c
commit
201d3d1a82
7 changed files with 31 additions and 33 deletions
|
@ -32,7 +32,7 @@ zbt-wg2626)
|
||||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
|
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
|
||||||
;;
|
;;
|
||||||
xiaomi,mir3p|\
|
xiaomi,mir3p|\
|
||||||
mir3g)
|
xiaomi,mir3g)
|
||||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
|
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -236,17 +236,6 @@ mikrotik,rbm11g)
|
||||||
miniembplug)
|
miniembplug)
|
||||||
set_wifi_led "$boardname:red:wlan"
|
set_wifi_led "$boardname:red:wlan"
|
||||||
;;
|
;;
|
||||||
xiaomi,mir3p)
|
|
||||||
ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x10" "0x08"
|
|
||||||
ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x02" "0x08"
|
|
||||||
ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08"
|
|
||||||
ucidef_set_led_switch "lan3-amber" "LAN3 (amber)" "$boardname:amber:lan3" "switch0" "0x08" "0x08"
|
|
||||||
;;
|
|
||||||
mir3g)
|
|
||||||
ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x02" "0x08"
|
|
||||||
ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x08" "0x08"
|
|
||||||
ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08"
|
|
||||||
;;
|
|
||||||
mlw221|\
|
mlw221|\
|
||||||
mlwg2)
|
mlwg2)
|
||||||
set_wifi_led "$boardname:blue:wifi"
|
set_wifi_led "$boardname:blue:wifi"
|
||||||
|
@ -421,6 +410,17 @@ wrh-300cr)
|
||||||
set_wifi_led "$boardname:green:wlan"
|
set_wifi_led "$boardname:green:wlan"
|
||||||
ucidef_set_led_netdev "lan" "lan" "$boardname:green:ethernet" "eth0"
|
ucidef_set_led_netdev "lan" "lan" "$boardname:green:ethernet" "eth0"
|
||||||
;;
|
;;
|
||||||
|
xiaomi,mir3g)
|
||||||
|
ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x02" "0x08"
|
||||||
|
ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x08" "0x08"
|
||||||
|
ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08"
|
||||||
|
;;
|
||||||
|
xiaomi,mir3p)
|
||||||
|
ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x10" "0x08"
|
||||||
|
ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x02" "0x08"
|
||||||
|
ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08"
|
||||||
|
ucidef_set_led_switch "lan3-amber" "LAN3 (amber)" "$boardname:amber:lan3" "switch0" "0x08" "0x08"
|
||||||
|
;;
|
||||||
xzwifi,creativebox-v1)
|
xzwifi,creativebox-v1)
|
||||||
ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x10"
|
ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x10"
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -179,10 +179,6 @@ ramips_setup_interfaces()
|
||||||
ucidef_add_switch "switch0" \
|
ucidef_add_switch "switch0" \
|
||||||
"1:lan:2" "2:lan:1" "3:lan:3" "4:lan" "0:wan" "6@eth0"
|
"1:lan:2" "2:lan:1" "3:lan:3" "4:lan" "0:wan" "6@eth0"
|
||||||
;;
|
;;
|
||||||
mir3g)
|
|
||||||
ucidef_add_switch "switch0" \
|
|
||||||
"2:lan:2" "3:lan:1" "1:wan" "6t@eth0"
|
|
||||||
;;
|
|
||||||
psg1218b)
|
psg1218b)
|
||||||
ucidef_add_switch "switch0" \
|
ucidef_add_switch "switch0" \
|
||||||
"0:lan:3" "1:lan:2" "2:lan:1" "3:wan" "6@eth0"
|
"0:lan:3" "1:lan:2" "2:lan:1" "3:wan" "6@eth0"
|
||||||
|
@ -437,6 +433,10 @@ ramips_setup_interfaces()
|
||||||
ucidef_add_switch "switch0" \
|
ucidef_add_switch "switch0" \
|
||||||
"4:lan" "0:wan" "6@eth0"
|
"4:lan" "0:wan" "6@eth0"
|
||||||
;;
|
;;
|
||||||
|
xiaomi,mir3g)
|
||||||
|
ucidef_add_switch "switch0" \
|
||||||
|
"2:lan:2" "3:lan:1" "1:wan" "6t@eth0"
|
||||||
|
;;
|
||||||
xiaomi,mir3p)
|
xiaomi,mir3p)
|
||||||
ucidef_add_switch "switch0" \
|
ucidef_add_switch "switch0" \
|
||||||
"1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
|
"1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
|
||||||
|
@ -568,10 +568,6 @@ ramips_setup_macs()
|
||||||
lan_mac=$(mtd_get_mac_binary factory_info 13)
|
lan_mac=$(mtd_get_mac_binary factory_info 13)
|
||||||
wan_mac=$(macaddr_add "$lan_mac" 1)
|
wan_mac=$(macaddr_add "$lan_mac" 1)
|
||||||
;;
|
;;
|
||||||
mir3g|\
|
|
||||||
xiaomi,mir3p)
|
|
||||||
lan_mac=$(mtd_get_mac_binary Factory 0xe006)
|
|
||||||
;;
|
|
||||||
miwifi-mini)
|
miwifi-mini)
|
||||||
wan_mac=$(cat /sys/class/net/eth0/address)
|
wan_mac=$(cat /sys/class/net/eth0/address)
|
||||||
lan_mac=$(macaddr_setbit_la "$wan_mac")
|
lan_mac=$(macaddr_setbit_la "$wan_mac")
|
||||||
|
@ -653,6 +649,10 @@ ramips_setup_macs()
|
||||||
wlr-6000)
|
wlr-6000)
|
||||||
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 32772)" 2)
|
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 32772)" 2)
|
||||||
;;
|
;;
|
||||||
|
xiaomi,mir3g|\
|
||||||
|
xiaomi,mir3p)
|
||||||
|
lan_mac=$(mtd_get_mac_binary Factory 0xe006)
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
lan_mac=$(cat /sys/class/net/eth0/address)
|
lan_mac=$(cat /sys/class/net/eth0/address)
|
||||||
wan_mac=$(macaddr_add "$lan_mac" 1)
|
wan_mac=$(macaddr_add "$lan_mac" 1)
|
||||||
|
|
|
@ -277,9 +277,6 @@ ramips_board_detect() {
|
||||||
*"Mercury MAC1200R v2")
|
*"Mercury MAC1200R v2")
|
||||||
name="mac1200rv2"
|
name="mac1200rv2"
|
||||||
;;
|
;;
|
||||||
*"Mi Router 3G")
|
|
||||||
name="mir3g"
|
|
||||||
;;
|
|
||||||
*"MicroWRT")
|
*"MicroWRT")
|
||||||
name="microwrt"
|
name="microwrt"
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -37,11 +37,11 @@ platform_do_upgrade() {
|
||||||
|
|
||||||
case "$board" in
|
case "$board" in
|
||||||
hc5962|\
|
hc5962|\
|
||||||
mir3g|\
|
|
||||||
r6220|\
|
r6220|\
|
||||||
netgear,r6350|\
|
netgear,r6350|\
|
||||||
ubnt-erx|\
|
ubnt-erx|\
|
||||||
ubnt-erx-sfp|\
|
ubnt-erx-sfp|\
|
||||||
|
xiaomi,mir3g|\
|
||||||
xiaomi,mir3p)
|
xiaomi,mir3p)
|
||||||
nand_do_upgrade "$ARGV"
|
nand_do_upgrade "$ARGV"
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -10,10 +10,10 @@
|
||||||
model = "Xiaomi Mi Router 3G";
|
model = "Xiaomi Mi Router 3G";
|
||||||
|
|
||||||
aliases {
|
aliases {
|
||||||
led-boot = &led_status_blue;
|
led-boot = &led_status_yellow;
|
||||||
led-failsafe = &led_status_blue;
|
led-failsafe = &led_status_red;
|
||||||
led-running = &led_status_blue;
|
led-running = &led_status_blue;
|
||||||
led-upgrade = &led_status_blue;
|
led-upgrade = &led_status_yellow;
|
||||||
};
|
};
|
||||||
|
|
||||||
memory@0 {
|
memory@0 {
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
leds {
|
leds {
|
||||||
compatible = "gpio-leds";
|
compatible = "gpio-leds";
|
||||||
|
|
||||||
status_red {
|
led_status_red: status_red {
|
||||||
label = "mir3g:red:status";
|
label = "mir3g:red:status";
|
||||||
gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
|
gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
|
||||||
};
|
};
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
|
gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
|
||||||
};
|
};
|
||||||
|
|
||||||
status_yellow {
|
led_status_yellow: status_yellow {
|
||||||
label = "mir3g:yellow:status";
|
label = "mir3g:yellow:status";
|
||||||
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
|
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
|
||||||
};
|
};
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
keys {
|
button {
|
||||||
compatible = "gpio-keys-polled";
|
compatible = "gpio-keys-polled";
|
||||||
poll-interval = <20>;
|
poll-interval = <20>;
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
reg_usb_vbus: reg_usb_vbus {
|
reg_usb_vbus: regulator {
|
||||||
compatible = "regulator-fixed";
|
compatible = "regulator-fixed";
|
||||||
regulator-name = "usb_vbus";
|
regulator-name = "usb_vbus";
|
||||||
regulator-min-microvolt = <5000000>;
|
regulator-min-microvolt = <5000000>;
|
||||||
|
|
|
@ -251,7 +251,7 @@ define Device/xiaomi_mir3p
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += xiaomi_mir3p
|
TARGET_DEVICES += xiaomi_mir3p
|
||||||
|
|
||||||
define Device/mir3g
|
define Device/xiaomi_mir3g
|
||||||
DTS := MIR3G
|
DTS := MIR3G
|
||||||
BLOCKSIZE := 128k
|
BLOCKSIZE := 128k
|
||||||
PAGESIZE := 2048
|
PAGESIZE := 2048
|
||||||
|
@ -264,11 +264,12 @@ define Device/mir3g
|
||||||
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||||
DEVICE_TITLE := Xiaomi Mi Router 3G
|
DEVICE_TITLE := Xiaomi Mi Router 3G
|
||||||
SUPPORTED_DEVICES += R3G
|
SUPPORTED_DEVICES += R3G
|
||||||
|
SUPPORTED_DEVICES += mir3g
|
||||||
DEVICE_PACKAGES := \
|
DEVICE_PACKAGES := \
|
||||||
kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic \
|
kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic \
|
||||||
uboot-envtools
|
uboot-envtools
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += mir3g
|
TARGET_DEVICES += xiaomi_mir3g
|
||||||
|
|
||||||
define Device/mt7621
|
define Device/mt7621
|
||||||
DTS := MT7621
|
DTS := MT7621
|
||||||
|
|
Loading…
Reference in a new issue