05 Mar, 2018
1 commit
-
Thomas reported U-Boot failed to build host tools if libfdt-devel
package is installed because tools include libfdt headers from
/usr/include/ instead of using internal ones.This commit moves the header code:
include/libfdt.h -> include/linux/libfdt.h
include/libfdt_env.h -> include/linux/libfdt_env.hand replaces include directives:
#include -> #include
#include -> #includeReported-by: Thomas Petazzoni
Signed-off-by: Masahiro Yamada
28 Feb, 2018
1 commit
-
Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NETSigned-off-by: Michal Simek
Signed-off-by: Tom Rini
10 Feb, 2018
5 commits
-
efi_disk_register should return as status code (efi_status_t).
Disks with zero blocks should be reported as 'not ready' without throwing
an error.This patch solves a problem running OpenBSD on system configured with
CONFIG_BLK=n (e.g. i.MX6).Reported-by: Jonathan Gray
Signed-off-by: Heinrich Schuchardt
Tested-by: Jonathan Gray
Signed-off-by: Alexander Graf -
Add stubs for UpdateCapsule, QueryCapsuleCapabilities, and
QueryVariableInfo.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
Currently the UEFI revision number in the system table header is set to
2.0.5. This version number does not refer to any existing version of the
UEFI standard.Set the revision number to 2.7.
Signed-off-by: Heinrich Schuchardt
Reviewed-by: Mark Kettenis
Signed-off-by: Alexander Graf -
Currently we set the function pointer for the CreateEventEx boot service
to NULL. When called this would lead to an immediate failure.A function stub is provided which handles the case that the boot service
is called without an event group and returns EFI_UNSUPPORTED otherwise.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
Before the patch an undefined constant EFI_SUBSYSTEM was used in the
crt0 code. The current version of binutils does not swallow the error.https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=888403
The necessary constant IMAGE_SUBSYSTEM_EFI_APPLICATION is already
defined in pe.h. So let's factor out asm-generic/pe.h for the
image subsystem constants and use it in our assembler code.IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER does not exist in the specification
let's use IMAGE_SUBSYSTEM_EFI_ROM instead.The include pe.h is only used in code maintained by Alex so let him be the
maintainer here too.Reported-by: Andre Przywara
Signed-off-by: Heinrich Schuchardt
Tested-by: Vagrant Cascadian
Signed-off-by: Alexander Graf
09 Feb, 2018
2 commits
-
config_fallbacks.h has some logic that sets HAVE_BLOCK_DEVICE
based on a list of enabled options. Moving HAVE_BLOCK_DEVICE to
Kconfig allows us to drastically shrink the logic in
config_fallbacks.hSigned-off-by: Adam Ford
[trini: Rename HAVE_BLOCK_DEVICE to CONFIG_BLOCK_DEVICE]
Signed-off-by: Tom Rini -
config_fallback.h has some logic that checks a variety of options
and selects LIB_UUID if it hasn't already been selected. This
will all LIB_UUID in Kconfig and select this option for the list
of options to allow us to remove the logic from fallbacksSigned-off-by: Adam Ford
29 Jan, 2018
6 commits
-
Now that we have %pD support in vsprintf we should avoid separate
logic for printing device paths in other places.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
In an image is loaded from memory we do not have a device path.
Do not install NULL as device path in this case.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
When a UEFI payload just returns instead of calling the Exit() callback,
we handle that in efi_do_enter() and call Exit on its behalf, so that
the loaded_image->exit_status value is correct.We were missing that logic in StartImage(). Call it there too.
Reported-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
Provide a better description for indent_string.
Fix a typo.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
EFI calls are usually defined as asmlinkage. That means we pass all parameters
to functions via the stack x86_32.On x86_64 however, we need to also stick to the MS ABI calling conventions,
which the EFIAPI define conveniently handles for us. Most EFI functions were
also marked with EFIAPI, except for the entry call.So this patch adjusts all entry calls to use EFIAPI instead of the manual
asmlinkage attribute.While at it, we also change the prototype of the entry point to return
efi_status_t instead of ulong, as this is the correct prototype definition.Signed-off-by: Alexander Graf
---
v1 -> v2:
- Use efi_status_t in all occurences
-
We have 2 users of the EFI headers: efi_loader and the EFI stub. Efi_loader
always expects that the bitness of the definitions it uses is identical to
the execution.The EFI stub however allows to run x86_64 U-Boot on 32bit EFI and the other
way around, so it allows for different bitness of EFI definitions and U-Boot
environment.This patch explicitly requests via Kconfig that efi_loader can only be enabled
if the bitness is identical. Because we can run efi_loader on x86_64 without
EFI stub enabled, it also ensures that this case propagates the correct ABI
constraints.Signed-off-by: Alexander Graf
23 Jan, 2018
25 commits
-
Create device path nodes for UCLASS_ETH udevices.
Create device path nodes of block device children of UCLASS_MMC udevices.
Consistently use debug for unsupported nodes.
Set the log level to error.Signed-off-by: Heinrich Schuchardt
[agraf: Fix build failure by adding #ifdef CONFIG_DM_ETH]
Signed-off-by: Alexander Graf -
This patch lets the implementation of ExitBootServices conform to
the UEFI standard.The timer events must be disabled before calling the notification
functions of the exit boot services events.The boot services must be disabled in the system table.
The handles in the system table should be defined as efi_handle_t.
Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
In ExitBootServices we need to signal events irrespective of the current
TPL level. A new parameter check_tpl is added to efi_signal_event().Function efi_console_timer_notify() gets some comments.
Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
On a block device and its partitions the same protocols can be
installed. To tell the apart we can use the type of the last
node of the device path which is not the end node.The patch provides a utility function to find this last node.
Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
Add the revision constants.
Depending on the revision additional fields are needed in the
media descriptor.
Use efi_uintn_t for number of bytes to read or write.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
Up to now we have been using efi_disk_create_partitions() to create
partitions for block devices that existed before starting an EFI
application.We need to call it for block devices created by EFI
applications at run time. The EFI application will define the
handle for the block device and install a device path protocol
on it. We have to use this device path as stem for the partition
device paths.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
Provide new function efi_dp_part_node() to create a device
node for a partition.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
The GUID of the EFI_BLOCK_IO_PROTOCOL is needed in different code
parts. To avoid duplication make efi_block_io_guid a global symbol.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
The interface type name can be used to look up the interface type.
Don't confound it with the driver name which may be different.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
The calling convention for the entry point of an EFI image
is always 'asmlinkage'.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
Check if the device tree and the SMBIOS table are available.
Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
The category of memory allocated for an EFI image should depend on
its type (application, bootime service driver, runtime service driver).Our helloworld.efi built on arm64 has an illegal image type. Treat it
like an EFI application.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
Use %pD to print the device path instead of its address when
entering efi_load_image.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
In contrast to the description the code did not split the device
path into device part and file part.The code should use the installed protocol and not refer to the
internal structure of the the disk object.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
When installing the the simple file system protocol we have to path
the address of the structure and not the address of a pointer to the
structure.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
For the construction of device paths we need to call the
AllocatePool service. We should not ignore if it fails due to an
out of memory situation.This patch changes the device path functions to return NULL if
the memory allocation fails.Additional patches will be needed to fix the callers.
Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
We should consistently use the efi_handle_t typedef when
referring to handles.Signed-off-by: Heinrich Schuchardt
Reviewed-by: Simon Glass
Signed-off-by: Alexander Graf -
The UninstallProtocol boot service should first try to
disconnect controllers that have been connected with
EFI_OPEN_PROTOCOL_BY_DRIVER.If the protocol is still opened by an agent, it should be
closed.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
Unfortunately we need a forward declaration because both
OpenProtocol and CloseProtocol have to call DisconnectController.
And DisconnectController calls both OpenProtcol and CloseProtocol.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
Handles should be passed as efi_handle_t and not as void *.
Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
Implement the ConnectController boot service.
A unit test is supplied in a subsequent patch.
Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
When a device path protocol is installed write the device
path to the console in debug mode.For printing the new macro EFI_PRINT is used, which can be reused
for future diagnostic output.Remove unused EFI_PRINT_GUID macro
Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
efi_open_protocol_information provides the agent and controller
handles as well as the attributes and open count of an protocol
on a handle.Signed-off-by: Heinrich Schuchardt
[agraf: fix counting error]
Signed-off-by: Alexander Graf -
efi_open_protocol and efi_close_protocol have to keep track of
opened protocols.Check if the protocol was opened for the same agent and
controller.Remove all open protocol information for this pair.
Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
efi_open_protocol has to keep track of opened protocols.
OpenProtocol enters the agent and controller handle
information into this list.A unit test is supplied with a subsequent patch.
Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf