Part Number: AM263P4
Other Parts Discussed in Thread: SYSCONFIG, AM2634

I have roughly described the complete secure boot flow of the AM263P4 using the flowchart above:
-
Power on
-
R5 RBL and HSM RBL run
-
R5 SBL loads the SBL from external flash into L2 (0x70002000) via boot mode
-
The HSM RBL uses the SMPK and SMEK injected by Keywriter to verify the signature and decrypt the SBL loaded into L2. If the verification passes, it first copies the SBL's IVT and Initialization Code to TCMA (0x20000), then eclipses (masks) the R5 RBL at ROM address 0x0, and remaps the SBL's IVT and Initialization Code to address 0x0 (this address then effectively becomes a RAM address). The remaining SBL program continues to run at 0x70002000.

-
After the SBL runs successfully, the SBL reads the HSM firmware from a specified location in flash and loads it into a designated location in L2 RAM (configurable in SysConfig). The SBL calls the
Hsmclient_loadHSMRtFirmwarefunction to load the HSM firmware. At this point, the HSM RBL uses the SMPK and SMEK injected by Keywriter to verify and decrypt the HSM firmware loaded into L2. If verification passes, the HSM RBL moves the HSM program to the HSM core's RAM region (memory view / virtual address 0x20000-0x60000). It then eclipses (masks) the HSM RBL in ROM (0x0-0x40000) and remaps the HSM program to the virtual address region 0x0-0x40000 (which now effectively becomes RAM), and then runs it, ensuring that the HSM program starts executing from RAM address 0x0.
Question :
-
Is the above flow correct? If there are any issues, please specify them .In this flow, are the SBL and HSM firmware first loaded into L2 RAM, then verified, and finally remapped to the specified locations? Or are they first loaded into L2 RAM, then remapped to the specified locations, and then verified?
-
Is the above flow the same regardless of whether the SBL and HSM are separated or not?

