Add support for Linksys MX2000 (Atlas 6) and MX5500 (Atlas 6 Pro). These devices are completely identical except for the secondary wifi chip used for 5Ghz: QCN6102 is used on MX2000 while QCN9024 is used on MX5500 Speficiations: * SoC: Qualcomm IPQ5018 (64-bit dual-core ARM Cortex-A53 @ 1.0Ghz) * Memory: Winbond W634GU6NB-11 (512 MiB DDR3-933) * Serial Port: 3v3 TTL 115200n8 * Wi-Fi: IPQ5018 (2x2 2.4 Ghz 802.11b/g/n/ax) * Wi-Fi: MX2000: QCN6102 (2x2:2 5 Ghz 802.11an/ac/ax) MX5500: QCN9024 (4x4:4 5 Ghz 802.11an/ac/ax) * Ethernet: IPQ5018 integrated virtual switch connected to an external QCA8337 switch (4 Ports 10/100/1000 GBASE-T) * Flash: Macronix MX35UF2GE4AD (256 MiB) * LEDs: 1x multi-color PWM LED * Buttons: 1x WPS (GPIO 27 Active Low) 1x Reset (GPIO 28 Acive Low) Flash instructions (in case of MX2000, else replace with MX5500 images): 1. On OEM firmware, login to the device (typically at http://192.168.1.1) and click 'CA' in the bottom right corner -> Connectivity -> Manual Upgrade. Alternatively, browse to http://<router IP>/fwupdate.html. Upgrade firmware using openwrt-qualcommax-ipq50xx-linksys_mx2000-squashfs-factory.bin image. Optionally install on second partition, after first boot check actual partition: fw_printenv -n boot_part and install firmware on second partition using command in case of 2: mtd -r -e kernel -n write openwrt-qualcommax-ipq50xx-linksys_mx2000-squashfs-factory.bin kernel and in case of 1: mtd -r -e alt_kernel -n write openwrt-qualcommax-ipq50xx-linksys_mx2000-squashfs-factory.bin alt_kernel 2. Installation using serial connection from OEM firmware (default login: root, password: admin): fw_printenv -n boot_part In case of 2: flash_erase /dev/mtd12 0 0 nandwrite -p /dev/mtd12 openwrt-qualcommax-ipq50xx-linksys_mx2000-squashfs-factory.bin or in case of 1: flash_erase /dev/mtd14 0 0 nandwrite -p /dev/mtd14 openwrt-qualcommax-ipq50xx-linksys_mx2000-squashfs-factory.bin After first boot install firmware on second partition: mtd -r -e kernel -n write openwrt-qualcommax-ipq50xx-linksys_mx2000-squashfs-factory.bin kernel or: mtd -r -e alt_kernel -n write openwrt-qualcommax-ipq50xx-linksys_mx2000-squashfs-factory.bin alt_kernel 3. Back to the OEM firmware. Download firmware from OEM website: MX2000: https://support.linksys.com/kb/article/585-en/ MX5500: https://support.linksys.com/kb/article/587-en/ From serial or SSH: fw_printenv boot_part in case of 1: mtd -r -e alt_kernel -n write FW_MX2000_1.1.7.210469_prod.img alt_kernel else in case of 2: mtd -r -e kernel -n write FW_MX2000_1.1.7.210469_prod.img kernel Signed-off-by: George Moussalem <george.moussalem@outlook.com> Link: https://github.com/openwrt/openwrt/pull/17182 Signed-off-by: Robert Marko <robimarko@gmail.com>
85 lines
1.7 KiB
Bash
85 lines
1.7 KiB
Bash
PART_NAME=firmware
|
|
REQUIRE_IMAGE_METADATA=1
|
|
|
|
RAMFS_COPY_BIN='fw_printenv fw_setenv head'
|
|
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
|
|
|
|
remove_oem_ubi_volume() {
|
|
local oem_volume_name="$1"
|
|
local oem_ubivol
|
|
local mtdnum
|
|
local ubidev
|
|
|
|
mtdnum=$(find_mtd_index "$CI_UBIPART")
|
|
if [ ! "$mtdnum" ]; then
|
|
return
|
|
fi
|
|
|
|
ubidev=$(nand_find_ubi "$CI_UBIPART")
|
|
if [ ! "$ubidev" ]; then
|
|
ubiattach --mtdn="$mtdnum"
|
|
ubidev=$(nand_find_ubi "$CI_UBIPART")
|
|
fi
|
|
|
|
if [ "$ubidev" ]; then
|
|
oem_ubivol=$(nand_find_volume "$ubidev" "$oem_volume_name")
|
|
[ "$oem_ubivol" ] && ubirmvol "/dev/$ubidev" --name="$oem_volume_name"
|
|
fi
|
|
}
|
|
|
|
linksys_mx_do_upgrade() {
|
|
local setenv_script="/tmp/fw_env_upgrade"
|
|
|
|
CI_UBIPART="rootfs"
|
|
boot_part="$(fw_printenv -n boot_part)"
|
|
if [ -n "$UPGRADE_OPT_USE_CURR_PART" ]; then
|
|
if [ "$boot_part" -eq "2" ]; then
|
|
CI_KERNPART="alt_kernel"
|
|
CI_UBIPART="alt_rootfs"
|
|
fi
|
|
else
|
|
if [ "$boot_part" -eq "1" ]; then
|
|
echo "boot_part 2" >> $setenv_script
|
|
CI_KERNPART="alt_kernel"
|
|
CI_UBIPART="alt_rootfs"
|
|
else
|
|
echo "boot_part 1" >> $setenv_script
|
|
fi
|
|
fi
|
|
|
|
boot_part_ready="$(fw_printenv -n boot_part_ready)"
|
|
if [ "$boot_part_ready" -ne "3" ]; then
|
|
echo "boot_part_ready 3" >> $setenv_script
|
|
fi
|
|
|
|
auto_recovery="$(fw_printenv -n auto_recovery)"
|
|
if [ "$auto_recovery" != "yes" ]; then
|
|
echo "auto_recovery yes" >> $setenv_script
|
|
fi
|
|
|
|
if [ -f "$setenv_script" ]; then
|
|
fw_setenv -s $setenv_script || {
|
|
echo "failed to update U-Boot environment"
|
|
return 1
|
|
}
|
|
fi
|
|
nand_do_upgrade "$1"
|
|
}
|
|
|
|
platform_check_image() {
|
|
return 0;
|
|
}
|
|
|
|
platform_do_upgrade() {
|
|
case "$(board_name)" in
|
|
linksys,mx2000|\
|
|
linksys,mx5500)
|
|
remove_oem_ubi_volume rootfs
|
|
linksys_mx_do_upgrade "$1"
|
|
;;
|
|
*)
|
|
default_do_upgrade "$1"
|
|
;;
|
|
esac
|
|
}
|