ARM Trusted Firmware for RPi3

July 8, 2018 ยท View on GitHub

Last updated May 9th, 2018.

This is an implementation of ATF for the RPi3 platform, based off of https://github.com/ardbiesheuvel/arm-trusted-firmware/tree/rpi3.

No attempt has been made to keep it in sync with https://github.com/ARM-software/arm-trusted-firmware. Sorry.

Purpose

This tree is meant to be used with a preloaded BL33 payload, as part of a UEFI or U-Boot implementation for the Raspberry Pi 3.

This is a 64-bit implementation.

Building

export CROSS_COMPILE=aarch64-linux-gnu-
make -C raspberry-pi3-atf PLAT=rpi3 PRELOADED_BL33_BASE=0x30000 SUPPORT_VFP=1 DEBUG=1 V=1 fip all

This is not directly useful by itself, since you would need to combine the BL1 and FIP with a BL33 payload.

Features

  • PSCI_CPU_ON_AARCH64
  • PSCI_SYSTEM_RESET
  • PSCI_SYSTEM_OFF (as PSCI_SYSTEM_RESET)
  • Compatible with Windows on Arm ;-).

Implementation Details

ATF of course runs in secure mode, but there is no secure memory, and there are no secure peripherals. Caveat Emptor!

This ATF implementation expects the following memory layout:

Address StartAddress EndWhat
0x000000000x00007FFFBL1
0x000080000x0000FFFFDTB
0x000100000x0002FFFFFIP containing BL2 + BL31
0x000300000x001FFFFFBL33 Non-Secure firmware
0x002000000x0024FFFF"Secure SRAM"
0x002500000x003FFFFF"Secure DRAM"
0x00400000...Non-Secure DRAM

This means that a minimally-viable image will concatenate BL1, FIP and the BL33 payload, to be loaded via a custom config.txt:

arm_control=0x200
enable_uart=1
armstub=atf_and_bl33.bin
disable_commandline_tags=2
device_tree_address=0x8000
device_tree_end=0x10000

[0x8000:0x10000) is where you can load the DTB if you want it, this ATF implementation does not use the DTB in any way.

Contact

Andrey Warkentin andrey.warkentin@gmail.com

Btw, feel free to upstream, if so inclined.