blob: f2e1b9f2ddb391e6451366a758b4221ab9c4f922 [file] [log] [blame]
Mario Bălănicăc883ce02023-12-02 03:08:02 +02001Raspberry Pi 5
2==============
3
4The `Raspberry Pi 5`_ is a single-board computer that contains four
5Arm Cortex-A76 cores.
6
7This port is a minimal BL31 implementation capable of booting 64-bit EL2
8payloads such as Linux and EDK2.
9
10**IMPORTANT NOTE**: This port isn't secure. All of the memory used is DRAM,
11which is available from both the Non-secure and Secure worlds. The SoC does
12not seem to feature a secure memory controller of any kind, so portions of
13DRAM can't be protected properly from the Non-secure world.
14
15Build
16------------------
17
18To build this platform, run:
19
20.. code:: shell
21
22 CROSS_COMPILE=aarch64-linux-gnu- make PLAT=rpi5 DEBUG=1
23
24The firmware will be generated at ``build/rpi5/debug/bl31.bin``.
25
26The following build options are supported:
27
28- ``RPI3_DIRECT_LINUX_BOOT``: Enabled by default. Allows direct boot of the Linux
29 kernel from the firmware.
30
31- ``PRELOADED_BL33_BASE``: Used to specify the fixed address of a BL33 binary
32 that has been preloaded by earlier boot stages (VPU). Useful for bundling
33 BL31 and BL33 in the same ``armstub`` image (e.g. TF-A + EDK2).
34
35- ``RPI3_PRELOADED_DTB_BASE``: This option allows to specify the fixed address of
36 a DTB in memory. Can only be used if ``device_tree_address=`` is present in
37 config.txt.
38
39- ``RPI3_RUNTIME_UART``: Indicates whether TF-A should use the debug UART for
40 runtime messages or not. ``-1`` (default) disables the option, any other value
41 enables it.
42
43Usage
44------------------
45
46Copy the firmware binary to the first FAT32 partition of a supported boot media
47(SD, USB) and append ``armstub=bl31.bin`` to config.txt, or just rename the
48file to ``armstub8-2712.bin``.
49
50No other config options or files are required by the firmware alone, this will
51depend on the payload you intend to run.
52
53For Linux, you must also place an appropriate DTB and kernel in the boot
54partition. This has been validated with a copy of Raspberry Pi OS.
55
56The VPU will preload a BL33 AArch64 image named either ``kernel_2712.img`` or
57``kernel8.img``, which can be overridden by adding a ``kernel=filename`` option
58to config.txt.
59
60Kernel and DTB load addresses are also chosen by the VPU and can be changed with
61``kernel_address=`` and ``device_tree_address=`` in config.txt. If TF-A was built
62with ``PRELOADED_BL33_BASE`` or ``RPI3_PRELOADED_DTB_BASE``, setting those config
63options may be necessary.
64
65By default, all boot stages print messages to the dedicated UART debug port.
66Configuration is ``115200 8n1``.
67
68Design
69------------------
70
71This port is largely based on the RPi 4 one.
72
73The boot process is essentially the same, the only notable difference being that
74all VPU blobs have been moved into EEPROM (former start4.elf & fixup4.dat). There's
75also a custom BL31 TF-A armstub included for PSCI, which can be replaced with this
76port.
77
78.. _Raspberry Pi 5: https://www.raspberrypi.com/products/raspberry-pi-5/