index.rst 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. Arm Juno Development Platform
  2. =============================
  3. Platform-specific build options
  4. -------------------------------
  5. - ``JUNO_TZMP1`` : Boolean option to configure Juno to be used for TrustZone
  6. Media Protection (TZ-MP1). Default value of this flag is 0.
  7. Running software on Juno
  8. ------------------------
  9. This version of TF-A has been tested on variants r0, r1 and r2 of Juno.
  10. To run TF-A on Juno, you need to first prepare an SD card with Juno software
  11. stack that includes TF-A. This version of TF-A is tested with pre-built
  12. `Linaro release software stack`_ version 20.01. You can alternatively
  13. build the software stack yourself by following the
  14. `Juno platform software user guide`_. Once you prepare the software stack
  15. on an SD card, you can replace the ``bl1.bin`` and ``fip.bin``
  16. binaries in the ``SOFTWARE/`` directory with custom built TF-A binaries.
  17. Preparing TF-A images
  18. ---------------------
  19. This section provides Juno and FVP specific instructions to build Trusted
  20. Firmware, obtain the additional required firmware, and pack it all together in
  21. a single FIP binary. It assumes that a Linaro release software stack has been
  22. installed.
  23. .. note::
  24. Pre-built binaries for AArch32 are available from Linaro Release 16.12
  25. onwards. Before that release, pre-built binaries are only available for
  26. AArch64.
  27. .. warning::
  28. Follow the full instructions for one platform before switching to a
  29. different one. Mixing instructions for different platforms may result in
  30. corrupted binaries.
  31. .. warning::
  32. The uboot image downloaded by the Linaro workspace script does not always
  33. match the uboot image packaged as BL33 in the corresponding fip file. It is
  34. recommended to use the version that is packaged in the fip file using the
  35. instructions below.
  36. .. note::
  37. For the FVP, the kernel FDT is packaged in FIP during build and loaded
  38. by the firmware at runtime.
  39. #. Clean the working directory
  40. .. code:: shell
  41. make realclean
  42. #. Obtain SCP binaries (Juno)
  43. This version of TF-A is tested with SCP version 2.12.0 on Juno. You can
  44. download pre-built SCP binaries (``scp_bl1.bin`` and ``scp_bl2.bin``)
  45. from `TF-A downloads page`_. Alternatively, you can `build
  46. the binaries from source`_.
  47. #. Obtain BL33 (all platforms)
  48. Use the fiptool to extract the BL33 image from the FIP
  49. package included in the Linaro release:
  50. .. code:: shell
  51. # Build the fiptool
  52. make [DEBUG=1] [V=1] fiptool
  53. # Unpack firmware images from Linaro FIP
  54. ./tools/fiptool/fiptool unpack <path-to-linaro-release>/[SOFTWARE]/fip.bin
  55. The unpack operation will result in a set of binary images extracted to the
  56. current working directory. BL33 corresponds to ``nt-fw.bin``.
  57. .. note::
  58. The fiptool will complain if the images to be unpacked already
  59. exist in the current directory. If that is the case, either delete those
  60. files or use the ``--force`` option to overwrite.
  61. .. note::
  62. For AArch32, the instructions below assume that nt-fw.bin is a
  63. normal world boot loader that supports AArch32.
  64. #. Build TF-A images and create a new FIP for FVP
  65. .. code:: shell
  66. # AArch64
  67. make PLAT=fvp BL33=nt-fw.bin all fip
  68. # AArch32
  69. make PLAT=fvp ARCH=aarch32 AARCH32_SP=sp_min BL33=nt-fw.bin all fip
  70. #. Build TF-A images and create a new FIP for Juno
  71. For AArch64:
  72. Building for AArch64 on Juno simply requires the addition of ``SCP_BL2``
  73. as a build parameter.
  74. .. code:: shell
  75. make PLAT=juno BL33=nt-fw.bin SCP_BL2=scp_bl2.bin all fip
  76. For AArch32:
  77. Hardware restrictions on Juno prevent cold reset into AArch32 execution mode,
  78. therefore BL1 and BL2 must be compiled for AArch64, and BL32 is compiled
  79. separately for AArch32.
  80. - Before building BL32, the environment variable ``CROSS_COMPILE`` must point
  81. to the AArch32 Linaro cross compiler.
  82. .. code:: shell
  83. export CROSS_COMPILE=<path-to-aarch32-gcc>/bin/arm-linux-gnueabihf-
  84. - Build BL32 in AArch32.
  85. .. code:: shell
  86. make ARCH=aarch32 PLAT=juno AARCH32_SP=sp_min \
  87. RESET_TO_SP_MIN=1 JUNO_AARCH32_EL3_RUNTIME=1 bl32
  88. - Save ``bl32.bin`` to a temporary location and clean the build products.
  89. ::
  90. cp <path-to-build>/bl32.bin <path-to-temporary>
  91. make realclean
  92. - Before building BL1 and BL2, the environment variable ``CROSS_COMPILE``
  93. must point to the AArch64 Linaro cross compiler.
  94. .. code:: shell
  95. export CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf-
  96. - The following parameters should be used to build BL1 and BL2 in AArch64
  97. and point to the BL32 file.
  98. .. code:: shell
  99. make ARCH=aarch64 PLAT=juno JUNO_AARCH32_EL3_RUNTIME=1 \
  100. BL33=nt-fw.bin SCP_BL2=scp_bl2.bin \
  101. BL32=<path-to-temporary>/bl32.bin all fip
  102. The resulting BL1 and FIP images may be found in:
  103. ::
  104. # Juno
  105. ./build/juno/release/bl1.bin
  106. ./build/juno/release/fip.bin
  107. # FVP
  108. ./build/fvp/release/bl1.bin
  109. ./build/fvp/release/fip.bin
  110. After building TF-A, the files ``bl1.bin``, ``fip.bin`` and ``scp_bl1.bin``
  111. need to be copied to the ``SOFTWARE/`` directory on the Juno SD card.
  112. Booting Firmware Update images
  113. ------------------------------
  114. The new images must be programmed in flash memory by adding
  115. an entry in the ``SITE1/HBI0262x/images.txt`` configuration file
  116. on the Juno SD card (where ``x`` depends on the revision of the Juno board).
  117. Refer to the `Juno Getting Started Guide`_, section 2.3 "Flash memory
  118. programming" for more information. User should ensure these do not
  119. overlap with any other entries in the file.
  120. ::
  121. NOR10UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
  122. NOR10ADDRESS: 0x00400000 ;Image Flash Address [ns_bl2u_base_address]
  123. NOR10FILE: \SOFTWARE\fwu_fip.bin ;Image File Name
  124. NOR10LOAD: 00000000 ;Image Load Address
  125. NOR10ENTRY: 00000000 ;Image Entry Point
  126. NOR11UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
  127. NOR11ADDRESS: 0x03EB8000 ;Image Flash Address [ns_bl1u_base_address]
  128. NOR11FILE: \SOFTWARE\ns_bl1u.bin ;Image File Name
  129. NOR11LOAD: 00000000 ;Image Load Address
  130. The address ns_bl1u_base_address is the value of NS_BL1U_BASE - 0x8000000.
  131. In the same way, the address ns_bl2u_base_address is the value of
  132. NS_BL2U_BASE - 0x8000000.
  133. .. _plat_juno_booting_el3_payload:
  134. Booting an EL3 payload
  135. ----------------------
  136. If the EL3 payload is able to execute in place, it may be programmed in flash
  137. memory by adding an entry in the ``SITE1/HBI0262x/images.txt`` configuration file
  138. on the Juno SD card (where ``x`` depends on the revision of the Juno board).
  139. Refer to the `Juno Getting Started Guide`_, section 2.3 "Flash memory
  140. programming" for more information.
  141. Alternatively, the same DS-5 command mentioned in the FVP section above can
  142. be used to load the EL3 payload's ELF file over JTAG on Juno.
  143. For more information on EL3 payloads in general, see
  144. :ref:`alt_boot_flows_el3_payload`.
  145. Booting a preloaded kernel image
  146. --------------------------------
  147. The Trusted Firmware must be compiled in a similar way as for FVP explained
  148. above. The process to load binaries to memory is the one explained in
  149. `plat_juno_booting_el3_payload`_.
  150. Testing System Suspend
  151. ----------------------
  152. The SYSTEM SUSPEND is a PSCI API which can be used to implement system suspend
  153. to RAM. For more details refer to section 5.16 of `PSCI`_. To test system suspend
  154. on Juno, at the linux shell prompt, issue the following command:
  155. .. code:: shell
  156. echo +10 > /sys/class/rtc/rtc0/wakealarm
  157. echo -n mem > /sys/power/state
  158. The Juno board should suspend to RAM and then wakeup after 10 seconds due to
  159. wakeup interrupt from RTC.
  160. Additional Resources
  161. --------------------
  162. Please visit the `Arm Platforms Portal`_ to get support and obtain any other Juno
  163. software information. Please also refer to the `Juno Getting Started Guide`_ to
  164. get more detailed information about the Juno Arm development platform and how to
  165. configure it.
  166. --------------
  167. *Copyright (c) 2019-2023, Arm Limited. All rights reserved.*
  168. .. _Linaro release software stack: http://releases.linaro.org/members/arm/platforms/
  169. .. _Juno platform software user guide: https://git.linaro.org/landing-teams/working/arm/arm-reference-platforms.git/about/docs/juno/user-guide.rst
  170. .. _TF-A downloads page: https://downloads.trustedfirmware.org/tf-a/css_scp_2.12.0/juno/
  171. .. _build the binaries from source: https://github.com/ARM-software/SCP-firmware/blob/master/user_guide.md#scp-firmware-user-guide
  172. .. _Arm Platforms Portal: https://community.arm.com/dev-platforms/
  173. .. _Juno Getting Started Guide: https://developer.arm.com/documentation/den0928/f/?lang=en
  174. .. _PSCI: https://developer.arm.com/documentation/den0022/latest/