The basic idea of this design is to
offline burn the required files to the Nor flash at specified offsets. These files include
three bootloaders.
- The first bootloader is a Keywriter
located at address 0x0, which is used to burn the key.
- The second bootloader is a Flash Writer
located at address 0x400000. This flash writer is single stage SBL/SPL based with the only
job of moving the SBL from known location X to primary offset 0x0 and optionally redundant
offset 0x400000.
- The third bootloader contains the boot
loader from the customer and application (pre-signed and encrypted with the key from the
customer). The address can be flexibly configured based on the selected Nor flash
capacity, and the requirement is that the addresses do not overlap with the first two
bootloaders.
During the first power-up, the program
executes from the keywriter at address 0x0, converting the chip from HS-FS to HS-SE. During
the second power-up, the BootROM fails to verify the keywriter at address 0x0 and jumps to
address 0x400000 to execute the flash writer. This program burns the service startup program
of the customer and application (pre-signed and encrypted with the key from the customer) to
address 0x0 in the flash memory, overwriting the previous keywriter file. At this time,
after powering on again, the Boot ROM normally reads the business startup program and
application from address 0x0, completes the key signature verification and decryption, and
then completes the boot and starts the SOC.
Requirements
Boot mode => Primary: OSPI, Backup:
(Don't care)
Flash is offline flashed with three parts of
files on related offset.
Procedure
- On First POR: Device state: HS-FS. ROM
boots OTP Keywriter from the 0x0 Nor flash offset. Program the keys according to the
Keywriter guide. Convert HS-FS to HS-SE.
- On Second POR: Device state: HS-SE. ROM
boots Flash Writer from the 0x400000 Nor flash offset. Flash the SDK images
(SBL/Applications) into 0x0, 0x8000.
- On Third POR: Device state: HS-SE. ROM
boot customer bootloader and application from 0x0 offset and bring up board.