Skip to main content
The following section describes how you can add, delete, modify, and rename flash partitions for a Qualcomm Linux supported machine. The partitions are defined using the partitions.conf configuration files. These files are available at https://github.com/qualcomm-linux/qcom-ptool/tree/main/platforms. For more information, see: Ptool workflow figure. You can modify the partition configuration files to add, delete, modify, or rename partitions. For example, to work with UFS partition files for IQ-9075 EVK, use the following file: https://github.com/qualcomm-linux/qcom-ptool/tree/main/platforms/iq-9075-evk/ufs By modifying these configuration files and integrating these in the build, you can generate a custom partition layout. When a configuration file from https://github.com/qualcomm-linux/qcom-ptool/tree/main/platforms is used in Qualcomm Linux builds, the workflow spans all the steps from the Ptool workflow figure. The following tables list the files and tools used for partitioning workflow:
FileDescription
Partition layout fileDefines all partitions for storage in JSON format. This file is used by gen_partition tool.
Generated Partition XML fileDefines the Qualcomm internal XML format. This generated file is used by Ptool.
ToolDescription
gen_partitionReads the partition layout files and generates an internal XML format handled by the Qualcomm Ptool.
PtoolThe Qualcomm Ptool converts information in partition XML to GUID Partition Table (GPT) binaries.

Partition layout file

The partitions on the universal flash storage (UFS) and embedded multimedia card (eMMC) store various images of the bootchain and the Linux operating system. The configuration file details the partitions configured for a specific Qualcomm development kit. The following configuration files define the UFS partitions for the RB3 Gen 2 development kit and the partitions for IQ-9075 EVK:

Partition layout file syntax

The following examples from the partitions.conf from qcs6490-rb3gen2 show the syntax of the partition layout file. The first entry in the configuration file defines the disk type, disk size, logical block addressing (LBA) size (sector size), and whether the last partition should grow till the last usable LBA.
  • The following is an example for the UFS:
    # select disk type emmc | nand | ufs Mandatory
    # disk size in bytes Mandatory
    
    --disk --type=ufs --size=137438953472 --write-protect-boundary=0 --sector-size-in-bytes=4096 --grow-last-partition
    
  • The following is an example for the eMMC:
    # select disk type emmc | nand | ufs Mandatory
    # disk size in bytes Mandatory
    
    --disk --type=emmc --size=76841669632 --write-protect-boundary=65536 --sector-size-in-bytes=512 --grow-last-partition
    
The qcs6490-rb3gen2/ufs file specifies the following examples of partitions. A few partitions are defined in LUN0, with each line representing an individual partition.

UFS

Note In the following examples, the file names mentioned in LUN1 to LUN5 entries by the --filename=parameter of partitions.conf are downloaded by the recipe firmware-qcom-boot-qcs6490.incfrom Qualcomm software center
  • Example 1: The efi partition of 524288 KB is defined in LUN0. The efi.bin file is generated during the BitBake build.
    --partition --lun=0 --name=efi --size=524288KB --type-guid=C12A7328-F81F-11D2-BA4B-00A0C93EC93B --filename=efi.bin
    
A couple of partitions are defined in LUN1. Each line defines an individual partition:
  • Example 2: The xbl_a partition of 3604 KB is defined for LUN1. Flash the xbl.elf file to this partition.
    #This is LUN 1 - Boot LUN A
    --partition --lun=1 --name=xbl_a --size=3604KB --type-guid=DEA0BA2C-CBDD-4805-B4F9-F428251C3E98 --filename=xbl.elf
    
  • Example 3: The xbl_config_a partition of 512 KB is defined for LUN1. Flash the xbl_config.elf file to this partition.
    #This is LUN 1 - Boot LUN A
    --partition --lun=1 --name=xbl_config_a --size=512KB --type-guid=5A325AE4-4276-B66D-0ADD-3494DF27706A --filename=xbl_config.elf
    
A partition defined in LUN4:
  • Example 4: The aop_a partition of 512 KB is defined for LUN4. Flash the aop.mbn file to this partition.
    --partition --lun=4 --name=aop_a --size=512KB --type-guid=D69E90A5-4CAB-0071-F6DF-AB977F141A7F --filename=aop.mbn
    

eMMC

  • Example 1: The xbl_a partition of 3584 KB is defined for LUN0. Flash the xbl.elf file to this partition.
    #This is LUN 0 - Boot LUN A
    --partition --name=xbl_a --size=3584KB --type-guid=DEA0BA2C-CBDD-4805-B4F9-F428251C3E98 --filename=xbl.elf
    
  • Example 2: The xbl_config_a partition of 128 KB is defined for LUN0. Flash the xbl_config.elf file to this partition.
    #This is LUN 0 - Boot LUN A
    --partition --name=xbl_config_a --size=128KB --type-guid=5A325AE4-4276-B66D-0ADD-3494DF27706A --filename=xbl_feature_config.elf
    
The options used for each partition entry are as follows:
  • Mandatory options:
    • --lun (mandatory for UFS, not required for eMMC. Expressed as number)
    • --name (name for the partition, a string)
    • --size (size of the partition, generally expressed in KB)
    • --type-guid (GUID for the partition)
  • Optional options:
    • --attributes (Optional 64 bit attribute, for example, 1000000000000004)
    • --filename (Name of the file that is flashed to the partition)
    • --readonly (whether the partition should be read-only, values true or false)
    • --sparse (whether the partition is for a sparse image, values true or false)

Linux operating system partitions

PartitionsDescription
EFI partitionThe EFI system partition (ESP) contains Esp.bin and a vfat file. It contains all the details necessary for the UEFI to enable systemd-boot. For more information about this image, see EFI image.
Rootfs partitionThis partition contains the rootfs.img image file. This image consists of all the user space libraries and binaries.

Partition tool (Ptool)

Ptool generates a GUID partition table binary that the QDL tool uses to partition the storage. The following figure shows the Ptool workflow:
Figure: Ptool workflow

Figure: Ptool workflow

The Ptool‑generated binaries for the QCS6490 RB3 Gen 2 Vision development kit are located in the build/tmp/deploy/images/rb3gen2-core-kit/qcomflash directory.

Modify partition

The partitions.conf file available at https://github.com/qualcomm-linux/qcom-ptool/tree/main/platforms/qcs6490-rb3gen2/ufs, defines the partitions for QCS6490 RB3 Gen 2 Core development kit. The gen_partition.py tool processes and generates partition.xml, which is a mandatory input for ptool.py. As a final step, Ptool generates the rawprogram.xml, patch.xml, gpt_main*.bin, and gpt_backup*.bin files, which are required by the QDL tool to flash the system image to the device.
  1. To add a partition, make a partition entry in the configuration file: partitions.conf for a particular device.
  2. Run the BitBake command to generate all necessary files:
    bitbake <image-name>
    
  3. After the image build completes, if MACHINE is rb3gen2-core-kit and the image recipe selected is qcom-multimedia-image, run the following command to flash the image:
    cd <workspace>/build/tmp/deploy/images/rb3gen2-core-kit/qcom-multimedia-image-rb3gen2-core-kit.rootfs-<timestamp>.qcomflash
    ./qdl prog_firehose_ddr.elf rawprogram*.xml patch*.xml
    

Best practices

  • Many partitions are crucial for functionality. Before removing or resizing partitions, review the partition layout documentation carefully.
  • To reflect changes in partitions.conf, update the QCOM_PARTITION_CONF variable in the machine configuration.
  • For UFS devices, always specify the --lun option for each partition entry.

Next steps