Mario Bălănică | c883ce0 | 2023-12-02 03:08:02 +0200 | [diff] [blame^] | 1 | Raspberry Pi 5 |
| 2 | ============== |
| 3 | |
| 4 | The `Raspberry Pi 5`_ is a single-board computer that contains four |
| 5 | Arm Cortex-A76 cores. |
| 6 | |
| 7 | This port is a minimal BL31 implementation capable of booting 64-bit EL2 |
| 8 | payloads such as Linux and EDK2. |
| 9 | |
| 10 | **IMPORTANT NOTE**: This port isn't secure. All of the memory used is DRAM, |
| 11 | which is available from both the Non-secure and Secure worlds. The SoC does |
| 12 | not seem to feature a secure memory controller of any kind, so portions of |
| 13 | DRAM can't be protected properly from the Non-secure world. |
| 14 | |
| 15 | Build |
| 16 | ------------------ |
| 17 | |
| 18 | To build this platform, run: |
| 19 | |
| 20 | .. code:: shell |
| 21 | |
| 22 | CROSS_COMPILE=aarch64-linux-gnu- make PLAT=rpi5 DEBUG=1 |
| 23 | |
| 24 | The firmware will be generated at ``build/rpi5/debug/bl31.bin``. |
| 25 | |
| 26 | The 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 | |
| 43 | Usage |
| 44 | ------------------ |
| 45 | |
| 46 | Copy 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 |
| 48 | file to ``armstub8-2712.bin``. |
| 49 | |
| 50 | No other config options or files are required by the firmware alone, this will |
| 51 | depend on the payload you intend to run. |
| 52 | |
| 53 | For Linux, you must also place an appropriate DTB and kernel in the boot |
| 54 | partition. This has been validated with a copy of Raspberry Pi OS. |
| 55 | |
| 56 | The 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 |
| 58 | to config.txt. |
| 59 | |
| 60 | Kernel 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 |
| 62 | with ``PRELOADED_BL33_BASE`` or ``RPI3_PRELOADED_DTB_BASE``, setting those config |
| 63 | options may be necessary. |
| 64 | |
| 65 | By default, all boot stages print messages to the dedicated UART debug port. |
| 66 | Configuration is ``115200 8n1``. |
| 67 | |
| 68 | Design |
| 69 | ------------------ |
| 70 | |
| 71 | This port is largely based on the RPi 4 one. |
| 72 | |
| 73 | The boot process is essentially the same, the only notable difference being that |
| 74 | all VPU blobs have been moved into EEPROM (former start4.elf & fixup4.dat). There's |
| 75 | also a custom BL31 TF-A armstub included for PSCI, which can be replaced with this |
| 76 | port. |
| 77 | |
| 78 | .. _Raspberry Pi 5: https://www.raspberrypi.com/products/raspberry-pi-5/ |