]>
Commit | Line | Data |
---|---|---|
1aa5e936 SG |
1 | # |
2 | # Copyright (C) 2015 Google, Inc | |
3 | # | |
4 | # SPDX-License-Identifier: GPL-2.0+ | |
5 | # | |
6 | ||
f3b5056c | 7 | EFI on U-Boot |
1aa5e936 | 8 | ============= |
f3b5056c HS |
9 | This document provides information about the implementation of the UEFI API [1] |
10 | in U-Boot. | |
1aa5e936 | 11 | |
1aa5e936 | 12 | |
f3b5056c | 13 | =========== Table of Contents =========== |
1aa5e936 | 14 | |
f3b5056c HS |
15 | Motivation |
16 | How do I get it? | |
1aa5e936 | 17 | Status |
1aa5e936 | 18 | Future work |
1aa5e936 | 19 | |
1aa5e936 | 20 | |
f3b5056c HS |
21 | Motivation |
22 | ---------- | |
996a18a7 | 23 | |
f3b5056c | 24 | With this API support in place, you can run any UEFI payload (such as the Linux |
996a18a7 AG |
25 | kernel, grub2 or gummiboot) on U-Boot. This dramatically simplifies boot loader |
26 | configuration, as U-Boot based systems now look and feel (almost) the same way | |
27 | as TianoCore based systems. | |
28 | ||
29 | How do I get it? | |
30 | ---------------- | |
31 | ||
32 | EFI support for 32bit ARM and AArch64 is already included in U-Boot. All you | |
33 | need to do is enable | |
34 | ||
35 | CONFIG_CMD_BOOTEFI=y | |
36 | CONFIG_EFI_LOADER=y | |
37 | ||
38 | in your .config file and you will automatically get a bootefi command to run | |
39 | an efi application as well as snippet in the default distro boot script that | |
40 | scans for removable media efi binaries as fallback. | |
41 | ||
42 | Status | |
43 | ------ | |
44 | ||
45 | I am successfully able to run grub2 and Linux EFI binaries with this code on | |
46 | ARMv7 as well as AArch64 systems. | |
47 | ||
48 | When enabled, the resulting U-Boot binary only grows by ~10KB, so it's very | |
49 | light weight. | |
50 | ||
51 | All storage devices are directly accessible from the uEFI payload | |
52 | ||
53 | Removable media booting (search for /efi/boot/boota{a64,arm}.efi) is supported. | |
54 | ||
55 | Simple use cases like "Plug this SD card into my ARM device and it just | |
56 | boots into grub which boots into Linux", work very well. | |
57 | ||
c7ae3dfd SG |
58 | |
59 | Running HelloWord.efi | |
60 | --------------------- | |
61 | ||
62 | You can run a simple 'hello world' EFI program in U-Boot. | |
63 | Enable the option CONFIG_CMD_BOOTEFI_HELLO. | |
64 | ||
65 | Then you can boot into U-Boot and type: | |
66 | ||
67 | > bootefi hello | |
68 | ||
69 | The 'hello world EFI' program will then run, print a message and exit. | |
70 | ||
71 | ||
996a18a7 AG |
72 | Future work |
73 | ----------- | |
74 | ||
75 | Of 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 | |
78 | have) | |
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 | |
f3b5056c HS |
85 | |
86 | [1] http://uefi.org/ |