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