README.ti-secure 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. README on how boot images are created for secure TI devices
  2. CONFIG_TI_SECURE_DEVICE:
  3. Secure TI devices require a boot image that is authenticated by ROM
  4. code to function. Without this, even JTAG remains locked and the
  5. device is essentially useless. In order to create a valid boot image for
  6. a secure device from TI, the initial public software image must be signed
  7. and combined with various headers, certificates, and other binary images.
  8. Information on the details on the complete boot image format can be obtained
  9. from Texas Instruments. The tools used to generate boot images for secure
  10. devices are part of a secure development package (SECDEV) that can be
  11. downloaded from:
  12. http://www.ti.com/mysecuresoftware (login required)
  13. The secure development package is access controlled due to NDA and export
  14. control restrictions. Access must be requested and granted by TI before the
  15. package is viewable and downloadable. Contact TI, either online or by way
  16. of a local TI representative, to request access.
  17. Booting of U-Boot SPL
  18. =====================
  19. When CONFIG_TI_SECURE_DEVICE is set, the U-Boot SPL build process
  20. requires the presence and use of these tools in order to create a
  21. viable boot image. The build process will look for the environment
  22. variable TI_SECURE_DEV_PKG, which should be the path of the installed
  23. SECDEV package. If the TI_SECURE_DEV_PKG variable is not defined or
  24. if it is defined but doesn't point to a valid SECDEV package, a
  25. warning is issued during the build to indicate that a final secure
  26. bootable image was not created.
  27. Within the SECDEV package exists an image creation script:
  28. ${TI_SECURE_DEV_PKG}/scripts/create-boot-image.sh
  29. This is called as part of the SPL/u-boot build process. As the secure
  30. boot image formats and requirements differ between secure SOC from TI,
  31. the purpose of this script is to abstract these details as much as
  32. possible.
  33. The script is basically the only required interface to the TI SECDEV
  34. package for creating a bootable SPL image for secure TI devices.
  35. Invoking the script for AM43xx Secure Devices
  36. =============================================
  37. create-boot-image.sh \
  38. <IMAGE_FLAG> <INPUT_FILE> <OUTPUT_FILE> <SPL_LOAD_ADDR>
  39. <IMAGE_FLAG> is a value that specifies the type of the image to
  40. generate OR the action the image generation tool will take. Valid
  41. values are:
  42. SPI_X-LOADER - Generates an image for SPI flash (byte
  43. swapped)
  44. XIP_X-LOADER - Generates a single stage u-boot for
  45. NOR/QSPI XiP
  46. ISSW - Generates an image for all other boot modes
  47. <INPUT_FILE> is the full path and filename of the public world boot
  48. loaderbinary file (depending on the boot media, this is usually
  49. either u-boot-spl.bin or u-boot.bin).
  50. <OUTPUT_FILE> is the full path and filename of the final secure
  51. image. The output binary images should be used in place of the standard
  52. non-secure binary images (see the platform-specific user's guides and
  53. releases notes for how the non-secure images are typically used)
  54. u-boot-spl_HS_SPI_X-LOADER - byte swapped boot image for SPI flash
  55. u-boot_HS_XIP_X-LOADER - boot image for NOR or QSPI flash
  56. u-boot-spl_HS_ISSW - boot image for all other boot media
  57. <SPL_LOAD_ADDR> is the address at which SOC ROM should load the
  58. <INPUT_FILE>
  59. Invoking the script for DRA7xx/AM57xx Secure Devices
  60. ====================================================
  61. create-boot-image.sh <IMAGE_TYPE> <INPUT_FILE> <OUTPUT_FILE>
  62. <IMAGE_TYPE> is a value that specifies the type of the image to
  63. generate OR the action the image generation tool will take. Valid
  64. values are:
  65. X-LOADER - Generates an image for NOR or QSPI boot modes
  66. MLO - Generates an image for SD/MMC/eMMC boot modes
  67. ULO - Generates an image for USB/UART peripheral boot modes
  68. Note: ULO is not yet used by the u-boot build process
  69. <INPUT_FILE> is the full path and filename of the public world boot
  70. loader binary file (for this platform, this is always u-boot-spl.bin).
  71. <OUTPUT_FILE> is the full path and filename of the final secure image.
  72. The output binary images should be used in place of the standard
  73. non-secure binary images (see the platform-specific user's guides
  74. and releases notes for how the non-secure images are typically used)
  75. u-boot-spl_HS_MLO - boot image for SD/MMC/eMMC. This image is
  76. copied to a file named MLO, which is the name that
  77. the device ROM bootloader requires for loading from
  78. the FAT partition of an SD card (same as on
  79. non-secure devices)
  80. u-boot-spl_HS_X-LOADER - boot image for all other flash memories
  81. including QSPI and NOR flash
  82. Booting of Primary U-Boot (u-boot.img)
  83. ======================================
  84. The SPL image is responsible for loading the next stage boot loader,
  85. which is the main u-boot image. For secure TI devices, the SPL will
  86. be authenticated, as described above, as part of the particular
  87. device's ROM boot process. In order to continue the secure boot
  88. process, the authenticated SPL must authenticate the main u-boot
  89. image that it loads.
  90. The configurations for secure TI platforms are written to make the boot
  91. process use the FIT image format for the u-boot.img (CONFIG_SPL_FRAMEWORK
  92. and CONFIG_SPL_LOAD_FIT). With these configurations the binary
  93. components that the SPL loads include a specific DTB image and u-boot
  94. image. These DTB image may be one of many available to the boot
  95. process. In order to secure these components so that they can be
  96. authenticated by the SPL as they are loaded from the FIT image, the
  97. build procedure for secure TI devices will secure these images before
  98. they are integrated into the FIT image. When those images are extracted
  99. from the FIT image at boot time, they are post-processed to verify that
  100. they are still secure. The outlined security-related SPL post-processing
  101. is enabled through the CONFIG_SPL_FIT_IMAGE_POST_PROCESS option which
  102. must be enabled for the secure boot scheme to work. In order to allow
  103. verifying proper operation of the secure boot chain in case of successful
  104. authentication messages like "Authentication passed: CERT_U-BOOT-NOD" are
  105. output by the SPL to the console for each blob that got extracted from the
  106. FIT image. Note that the last part of this log message is the (truncated)
  107. name of the signing certificate embedded into the blob that got processed.
  108. The exact details of the how the images are secured is handled by the
  109. SECDEV package. Within the SECDEV package exists a script to process
  110. an input binary image:
  111. ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh
  112. This is called as part of the u-boot build process. As the secure
  113. image formats and requirements can differ between the various secure
  114. SOCs from TI, this script in the SECDEV package abstracts these
  115. details. This script is essentially the only required interface to the
  116. TI SECDEV package for creating a u-boot.img image for secure TI
  117. devices.
  118. The SPL/u-boot code contains calls to dedicated secure ROM functions
  119. to perform the validation on the secured images. The details of the
  120. interface to those functions is shown in the code. The summary
  121. is that they are accessed by invoking an ARM secure monitor call to
  122. the device's secure ROM (fixed read-only-memory that is secure and
  123. only accessible when the ARM core is operating in the secure mode).
  124. Invoking the secure-binary-image script for Secure Devices
  125. ==========================================================
  126. secure-binary-image.sh <INPUT_FILE> <OUTPUT_FILE>
  127. <INPUT_FILE> is the full path and filename of the input binary image
  128. <OUTPUT_FILE> is the full path and filename of the output secure image.