From e749e2b8f333ea9f2de72d4fb1ff277b49c12f30 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 22 Jan 2024 00:56:47 +0000 Subject: [PATCH] mediatek: mt7622: convert unifi6lr-v{1,2,3}-ubootmod to fitblk No bootloader changes needed in this case, smooth transition. Signed-off-by: Daniel Golle --- package/boot/uboot-envtools/files/mediatek_mt7622 | 6 ++++-- .../mediatek/dts/mt7622-ubnt-unifi-6-lr-v1-ubootmod.dts | 7 ++++++- .../mediatek/dts/mt7622-ubnt-unifi-6-lr-v2-ubootmod.dts | 7 ++++++- .../mediatek/dts/mt7622-ubnt-unifi-6-lr-v3-ubootmod.dts | 7 ++++++- target/linux/mediatek/image/mt7622.mk | 6 +++--- .../mediatek/mt7622/base-files/lib/upgrade/platform.sh | 9 ++++++++- 6 files changed, 33 insertions(+), 9 deletions(-) diff --git a/package/boot/uboot-envtools/files/mediatek_mt7622 b/package/boot/uboot-envtools/files/mediatek_mt7622 index 4a9979896790e1..6a2cf8dd8e9230 100644 --- a/package/boot/uboot-envtools/files/mediatek_mt7622 +++ b/package/boot/uboot-envtools/files/mediatek_mt7622 @@ -48,8 +48,10 @@ buffalo,wsr-2533dhp2) ruijie,rg-ew3200gx-pro) ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x20000" "0x20000" ;; -ubnt,unifi-6-lr-ubootmod) - ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x1000" +ubnt,unifi-6-lr-v1-ubootmod|\ +ubnt,unifi-6-lr-v2-ubootmod|\ +ubnt,unifi-6-lr-v3-ubootmod) + ubootenv_add_uci_config "/dev/mtd$(find_mtd_index "u-boot-env")" "0x0" "0x4000" "0x1000" ;; xiaomi,redmi-router-ax6s) ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x40000" diff --git a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1-ubootmod.dts b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1-ubootmod.dts index 7a7a8a815911ea..5f62ed1a455029 100644 --- a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1-ubootmod.dts @@ -5,6 +5,11 @@ / { model = "Ubiquiti UniFi 6 LR v1 (U-Boot mod)"; compatible = "ubnt,unifi-6-lr-v1-ubootmod", "mediatek,mt7622"; + + chosen { + rootdisk = <&rootdisk>; + bootargs = "earlycon=uart8250,mmio32,0x11002000 swiotlb=512 console=ttyS0,115200n8 root=/dev/fit0"; + }; }; &nor_partitions { @@ -54,7 +59,7 @@ reg = <0x120000 0xee0000>; }; - partition@1000000 { + rootdisk: partition@1000000 { compatible = "denx,fit"; label = "firmware"; reg = <0x1000000 0x3000000>; diff --git a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2-ubootmod.dts b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2-ubootmod.dts index 3a37d1d5004f0f..96effb8aab4117 100644 --- a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2-ubootmod.dts @@ -5,6 +5,11 @@ / { model = "Ubiquiti UniFi 6 LR v2 (U-Boot mod)"; compatible = "ubnt,unifi-6-lr-v2-ubootmod", "mediatek,mt7622"; + + chosen { + rootdisk = <&rootdisk>; + bootargs = "earlycon=uart8250,mmio32,0x11002000 swiotlb=512 console=ttyS0,115200n8 root=/dev/fit0"; + }; }; &nor_partitions { @@ -54,7 +59,7 @@ reg = <0x120000 0xee0000>; }; - partition@1000000 { + rootdisk: partition@1000000 { compatible = "denx,fit"; label = "firmware"; reg = <0x1000000 0x3000000>; diff --git a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3-ubootmod.dts b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3-ubootmod.dts index e91aaa63f58bdf..ec98dd262cfb36 100644 --- a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3-ubootmod.dts @@ -5,6 +5,11 @@ / { model = "Ubiquiti UniFi 6 LR v3 (U-Boot mod)"; compatible = "ubnt,unifi-6-lr-v3-ubootmod", "mediatek,mt7622"; + + chosen { + rootdisk = <&rootdisk>; + bootargs = "earlycon=uart8250,mmio32,0x11002000 swiotlb=512 console=ttyS0,115200n8 root=/dev/fit0"; + }; }; &nor_partitions { @@ -54,7 +59,7 @@ reg = <0x120000 0xee0000>; }; - partition@1000000 { + rootdisk: partition@1000000 { compatible = "denx,fit"; label = "firmware"; reg = <0x1000000 0x3000000>; diff --git a/target/linux/mediatek/image/mt7622.mk b/target/linux/mediatek/image/mt7622.mk index 0d631c19963ecd..dd86c167de4b64 100644 --- a/target/linux/mediatek/image/mt7622.mk +++ b/target/linux/mediatek/image/mt7622.mk @@ -375,7 +375,7 @@ define Device/ubnt_unifi-6-lr-v1-ubootmod DEVICE_VARIANT := v1 U-Boot mod DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v1-ubootmod DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7915-firmware kmod-leds-ubnt-ledbar + DEVICE_PACKAGES := fitblk kmod-mt7915-firmware kmod-leds-ubnt-ledbar KERNEL := kernel-bin | lzma KERNEL_INITRAMFS_SUFFIX := -recovery.itb KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k @@ -405,7 +405,7 @@ define Device/ubnt_unifi-6-lr-v2-ubootmod DEVICE_VARIANT := v2 U-Boot mod DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v2-ubootmod DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7915-firmware + DEVICE_PACKAGES := fitblk kmod-mt7915-firmware KERNEL := kernel-bin | lzma KERNEL_INITRAMFS_SUFFIX := -recovery.itb KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k @@ -434,7 +434,7 @@ define Device/ubnt_unifi-6-lr-v3-ubootmod DEVICE_VARIANT := v3 U-Boot mod DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v3-ubootmod DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7915-firmware + DEVICE_PACKAGES := fitblk kmod-mt7915-firmware KERNEL := kernel-bin | lzma KERNEL_INITRAMFS_SUFFIX := -recovery.itb KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh index 5e810d79eed491..23a1f8cf5eaab3 100755 --- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh @@ -21,7 +21,10 @@ platform_do_upgrade() { local file_type=$(identify $1) case "$board" in - bananapi,bpi-r64) + bananapi,bpi-r64|\ + ubnt,unifi-6-lr-v1-ubootmod|\ + ubnt,unifi-6-lr-v2-ubootmod|\ + ubnt,unifi-6-lr-v3-ubootmod) [ -e /dev/fit0 ] && fitblk /dev/fit0 [ -e /dev/fitrw ] && fitblk /dev/fitrw bootdev="$(platform_get_bootdev)" @@ -31,6 +34,10 @@ platform_do_upgrade() { CI_KERNPART="production" emmc_do_upgrade "$1" ;; + mtdblock*) + PART_NAME="/dev/mtd${bootdev:8}" + default_do_upgrade "$1" + ;; ubiblock*) CI_KERNPART="fit" nand_do_upgrade "$1"