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