mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-27 01:11:14 +00:00
a30abb1b6b
MobiPromo CM520-79F is an AC1300 dual band router based on IPQ4019 Specification: SoC/Wireless: QCA IPQ4019 RAM: 512MiB Flash: 128MiB SLC NAND Ethernet PHY: QCA8075 Ethernet ports: 1x WAN, 2x LAN LEDs: 7 LEDs 2 (USB, CAN) are GPIO other 5 (2.4G, 5G, LAN1, LAN2, WAN) are connected to a shift register Button: Reset Flash instruction: Disassemble the router, connect UART pins like this: GND TX RX [x x . . x .] [. . . . . .] (QCA8075 and IPQ4019 below) Baud-rate: 115200 Set up TFTP server: IP 192.168.1.188/24 Power on the router and interrupt the booting with UART console env backup (in case you want to go back to stock and need it there): printenv (Copy the output to somewhere save) Set bootenv: setenv set_ubi 'set mtdids nand0=nand0; set mtdparts mtdparts=nand0:0x7480000@0xb80000(fs); ubi part fs' setenv bootkernel 'ubi read 0x84000000 kernel; bootm 0x84000000#config@1' setenv cm520_boot 'run set_ubi; run bootkernel' setenv bootcmd 'run cm520_boot' setenv bootargs saveenv Boot initramfs from TFTP: tftpboot openwrt-ipq40xx-generic-mobipromo_cm520-79f-initramfs-fit-zImage.itb bootm After initramfs image is booted, backup rootfs partition in case of reverting to stock image cat /dev/mtd12 > /tmp/mtd12.bin Then fetch it via SCP Upload nand-factory.ubi to /tmp via SCP, then run mtd erase rootfs mtd write /tmp/*nand-factory.ubi rootfs reboot To revert to stock image, restore default bootenv in uboot UART console setenv bootcmd 'bootipq' printenv use the saved dump you did back when you installed OpenWrt to verify that there are no other differences from back in the day. saveenv upload the backed up mtd12.bin and run tftpboot mtd12.bin nand erase 0xb80000 0x7480000 nand write 0x84000000 0xb80000 0x7480000 The BOOTCONFIG may have been configured to boot from alternate partition (rootfs_1) instead In case of this, set it back to rootfs: cd /tmp cat /dev/mtd7 > mtd7.bin echo -ne '\x0b' | dd of=mtd7.bin conv=notrunc bs=1 count=1 seek=4 for i in 28 48 68 108; do dd if=/dev/zero of=mtd7.bin conv=notrunc bs=1 count=1 seek=$i done mtd write mtd7.bin BOOTCONFIG mtd write mtd7.bin BOOTCONFIG1 Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn> [renamed volume to ubi to support autoboot, as per David Lam's test in PR#2432] Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
76 lines
2.5 KiB
Bash
Executable File
76 lines
2.5 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Copyright (C) 2015 OpenWrt.org
|
|
#
|
|
|
|
. /lib/functions/uci-defaults.sh
|
|
|
|
board_config_update
|
|
|
|
board=$(board_name)
|
|
boardname="${board##*,}"
|
|
|
|
case "$board" in
|
|
alfa-network,ap120c-ac)
|
|
ucidef_set_led_netdev "wan" "WAN" "${boardname}:amber:wan" "eth1"
|
|
;;
|
|
asus,rt-ac58u)
|
|
ucidef_set_led_netdev "wan" "WAN" "${boardname}:blue:wan" "eth1"
|
|
ucidef_set_led_switch "lan" "LAN" "${boardname}:blue:lan" "switch0" "0x1e"
|
|
;;
|
|
avm,fritzbox-4040)
|
|
ucidef_set_led_wlan "wlan" "WLAN" "fritz4040:green:wlan" "phy0tpt" "phy1tpt"
|
|
ucidef_set_led_netdev "wan" "WAN" "fritz4040:green:wan" "eth1"
|
|
ucidef_set_led_switch "lan" "LAN" "fritz4040:green:lan" "switch0" "0x1e"
|
|
;;
|
|
avm,fritzbox-7530 |\
|
|
glinet,gl-b1300)
|
|
ucidef_set_led_wlan "wlan" "WLAN" "${boardname}:green:wlan" "phy0tpt"
|
|
;;
|
|
engenius,eap1300)
|
|
ucidef_set_led_netdev "lan" "LAN" "${boardname}:blue:lan" "eth0"
|
|
ucidef_set_led_wlan "wlan2g" "WLAN2G" "${boardname}:blue:wlan2g" "phy0tpt"
|
|
ucidef_set_led_wlan "wlan5g" "WLAN5G" "${boardname}:yellow:wlan5g" "phy1tpt"
|
|
ucidef_set_led_default "mesh" "MESH" "${boardname}:blue:mesh" "0"
|
|
;;
|
|
engenius,eap2200)
|
|
ucidef_set_led_netdev "lan1" "LAN1" "${boardname}:blue:lan1" "eth0"
|
|
ucidef_set_led_netdev "lan2" "LAN2" "${boardname}:blue:lan2" "eth1"
|
|
;;
|
|
engenius,ens620ext)
|
|
ucidef_set_led_wlan "wlan2g" "WLAN2G" "${boardname}:green:wlan2G" "phy0tpt"
|
|
ucidef_set_led_wlan "wlan5g" "WLAN5G" "${boardname}:green:wlan5G" "phy1tpt"
|
|
ucidef_set_led_netdev "lan1" "LAN1" "${boardname}:green:lan1" "eth0"
|
|
ucidef_set_led_netdev "lan2" "LAN2" "${boardname}:green:lan2" "eth1"
|
|
;;
|
|
mobipromo,cm520-79f)
|
|
ucidef_set_led_netdev "wan" "WAN" "${boardname}:blue:wan" "eth1"
|
|
ucidef_set_led_switch "lan1" "LAN1" "${boardname}:blue:lan1" "switch0" "0x10"
|
|
ucidef_set_led_switch "lan2" "LAN2" "${boardname}:blue:lan2" "switch0" "0x08"
|
|
;;
|
|
netgear,ex6100v2 |\
|
|
netgear,ex6150v2)
|
|
ucidef_set_led_wlan "wlan2g" "WLAN2G" "ex61x0v2:green:router" "phy0tpt"
|
|
ucidef_set_led_wlan "wlan5g" "WLAN5G" "ex61x0v2:green:client" "phy1tpt"
|
|
;;
|
|
qxwlan,e2600ac-c1 |\
|
|
qxwlan,e2600ac-c2)
|
|
ucidef_set_led_wlan "wlan2g" "WLAN0" "e2600ac:green:wlan0" "phy0tpt"
|
|
ucidef_set_led_wlan "wlan5g" "WLAN1" "e2600ac:green:wlan1" "phy1tpt"
|
|
;;
|
|
zyxel,nbg6617)
|
|
ucidef_set_led_wlan "wlan2g" "WLAN2G" "${boardname}:green:wlan2G" "phy0tpt"
|
|
ucidef_set_led_wlan "wlan5g" "WLAN5G" "${boardname}:green:wlan5G" "phy1tpt"
|
|
;;
|
|
zyxel,wre6606)
|
|
ucidef_set_led_wlan "wlan2g" "WLAN2G" "${boardname}:green:wlan2g" "phy0tpt"
|
|
ucidef_set_led_wlan "wlan5g" "WLAN5G" "${boardname}:green:wlan5g" "phy1tpt"
|
|
;;
|
|
*)
|
|
;;
|
|
esac
|
|
|
|
board_config_flush
|
|
|
|
exit 0
|