qualcommax: ipq807x: Xiaomi AX9000: add custom U-Boot layout support

Some devices use third-party non original uboot and mibib, and OpenWrt expand layout cannot flash and boot normally on such partitions

Signed-off-by: jinkela air <air_jinkela@163.com>
This commit is contained in:
jinkela air
2025-06-25 14:25:37 +08:00
parent 360bfcbcdf
commit 753e8267c6
10 changed files with 88 additions and 5 deletions
@@ -64,7 +64,8 @@ redmi,ax6|\
redmi,ax6-stock|\
xiaomi,ax3600|\
xiaomi,ax3600-stock|\
xiaomi,ax9000)
xiaomi,ax9000|\
xiaomi,ax9000-stock)
ubootenv_add_mtd "0:appsblenv" "0x0" "0x10000" "0x20000"
ubootenv_add_sys_mtd "bdata" "0x0" "0x10000" "0x20000"
;;
@@ -0,0 +1,63 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "ipq8072-ax9000.dts"
/ {
model = "Xiaomi AX9000 (stock layout)";
compatible = "xiaomi,ax9000-stock", "qcom,ipq8074";
aliases {
/* Aliases as required by u-boot to patch MAC addresses */
ethernet1 = &dp1;
ethernet2 = &dp2;
ethernet3 = &dp3;
ethernet4 = &dp4;
ethernet5 = &dp5;
};
chosen {
bootargs-append = " root=/dev/ubiblock0_1";
};
};
&qpic_nand {
/delete-node/ partitions;
nand@0 {
/delete-node/ partitions;
partitions {
compatible = "qcom,smem-part";
};
};
};
&dp1 {
/delete-property/ nvmem-cells;
/delete-property/ nvmem-cell-names;
};
&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;
};
@@ -558,7 +558,7 @@
perst-gpio = <&tlmm 62 GPIO_ACTIVE_HIGH>;
pcie@0 {
wifi@0,0 {
wifi0: wifi@0,0 {
status = "okay";
compatible = "qcom,ath10k";
+11
View File
@@ -501,6 +501,17 @@ endif
endef
TARGET_DEVICES += xiaomi_ax9000
define Device/xiaomi_ax9000-stock
$(call Device/xiaomi_ax9000)
DEVICE_VARIANT := (stock layout)
DEVICE_ALT0_VENDOR := Xiaomi
DEVICE_ALT0_MODEL := AX9000
DEVICE_ALT0_VARIANT := (custom U-Boot layout)
KERNEL_SIZE :=
ARTIFACTS :=
endef
TARGET_DEVICES += xiaomi_ax9000-stock
define Device/yuncore_ax880
$(call Device/FitImage)
$(call Device/UbiFit)
@@ -51,7 +51,8 @@ xiaomi,ax3600-stock)
ucidef_set_led_netdev "lan3-port-link" "LAN3-PORT-LINK" "90000.mdio-1:04:green:lan" "lan3" "tx rx link_10 link_100 link_1000"
ucidef_set_led_netdev "wan" "WAN" "blue:network" "wan"
;;
xiaomi,ax9000)
xiaomi,ax9000|\
xiaomi,ax9000-stock)
ucidef_set_led_netdev "wan-port-link" "WAN-PORT-LINK" "90000.mdio-1:18:green:wan" "wan" "tx rx link_10 link_100 link_1000 link_2500"
ucidef_set_led_netdev "lan1-port-link" "LAN1-PORT-LINK" "90000.mdio-1:03:green:lan" "lan1" "tx rx link_10 link_100 link_1000"
ucidef_set_led_netdev "lan2-port-link" "LAN2-PORT-LINK" "90000.mdio-1:02:green:lan" "lan2" "tx rx link_10 link_100 link_1000"
@@ -28,6 +28,7 @@ ipq807x_setup_interfaces()
linksys,mx5300|\
linksys,mx8500|\
xiaomi,ax9000|\
xiaomi,ax9000-stock|\
zbtlink,zbt-z800ax)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
;;
@@ -12,6 +12,9 @@ case "$FIRMWARE" in
xiaomi,ax3600-stock)
caldata_extract "0:art" 0x33000 0x844
;;
xiaomi,ax9000-stock)
caldata_extract "0:art" 0x4d000 0x844
;;
esac
;;
*)
@@ -35,6 +35,7 @@ case "$FIRMWARE" in
xiaomi,ax3600|\
xiaomi,ax3600-stock|\
xiaomi,ax9000|\
xiaomi,ax9000-stock|\
yuncore,ax880|\
zte,mf269|\
zte,mf269-stock)
@@ -22,7 +22,8 @@ boot() {
fw_setenv boot_count 0
;;
redmi,ax6-stock|\
xiaomi,ax3600-stock)
xiaomi,ax3600-stock|\
xiaomi,ax9000-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
@@ -257,7 +257,8 @@ platform_do_upgrade() {
nand_do_upgrade "$1"
;;
redmi,ax6-stock|\
xiaomi,ax3600-stock)
xiaomi,ax3600-stock|\
xiaomi,ax9000-stock)
part_num="$(fw_printenv -n flag_boot_rootfs)"
if [ "$part_num" -eq "1" ]; then
CI_UBIPART="rootfs_1"