2015-08-04 18:34:05 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2015 Google, Inc
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
|
|
|
#
|
|
|
|
|
2018-01-30 19:03:02 +00:00
|
|
|
EFI on U-Boot
|
2015-08-04 18:34:05 +00:00
|
|
|
=============
|
2018-01-30 19:03:02 +00:00
|
|
|
This document provides information about the implementation of the UEFI API [1]
|
|
|
|
in U-Boot.
|
2015-08-04 18:34:05 +00:00
|
|
|
|
|
|
|
|
2018-01-30 19:03:02 +00:00
|
|
|
=========== Table of Contents ===========
|
2015-08-04 18:34:05 +00:00
|
|
|
|
2018-01-30 19:03:02 +00:00
|
|
|
Motivation
|
|
|
|
How do I get it?
|
2015-08-04 18:34:05 +00:00
|
|
|
Status
|
|
|
|
Future work
|
|
|
|
|
|
|
|
|
2018-01-30 19:03:02 +00:00
|
|
|
Motivation
|
|
|
|
----------
|
2016-03-04 00:10:09 +00:00
|
|
|
|
2018-01-30 19:03:02 +00:00
|
|
|
With this API support in place, you can run any UEFI payload (such as the Linux
|
2016-03-04 00:10:09 +00:00
|
|
|
kernel, grub2 or gummiboot) on U-Boot. This dramatically simplifies boot loader
|
|
|
|
configuration, as U-Boot based systems now look and feel (almost) the same way
|
|
|
|
as TianoCore based systems.
|
|
|
|
|
|
|
|
How do I get it?
|
|
|
|
----------------
|
|
|
|
|
|
|
|
EFI support for 32bit ARM and AArch64 is already included in U-Boot. All you
|
|
|
|
need to do is enable
|
|
|
|
|
|
|
|
CONFIG_CMD_BOOTEFI=y
|
|
|
|
CONFIG_EFI_LOADER=y
|
|
|
|
|
|
|
|
in your .config file and you will automatically get a bootefi command to run
|
|
|
|
an efi application as well as snippet in the default distro boot script that
|
|
|
|
scans for removable media efi binaries as fallback.
|
|
|
|
|
|
|
|
Status
|
|
|
|
------
|
|
|
|
|
|
|
|
I am successfully able to run grub2 and Linux EFI binaries with this code on
|
|
|
|
ARMv7 as well as AArch64 systems.
|
|
|
|
|
|
|
|
When enabled, the resulting U-Boot binary only grows by ~10KB, so it's very
|
|
|
|
light weight.
|
|
|
|
|
|
|
|
All storage devices are directly accessible from the uEFI payload
|
|
|
|
|
|
|
|
Removable media booting (search for /efi/boot/boota{a64,arm}.efi) is supported.
|
|
|
|
|
|
|
|
Simple use cases like "Plug this SD card into my ARM device and it just
|
|
|
|
boots into grub which boots into Linux", work very well.
|
|
|
|
|
2016-11-07 15:47:08 +00:00
|
|
|
|
|
|
|
Running HelloWord.efi
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
You can run a simple 'hello world' EFI program in U-Boot.
|
|
|
|
Enable the option CONFIG_CMD_BOOTEFI_HELLO.
|
|
|
|
|
|
|
|
Then you can boot into U-Boot and type:
|
|
|
|
|
|
|
|
> bootefi hello
|
|
|
|
|
|
|
|
The 'hello world EFI' program will then run, print a message and exit.
|
|
|
|
|
|
|
|
|
2016-03-04 00:10:09 +00:00
|
|
|
Future work
|
|
|
|
-----------
|
|
|
|
|
|
|
|
Of course, there are still a few things one could do on top:
|
|
|
|
|
|
|
|
- Improve disk media detection (don't scan, use what information we
|
|
|
|
have)
|
|
|
|
- Add EFI variable support using NVRAM
|
|
|
|
- Add GFX support
|
|
|
|
- Make EFI Shell work
|
|
|
|
- Network device support
|
|
|
|
- Support for payload exit
|
|
|
|
- Payload Watchdog support
|
2018-01-30 19:03:02 +00:00
|
|
|
|
|
|
|
[1] http://uefi.org/
|