Skip to main content

Rockchip Introduction Partition

:::info 文档信息

文档标识:RK-SM-YF-016 · 发布版本:V1.5.0 · 发布日期:2020-06-16 · 页数:11 · 语言:英文

原始文档:Rockchip_Introduction_Partition_EN.pdf

:::

章节大纲​

  • Rockchip Introduction Partition(P1)
    • Parameter Preview(P6)
    • Details Information(P7)
      • FIRMWARE_VER:9.0(P7)
      • MACHINE_MODEL:RK3326(P7)
      • MACHINE_ID:007(P7)
      • MANUFACTURER:rk3326(P8)
      • MAGIC:0x5041524B(P8)
      • ATAG:0x60000800(P8)
      • MACHINE:3226(P8)
      • CHECK_MASK:0x80(P9)
      • TYPE:GPT(P9)
      • CMDLINE:(P9)
    • Partition Definition Specification(P11)

在线预览​

若预览无法显示,请直接下载 PDF 后用本地阅读器打开。


1. Parameter Preview​

The parameter file is mainly used to define partition table. It can support two partition formats: GPT partition and legacy CMDLINE partition. There will be some differences in the contents of parameter files for different projects and different platforms.

The document use the parameter file of RK3326 to explanation.

The parameter file for GPT:

FIRMWARE_VER:9.0
MACHINE_MODEL:RK3326
MACHINE_ID:007
MANUFACTURER: RK3326
MAGIC: 0x5041524B
ATAG: 0x00200800
MACHINE: 3326
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
TYPE: GPT
CMDLINE:mtdparts=rk29xxnand:0x00002000@0x00004000(uboot),0x00002000@0x00006000(tr
ust),0x00002000@0x00008000(misc),0x00002000@0x0000a000(dtb),0x00002000@0x0000c000
(dtbo),0x00000800@0x0000e000(vbmeta),0x00010000@0x0000e800(boot),0x00030000@0x000
1e800(recovery),0x00028000@0x0004e800(backup),0x00002000@0x00076800(security),0x0
0070000@0x00078800(cache),0x002d0000@0x000e8800(system),0x00008000@0x003b8800(met
adata),0x00070000@0x003c0800(vendor),0x00020000@0x00430800(oem),0x00000400@0x0045
0800(frp),-@0x00450c00(userdata:grow)
uuid:system=af01642c-9b84-11e8-9b2a-234eb5e198a0

The parameter file for CMDLINE:

FIRMWARE_VER:9.0
MACHINE_MODEL:RK3326
MACHINE_ID:007
MANUFACTURER: RK3326
MAGIC: 0x5041524B
ATAG: 0x00200800
MACHINE: 3326
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
CMDLINE:console=ttyFIQ0 androidboot.console=ttyFIQ0 initrd=0x62000000,0x00800000
mtdparts=rk29xxnand:0x00002000@0x00004000(uboot),0x00002000@0x00006000(trust),0x0
0002000@0x00008000(misc),0x00002000@0x0000a000(dtb),0x00002000@0x0000c000(dtbo),0
x00000800@0x0000e000(vbmeta),0x00010000@0x0000e800(boot),0x00030000@0x0001e800(re
covery),0x00028000@0x0004e800(backup),0x00002000@0x00076800(security),0x00070000@
0x00078800(cache),0x002d0000@0x000e8800(system),0x00008000@0x003b8800(metadata),0
x00070000@0x003c0800(vendor),0x00020000@0x00430800(oem),0x00000400@0x00450800(frp
),-@0x00450c00(userdata)

The main differences between GPT partition and legacy CMDLINE partition are:

Defined "TYPE: GPT" Add "grow" flag in Last partition, For example: "userdata:grow" Define UUID for system or rootfs, For example: "uuid:system=af01642c-9b84-11e8-9b2a- 234eb5e198a0" Parameter files will not be burned into NVM (EMMC, NAND, etc.), and only mtdparts partition definitions and UUIDs will be used. Other informations are only defined for compatibility with upgrade tools.

2. Details Information​

2.1 FIRMWARE_VER:9.0​

ItemFIRMWARE VER _
TypeDecimal number,format: X.X
value0 - 255
descriptionThe firmware version will be used as packaging updata.img, and the upgrade tool will identify the firmware version based on this code.

2.2 MACHINE_MODEL:RK3326​

ItemMACHINE MODEL _
TypeStrings
Length(max)255
descriptionMachine model, use for package updata.img, you can modify it for display in upgrade tool according to different projects, which also determine whether the firmware matches correctly device as upgrading firmware in recovery.

2.3 MACHINE_ID:007​

ItemMACHINE ID _
TypeStrings
Length(max)255
descriptionThe Product development ID, which consists of characters and numbers, use for package updata.img. There are different IDs in different projects, which can be used to identify machine models. Also, determine if the firmware matches correctly device as upgrading firmware in recovery.

2.4 MANUFACTURER:rk3326​

