-
Notifications
You must be signed in to change notification settings - Fork 21
Physical partitions for emmc #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,12 +4,16 @@ | |
| # select disk type emmc | nand | ufs Mandatory | ||
| # disk size in bytes Mandatory | ||
| # options if not explicitly provide | ||
| # | ||
| # The eMMC hardware uses at least 2 physical partitions on this platform: | ||
| # - Physical Partition 0 (no --phys-part, or --phys-part=0): Main storage with all partitions (JEDEC "User Data Area") | ||
| # - Physical Partition 1 (--phys-part=1): OTP storage with cdt partition only (JEDEC "Boot Area Partition 1") | ||
|
|
||
| --disk --type=emmc --size=76841669632 --write-protect-boundary=65536 --sector-size-in-bytes=512 --grow-last-partition | ||
|
|
||
| # per partition entry | ||
| # mandatory options: | ||
| # --lun (mandatory for UFS, emmc no need this) | ||
| # --phys-part (specifies physical partition number for eMMC/UFS) | ||
| # --name | ||
| # --size in bytes | ||
| # --type-guid | ||
|
|
@@ -19,91 +23,86 @@ | |
| # --readonly true | ||
| # --sparse false | ||
|
|
||
| # Physical Partition 0 (--phys-part=0) - Main storage partition (JEDEC "User Data Area") | ||
| # Boot partitions | ||
| --partition --name=xbl_a --size=5120KB --type-guid=DEA0BA2C-CBDD-4805-B4F9-F428251C3E98 --filename=xbl.elf | ||
| --partition --name=xbl_b --size=5120KB --type-guid=7A3DF1A3-A31A-454D-BD78-DF259ED486BE --filename=xbl.elf | ||
| --partition --name=xbl_config_a --size=512KB --type-guid=5A325AE4-4276-B66D-0ADD-3494DF27706A --filename=xbl_config.elf | ||
| --partition --name=shrm_a --size=80KB --type-guid=CB74CA22-2F0D-4B82-A1D6-C4213F348D73 --filename=shrm.elf | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I cannot leave a comment on the commit message, so adding it here. can you please clearly say which version of the boot binaries you used as a reference, it might be useful to keep that in the history
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've used an internal boot binaries build that @loicpoulain shared with me, I'll share it with you
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ndechesne I've compared this partitions.conf with the partition_emmc.xml in the QCS8300 boot binaries (r1.0_00114.0) and they match except for these differences:
The last one is interesting, the .xml GUID makes more sense to me than the unknown one used in .conf (https://uapi-group.org/specifications/specs/discoverable_partitions_specification/) but I'd still stick to the same GUID as other boards as I believe persist is a Yocto specific HLOS partition.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. persist is a partition used in QTEE (TZ) to store its encrypted data. not sure we can consider it as an HLOS partition. and it is not always at the end of the emmc (it is always on the last LUN on UFS, that is by design). we seem to be using 0FC63DAF-8483-4772-8E79-3D69D8477DE4 for the qcs615 (talos) boards. we should check if there is a GUID that is strictly required, since we are spotting an inconsistency here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I briefly researched this, IIUC QTEE has different dependencies on storage. There's notably some RPMB usage, but we don't currently attempt to provision RPMB from ptool reference files (we could), and "secure file system" (SFS). SFS is actually accessed through HLOS, even if QTEE handles the encryption itself. The /persist path can be anything that the HLOS choses, and it's typically a regular fs. We are currently discussing adding a persist partition to meta-qcom: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Looks like I over-focused on the one-time provisioned use-case. Apart from this, both OPTEE and QTEE use HDCP keys and DRM keys are just one type of GP Persistent Objects even though they are created and stored once for the lifetime of the device. All in all, we are asking for the same thing that OPTEE requires. The only difference is that for us, integrity of the contents of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sorry, not "on the fly", of course. I meant that if we detect that persist partition is damaged or doesn't contain keys (or something else), it should be reinited automatically during the boot from the separately stored HDCP / DRM keys. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's correct, this behavior is already implemented by the Secure File System as per the TEE Internal Core API specification, "Any function that accesses a persistent object handle MAY return a status of So yes, in case of corruption, we do 'reinit' or 'RESET' the object. But mind you, before doing so, we do make an attempt to recover from a backup version of the object. So like I said, we make all sorts of efforts to avoid corruption both in our implementation of the Secure File System, as well as in the properties of the Persist partition (being separate from rootfs). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By the way, the 'backup' versions are also stored in the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (We should probably continue discussing in the meta-qcom issue or PR) I understand the idea of precious data that we want to backup on device, perhaps in a partition not managed by the HLOS. I don't find the design of a singled out partition for TEE particularly elegant, but it's also pragmatic. I've been thinking that ptool ought to have a way to mix:
And in this case, it almost feels like a third use case, a little bit like the Arduino one:
|
||
| --partition --name=xbl_b --size=5120KB --type-guid=7A3DF1A3-A31A-454D-BD78-DF259ED486BE --filename=xbl.elf | ||
| --partition --name=xbl_config_b --size=512KB --type-guid=F462E0EA-A20E-4B10-867A-2D4455366548 --filename=xbl_config.elf | ||
| --partition --name=shrm_b --size=80KB --type-guid=39FD6C00-49EB-6BD1-6899-2FB849DD4F75 --filename=shrm.elf | ||
|
|
||
| # OTP / Misc partitions | ||
| --partition --name=ALIGN_TO_128K_1 --size=104KB --type-guid=FDE1604B-D68B-4BD4-973D-962AE7A1ED88 | ||
| --partition --name=cdt --size=4KB --type-guid=A19F205F-CCD8-4B6D-8F1E-2D9BC24CFFB1 --filename=cdt.bin | ||
| # OTP / Misc partitions (on PHY 0) | ||
| --partition --name=ddr_a --size=1024KB --type-guid=20A0C19C-286A-42FA-9CE7-F64C3226A794 | ||
| --partition --name=ddr_b --size=1024KB --type-guid=325DEF02-1305-44A3-AA8D-AC82FEBE220E | ||
|
|
||
| # Firmware partitions | ||
| # A/B partitions | ||
| --partition --name=aop_a --size=256KB --type-guid=D69E90A5-4CAB-0071-F6DF-AB977F141A7F --filename=aop.mbn | ||
| --partition --name=aop_b --size=256KB --type-guid=B8B27C4C-4B5B-8AB2-502F-A792B590A896 --filename=aop.mbn | ||
| --partition --name=shrm_a --size=80KB --type-guid=CB74CA22-2F0D-4B82-A1D6-C4213F348D73 --filename=shrm.elf | ||
| --partition --name=shrm_b --size=80KB --type-guid=39FD6C00-49EB-6BD1-6899-2FB849DD4F75 --filename=shrm.elf | ||
| --partition --name=uefi_a --size=5120KB --type-guid=400FFDCD-22E0-47E7-9A23-F16ED9382388 --filename=uefi.elf | ||
| --partition --name=uefi_b --size=5120KB --type-guid=9F234B5B-0EFB-4313-8E4C-0AF1F605536B --filename=uefi.elf | ||
| --partition --name=core_nhlos_a --size=174080KB --type-guid=6690B4CE-70E9-4817-B9F1-25D64D888357 | ||
| --partition --name=core_nhlos_b --size=174080KB --type-guid=77036CD4-03D5-42BB-8ED1-37E5A88BAA34 | ||
| --partition --name=uefisecapp_a --size=2048KB --type-guid=BE8A7E08-1B7A-4CAE-993A-D5B7FB55B3C2 --filename=uefi_sec.mbn | ||
| --partition --name=uefisecapp_b --size=2048KB --type-guid=538CBDBA-D4A4-4438-A466-D7B356FAC165 --filename=uefi_sec.mbn | ||
| --partition --name=xbl_ramdump_a --size=2048KB --type-guid=0382F197-E41F-4E84-B18B-0B564AEAD875 --filename=XblRamdump.elf | ||
| --partition --name=xbl_ramdump_b --size=2048KB --type-guid=C3E58B09-ABCB-42EA-9F0C-3FA453FA892E --filename=XblRamdump.elf | ||
| --partition --name=dtb_a --size=65536KB --type-guid=2A1A52FC-AA0B-401C-A808-5EA0F91068F8 --filename=dtb.bin | ||
| --partition --name=dtb_b --size=65536KB --type-guid=A166F11A-2B39-4FAA-B7E7-F8AA080D0587 --filename=dtb.bin | ||
| --partition --name=tz_a --size=4000KB --type-guid=A053AA7F-40B8-4B1C-BA08-2F68AC71A4F4 --filename=tz.mbn | ||
| --partition --name=tz_b --size=4000KB --type-guid=C832EA16-8B0D-4398-A67B-EBB30EF98E7E --filename=tz.mbn | ||
| --partition --name=hyp_a --size=65536KB --type-guid=E1A6A689-0C8D-4CC6-B4E8-55A4320FBD8A --filename=hypvm.mbn | ||
| --partition --name=hyp_b --size=65536KB --type-guid=3D3E3AD2-8FF3-4975-A7E7-0E8A10B69F0D --filename=hypvm.mbn | ||
| --partition --name=TZAPPS --size=320KB --type-guid=14D11C40-2A3D-4F97-882D-103A1EC09333 | ||
| --partition --name=mdtpsecapp_a --size=4096KB --type-guid=EA02D680-8712-4552-A3BE-E6087829C1E6 | ||
| --partition --name=mdtp_a --size=32768KB --type-guid=3878408A-E263-4B67-B878-6340B35B11E3 | ||
| --partition --name=keymaster_a --size=512KB --type-guid=A11D2A7C-D82A-4C2F-8A01-1805240E6626 | ||
| --partition --name=keymaster_b --size=512KB --type-guid=441EEF80-DE15-4522-9995-563398D94889 | ||
| --partition --name=devcfg_a --size=128KB --type-guid=F65D4B16-343D-4E25-AAFC-BE99B6556A6D --filename=devcfg_iot.mbn | ||
| --partition --name=devcfg_b --size=128KB --type-guid=4E820A31-17E3-447D-B32D-FB339F7EA1A2 --filename=devcfg_iot.mbn | ||
| --partition --name=qupfw_a --size=128KB --type-guid=21D1219F-2ED1-4AB4-930A-41A16AE75F7F | ||
| --partition --name=qupfw_b --size=128KB --type-guid=04BA8D53-5091-4958-9CA1-0FE0941D2CBC | ||
| --partition --name=cpucp_a --size=1024KB --type-guid=1E8615BD-6D8C-41AD-B3EA-50E8BF40E43F --filename=cpucp.elf | ||
| --partition --name=cpucp_b --size=1024KB --type-guid=6C1111FB-5354-41DE-AC17-5B6E542BE836 --filename=cpucp.elf | ||
| --partition --name=apdp_a --size=64KB --type-guid=E6E98DA2-E22A-4D12-AB33-169E7DEAA507 --filename=zeros_33sectors.bin | ||
| --partition --name=apdp_b --size=64KB --type-guid=110F198D-8174-4193-9AF1-5DA94CDC59C9 --filename=zeros_33sectors.bin | ||
| --partition --name=multiimgoem_a --size=32KB --type-guid=E126A436-757E-42D0-8D19-0F362F7A62B8 --filename=multi_image.mbn | ||
| --partition --name=multiimgoem_b --size=32KB --type-guid=3E3E3ECD-C512-4F95-9144-6063826A8970 --filename=multi_image.mbn | ||
| --partition --name=multiimgqti_a --size=32KB --type-guid=846C6F05-EB46-4C0A-A1A3-3648EF3F9D0E --filename=multi_image_qti.mbn | ||
| --partition --name=multiimgqti_b --size=32KB --type-guid=D30C8B21-DDD9-45B6-8DE0-3165D34395C9 --filename=multi_image_qti.mbn | ||
| --partition --name=imagefv_a --size=1024KB --type-guid=17911177-C9E6-4372-933C-804B678E666F --filename=imagefv.elf | ||
| --partition --name=imagefv_b --size=1024KB --type-guid=920CFC3D-7285-4A47-9C1C-4A87590E0687 --filename=imagefv.elf | ||
| --partition --name=gearvm_a --size=16000KB --type-guid=06EF844E-08FC-494E-89EB-396D4D6C5B27 | ||
| --partition --name=gearvm_b --size=16000KB --type-guid=4D09E70E-F349-11ED-A05B-0242AC120003 | ||
|
|
||
| # Added based on QCS8300_bootbinaries/partition_emmc.xml XML comparison (Missing in UFS) | ||
| --partition --name=core_nhlos_a --size=174080KB --type-guid=6690B4CE-70E9-4817-B9F1-25D64D888357 | ||
| --partition --name=core_nhlos_b --size=174080KB --type-guid=77036CD4-03D5-42BB-8ED1-37E5A88BAA34 | ||
| --partition --name=mdtpsecapp_a --size=4096KB --type-guid=EA02D680-8712-4552-A3BE-E6087829C1E6 | ||
| --partition --name=mdtp_a --size=32768KB --type-guid=3878408A-E263-4B67-B878-6340B35B11E3 | ||
| --partition --name=usb4fw_a --size=61KB --type-guid=3FA03C7A-9FDC-498B-A2A8-DE11EE339790 | ||
| --partition --name=cateloader --size=2048KB --type-guid=AA9A5C4C-4F1F-7D3A-014A-22BD33BF7191 | ||
| --partition --name=uefivarstore --size=512KB --type-guid=165BD6BC-9250-4AC8-95A7-A93F4A440066 | ||
| --partition --name=quantumsdk --size=40960KB --type-guid=AA9A5C4C-4F1F-7D3A-014A-22BD33BF7191 | ||
| --partition --name=quantumfv --size=512KB --type-guid=80C23C26-C3F9-4A19-BB38-1E457DACEB09 | ||
|
|
||
| # Non A/B partitions | ||
| --partition --name=TZAPPS --size=320KB --type-guid=14D11C40-2A3D-4F97-882D-103A1EC09333 | ||
| --partition --name=SYSFW_VERSION --size=4KB --type-guid=3C44F88B-1878-4C29-B122-EE78766442A7 | ||
| --partition --name=devinfo --size=4KB --type-guid=65ADDCF4-0C5C-4D9A-AC2D-D90B5CBFCD03 | ||
| --partition --name=dip --size=1024KB --type-guid=4114B077-005D-4E12-AC8C-B493BDA684FB | ||
| --partition --name=spunvm --size=8192KB --type-guid=E42E2B4C-33B0-429B-B1EF-D341C547022C | ||
| --partition --name=splash --size=33424KB --type-guid=AD99F201-DC71-4E30-9630-E19EEF553D1B | ||
| --partition --name=limits --size=4KB --type-guid=10A0C19C-516A-5444-5CE3-664C3226A794 | ||
| --partition --name=logfs --size=8192KB --type-guid=BC0330EB-3410-4951-A617-03898DBE3372 | ||
| --partition --name=cateloader --size=2048KB --type-guid=AA9A5C4C-4F1F-7D3A-014A-22BD33BF7191 | ||
| --partition --name=emac --size=512KB --type-guid=E7E5EFF9-D224-4EB3-8F0B-1D2A4BE18665 | ||
| --partition --name=uefivarstore --size=512KB --type-guid=165BD6BC-9250-4AC8-95A7-A93F4A440066 | ||
| --partition --name=secdata --size=128KB --type-guid=76CFC7EF-039D-4E2C-B81E-4DD8C2CB2A93 | ||
| --partition --name=quantumsdk --size=40960KB --type-guid=AA9A5C4C-4F1F-7D3A-014A-22BD33BF7191 | ||
| --partition --name=quantumfv --size=512KB --type-guid=80C23C26-C3F9-4A19-BB38-1E457DACEB09 | ||
| --partition --name=toolsfv --size=1024KB --type-guid=97745ABA-135A-44C3-9ADC-05616173C24C --filename=tools.fv | ||
| --partition --name=softsku --size=8KB --type-guid=69CFD37F-3D6B-48ED-9739-23015606BE65 | ||
|
|
||
| # PVM images | ||
| --partition --name=gearvm_a --size=16000KB --type-guid=06EF844E-08FC-494E-89EB-396D4D6C5B27 | ||
| --partition --name=diag_log --size=65536KB --type-guid=3989AF30-5C02-4154-AD00-1D34C816CAC1 | ||
| --partition --name=pvm_log --size=65536KB --type-guid=2889C942-FF80-4DA8-A5B8-3F32F285C0D8 | ||
| --partition --name=gvm_log --size=65536KB --type-guid=78EBFD49-E8B1-4E75-ABC0-3F2DBC7428DD | ||
| --partition --name=aop_b --size=256KB --type-guid=B8B27C4C-4B5B-8AB2-502F-A792B590A896 --filename=aop.mbn | ||
| --partition --name=tz_b --size=4000KB --type-guid=C832EA16-8B0D-4398-A67B-EBB30EF98E7E --filename=tz.mbn | ||
| --partition --name=hyp_b --size=65536KB --type-guid=3D3E3AD2-8FF3-4975-A7E7-0E8A10B69F0D --filename=hypvm.mbn | ||
| --partition --name=keymaster_b --size=512KB --type-guid=441EEF80-DE15-4522-9995-563398D94889 | ||
| --partition --name=devcfg_b --size=128KB --type-guid=4E820A31-17E3-447D-B32D-FB339F7EA1A2 --filename=devcfg_iot.mbn | ||
| --partition --name=cpucp_b --size=1024KB --type-guid=6C1111FB-5354-41DE-AC17-5B6E542BE836 --filename=cpucp.elf | ||
| --partition --name=apdp_b --size=64KB --type-guid=110F198D-8174-4193-9AF1-5DA94CDC59C9 --filename=zeros_33sectors.bin | ||
| --partition --name=multiimgoem_b --size=32KB --type-guid=3E3E3ECD-C512-4F95-9144-6063826A8970 --filename=multi_image.mbn | ||
| --partition --name=multiimgqti_b --size=32KB --type-guid=D30C8B21-DDD9-45B6-8DE0-3165D34395C9 --filename=multi_image_qti.mbn | ||
| --partition --name=imagefv_b --size=1024KB --type-guid=920CFC3D-7285-4A47-9C1C-4A87590E0687 --filename=imagefv.elf | ||
| --partition --name=gearvm_b --size=16000KB --type-guid=4D09E70E-F349-11ED-A05B-0242AC120003 | ||
| --partition --name=logdump --size=524288KB --type-guid=5AF80809-AABB-4943-9168-CDFC38742598 | ||
| --partition --name=recoveryinfo --size=4KB --type-guid=7374B391-291C-49FA-ABC2-0463AB5F713F | ||
| --partition --name=xbl_logs --size=1024KB --type-guid=F7EECB66-781A-439A-8955-70E12ED4A7A0 | ||
| --partition --name=SYSFW_VERSION --size=4KB --type-guid=3C44F88B-1878-4C29-B122-EE78766442A7 | ||
|
|
||
| # Protected Read-write LUN partitions | ||
| # HLOS partitions | ||
| --partition --name=persist --size=30720KB --type-guid=6C95E238-E343-4BA8-B489-8681ED22AD0B | ||
|
|
||
| # HLOS LUN partitions (kept at the end) | ||
| --partition --name=efi --size=524288KB --type-guid=C12A7328-F81F-11D2-BA4B-00A0C93EC93B --filename=efi.bin | ||
| --partition --name=rootfs --size=16777216KB --type-guid=B921B045-1DF0-41C3-AF44-4C6F280D3FAE --filename=rootfs.img | ||
|
|
||
| # Physical Partition 1 (--phys-part=1) - OTP storage partition (JEDEC "Boot Area Partition 1") | ||
| --partition --phys-part=1 --name=cdt --size=4KB --type-guid=A19F205F-CCD8-4B6D-8F1E-2D9BC24CFFB1 --filename=cdt.bin | ||
| --partition --phys-part=1 --name=last_parti --size=0KB --type-guid=00000000-0000-0000-0000-000000000000 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a really nice change. this code gives me headache each time i need to read it.. we probably should clean up even further (not in this PR) the generate_multi_lun_xml() function. you might have noticed that we are doing the main loop 6 times even there is just 1 or 2 physical partitions..
but for the purpose of this PR, I am +1
I also generated all partitions xml file before/after this PR, and they are unchanged (expected), except for the 8275 EVK of course.