Simon Glass | 1aa5e93 | 2015-08-04 12:34:05 -0600 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2015 Google, Inc |
| 3 | # |
| 4 | # SPDX-License-Identifier: GPL-2.0+ |
| 5 | # |
| 6 | |
Alexander Graf | 996a18a | 2016-03-04 01:10:09 +0100 | [diff] [blame] | 7 | EFI on U-Boot |
| 8 | ============= |
Heinrich Schuchardt | f3b5056 | 2018-01-30 20:03:02 +0100 | [diff] [blame] | 9 | This document provides information about the implementation of the UEFI API [1] |
| 10 | in U-Boot. |
Alexander Graf | 996a18a | 2016-03-04 01:10:09 +0100 | [diff] [blame] | 11 | |
Alexander Graf | 996a18a | 2016-03-04 01:10:09 +0100 | [diff] [blame] | 12 | |
Heinrich Schuchardt | f3b5056 | 2018-01-30 20:03:02 +0100 | [diff] [blame] | 13 | =========== Table of Contents =========== |
Alexander Graf | 996a18a | 2016-03-04 01:10:09 +0100 | [diff] [blame] | 14 | |
Heinrich Schuchardt | f3b5056 | 2018-01-30 20:03:02 +0100 | [diff] [blame] | 15 | Motivation |
| 16 | How do I get it? |
| 17 | Status |
| 18 | Future work |
| 19 | |
| 20 | |
| 21 | Motivation |
| 22 | ---------- |
| 23 | |
| 24 | With this API support in place, you can run any UEFI payload (such as the Linux |
Alexander Graf | 996a18a | 2016-03-04 01:10:09 +0100 | [diff] [blame] | 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 | |
Simon Glass | c7ae3df | 2016-11-07 08:47:08 -0700 | [diff] [blame] | 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 | |
Alexander Graf | 996a18a | 2016-03-04 01:10:09 +0100 | [diff] [blame] | 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 |
Heinrich Schuchardt | f3b5056 | 2018-01-30 20:03:02 +0100 | [diff] [blame] | 85 | |
| 86 | [1] http://uefi.org/ |