The Bonanza Peak series are a couple of MT7986-powered 2.5 GBit/s Wi-Fi 6 residential gateway, access point and mesh router products. All of them come with an eMMC to boot from, are powered via USB-C and got a USB 3.0 type-A port. All of them got a Dialog (Renesas) DA14531 Bluetooth module connected via UART. If the device was previously running stock firmware, the BT chip's internal flash has been loaded with firmware and it can be attached using hciattach when using OpenWrt. SOC: MediaTek MT7986A RAM: 2 GiB DDR4 eMMC: 8 GiB Bluetooth: BLE5 (DA14531) Serial: 3.3V level, 115200 8n1 on 4-pin connector * SDG-8612 - Dual-band RJ-45 gateway 2x 2.5G MaxLinear PHY for WAN port 3x 1GE LAN ports via MT7531 switch * SDG-8614 - Dual-band SFP gateway 1x SFP cage with up to 2.5G speed 1x 2.5G MaxLinear PHY for LAN port 3x 1GE LAN ports via MT7531 switch * SDG-8622 - Tri-band mesh router 2x 2.5G MaxLinear PHY The MT7986 2G and 5G are used as 2G and 5G high band. There’s a MT7915 PCIe card for 5G low band. * SDG-8632 - Tri-band mesh router with 6 GHz 2x 2.5G MaxLinear PHY The MT7986 serves the 2G and 6G bands. There’s a MT7915 PCIe card for 5G. Installation via U-Boot serial console: 0. setup TFTP server with IP 192.168.1.10/24, place initramfs image renamed to openwrt.XXX where XXX is the internal product number: SDG-8612: XXX = 412 SDG-8614: XXX = 414 SDG-8622: XXX = 422 SDG-8632: XXX = 432 1. connect to the serial console and power on the device. Interrupt the bootloader by pressing 'st' 2. setenv boot_mode openwrt ; saveenv 3. run boot1 Load firmware via TFTP and write to flash 4. run boot2 Now OpenWrt initramfs should boot 5. upload sysupgrade.bin via scp to /tmp 6. sysupgrade Signed-off-by: Daniel Golle <daniel@makrotopia.org>
203 lines
3.9 KiB
Bash
Executable File
203 lines
3.9 KiB
Bash
Executable File
REQUIRE_IMAGE_METADATA=1
|
|
|
|
xiaomi_initial_setup()
|
|
{
|
|
# initialize UBI and setup uboot-env if it's running on initramfs
|
|
[ "$(rootfs_type)" = "tmpfs" ] || return 0
|
|
|
|
local mtdnum="$( find_mtd_index ubi )"
|
|
if [ ! "$mtdnum" ]; then
|
|
echo "unable to find mtd partition ubi"
|
|
return 1
|
|
fi
|
|
|
|
local kern_mtdnum="$( find_mtd_index ubi_kernel )"
|
|
if [ ! "$kern_mtdnum" ]; then
|
|
echo "unable to find mtd partition ubi_kernel"
|
|
return 1
|
|
fi
|
|
|
|
ubidetach -m "$mtdnum"
|
|
ubiformat /dev/mtd$mtdnum -y
|
|
|
|
ubidetach -m "$kern_mtdnum"
|
|
ubiformat /dev/mtd$kern_mtdnum -y
|
|
|
|
if ! fw_printenv -n flag_try_sys2_failed &>/dev/null; then
|
|
echo "failed to access u-boot-env. skip env setup."
|
|
return 0
|
|
fi
|
|
|
|
fw_setenv boot_wait on
|
|
fw_setenv uart_en 1
|
|
fw_setenv flag_boot_rootfs 0
|
|
fw_setenv flag_last_success 1
|
|
fw_setenv flag_boot_success 1
|
|
fw_setenv flag_try_sys1_failed 8
|
|
fw_setenv flag_try_sys2_failed 8
|
|
|
|
local board=$(board_name)
|
|
case "$board" in
|
|
xiaomi,mi-router-wr30u-stock)
|
|
fw_setenv mtdparts "nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),2048k(factory),2048k(fip),256k(crash),256k(crash_log),34816k(ubi),34816k(ubi1),32768k(overlay),12288k(data),256k(KF)"
|
|
;;
|
|
xiaomi,redmi-router-ax6000-stock)
|
|
fw_setenv mtdparts "nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),2048k(factory),2048k(fip),256k(crash),256k(crash_log),30720k(ubi),30720k(ubi1),51200k(overlay)"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
platform_do_upgrade() {
|
|
local board=$(board_name)
|
|
|
|
case "$board" in
|
|
acer,predator-w6|\
|
|
smartrg,sdg-8612|\
|
|
smartrg,sdg-8614|\
|
|
smartrg,sdg-8622|\
|
|
smartrg,sdg-8632)
|
|
CI_KERNPART="kernel"
|
|
CI_ROOTPART="rootfs"
|
|
emmc_do_upgrade "$1"
|
|
;;
|
|
asus,tuf-ax4200|\
|
|
asus,tuf-ax6000)
|
|
CI_UBIPART="UBI_DEV"
|
|
CI_KERNPART="linux"
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
bananapi,bpi-r3)
|
|
local rootdev="$(cmdline_get_var root)"
|
|
rootdev="${rootdev##*/}"
|
|
rootdev="${rootdev%p[0-9]*}"
|
|
case "$rootdev" in
|
|
mmc*)
|
|
CI_ROOTDEV="$rootdev"
|
|
CI_KERNPART="production"
|
|
emmc_do_upgrade "$1"
|
|
;;
|
|
mtdblock*)
|
|
PART_NAME="fit"
|
|
default_do_upgrade "$1"
|
|
;;
|
|
ubiblock*)
|
|
CI_KERNPART="fit"
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
esac
|
|
;;
|
|
cmcc,rax3000m)
|
|
case "$(cmdline_get_var root)" in
|
|
/dev/mmc*)
|
|
CI_KERNPART="production"
|
|
emmc_do_upgrade "$1"
|
|
;;
|
|
*)
|
|
CI_KERNPART="fit"
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
esac
|
|
;;
|
|
cudy,wr3000-v1)
|
|
default_do_upgrade "$1"
|
|
;;
|
|
glinet,gl-mt2500|\
|
|
glinet,gl-mt6000)
|
|
CI_KERNPART="kernel"
|
|
CI_ROOTPART="rootfs"
|
|
emmc_do_upgrade "$1"
|
|
;;
|
|
h3c,magic-nx30-pro|\
|
|
jcg,q30-pro|\
|
|
mediatek,mt7981-rfb|\
|
|
qihoo,360t7|\
|
|
tplink,tl-xdr4288|\
|
|
tplink,tl-xdr6086|\
|
|
tplink,tl-xdr6088|\
|
|
xiaomi,mi-router-wr30u-ubootmod|\
|
|
xiaomi,redmi-router-ax6000-ubootmod)
|
|
CI_KERNPART="fit"
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
mercusys,mr90x-v1)
|
|
CI_UBIPART="ubi0"
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
ubnt,unifi-6-plus)
|
|
CI_KERNPART="kernel0"
|
|
EMMC_ROOT_DEV="$(cmdline_get_var root)"
|
|
emmc_do_upgrade "$1"
|
|
;;
|
|
xiaomi,mi-router-wr30u-stock|\
|
|
xiaomi,redmi-router-ax6000-stock)
|
|
CI_KERN_UBIPART=ubi_kernel
|
|
CI_ROOT_UBIPART=ubi
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
zyxel,ex5601-t0-ubootmod)
|
|
CI_KERNPART="fit"
|
|
CI_ROOTPART="ubi_rootfs"
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
*)
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
PART_NAME=firmware
|
|
|
|
platform_check_image() {
|
|
local board=$(board_name)
|
|
local magic="$(get_magic_long "$1")"
|
|
|
|
[ "$#" -gt 1 ] && return 1
|
|
|
|
case "$board" in
|
|
bananapi,bpi-r3|\
|
|
cmcc,rax3000m)
|
|
[ "$magic" != "d00dfeed" ] && {
|
|
echo "Invalid image type."
|
|
return 1
|
|
}
|
|
return 0
|
|
;;
|
|
*)
|
|
nand_do_platform_check "$board" "$1"
|
|
return $?
|
|
;;
|
|
esac
|
|
|
|
return 0
|
|
}
|
|
|
|
platform_copy_config() {
|
|
case "$(board_name)" in
|
|
bananapi,bpi-r3|\
|
|
cmcc,rax3000m)
|
|
case "$(cmdline_get_var root)" in
|
|
/dev/mmc*)
|
|
emmc_copy_config
|
|
;;
|
|
esac
|
|
;;
|
|
acer,predator-w6|\
|
|
glinet,gl-mt2500|\
|
|
glinet,gl-mt6000|\
|
|
ubnt,unifi-6-plus)
|
|
emmc_copy_config
|
|
;;
|
|
esac
|
|
}
|
|
|
|
platform_pre_upgrade() {
|
|
local board=$(board_name)
|
|
|
|
case "$board" in
|
|
xiaomi,mi-router-wr30u-stock|\
|
|
xiaomi,redmi-router-ax6000-stock)
|
|
xiaomi_initial_setup
|
|
;;
|
|
esac
|
|
}
|