• Home
  • Raw
  • Download

Lines Matching +full:use +full:- +full:kernel

4 The `Raspberry Pi 3`_ is an inexpensive single-board computer that contains four
5 Arm Cortex-A53 cores.
7 The following instructions explain how to use this port of the TF-A with the
10 officially supported kernel is a AArch32 kernel. This doesn't mean that this
11 port of TF-A can't boot a AArch64 kernel. The `Linux tree fork`_ maintained by
13 `AArch64 kernel build instructions`_.
16 which is available from both the Non-secure and Secure worlds. This port
18 elements like PSCI to support the Linux kernel.
21 ------
34 - If a file called ``kernel8.img`` is located on the ``boot`` partition of the
36 a `default AArch64 stub`_ at address **0x0** that jumps to the kernel.
38 - If there is also a file called ``armstub8.bin``, it will load it at address
42 This means that we can use the default AArch32 kernel provided in the official
43 `Raspbian`_ distribution by renaming it to ``kernel8.img``, while TF-A and
45 default bootstrap code. When using a AArch64 kernel, it is only needed to make
48 Ideally, we want to load the kernel and have all cores available, which means
49 that we need to make the secondary cores work in the way the kernel expects, as
51 between TF-A and the kernel.
53 To get the most out of a AArch32 kernel, we want to boot it in Hypervisor mode
56 is used for EL2. When using a AArch64 kernel, it should simply start in EL2.
63 when compiling TF-A. This is done automatically by the build system.
68 The file ``kernel8.img`` contains a kernel image that is loaded to the address
69 specified in ``config.txt``. The `Linux kernel tree`_ has information about how
70 a AArch32 Linux kernel image is loaded in ``Documentation/arm/Booting``:
75 kernel should be placed in the first 128MiB of RAM. It is recommended
84 TF-A images (and specially the first 32 MiB, as they are directly used to
85 place the uncompressed AArch32 kernel image. This way, both AArch32 and
96 0x00000000 +-----------------+
98 0x00020000 +-----------------+
100 0x00200000 +-----------------+
104 0x01000000 +-----------------+
106 +-----------------+
110 0x02000000 +-----------------+
111 | Kernel | (Loaded by the VideoCore)
112 +-----------------+
116 0x10000000 +-----------------+
118 0x10100000 +-----------------+
120 0x11000000 +-----------------+
121 | Non-secure DRAM | BL33
122 +-----------------+
126 0x3F000000 +-----------------+
128 0x40000000 +-----------------+
131 so that the kernel doesn't use it. The current port tries to modify the live DTB
135 command line passed to the kernel in ``cmdline.txt``. See the `Setup SD card`_
144 TF-A, there are 880 MiB available for Linux.
149 The boot sequence of TF-A is the usual one except when booting an AArch32
150 kernel. In that case, BL33 is booted in AArch32 Hypervisor mode so that it
151 can jump to the kernel in the same mode and let it take over that privilege
153 TF-A) it could only jump to the kernel in AArch32 in Supervisor mode.
155 The `Linux kernel tree`_ has instructions on how to jump to the Linux kernel
159 This port support a direct boot of the Linux kernel from the firmware (as a BL33
160 image). Alternatively, U-Boot or other bootloaders may be used.
165 This port of the Trusted Firmware-A supports ``PSCI_CPU_ON``,
170 The kernel used by `Raspbian`_ doesn't have support for PSCI, so it is needed to
171 use mailboxes to trap the secondary cores until they are ready to jump to the
172 kernel. This mailbox is located at a different address in the AArch32 default
173 kernel than in the AArch64 kernel.
175 Kernels with PSCI support can use the PSCI calls instead for a cleaner boot.
177 Also, this port of TF-A has another Trusted Mailbox in Shared BL RAM. During
184 from the kernel. When the primary CPU jumps into the kernel, it will send an
186 by the kernel.
189 ------------------
191 To boot a AArch64 kernel, only the AArch64 toolchain is required.
193 To boot a AArch32 kernel, both AArch64 and AArch32 toolchains are required. The
194 AArch32 toolchain is needed for the AArch32 bootstrap needed to load a 32-bit
195 kernel.
199 build folder (e.g. ``build/rpi3/debug/armstub8.bin``). To know how to use this
204 - ``RPI3_BL33_IN_AARCH32``: This port can load a AArch64 or AArch32 BL33 image.
205 By default this option is 0, which means that TF-A will jump to BL33 in EL2
209 - ``PRELOADED_BL33_BASE``: Used to specify the address of a BL33 binary that has
213 ``config.txt``. It doesn't have to contain a kernel, it could have any
216 - ``RPI3_DIRECT_LINUX_BOOT``: Disabled by default. Set to 1 to enable the direct
217 boot of the Linux kernel from the firmware. Option ``RPI3_PRELOADED_DTB_BASE``
218 is mandatory when the direct Linux kernel boot is used. Options
220 unlikely that the kernel image will fit in the space reserved for BL33 images.
222 32-bit kernel. The only thing this option does is to set the arguments in
223 registers x0-x3 or r0-r2 as expected by the kernel.
225 - ``RPI3_PRELOADED_DTB_BASE``: Auxiliary build option needed when using
229 - ``RPI3_RUNTIME_UART``: Indicates whether the UART should be used at runtime
230 or disabled. ``-1`` (default) disables the runtime UART. Any other value
233 - ``RPI3_USE_UEFI_MAP``: Set to 1 to build ATF with the altername memory
240 0x00000000 +-----------------+
242 0x00010000 +-----------------+
244 0x00020000 +-----------------+
246 0x00030000 +-----------------+
250 0x00200000 +-----------------+
252 0x00300000 +-----------------+
254 0x00400000 +-----------------+
257 | Non-secure DRAM | BL33
260 0x01000000 +-----------------+
264 0x3F000000 +-----------------+
267 - ``BL32``: This port can load and run OP-TEE. The OP-TEE image is optional.
268 Please use the code from `here <https://github.com/OP-TEE/optee_os>`__.
269 Build the Trusted Firmware with option ``BL32=tee-header_v2.bin
270 BL32_EXTRA1=tee-pager_v2.bin BL32_EXTRA2=tee-pageable_v2.bin``
274 If OP-TEE is used it may be needed to add the following options to the
275 Linux command line so that the USB driver doesn't use FIQs:
280 - ``TRUSTED_BOARD_BOOT``: This port supports TBB. Set this option to 1 to enable
281 it. In order to use TBB, you might want to set ``GENERATE_COT=1`` to let the
288 - ``ENABLE_STACK_PROTECTOR``: Disabled by default. It uses the hardware RNG of
293 - AArch32 for TF-A itself.
295 - ``EL3_PAYLOAD_BASE``: The reason is that you can already load anything to any
297 TF-A in this case.
302 This is the case for the 32-bit image of Raspbian, for example. 64-bit kernels
306 First, clone and compile the 32-bit version of the `Raspberry Pi 3 TF-A
307 bootstrap`_. Choose the one needed for the architecture of your kernel.
309 Then compile TF-A. For a 32-bit kernel, use the following command line:
313 CROSS_COMPILE=aarch64-linux-gnu- make PLAT=rpi3 \
315 BL33=../rpi3-arm-tf-bootstrap/aarch32/el2-bootstrap.bin
317 For a 64-bit kernel, use this other command line:
321 CROSS_COMPILE=aarch64-linux-gnu- make PLAT=rpi3 \
322 BL33=../rpi3-arm-tf-bootstrap/aarch64/el2-bootstrap.bin
324 However, enabling PSCI support in a 64-bit kernel is really easy. In the
325 repository `Raspberry Pi 3 TF-A bootstrap`_ there is a patch that can be applied
326 to the Linux kernel tree maintained by the Raspberry Pi foundation. It modifes
327 the DTS to tell the kernel to use PSCI. Once this patch is applied, follow the
328 instructions in `AArch64 kernel build instructions`_ to get a working 64-bit
329 kernel image and supporting files.
334 For a 64-bit kernel:
338 CROSS_COMPILE=aarch64-linux-gnu- make PLAT=rpi3 \
343 For a 32-bit kernel:
347 CROSS_COMPILE=aarch64-linux-gnu- make PLAT=rpi3 \
353 AArch64 kernel build instructions
354 ---------------------------------
356 The following instructions show how to install and run a AArch64 kernel by
358 want to use the default 32-bit kernel.
360 Note that this system won't be fully 64-bit because all the tools in the
361 filesystem are 32-bit binaries, but it's a quick way to get it working, and it
362 allows the user to run 64-bit binaries in addition to 32-bit binaries.
369 git clone --depth=1 -b rpi-4.18.y https://github.com/raspberrypi/linux
372 2. Configure and compile the kernel. Adapt the number after ``-j`` so that it is
378 make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcmrpi3_defconfig
379 make -j 6 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
381 3. Copy the kernel image and the device tree to the SD card. Replace the path
388 cp arch/arm64/boot/dts/broadcom/bcm2710-rpi-3-b.dtb /path/to/boot/
389 cp arch/arm64/boot/dts/broadcom/bcm2710-rpi-3-b-plus.dtb /path/to/boot/
391 4. Install the kernel modules. Replace the path by the corresponding path to the
396 make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
400 the existing ``kernel7.img`` (we have already copied a AArch64 kernel).
403 -------------
407 untouched). They have been tested with the image available in 2018-03-13.
412 bootloader into booting the Arm cores in AArch64 mode, like TF-A needs,
413 even though the kernel is not compiled for AArch64.
433 text. In the case of an AArch32 kernel, you should see something like this:
438 NOTICE: BL1: v1.4(release):v1.4-329-g61e94684-dirty
441 NOTICE: BL2: v1.4(release):v1.4-329-g61e94684-dirty
444 NOTICE: BL31: v1.4(release):v1.4-329-g61e94684-dirty
446 [ 0.266484] bcm2835-aux-uart 3f215040.serial: could not get clk: -517
456 .. _Linux kernel tree: https://github.com/torvalds/linux
458 .. _Raspberry Pi 3: https://www.raspberrypi.org/products/raspberry-pi-3-model-b/
459 .. _Raspberry Pi 3 TF-A bootstrap: https://github.com/AntonioND/rpi3-arm-tf-bootstrap