chosen {
stdout-path = "serial0:115200n8";
- bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8 swiotlb=512";
+ rootdisk = <&ubi_rootfs>;
+ bootargs = "earlycon=uart8250,mmio32,0x11002000 swiotlb=512 ubi.block=0,fit root=/dev/fit0";
};
memory {
mediatek,bmt-v2;
mediatek,bmt-table-size = <0x1000>;
- mediatek,bmt-remap-range = <0x0 0x6c0000>;
+ mediatek,bmt-remap-range = <0x0 0x340000>;
partitions {
compatible = "fixed-partitions";
read-only;
};
- /* Shrunk and renamed from "firmware"
- * as to not break luci size checks
- */
partition@2c0000 {
- label = "kernel";
- reg = <0x2c0000 0x400000>;
+ label = "ubi-loader";
+ reg = <0x2c0000 0x80000>;
};
/* ubi partition is the result of squashing
* - overlay
* - obr
*/
- partition@6c0000 {
+ partition@340000 {
label = "ubi";
- reg = <0x6C0000 0x6f00000>;
+ reg = <0x340000 0x7280000>;
+ compatible = "linux,ubi";
+
+ volumes {
+ ubi_rootfs: ubi-volume-fit {
+ volname = "fit";
+ };
+ };
};
};
};
cat $(STAGING_DIR_IMAGE)/mt7622_$1-u-boot.fip >> $@
endef
+define Build/uboot-bin
+ cat $(STAGING_DIR_IMAGE)/mt7622_$1-u-boot.bin >> $@
+endef
+
+define Build/uboot-fit
+ $(TOPDIR)/scripts/mkits.sh \
+ -D $(DEVICE_NAME) -o $@.its -k $@ \
+ -C $(word 1,$(1)) \
+ -a 0x41e00000 -e 0x41e00000 \
+ -c "config-1" \
+ -A $(LINUX_KARCH) -v u-boot
+ PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
+ @mv $@.new $@
+endef
+
# Append header to a D-Link M32/R32 Kernel 1 partition
define Build/m32-r32-recovery-header-kernel1
$(eval header_start=$(word 1,$(1)))
BOARD_NAME := xiaomi,redmi-router-ax6s
DEVICE_PACKAGES := kmod-mt7915-firmware
UBINIZE_OPTS := -E 5
- IMAGES += factory.bin
BLOCKSIZE := 128k
PAGESIZE := 2048
- KERNEL_SIZE := 4096k
+ KERNEL := kernel-bin | gzip
+ KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
- IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi
- IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+ IMAGES := sysupgrade.itb
+ IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+ ARTIFACTS := ubi-loader.itb
+ ARTIFACT/ubi-loader.itb := uboot-bin xiaomi_redmi-router-ax6s-ubi-loader | lzma | uboot-fit lzma
+ifneq ($(CONFIG_TARGET_ROOTFS_SQUASHFS),)
+ ARTIFACTS += factory.bin
+ ARTIFACT/factory.bin := uboot-bin xiaomi_redmi-router-ax6s-ubi-loader | lzma | uboot-fit lzma | pad-to 512k | ubinize-image fit squashfs-sysupgrade.itb
+endif
+ DEVICE_COMPAT_VERSION := 2.0
+ DEVICE_COMPAT_MESSAGE := Flash layout changes require a manual reinstall using factory.bin.
endef
-# TARGET_DEVICES += xiaomi_redmi-router-ax6s
+TARGET_DEVICES += xiaomi_redmi-router-ax6s
uci set system.@system[0].compat_version="1.1"
uci commit system
;;
- linksys,e8450-ubi)
+ linksys,e8450-ubi|\
+ xiaomi,redmi-router-ax6s)
uci set system.@system[0].compat_version="2.0"
uci commit system
;;
linksys,e8450-ubi|\
ubnt,unifi-6-lr-v1-ubootmod|\
ubnt,unifi-6-lr-v2-ubootmod|\
- ubnt,unifi-6-lr-v3-ubootmod)
+ ubnt,unifi-6-lr-v3-ubootmod|\
+ xiaomi,redmi-router-ax6s)
[ -e /dev/fit0 ] && fitblk /dev/fit0
[ -e /dev/fitrw ] && fitblk /dev/fitrw
bootdev="$(fitblk_get_bootdev)"
elecom,wrc-x3200gst3|\
mediatek,mt7622-rfb1-ubi|\
netgear,wax206|\
- totolink,a8000ru|\
- xiaomi,redmi-router-ax6s)
+ totolink,a8000ru)
nand_do_upgrade "$1"
;;
linksys,e8450)
elecom,wrc-x3200gst3|\
mediatek,mt7622-rfb1-ubi|\
netgear,wax206|\
- totolink,a8000ru|\
- xiaomi,redmi-router-ax6s)
+ totolink,a8000ru)
nand_do_platform_check "$board" "$1"
return $?
;;