Implementation of secure flash boot on device is a two-step process:
- Generation of the authentication tag – this happens outside the device during
image creation.
- The C2000™ or Arm®, hex utility runs the CMAC algorithm on the flash boot code
image using the input CMACKEY and the CMAC application data structures that
preserve the memory space for the golden CMAC authentication tag. For more
details on the hex utility, see [3] and [4].
- The generated golden CMAC tag
is embedded in the hex file at the location specified in Table 4-1.
- The hex image (now containing the golden CMAC tag) is programmed into the
corresponding sector of the flash.
- The appropriate secure flash
boot mode is chosen as per Table 4-1 and programmed in the CPU1 USER OTP.
- Authentication of the application boot code in flash – this happens inside
the device as part of the Secure Flash Boot execution
- The BOOTDEFx/BOOTPINCONFIG
fields are configured to select the Secure Flash Boot option according to
Table 4-1 and upon a reset, the device boots and execute the CMAC
algorithm on the specified flash sector.
- The tag generated by the CMAC algorithm is compared with the Golden CMAC tag
residing at the preprogrammed location.
- Upon a successful tag match, the boot process branches to the authenticated
flash code and begins execution.
- Upon a tag match failure, different actions are taken on CPU1/CPU2/CM :
- In the case of CPU1,
the device is reset (the code remains in a loop and XRSn is issued
automatically on the Watchdog expiry).
- In the case of CPU2, the secure boot failure flag is set in the
CPU2TOCPU1IPCBOOTSTS register, IPC command is sent to CPU1 with
secure flash CMAC error code, and the CPU2 boot code waits in a loop
for CPU1 to take necessary action. A copy of the
CPU2TOCPU1IPCBOOTSTS register is also captured in the 0x0000 0002
address location of CPU2.
- In the case of CM, the secure boot failure flag is set in the
CMTOCPU1IPCBOOTSTS register, IPC command is sent to CPU1 with secure
flash CMAC error code and the CM boot code waits in a loop for CPU1
to take necessary action. A copy of the CMTOCPU1IPCBOOTSTS register
is also captured in the 0x2000 0000 address location of CM.
Note: The CMAC algorithm, while calculating the authentication tag on the image and also
while authenticating the image, treats the memory addresses containing the golden tag as
all ones.