Ubiquiti UniFi 6 LR - Flash layout

Hey,

I'm trying to apply the uboot-mod to my Unifi AP but my flash layout seems different and I'm missing some context for mtd I guess.

dev:    size   erasesize  name
mtd0: 00040000 00010000 "preloader"
mtd1: 00020000 00010000 "atf"
mtd2: 00060000 00010000 "u-boot"
mtd3: 00010000 00010000 "u-boot-env"
mtd4: 00040000 00010000 "factory"
mtd5: 00010000 00010000 "eeprom"
mtd6: 00010000 00010000 "bs"
mtd7: 00100000 00010000 "cfg"
mtd8: 01ee0000 00010000 "firmware"
mtd9: 00400000 00010000 "kernel"
mtd10: 01ae0000 00010000 "rootfs"
mtd11: 01640000 00010000 "rootfs_data"
mtd12: 01ee0000 00010000 "kernel1"

compared to here I assume kernel is kernel0 and kernel1 as given.

I'm not sure I tried to do the steps (mtd write) when booted into openwrt - is this possible or do I have to tftp-boot for this? Is this possible with the stock uboot?

Regards the mtd-commands I struggle to understand where the paritions "bl2" e.g. comes from that are used:

mtd write *ubnt_unifi-6-lr-*-ubootmod-preloader.bin bl2
mtd write *ubnt_unifi-6-lr-*-ubootmod-bl31-uboot.fip fip
mtd erase u-boot-env
mtd write *ubnt_unifi-6-lr-*-ubootmod-initramfs-recovery.itb recovery
mtd write *ubnt_unifi-6-lr-*-ubootmod-squashfs-sysupgrade.itb firmware
reboot -f

Hope you can help me clear this up and get this running :slight_smile: Thanks!

From the filenames I would be tempted to flash ubnt_unifi-6-lr--ubootmod-preloader.bin to preloader and ubnt_unifi-6-lr--ubootmod-bl31-uboot.fip to u-boot but I don't understand where recovery is supposed to go

@alexceltare2 Maybe any idea? I have seen you worked on it

[    0.895116] spi-nor spi0.0: w25q512jvq (65536 Kbytes)
[    0.900496] 10 fixed-partitions partitions found on MTD device spi0.0
[    0.907017] OF: Bad cell count for /spi@11014000/flash@0/partitions
[    0.913384] OF: Bad cell count for /spi@11014000/flash@0/partitions
[    0.919894] Creating 10 MTD partitions on "spi0.0":
[    0.924868] 0x000000000000-0x000000040000 : "preloader"
[    0.930487] 0x000000040000-0x000000060000 : "atf"
[    0.935588] 0x000000060000-0x0000000c0000 : "u-boot"
[    0.940899] 0x0000000c0000-0x0000000d0000 : "u-boot-env"
[    0.946594] 0x0000000d0000-0x000000110000 : "factory"
[    0.951969] 0x000000110000-0x000000120000 : "eeprom"
[    0.957353] OF: Bad cell count for /spi@11014000/flash@0/partitions
[    0.963870] 0x000000120000-0x000000130000 : "bs"
[    0.968905] 0x000000130000-0x000000230000 : "cfg"
[    0.973940] 0x000000230000-0x000002110000 : "firmware"
[    0.979584] 2 fit-fw partitions found on MTD device firmware
[    0.985345] Creating 2 MTD partitions on "firmware":
[    0.990353] 0x000000000000-0x000000400000 : "kernel"
[    0.995868] 0x000000400000-0x000001ee0000 : "rootfs"
[    1.001163] mtd: setting mtd10 (rootfs) as root device
[    1.006571] 1 squashfs-split partitions found on MTD device rootfs
[    1.012797] 0x0000008a0000-0x000001ee0000 : "rootfs_data"
[    1.019151] 0x000002110000-0x000003ff0000 : "kernel1"
[    1.027592] mtk-spi-nor 11014000.spi: spi frequency: 46666653 Hz

From debug-session in matrix-chat, tried "firstboot" and "jffs2reset -y && reboot" to reset

no idea. maybe the layout changed at some point rendering the method ineffective.

Hey, I was able to solve the issue - using the urescue command I flashed the latest oem-firmeware, then I had the correct flash-layout when tftp-booting the initramfs so I was able to convert the bootloader as explained seems the layout changed after I converted it to openwrt.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.