RaspberryPiPkg
DEPRECATED - DO NOT USE | Go here instead ->
Install / Use
/learn @andreiw/RaspberryPiPkgREADME
DEPRECATED - DO NOT USE
This repo isn't just resting - it's dead. Why? Because it's been upstreamed to the master TianoCore UEFI branch - https://github.com/tianocore/edk2-platforms/tree/master/Platform/RaspberryPi/RPi3
This is going to remain up only for historical purpose.
Also see https://rpi4-uefi.dev
64-bit Tiano Core UEFI for the Raspberry Pi 3
Last updated Feb 18th, 2019.
This is a port of 64-bit Tiano Core UEFI firmware for the Pi 3/3B+ platforms, based on Ard Bisheuvel's 64-bit and Microsoft's 32-bit implementations.
Initially, this was supposed to be an easy walk in the park, where the Microsoft drivers somewhat slid into Ard's UEFI implementation, and I would call it a day. Instead, it turned out to be a severely more frustrating experience :-).
Purpose
This is meant as a generally useful 64-bit ATF + UEFI implementation for the Pi 3/3B+, good enough for most kinds of UEFI development and good enough for running real operating systems. It has been validated to install and boot Linux (SUSE, Ubuntu), NetBSD and FreeBSD, and there is experimental (64-bit) Windows on Arm support as well. It wound up being the early development platform for NetBSD's 64-bit Arm UEFI bootloader, and was used to demonstrate VMware ESXi-Arm on the Pi as well.
It's mostly EBBR compliant, favoring user experience over pedantic compliance where those two are in conflict. With enough HypDxe grease it may even, some day, pass for an SBSA + SBBR system ;-).
Latest Status
- 2019 Feb 18th: DisplayDxe fixes, updated DTB
- 2019 Jan 16th: boot options fixes, _CCA, supported firmware for Windows MCCI driver.
- 2019 Jan 14th: boot option cleanup, EBC, release, SPCR fix (Windows EMS support)
- 2018 Nov 17th: Display, USB, GraphicsConsole, VirtualRealTimeClockLib improvements, edk2 rebase.
- 2018 Oct 1st: Rhxp and PEP devices in ACPI, (untested) JTAG support via debug configuration menu.
- 2018 Sep 29th: MsftFunctionConfig ACPI descriptors.
- 2018 Sep 28th: SMBIOS nits, clear screen before boot, SPCR InterruptType, DWC_OTG range and extra _CID.
- 2018 Sep 18th: PXE boot order fix, serial prompting, improved variable dumping
- 2018 Sep 14th: fix FADT minor version (PSCI detection) and SMBIOS regression (seen in Windows).
- 2018 Jul 8th: switch to private MmcDxe, improve multiblock write robustness, power-off/halt in ATF
- 2018 Jun 26th: SdHostDxe error handling, early eMMC support for both SdHost and Arasan
- 2018 Jun 22nd: Arasan and SdHost multiblock, Arasan/SdHost/MMC tweaks/stability, uSD default routing is SdHost
- 2018 Jun 17th: SdHostDxe boot order fix, MMC tweaks menu, GCC5_DEBUG fix.
- 2018 Jun 16th: SdHostDxe support, HypDxe on by default.
- 2018 Jun 13th: Fix GCC5 compilation error for HypDxe.
- 2018 Jun 12th: Fix SMBIOS Type 0 BIOS date.
- 2018 Jun 7th: HypDxe can redirect WoA kernel messages to UART.
- 2018 May 27th: allow 640 x 480 and lower resolutions.
- 2018 May 24th: fix WoA regression reported with build 17134.
- 2018 May 22nd: can boot 64-bit Windows on Arm without WinDbg (and without hacky ATF).
- 2018 May 19th: Ax88772b USB NIC (not onboard SMSC95xx) PXE boot.
- 2018 May 18th: allow changing Arm frequency settings (do nothing, force 600MHz or max)
- 2018 May 14th: rebase to current edk2 upstream (still under verification, no bin release).
- 2018 May 13th: set maximum Arm frequency, better info/smbios, DisplayDxe fix.
- 2018 May 12th: updated May 9th build VC firmware to support RPi3.
- 2018 May 9th: pseudo-NVRAM, persisted RTC, Arasan controller ACPI description, USB fix.
- 2018 Apr 24th: SMP support in WoA.
- 2018 Apr 22nd: switched to MS-IoT ACPI, can boot 64-bit WoA WinPE with WinDbg.
- 2018 Apr 21st: improved booting experience, removed BGRT, WoA docs.
- 2018 Apr 5th: improved ACPI (FADT, GTDT, SPCR, BGRT, MADT), UEFI implementation comparison.
- 2018 Mar 31st: updated supported keyboard info.
- 2018 Mar 1st: updated ATF to fix Ubuntu poweroff crash and add directions.
- 2018 Feb 27th: updated ATF to fix overheat on SYSTEM_OFF.
- 2018 Feb 26th: improved USB driver and HS support.
- 2018 Feb 22nd: improved USB support for keyboards.
- 2018 Jan 13th: updated build instructions, information on keyboards supported, added prebuilts.
- 2017 Dec 26th: USB hotplug and keyboard support.
- 2017 Dec 15th: Initial release.
Features
Here is a comparison table between different available EFI firmware implementations for the RPi3.
| Feature | This Implementation | Ard's | Microsoft's | U-Boot | Minoca | | ------- | ------------------- | ------ | ----------- | ------ | ------ | | Bitness | 64-bit | 64-bit | 32-bit | Either | 32-bit | | PSCI CPU_ON | Yes | No | No | No | No | | PSCI SYSTEM_RESET | Yes | Yes | No | No | No | | PSCI SYSTEM_OFF | Yes | No | No | No | No | | DT | Yes | Yes | No | Yes | No | | Pass-through DT | Yes | No | N/A | Yes | No | | NVRAM | Limited | No | No | No | No | | RTC | Limited | No | No | No | No | | ACPI | Yes | No | Yes | No | Yes | | Serial | Yes | Yes | Yes | Yes | Yes | | HDMI GOP | Yes | No | No | Yes | No | | SMBIOS | Yes | No | Yes | No | Yes | | uSD | Yes | No | Yes | Yes | Yes | | uSD SdHost and Arasan | Yes | No | Yes | ? | No | | USB1 | Limited | No | No | Yes | No | | USB2/3 | Yes | No | No | Yes | No | No | | USB Mass Storage | Yes | No | No | Yes | No | | USB Keyboard | Yes | No | No | Yes | No | | USB Ax88772b PXE/Network | Yes | No | No | Yes | No | | USB SMSC95xx PXE/Network | No | No | No | Yes | No | | Tiano | Yes | Yes | Yes | No | No | | AArch32 Windows IoT | No | No | Yes | No | No | | AArch64 Windows on Arm | Limited | No | No | No | No | | AArch64 Linux | Yes | Limited | No | Yes | No | | AArch32 Linux | No | No | No | Yes | No | | AArch64 FreeBSD | Yes | No | No | Yes | No | | AArch32 Minoca | No | No | No | No | Yes |
Building
Note: If you want to use the pre-built UEFI images, you can skip this section.
- Clone
https://github.com/tianocore/edk2.git
This is the last known good edk2 commit:
commit 66127011a544b90e800eb3619e84c2f94a354903
Author: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Date: Wed Nov 14 11:27:24 2018 -0800
ArmPkg/ArmGicDxe ARM: fix encoding for GICv3 interrupt acknowledge
You should rewind your edk2 tree to this commit. Here be dragons!
-
Clone this repo.
-
Apply the various patches against the edk2 tree. Yes, it sucks to have to do this, but this is a clearer way forward than forking every single Tiano driver that has a bug in it, or worse - carrying around an entire private fork of edk2. You're welcome to upstream these patches!
To avoid issues, apply using --ignore-whitespace. E.g.:
$ git am --ignore-whitespace ../RaspberryPiPkg/edk2Patches/*.patch
- Use one of the provided templates for your build script. If you use a different GCC version, change accordingly,
and adjust the compiler prefix to match your system - i.e. set
GCC49_AARCH64_PREFIXif you're passing-t GCC49tobuild.
If you want to build your own ATF, instead of using the checked-in binaries, follow
the additional directions under Binary/atf/readme.md.
Using
Basic
Please USE AN ADEQUATE POWER SUPPLY. Many people have had problems with poor performance (CPU underclocking itself to 600MHz) and other errors and issues (e.g. with USB) caused by an inadequate power supply. Recommended: 5V 3A. Many cheapo 2.5A power bricks can't really provide 2.5A. If you see a lightning bolt in the top right corner of the screen you have inadequate power.
UEFI boot media can be a uSD card or USB mass storage, if you've enabled USB booting previously in the OTP (i.e. via program_usb_boot_mode=1).
UEFI boot media must be MBR partitioned and FAT32 formatted.
As a starting point, take one of the latest RELEASE prebuilt image directories and copy contents to empty boot media. If you've built your own UEFI from source (e.g. $WORKSPACE/Build/RaspberryPiPkg-AARCH64/RELEASE_GCC5/FV/RPI_EFI.fd) you can simply now copy over and overwrite RPI_EFI.fd.
Note: You may not have a kernel.img (or kernelX.img, where X is a digit) in the root catalogue of the boot media. It will not boot.
The most basic config.txt contents are:
arm_control=0x200
enable_uart=1
armstub=RPI_EFI.fd
disable_commandline_tags=1
This will boot UEFI and expose an RPi3 device tree that is compatible with openSUSE Leap 42.2/42.3, although it was found to work with Ubuntu 18.04 (Bionic Beaver) as well.
Of course use the debug variant (e.g. $WORKSPACE/Build/RaspberryPiPkg-AARCH64/DEBUG_GCC5/FV/RPI_EFI.fd) if necessary, but it will boot a lot slower due to the verbose spew.
HDMI and the mini-UART serial port can be used for output devices. Output is mirrored. USB keyboards and the mini-UART serial port can be used as input.
USB keyboard support has been validated with a few keyboards:
- Logitech K750 (wireless)
- Dell SK-8125 keyboard (with built-in hub)
- Microsoft Natural Ergonomic Keyboard 4000
- An Apple keyboard (chicklet, USB2 hub)
The first time you boot, you will be looking at the UEFI Shell. 'exit' and modify the boot order. The boot order will persist across reboots. The boot manager will only list devices available to boot from (older versions had USB Port 0, USB Port 1, etc).
ESC enters setup. F1 always boots the UEFI Shell.

Note: you cannot boot 32-bit OSes like Raspbian with this firmware. Aw, shucks, right?
Custom Device Tree
Most likely, if you boot an OS other than openSUSE Leap 42.3, you will need to pass your own distro- and kernel- specific device tree. This will need to be extracted f
