Hardware specification: SoC: MediaTek MT7986A 4x A53 Flash: ESMT F50L1G41LB 128MB RAM: ESMT M15T4G16256A 512MB Ethernet (Max Speed): XDR4288: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan XDR6086: 1x 2.5G Wan, 1x 2.5G Lan, 1x 1G Lan XDR6088: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan WiFi: XDR4288: MT7976DAN (2.4G 2T2R, 5G 3T3R) XDR6086/XDR6088: WiFi1: MT7976GN 2.4GHz 4T4R WiFi2: MT7976AN 5GHz 4T4R Button: Reset, WPS, Turbo USB: 1 x USB 3.0 Power: DC 12V 4A Flash instructions: 1. Execute the following operation to open nc shell: https://openwrt.org/inbox/toh/tp-link/xdr-6086#rooting 2. Replace the stock bootloader to OpenWrt's: dd bs=131072 conv=sync of=/dev/mtdblock9 if=/tmp/xxx-preloader.bin dd bs=131072 conv=sync of=/dev/mtdblock9 seek=28 if=/tmp/xxx-bl31-uboot.fip 3. Connect to your PC via the Gigabit port of the router, set a static ip on the ethernet interface of your PC. (ip 192.168.1.254, gateway 192.168.1.1) 4. Download the initramfs image, and restart the router, waiting for tftp recovery to complete. 5. After openwrt boots up, perform sysupgrade. Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn> [Add uboot build, fit and sysupgrade support, fix RealTek PHYs] Signed-off-by: Daniel Golle <daniel@makrotopia.org>
134 lines
2.5 KiB
Bash
Executable File
134 lines
2.5 KiB
Bash
Executable File
REQUIRE_IMAGE_METADATA=1
|
|
|
|
redmi_ax6000_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
|
|
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)"
|
|
}
|
|
|
|
platform_do_upgrade() {
|
|
local board=$(board_name)
|
|
|
|
case "$board" in
|
|
asus,tuf-ax4200)
|
|
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
|
|
;;
|
|
tplink,tl-xdr4288|\
|
|
tplink,tl-xdr6086|\
|
|
tplink,tl-xdr6088|\
|
|
xiaomi,redmi-router-ax6000-ubootmod)
|
|
CI_KERNPART="fit"
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
xiaomi,redmi-router-ax6000-stock)
|
|
CI_KERN_UBIPART=ubi_kernel
|
|
CI_ROOT_UBIPART=ubi
|
|
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)
|
|
[ "$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)
|
|
case "$(cmdline_get_var root)" in
|
|
/dev/mmc*)
|
|
emmc_copy_config
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
}
|
|
|
|
platform_pre_upgrade() {
|
|
local board=$(board_name)
|
|
|
|
case "$board" in
|
|
xiaomi,redmi-router-ax6000-stock)
|
|
redmi_ax6000_initial_setup
|
|
;;
|
|
esac
|
|
}
|