u-boot/lib/efi_loader
Rob Clark ad644e7c18 efi_loader: efi variable support
Add EFI variable support, mapping to u-boot environment variables.
Variables are pretty important for setting up boot order, among other
things.  If the board supports saveenv, then it will be called in
ExitBootServices() to persist variables set by the efi payload.  (For
example, fallback.efi configuring BootOrder and BootXXXX load-option
variables.)

Variables are *not* currently exposed at runtime, post ExitBootServices.
On boards without a dedicated device for storage, which the loaded OS
is not trying to also use, this is rather tricky.  One idea, at least
for boards that can persist RAM across reboot, is to keep a "journal"
of modified variables in RAM, and then turn halt into a reboot into
u-boot, plus store variables, plus halt.  Whatever the solution, it
likely involves some per-board support.

Mapping between EFI variables and u-boot variables:

  efi_$guid_$varname = {attributes}(type)value

For example:

  efi_8be4df61-93ca-11d2-aa0d-00e098032b8c_OsIndicationsSupported=
     "{ro,boot,run}(blob)0000000000000000"
  efi_8be4df61-93ca-11d2-aa0d-00e098032b8c_BootOrder=
     "(blob)00010000"

The attributes are a comma separated list of these possible
attributes:

  + ro   - read-only
  + boot - boot-services access
  + run  - runtime access

NOTE: with current implementation, no variables are available after
ExitBootServices, and all are persisted (if possible).

If not specified, the attributes default to "{boot}".

The required type is one of:

  + utf8 - raw utf8 string
  + blob - arbitrary length hex string

Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2017-09-20 11:00:57 +02:00
..
.gitignore lib: gitignore *.elf and *.so generated by efi_loader 2017-01-09 10:30:24 -05:00
efi_boottime.c efi_loader: efi variable support 2017-09-20 11:00:57 +02:00
efi_console.c efi_loader: implement queueing of the notification function 2017-09-18 23:53:57 +02:00
efi_device_path.c efi_loader: add device-path utils 2017-09-20 10:31:55 +02:00
efi_device_path_to_text.c efi_loader: flesh out device-path to text 2017-09-20 10:32:54 +02:00
efi_disk.c efi_loader: add file/filesys support 2017-09-20 10:43:54 +02:00
efi_file.c efi_loader: add file/filesys support 2017-09-20 10:43:54 +02:00
efi_gop.c efi_loader: GOP fix for no display 2017-08-11 13:49:23 +02:00
efi_image_loader.c efi_loader: add file/filesys support 2017-09-20 10:43:54 +02:00
efi_memory.c efi_loader: make pool allocations cacheline aligned 2017-09-20 10:48:09 +02:00
efi_net.c efi_loader: refactor boot device and loaded_image handling 2017-09-20 10:36:56 +02:00
efi_runtime.c efi_loader: efi variable support 2017-09-20 11:00:57 +02:00
efi_smbios.c smbios: Expose in efi_loader as table 2016-10-19 09:01:52 +02:00
efi_variable.c efi_loader: efi variable support 2017-09-20 11:00:57 +02:00
helloworld.c efi: Add support for a hello world test program 2016-11-14 23:24:03 +01:00
Kconfig x86: Enable EFI loader support 2016-11-14 23:24:04 +01:00
Makefile efi_loader: efi variable support 2017-09-20 11:00:57 +02:00