2023年11月25日发(作者:)

Rockchip固件分区排列

⼀、介绍

在开放源代码⽀持中,Rockchip使⽤ 作为其主要分区表。我们将GPT存储在LBA0LBA63中。

⼆、U-boot中的GPT分区表

U-boot⽀持标准的 。

三、默认存储图

PartitionStart SectorPartition SizeRequirements

Number ofPartNum

Sectorsin GPT

100000001MBR0000000005120.5KB

630000003FPrimary GPT1000000013225631.5KB

preloader (miniloader or

U-Boot SPL)

SN, MAC and etc.Vendor Storage716800001c0051200000200262144256KB

Not usedReserved Space768000001e0038400000180196608192KB

legacy DRM keyreserved1806400001f80128000000806553664KB

loader16400000040710400001bc040960002.5MB1

U-Boot ENV812800001fc064000000403276832KB

reserved281920000200081920000200041943044MBlegacy parameter

loader2163840000400081920000200041943044MB2U-Boot or UEFI

trusted-os like ATF, OP-

TEE

kernel, dtb,boot(bootable must be

, ramdiskset)

Linux systemrootfs26214400040000----MB5

trust245760000600081920000200041943044MB3

Secondary GPT1677718300FFFFDF33000000211689616.5KB

327680000800022937600038000117440512112MB4

注1:如果preloader是miniloader,则loader2分区可⽤于,trust分区可⽤于; 如果preloader是不带trust⽀持的

五、通过U-boot写⼊GPT分区表

在u-boot console中,“ gpt”命令可⽤于写⼊gpt分区表:

gpt - GUID Partition Table

Usage:

gpt

- GUID partition table restoration and validity check

Restore or verify GPT information on a device connected

to interface

Example usage:

gpt write mmc 0 $partitions

gpt verify mmc 0 $partitions

例如:

=> env set partitions name=rootfs,size=-,type=system

=> gpt write mmc 0 $partitions

Writing GPT: success!

$ fastboot oem format -i 0x2207

...

OKAY [ 0.015s]

finished. total time: 0.015s

2fastboot flash gpt 分区映像>

if (strcmp(cmd, CONFIG_FASTBOOT_GPT_NAME) == 0) {

printf("%s: updating MBR, Primary and Backup GPT(s)n",

$ dd if=/dev/zero of= bs=1M count=256

256+0 records in