qualcommax: drop stock layout for xiaomi ax3600 and redmi ax6

New bootloaders for mainline firmware are available at:
https://drive.wrt.moe/uboot/qualcommax

Flash instructions:
1. Write stock mibib:
   mtd write ipq8071-xiaomi-*-mibib-stock.bin /dev/mtd1
2. Write new u-boot:
   mtd write ipq8071-xiaomi-*-uboot-stock.bin /dev/mtd7
3. Reboot the device, enter web failsafe by pressing the 'reset' button for 5 seconds.
4. Flash *.initramfs-factory.ubi firmware.
5. After ImmortalWrt has booted, perform sysupgrade.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2024-10-04 16:50:47 +08:00
parent 19e3832bf0
commit 6a6c7a2395
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
10 changed files with 3 additions and 198 deletions

View File

@ -46,9 +46,7 @@ tplink,eap660hd-v1)
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000"
;;
redmi,ax6|\
redmi,ax6-stock|\
xiaomi,ax3600|\
xiaomi,ax3600-stock|\
xiaomi,ax9000)
idx="$(find_mtd_index 0:appsblenv)"
[ -n "$idx" ] && \

View File

@ -1,57 +0,0 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "ipq8071-ax3600.dts"
/ {
model = "Xiaomi AX3600 (stock layout)";
compatible = "xiaomi,ax3600-stock", "qcom,ipq8074";
aliases {
/* Aliases as required by u-boot to patch MAC addresses */
ethernet1 = &dp2;
ethernet2 = &dp3;
ethernet3 = &dp4;
ethernet4 = &dp5;
};
chosen {
bootargs-append = " root=/dev/ubiblock0_1";
};
};
&qpic_nand {
/delete-node/ partitions;
nand@0 {
/delete-node/ partitions;
partitions {
compatible = "qcom,smem-part";
};
};
};
&dp2 {
/delete-property/ nvmem-cells;
/delete-property/ nvmem-cell-names;
};
&dp3 {
/delete-property/ nvmem-cells;
/delete-property/ nvmem-cell-names;
};
&dp4 {
/delete-property/ nvmem-cells;
/delete-property/ nvmem-cell-names;
};
&dp5 {
/delete-property/ nvmem-cells;
/delete-property/ nvmem-cell-names;
};
&wifi0 {
/delete-property/ nvmem-cells;
/delete-property/ nvmem-cell-names;
};

View File

@ -1,52 +0,0 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "ipq8071-ax6.dts"
/ {
model = "Redmi AX6 (stock layout)";
compatible = "redmi,ax6-stock", "qcom,ipq8074";
aliases {
/* Aliases as required by u-boot to patch MAC addresses */
ethernet1 = &dp2;
ethernet2 = &dp3;
ethernet3 = &dp4;
ethernet4 = &dp5;
};
chosen {
bootargs-append = " root=/dev/ubiblock0_1";
};
};
&qpic_nand {
/delete-node/ partitions;
nand@0 {
/delete-node/ partitions;
partitions {
compatible = "qcom,smem-part";
};
};
};
&dp2 {
/delete-property/ nvmem-cells;
/delete-property/ nvmem-cell-names;
};
&dp3 {
/delete-property/ nvmem-cells;
/delete-property/ nvmem-cell-names;
};
&dp4 {
/delete-property/ nvmem-cells;
/delete-property/ nvmem-cell-names;
};
&dp5 {
/delete-property/ nvmem-cells;
/delete-property/ nvmem-cell-names;
};

View File

@ -332,17 +332,6 @@ define Device/redmi_ax6
endef
TARGET_DEVICES += redmi_ax6
define Device/redmi_ax6-stock
$(call Device/redmi_ax6)
DEVICE_VARIANT := (stock layout)
DEVICE_ALT0_VENDOR := Redmi
DEVICE_ALT0_MODEL := AX6
DEVICE_ALT0_VARIANT := (custom U-Boot layout)
KERNEL_SIZE :=
ARTIFACTS :=
endef
TARGET_DEVICES += redmi_ax6-stock
define Device/spectrum_sax1v1k
$(call Device/FitImage)
$(call Device/EmmcImage)
@ -374,7 +363,6 @@ define Device/xiaomi_ax3600
$(call Device/UbiFit)
DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := AX3600
DEVICE_VARIANT := (OpenWrt expand layout)
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_DTS_CONFIG := config@ac04
@ -389,23 +377,11 @@ endif
endef
TARGET_DEVICES += xiaomi_ax3600
define Device/xiaomi_ax3600-stock
$(call Device/xiaomi_ax3600)
DEVICE_VARIANT := (stock layout)
DEVICE_ALT0_VENDOR := Xiaomi
DEVICE_ALT0_MODEL := AX3600
DEVICE_ALT0_VARIANT := (custom U-Boot layout)
KERNEL_SIZE :=
ARTIFACTS :=
endef
TARGET_DEVICES += xiaomi_ax3600-stock
define Device/xiaomi_ax9000
$(call Device/FitImage)
$(call Device/UbiFit)
DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := AX9000
DEVICE_VARIANT := (OpenWrt expand layout)
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_DTS_CONFIG := config@hk14

