Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains the layout of partitions in -system program image the ISP file ISPBOOOT.BIN of SP7350.After power on, internal ROM code of SP7350 will search for the file named ISPBOOOT.BIN in root directory of SD card if “boot from SD card” is selected by boot-switch of SP7350, or in root directory of USB flash drive if “boot from USB flash drive” is selected by boot-switch of SP7350. Once found the file, it loads . The ISP (In-System Program) file for SP7350 to boot and write images to flash devices.

When the SP7350 powers on, its internal ROM code initiates a search for the ISPBOOOT.BIN file. The search location is the root directory of the first or solo partition on the selected boot devices, with options including an SD card or a USB flash drive. Once found, the file is loaded, extracting the first-stage boot loader, X-Boot, from the image file and store X-Boot image to and storing it in the internal SRAM.

The X-Boot image is , situated at offset 0 of within ISPBOOOT.BIN and its size is 192 KiB at maximum. Actual size is recorded in header of x-boot image. If checksum is verified pass, it then jumps to run , has a maximum size of 192 KiB, with the actual size recorded in the X-Boot image header. Upon successful checksum verification, the system transitions to execute X-Boot.

X-Boot will first do initializes and trains the SDRAM controller initialization and training. After completed, DRAM is ready , preparing the DRAM for use. It Subsequently, it loads the TF-A (Trusted Firmware-A image from fip partition from ISPBOOOT.BIN and store to DRAM. It loads ) and OP-TEE (Open Portable Trusted Execution Environment) images from the fip (firmware image package) partition within ISPBOOOT.BIN, storing them in DRAM. Additionally, the U-Boot image is extracted from offset 0x30000 of ISPBOOOT.BIN and store to stored in DRAM. If checksum of both images are verified pass, it then jumps to run TF-A and then Upon successful checksum verification for all images, the system proceeds to execute TF-A, followed by OP-TEE, and finally U-Boot.

U-Boot then automatically run scripts for programming flash device, such as autonomously executes scripts to program one of the following flash devices: eMMC, SPI-NAND flash, 8-bit NAND flash, or SPI-NOR flash.

Refer to The partition layout of partitions of file ISPBOOOT.BIN is illustrated below, commencing with the image file starts with X-Boot image (partition name: xboot0) and , followed by the U-Boot image (partition namname: uboot0). Then is followed by a header which records detailed name, offset, size and etc. of the following , and a header detailing the subsequent partitions.

...

The following table explains each partition.

Partitions

Offset

Size

Descriptions

xboot0

0

192 kB

image Image of xX-bootBoot, including training firmware of DDR

uboot0

0x30000

1344 kB

image Image of U-Boot

file_header

0x180000

16 kB

header Header for the following partitions

xboot

0x184000

actual size

image Image of xX-boot, including training firmware of DDR

uboot1

-

actual size

image Image of U-Boot

uboot2

-

actual size

image Image of U-Boot

fip

-

actual size

image Image of fip, including TF-A and OP-TEE

env

-

actual size

image Image of environment variable variables of U-Boot

env_redund

-

actual size

image Image of environment variable variables of U-Boot (redundant)

dtb

-

actual size

image Image of device-tree blob (not used)

kernel

-

actual size

image Image of Linux kernel with U-Boot header

rootfs

-

actual size

image Image of root file-system

isp_script_nand

-

actual size

script Script of U-Boot for NAND flash in-system program

isp_script_emmc

-

actual size

script Script of U-Boot for eMMC in-system program

isp_script_nor

-

actual size

script Script of U-Boot for SPI-NOR flash in-system program

Refer to the code below for the definition of partition_info in the file_header.

Code Block
#define SIZE_FILE_NAME      (32)
struct partition_info_s {
	u08 file_name[SIZE_FILE_NAME];  // file name of source (basename only)
	u08 md5sum[36];
	u32 file_offset;                // offset in output file
	u64 file_size;                  // file size of the partition
	u32 partition_start_addr;       // partition's start address in NAND, there will be an offset added in U-Boot script ($isp_nand_addr_1st_part), less than 4GB is expected.
	u64 partition_size;             // reserved size for this partition, less than 4GB is expected.
	u32 flags;
	u32 emmc_partition_start;       // Unit: block
	u32 reserved[7];                // let size of this structure == SIZE_PARTITION_INFO_S
} __attribute__((packed));

Refer to the code below for the definition of file_header.

Code Block
#define SIZE_PARTITION_INFO_S           (128)
#define SIZE_INIT_SCRIPT                (2048)
#define NUM_OF_PARTITION                (111)
struct file_header_s {
	u08 signature[32];
	u08 init_script[SIZE_INIT_SCRIPT];
	u32 flags;
	u08 reserved[SIZE_PARTITION_INFO_S - 36];

	struct partition_info_s partition_info[NUM_OF_PARTITION];
} __attribute__((packed));          // sizeof(this structure) == 16384