Partition Setup

优质
小牛编辑
135浏览
2023-12-01

1.1. Partition Setup

K18 Flash partition is setup in uboot as below:

$(K18DIR)/uboot/include/configs/leo_k18_universal.h

/ mtd partitioning for serial NOR/NAND flash

*

  • device <spinand_mcu>, # parts = 10

  • 0: mcu 0x00100000 0x00000000 0

  • 1: uboot-stage1 0x00040000 0x00100000 0

  • 2: uboot_env 0x00040000 0x00140000 0

  • 3: uboot-stage2 0x00080000 0x00180000 0

  • 4: boot_music 0x00080000 0x00200000 0

  • 5: kernel_dtb 0x00080000 0x00280000 0

  • 6: misc 0x00200000 0x00300000 0

  • 7: kernel 0x00500000 0x00500000 0

  • 8: ota 0x00800000 0x00A00000 0

  • 9: rootfs 0x03C00000 0x01200000 0

  • 10: data 0x03200000 0x04E00000 0 /

"1m(mcu)," \

"256k(uboot_stage1)," \

"256k(uboot_env)," \

"512k(uboot_stage2)," \

"512k(boot_music)," \

"${fdt_size}@${fdt_offs}(kernel_dtb)," \

"2m(misc)," \

"${kernel_size}@${kernel_offs}(kernel)," \

"${ota_size}@${ota_offs}(ota_kernel)," \

"${rootfs_size}@${rootfs_offs}(rootfs)," \

"60m(data)"

Note:

When partition is modified, the image burning script file $(K18DIR)/openwrt/target/linux/leo/k18-universal/download.sh also need be modified for partition start offset changing:

MCU_OFFSET=0x0

SPL_OFFSET=0x100000

UBOOT_OFFSET=0x180000

BOOTMUSIC_OFFSET=0x280000

KERNEL_DTB_OFFSET=0x300000

MISC_OFFSET=0x380000

KERNEL_OFFSET=0x480000

OTA_OFFSET=0x980000

ROOTFS_OFFSET=0x1180000

DATA_OFFSET=0x3A00000

FLASH_SIZE=0x8000000