imx8m.rst 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. NXP i.MX 8M Series
  2. ==================
  3. The i.MX 8M family of applications processors based on Arm Corte-A53 and Cortex-M4
  4. cores provide high-performance computing, power efficiency, enhanced system
  5. reliability and embedded security needed to drive the growth of fast-growing
  6. edge node computing, streaming multimedia, and machine learning applications.
  7. imx8mq is dropped in TF-A CI build due to the small OCRAM size, but still actively
  8. maintained in NXP official release.
  9. Boot Sequence
  10. -------------
  11. Bootrom --> SPL --> BL31 --> BL33(u-boot) --> Linux kernel
  12. How to build
  13. ------------
  14. Build Procedure
  15. ~~~~~~~~~~~~~~~
  16. - Prepare AARCH64 toolchain.
  17. - Build spl and u-boot firstly, and get binary images: u-boot-spl.bin,
  18. u-boot-nodtb.bin and dtb for the target board.
  19. - Build TF-A
  20. Build bl31:
  21. .. code:: shell
  22. CROSS_COMPILE=aarch64-linux-gnu- make PLAT=<Target_SoC> bl31
  23. Target_SoC should be "imx8mq" for i.MX8MQ SoC.
  24. Target_SoC should be "imx8mm" for i.MX8MM SoC.
  25. Target_SoC should be "imx8mn" for i.MX8MN SoC.
  26. Target_SoC should be "imx8mp" for i.MX8MP SoC.
  27. Deploy TF-A Images
  28. ~~~~~~~~~~~~~~~~~~
  29. TF-A binary(bl31.bin), u-boot-spl.bin u-boot-nodtb.bin and dtb are combined
  30. together to generate a binary file called flash.bin, the imx-mkimage tool is
  31. used to generate flash.bin, and flash.bin needs to be flashed into SD card
  32. with certain offset for BOOT ROM. the u-boot and imx-mkimage will be upstreamed
  33. soon, this doc will be updated once they are ready, and the link will be posted.
  34. TBBR Boot Sequence
  35. ------------------
  36. When setting NEED_BL2=1 on imx8mm. We support an alternative way of
  37. boot sequence to support TBBR.
  38. Bootrom --> SPL --> BL2 --> BL31 --> BL33(u-boot with UEFI) --> grub
  39. This helps us to fulfill the SystemReady EBBR standard.
  40. BL2 will be in the FIT image and SPL will verify it.
  41. All of the BL3x will be put in the FIP image. BL2 will verify them.
  42. In U-boot we turn on the UEFI secure boot features so it can verify
  43. grub. And we use grub to verify linux kernel.
  44. Measured Boot
  45. -------------
  46. When setting MEASURED_BOOT=1 on imx8mm we can let TF-A generate event logs
  47. with a DTB overlay. The overlay will be put at PLAT_IMX8M_DTO_BASE with
  48. maximum size PLAT_IMX8M_DTO_MAX_SIZE. Then in U-boot we can apply the DTB
  49. overlay and let U-boot to parse the event log and update the PCRs.
  50. High Assurance Boot (HABv4)
  51. ---------------------------
  52. All actively maintained platforms have a support for High Assurance
  53. Boot (HABv4), which is implemented via ROM Vector Table (RVT) API to
  54. extend the Root-of-Trust beyond the SPL. Those calls are done via SMC
  55. and are executed in EL3, with results returned back to original caller.
  56. Note on DRAM Memory Mapping
  57. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  58. There is a special case of mapping the DRAM: entire DRAM available on the
  59. platform is mapped into the EL3 with MT_RW attributes.
  60. Mapping the entire DRAM allows the usage of 2MB block mapping in Level-2
  61. Translation Table entries, which use less Page Table Entries (PTEs). If
  62. Level-3 PTE mapping is used instead then additional PTEs would be required,
  63. which leads to the increase of translation table size.
  64. Due to the fact that the size of SRAM is limited on some platforms in the
  65. family it should rather be avoided creating additional Level-3 mapping and
  66. introduce more PTEs, hence the implementation uses Level-2 mapping which
  67. maps entire DRAM space.
  68. The reason for the MT_RW attribute mapping scheme is the fact that the SMC
  69. API to get the status and events is called from NS world passing destination
  70. pointers which are located in DRAM. Mapping DRAM without MT_RW permissions
  71. causes those locations not to be filled, which in turn causing EL1&0 software
  72. not to receive replies.
  73. Therefore, DRAM mapping is done with MT_RW attributes, as it is required for
  74. data exchange between EL3 and EL1&0 software.
  75. Reference Documentation
  76. ~~~~~~~~~~~~~~~~~~~~~~~
  77. Details on HABv4 usage and implementation could be found in following documents:
  78. - AN4581: "i.MX Secure Boot on HABv4 Supported Devices", Rev. 4 - June 2020
  79. - AN12263: "HABv4 RVT Guidelines and Recommendations", Rev. 1 - 06/2020
  80. - "HABv4 API Reference Manual". This document in the part of NXP Code Signing Tool (CST) distribution.