ipq807x: add stock layout variant for xiaomi ax3600

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2023-01-17 19:53:29 +08:00
parent ad344210d9
commit 6a01a7b07b
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
9 changed files with 127 additions and 2 deletions

View File

@ -25,6 +25,7 @@ edimax,cax1800)
;;
redmi,ax6|\
xiaomi,ax3600|\
xiaomi,ax3600-stock|\
xiaomi,ax9000)
idx="$(find_mtd_index 0:appsblenv)"
[ -n "$idx" ] && \

View File

@ -10,7 +10,8 @@ edgecore,eap102)
ucidef_set_led_netdev "wan" "WAN" "green:wanpoe" "wan"
;;
redmi,ax6|\
xiaomi,ax3600)
xiaomi,ax3600|\
xiaomi,ax3600-stock)
ucidef_set_led_netdev "wan" "WAN" "blue:network" "wan"
;;
qnap,301w)

View File

@ -24,7 +24,8 @@ ipq807x_setup_interfaces()
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 10g-2" "10g-1"
;;
redmi,ax6|\
xiaomi,ax3600)
xiaomi,ax3600|\
xiaomi,ax3600-stock)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
;;
xiaomi,ax9000)

View File

@ -0,0 +1,20 @@
#!/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

@ -15,6 +15,7 @@ case "$FIRMWARE" in
qnap,301w|\
redmi,ax6|\
xiaomi,ax3600|\
xiaomi,ax3600-stock|\
xiaomi,ax9000)
caldata_extract "0:art" 0x1000 0x20000
;;

View File

@ -9,5 +9,11 @@ boot() {
# Unset changed flag after sysupgrade complete
fw_setenv changed
;;
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

@ -83,6 +83,32 @@ 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"
;;
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"
;;
*)

View File

@ -0,0 +1,61 @@
// 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;
/delete-node/ nand@0;
nand@0 {
reg = <0>;
nand-ecc-strength = <4>;
nand-ecc-step-size = <512>;
nand-bus-width = <8>;
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

@ -98,6 +98,14 @@ endif
endef
TARGET_DEVICES += xiaomi_ax3600
define Device/xiaomi_ax3600-stock
$(call Device/xiaomi_ax3600)
DEVICE_VARIANT := (stock layout)
KERNEL_SIZE :=
ARTIFACTS :=
endef
TARGET_DEVICES += xiaomi_ax3600-stock
define Device/xiaomi_ax9000
$(call Device/FitImage)
$(call Device/UbiFit)