Skip to content

Commit

Permalink
mediatek: mt7622: convert unifi6lr-v{1,2,3}-ubootmod to fitblk
Browse files Browse the repository at this point in the history
No bootloader changes needed in this case, smooth transition.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  • Loading branch information
dangowrt committed Jan 22, 2024
1 parent 1563bbc commit e749e2b
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 9 deletions.
6 changes: 4 additions & 2 deletions package/boot/uboot-envtools/files/mediatek_mt7622
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -54,7 +59,7 @@
reg = <0x120000 0xee0000>;
};

partition@1000000 {
rootdisk: partition@1000000 {
compatible = "denx,fit";
label = "firmware";
reg = <0x1000000 0x3000000>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -54,7 +59,7 @@
reg = <0x120000 0xee0000>;
};

partition@1000000 {
rootdisk: partition@1000000 {
compatible = "denx,fit";
label = "firmware";
reg = <0x1000000 0x3000000>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -54,7 +59,7 @@
reg = <0x120000 0xee0000>;
};

partition@1000000 {
rootdisk: partition@1000000 {
compatible = "denx,fit";
label = "firmware";
reg = <0x1000000 0x3000000>;
Expand Down
6 changes: 3 additions & 3 deletions target/linux/mediatek/image/mt7622.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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"
Expand Down

0 comments on commit e749e2b

Please sign in to comment.