blob: 956f5bfa0c695b5934ccfcc635637f33978c561a [file] [log] [blame]
Simon Glass1aa5e932015-08-04 12:34:05 -06001#
2# Copyright (C) 2015 Google, Inc
3#
4# SPDX-License-Identifier: GPL-2.0+
5#
6
Alexander Graf996a18a2016-03-04 01:10:09 +01007EFI on U-Boot
8=============
Heinrich Schuchardtf3b50562018-01-30 20:03:02 +01009This document provides information about the implementation of the UEFI API [1]
10in U-Boot.
Alexander Graf996a18a2016-03-04 01:10:09 +010011
Alexander Graf996a18a2016-03-04 01:10:09 +010012
Heinrich Schuchardtf3b50562018-01-30 20:03:02 +010013=========== Table of Contents ===========
Alexander Graf996a18a2016-03-04 01:10:09 +010014
Heinrich Schuchardtf3b50562018-01-30 20:03:02 +010015Motivation
16How do I get it?
17Status
18Future work
19
20
21Motivation
22----------
23
24With this API support in place, you can run any UEFI payload (such as the Linux
Alexander Graf996a18a2016-03-04 01:10:09 +010025kernel, grub2 or gummiboot) on U-Boot. This dramatically simplifies boot loader
26configuration, as U-Boot based systems now look and feel (almost) the same way
27as TianoCore based systems.
28
29How do I get it?
30----------------
31
32EFI support for 32bit ARM and AArch64 is already included in U-Boot. All you
33need to do is enable
34
35 CONFIG_CMD_BOOTEFI=y
36 CONFIG_EFI_LOADER=y
37
38in your .config file and you will automatically get a bootefi command to run
39an efi application as well as snippet in the default distro boot script that
40scans for removable media efi binaries as fallback.
41
42Status
43------
44
45I am successfully able to run grub2 and Linux EFI binaries with this code on
46ARMv7 as well as AArch64 systems.
47
48When enabled, the resulting U-Boot binary only grows by ~10KB, so it's very
49light weight.
50
51All storage devices are directly accessible from the uEFI payload
52
53Removable media booting (search for /efi/boot/boota{a64,arm}.efi) is supported.
54
55Simple use cases like "Plug this SD card into my ARM device and it just
56boots into grub which boots into Linux", work very well.
57
Simon Glassc7ae3df2016-11-07 08:47:08 -070058
59Running HelloWord.efi
60---------------------
61
62You can run a simple 'hello world' EFI program in U-Boot.
63Enable the option CONFIG_CMD_BOOTEFI_HELLO.
64
65Then you can boot into U-Boot and type:
66
67 > bootefi hello
68
69The 'hello world EFI' program will then run, print a message and exit.
70
71
Alexander Graf996a18a2016-03-04 01:10:09 +010072Future work
73-----------
74
75Of course, there are still a few things one could do on top:
76
77 - Improve disk media detection (don't scan, use what information we
78have)
79 - Add EFI variable support using NVRAM
80 - Add GFX support
81 - Make EFI Shell work
82 - Network device support
83 - Support for payload exit
84 - Payload Watchdog support
Heinrich Schuchardtf3b50562018-01-30 20:03:02 +010085
86[1] http://uefi.org/