ItemMANUFACTURER
TypeStrings
Length(max)255
descriptionVendor information, which use to package updata.img, can be modified by yourself for the upgrade tool display.

2.5 MAGIC:0x5041524B​

ItemMAGIC
TypeHexadecimal number
Value0x5041524B(fix)
descriptionMagic number can not be modified. Some new APs use DTS instead of magic number. But for compatibility, please do not delete or modify.

2.6 ATAG:0x60000800​

ItemATAG
TypeHexadecimal number
value32 bits ddr address
descriptionATAG data stroage address. Some new APs use DTS instead of this. But for compatibility, please do not delete or modify.

2.7 MACHINE:3226​

ItemMACHINE
TypeStrings
Length(max)255
descriptionThis code uses to Kernel identification and match to the kernel, which can not be modified.

The following table lists the values for several Chipset:

ChipsetMACHINE
RK29xx2929
RK292X2928
RK30663066
RK3126C3126c
RK33263326
RK33993399
RK33083308

2.8 CHECK_MASK:0x80​

ItemMACHINE MODEL _
TypeHexadecimal number
Length(max)0x80(fix)
descriptionReserved, please do not modify it.

2.9 TYPE:GPT​

This code specify the partition defined in the file CMDLINE for the upgrade Tool to create GPT and write to NVM(NAND,EMMC,etc.) storage devices instead of the parameter file.

2.10 CMDLINE:​

"console=ttyFIQ0 androidboot.console=ttyFIQ0",which is serial port definition。

initrd=0x62000000,0x00800000,The first parameter is the location where RAMDISK is loaded into SDRAM, the second parameter is the size of RAMDISK.

The definition of androidboot.xxx is used as android started. There are some platforms define in the dts of the kernel. This part of the definition is generally no need to modified and remain the value of the SDK default.

The partition preview:

mtdparts=rk29xxnand:0x00002000@0x00002000(uboot),0x00002000@0x00004000(trust),0x0
0002000@0x00006000(misc),
0x00008000@0x00008000(resource),0x00010000@0x00010000(kernel),0x00010000@0x000200
00(boot),0x00020000@0x00030000(recovery),
0x00038000@0x00050000(backup),0x00002000@0x00088000(security),0x00100000@0x0008a0
00(cache),0x00400000@0x0018a000(system),
0x00008000@0x0058a000(metadata),0x00080000@0x00592000(vendor),0x00080000@0x006120
00(oem),0x00000400@0x00692000(frp),-@0x00692400(userdata)

Partition definition instruction:

  1. For compatibility , all the Rockchip SOCs are identified by rk29xxnand. 2. Single partition description:

For example: 0x00002000@0x00008000(boot), the value before the @ symbol is the partition size, the value after the @ symbol is the starting position of the partition, and the characters in the brackets are the names of the partitions. The unit of all values is sector, and one sector is 512 bytes. In the above example, the start position of the boot partition is 0x8000 sectors, and the size is 0x2000 sectors (4MB).

  1. For good performance, each partition start-address requires 32KB (64 sectors) alignment, and the size also requires an integer multiple of 32KB. 4. If you use the image in the format of sparse , the partition will be erased during the upgrade. For better compatibility, the corresponding partition is preferably aligned by 4MB, and the size is also configured as an integer multiple of 4MB. 5. Using GPT partition, the address defined in the parameter is the real logical address (LBA). For example, U-Boot is defined at 0x4000, as it loader into EMMC and NAND, the logical address is also 0x4000.
NameParameter AddressEMMC Logic AddressNAND Logic AddressSize
GPT--0032KB
LOADER--0x400x404MB- 32KB
Reserve--0x20000x20004MB
UBOOT0x40000x40000x40004MB
TRUST0x60000x60000x60004MB

The last partition needs to specify parameter "grow" , the tool will allocate the remaining space to the last partition.

  1. Using the legacy cmdline partition, if it is EMMC , the space of 0-4MB is reserved for the loader. The partition defined in the parameter needs to add 4MB. For example, U-Boot is defined at 0x2000, as actually write into EMMC, the logical address to be the same with GPT partition, that is 0x4000. If it is NAND , in order to be compatible with the legacy, all addresses are real logical addresses. For example, U-Boot is defined at 0x2000, the logical address is also 0x2000, which is different from GPT.
NameParameter AddressEMMC Logic AddressNAND Logic AddressSize
Reserve--0032KB
LOADER--0x400x404MB- 32KB
parameter--0x20000x04MB
UBOOT0x20000x40000x20004MB
TRUST0x40000x60000x40004MB

Note: Using NAND FLASH, The address 0x40 may write with the loader image,its share 0-4MB space with the parameter, and the valid data will not be overwritten.

3. Partition Definition Specification​

  1. All partitions which are written by bootrom, pre-loader, uboot and trust must be palced before recovery partition. 2. Any new partitions added by the customer, which are written by the pre-loader, uboot and trust, should be placed before the recovery partition; 3. The misc, vbmeta and security partitions which is used by rockchip should be placed before the recovery partition.