Hi all. I am trying to replicate OpenWRT’s UBI partition layout for the spim-nand on the BPI-R4. I am using the uboot and mtk-atf from https://github.com/frank-w/u-boot/tree/{2024-04-bpi,mtk-atf}, with some relevant patches from openwrt/package/boot/uboot-mediatek/patches at main · openwrt/openwrt · GitHub.
Based on OP’s instructions I tried:
make PLAT="mt7988" BOOT_DEVICE="spim-nand" BL33=../u-boot/u-boot.bin.xz USE_MKIMAGE= 1 DRAM_USE_COMB=1 UBI=1 all fip
Unfortunately though BL2 cannot find the fip image. Appreciate any help.
NAND boot:
F0: 102B 0000
FA: 1042 0000
FA: 1042 0000 [0200]
F9: 0000 0000
V0: 0000 0000 [0001]
00: 0000 0000
BP: 0600 0041 [0000]
G0: 1190 0000
EC: 0000 0000 [1000]
MK: 0000 0000 [0000]
T0: 0000 019D [0101]
Jump to BL
NOTICE: BL2: v2.9(release):4e064f88b83 spim-nand
NOTICE: BL2: Built : 17:50:18, Jun 6 2024
NOTICE: WDT: Cold boot
NOTICE: WDT: disabled
NOTICE: CPU: MT7988
NOTICE: EMI: Using DDR unknown settings
NOTICE: EMI: Detected DRAM size: 4096 MB
NOTICE: EMI: complex R/W mem test passed
NOTICE: SPI_NAND parses attributes from parameter page.
NOTICE: SPI_NAND Detected ID 0xef
NOTICE: Page size 2048, Block size 131072, size 134217728
ERROR: BL2: Failed to load image id 3 (-2)
MTD layout, SD boot:
spi-nand: spi_nand spi_nand@0: Winbond SPI NAND was found.
spi-nand: spi_nand spi_nand@0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
List of MTD devices:
* spi-nand0
- device: spi_nand@0
- parent: spi@1100a000
- driver: spi_nand
- path: /spi@1100a000/spi_nand@0
- type: NAND flash
- block size: 0x20000 bytes
- min I/O: 0x800 bytes
- OOB size: 64 bytes
- OOB available: 24 bytes
- 0x000000000000-0x000008000000 : "spi-nand0"
- 0x000000000000-0x000000200000 : "bl2"
- 0x000000200000-0x000008000000 : "ubi"
UBI layout, SD boot:
BPI-R4> ubi part ubi
ubi0: attaching mtd2
ubi0: scanning is finished
ubi0: attached mtd2 (name "ubi", size 126 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 1008, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0
ubi0: available PEBs: 949, total reserved PEBs: 59, PEBs reserved for bad PEB handling: 20
BPI-R4> ubi list
0: fip
1: ubootenv
2: ubootenv2