View File

@ -38,12 +38,10 @@ netgear,wax630)
ucidef_set_led_netdev "lan1" "LAN1" "lan1:green" "lan1"
ucidef_set_led_netdev "lan2" "LAN2" "lan2:green" "lan2"
;;
redmi,ax6|\
redmi,ax6-stock)
redmi,ax6)
ucidef_set_led_netdev "wan" "WAN" "blue:network" "wan"
;;
xiaomi,ax3600|\
xiaomi,ax3600-stock)
xiaomi,ax3600)
ucidef_set_led_netdev "wan-port-link" "WAN-PORT-LINK" "90000.mdio-1:01:green:wan" "wan" "tx rx link_10 link_100 link_1000"
ucidef_set_led_netdev "lan1-port-link" "LAN1-PORT-LINK" "90000.mdio-1:02:green:lan" "lan1" "tx rx link_10 link_100 link_1000"
ucidef_set_led_netdev "lan2-port-link" "LAN2-PORT-LINK" "90000.mdio-1:03:green:lan" "lan2" "tx rx link_10 link_100 link_1000"

View File

@ -31,10 +31,8 @@ ipq807x_setup_interfaces()
linksys,mx4200v2|\
prpl,haze|\
redmi,ax6|\
redmi,ax6-stock|\
spectrum,sax1v1k|\
xiaomi,ax3600|\
xiaomi,ax3600-stock)
xiaomi,ax3600)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
;;
edgecore,eap102|\

View File

@ -1,20 +0,0 @@
#!/bin/sh
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/caldata.sh
board=$(board_name)
case "$FIRMWARE" in
"ath10k/cal-pci-0000:01:00.0.bin")
case "$board" in
xiaomi,ax3600-stock)
caldata_extract "0:art" 0x33000 0x844
;;
esac
;;
*)
exit 1
;;
esac

View File

@ -24,9 +24,7 @@ case "$FIRMWARE" in
netgear,wax218|\
qnap,301w|\
redmi,ax6|\
redmi,ax6-stock|\
xiaomi,ax3600|\
xiaomi,ax3600-stock|\
xiaomi,ax9000|\
yuncore,ax880|\
zte,mf269|\

View File

@ -16,12 +16,5 @@ boot() {
linksys,mx8500)
mtd resetbc s_env || true
;;
redmi,ax6-stock|\
xiaomi,ax3600-stock)
# OTA handling should not be used. Reset it just in case.
fw_setenv flag_ota_reboot 0
# Not strictly needed but useful to handle partition crash condition
fw_setenv flag_boot_success 1
;;
esac
}

View File

@ -209,33 +209,6 @@ platform_do_upgrade() {
# Kernel and rootfs are placed in 2 different UBI
CI_KERN_UBIPART="ubi_kernel"
CI_ROOT_UBIPART="rootfs"
nand_do_upgrade "$1"
;;
redmi,ax6-stock|\
xiaomi,ax3600-stock)
part_num="$(fw_printenv -n flag_boot_rootfs)"
if [ "$part_num" -eq "1" ]; then
CI_UBIPART="rootfs_1"
target_num=1
# Reset fail flag for the current partition
# With both partition set to fail, the partition 2 (bit 1)
# is loaded
fw_setenv flag_try_sys2_failed 0
else
CI_UBIPART="rootfs"
target_num=0
# Reset fail flag for the current partition
# or uboot will skip the loading of this partition
fw_setenv flag_try_sys1_failed 0
fi
# Tell uboot to switch partition
fw_setenv flag_boot_rootfs "$target_num"
fw_setenv flag_last_success "$target_num"
# Reset success flag
fw_setenv flag_boot_success 0
nand_do_upgrade "$1"
;;
spectrum,sax1v1k)