History log of /u-boot/lib/efi_loader/efi_root_node.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# c38cb227 14-Dec-2023 Tom Rini <trini@konsulko.com>

efi_loader: Remove <common.h>

We largely do not need <common.h> in these files, so drop it. The only
exception here is that efi_freestanding.c needs <linux/types.h> and had
been getting that via <common.h>.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# bed72232 05-Feb-2023 Simon Glass <sjg@chromium.org>

Correct SPL use of EFI_UNICODE_COLLATION_PROTOCOL2

This converts 1 usage of this option to the non-SPL form, since there is
no SPL_EFI_UNICODE_COLLATION_PROTOCOL2 defined in Kconfig

Signed-off-by: Simon Glass <sjg@chromium.org>

# da841537 05-Feb-2023 Simon Glass <sjg@chromium.org>

Correct SPL use of EFI_LOADER_HII

This converts 1 usage of this option to the non-SPL form, since there is
no SPL_EFI_LOADER_HII defined in Kconfig

Signed-off-by: Simon Glass <sjg@chromium.org>

# 5cf9952e 05-Feb-2023 Simon Glass <sjg@chromium.org>

Correct SPL use of EFI_DEVICE_PATH_UTIL

This converts 1 usage of this option to the non-SPL form, since there is
no SPL_EFI_DEVICE_PATH_UTIL defined in Kconfig

Signed-off-by: Simon Glass <sjg@chromium.org>

# 05c4c9e2 06-Oct-2022 Ilias Apalodimas <ilias.apalodimas@linaro.org>

efi_loader: define internal implementations of install/uninstallmultiple

A following patch is cleaning up the core EFI code trying to remove
sequences of efi_create_handle, efi_add_protocol.

Although this works fine there's a problem with the latter since it is
usually combined with efi_delete_handle() which blindly removes all
protocols on a handle and deletes the handle. We should try to adhere to
the EFI spec which only deletes a handle if the last instance of a protocol
has been removed. Another problem is that efi_delete_handle() never checks
for opened protocols, but the EFI spec defines that the caller is
responsible for ensuring that there are no references to a protocol
interface that is going to be removed.

So let's fix this by replacing all callsites of
efi_create_handle(), efi_add_protocol() , efi_delete_handle() with
Install/UninstallMultipleProtocol.

In order to do that redefine functions that can be used by the U-Boot
proper internally and add '_ext' variants that will be used from the
EFI API

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 19ea5e66 16-Jan-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: remove EFI_UNICODE_COLLATION_PROTOCOL

In EFI 1.10 a version of the Unicode collation protocol using ISO 639-2
language codes existed. This protocol is not part of the UEFI specification
any longer. It was however required to run the UEFI Self Certification Test
(SCT) II, version 2.6, 2017. So we implemented it for the sole purpose of
running the SCT.

As the SCT does not need the protocol anymore it is time for removal.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 59593a52 16-Jan-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: EFI_DEVICE_PATH_UTILITIES_PROTOCOL configurable

Allow the EFI_DEVICE_PATH_UTILITIES_PROTOCOL to be disabled via
configuration.

On systems that are very tight on U-Boot image size we may want to disable
the protocol. As it is required to run the UEFI Shell enable it by default.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 4cb07d8d 16-Jan-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make EFI_DT_FIXUP_PROTOCOL configurable

Allow EFI_DT_FIXUP_PROTOCOL to be disabled via configuration.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 94686f60 13-Dec-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: implement EFI_DT_FIXUP_PROTOCOL

A boot manager like GRUB can use the protocol to

* apply U-Boot's fix-ups to the a device-tree
* let U-Boot make memory reservations according to the device-tree
* install the device-tree as a configuration table

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 861072b2 07-Dec-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: remove EFI_HII_CONFIG_ROUTING_PROTOCOL

Our implementation of the EFI_HII_CONFIG_ROUTING_PROTOCOL is a mere stub,
where all services return an error code. The protocol is neither needed for
the EFI shell nor for the UEFI SCT. To reduce the code size remove it from
the U-Boot binary.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# b59c13d4 24-Sep-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: installation of EFI_RNG_PROTOCOL

Having an EFI_RNG_PROTOCOL without a backing RNG device leads to failure
to boot Linux 5.8.

Only install the EFI_RNG_PROTOCOL if we have a RNG device.

Reported-by: Scott K Logan <logans@cottsay.net>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 33c37d97 28-Dec-2019 Sughosh Ganu <sughosh.ganu@linaro.org>

efi_rng_protocol: Install the efi_rng_protocol on the root node

Install the EFI_RNG_PROTOCOL implementation for it's subsequent use by
the kernel for features like kaslr.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# b1b782d3 16-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: implement deprecated Unicode collation protocol

In EFI 1.10 a version of the Unicode collation protocol using ISO 639-2
language codes existed. This protocol is not part of the UEFI specification
any longer. Unfortunately it is required to run the UEFI Self Certification
Test (SCT) II, version 2.6, 2017. So we implement it here for the sole
purpose of running the SCT. It can be removed once a compliant SCT is
available.

The configuration option defaults to no.

Signed-off-by: Rob Clark <robdclark@gmail.com>

Most of Rob's original patch is already merged. Only the deprecated
protocol is missing. Rebase it and make it configurable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 95ab3816 15-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename Unicode collation protocol 2 variables

Rename variables to make it clear they refer to the Unicode collation
protocol identified by the EFI_UNICODE_PROTOCOL2_GUID.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 33499735 08-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make Unicode collation protocol customizable

The Unicode collation protocol is not needed for EBBR compliance. So let's
make it a customizable option.

The Unicode capitalization table is only needed by this protocol. So let it
depend on the Unicode collation protocol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 84a918e8 05-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: LoadImage() check parent image

If the parent image handle does not refer to a loaded image return
EFI_INVALID_PARAMETER.
(UEFI SCT II 2017: 3.4.1 LoadImage() - 5.1.4.1.1)

Mark our root node as a loaded image to avoid an error when using it as
parent image.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# a2a4bc3b 15-Apr-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

efi_loader: export root node handle

This is a preparatory patch.
The root node handle will be used as a dummy parent handle when invoking
an EFI image from bootefi/bootmgr command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

Rebased.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f1465c15 11-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: simplify protocol installation

By using InstallMultipleProtocolInterfaces() the coding for installing
protocol interfaces on the root node can be simplified.

Suggested-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 8ec7d5d3 07-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: assign HII protocols to root node

We should not install the HII protocols on every loaded image. It is
sufficient to install them once on the root node.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 4e6b5d65 20-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: create root node

Currently we assign a lot of protocols to loaded images though
these protocols are not related to them. Instead they should be
installed on a separate handle. Via the device path it is the
parent to the devices like the network adapter.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# bed72232 05-Feb-2023 Simon Glass <sjg@chromium.org>

Correct SPL use of EFI_UNICODE_COLLATION_PROTOCOL2

This converts 1 usage of this option to the non-SPL form, since there is
no SPL_EFI_UNICODE_COLLATION_PROTOCOL2 defined in Kconfig

Signed-off-by: Simon Glass <sjg@chromium.org>

# da841537 05-Feb-2023 Simon Glass <sjg@chromium.org>

Correct SPL use of EFI_LOADER_HII

This converts 1 usage of this option to the non-SPL form, since there is
no SPL_EFI_LOADER_HII defined in Kconfig

Signed-off-by: Simon Glass <sjg@chromium.org>

# 5cf9952e 05-Feb-2023 Simon Glass <sjg@chromium.org>

Correct SPL use of EFI_DEVICE_PATH_UTIL

This converts 1 usage of this option to the non-SPL form, since there is
no SPL_EFI_DEVICE_PATH_UTIL defined in Kconfig

Signed-off-by: Simon Glass <sjg@chromium.org>

# 05c4c9e2 06-Oct-2022 Ilias Apalodimas <ilias.apalodimas@linaro.org>

efi_loader: define internal implementations of install/uninstallmultiple

A following patch is cleaning up the core EFI code trying to remove
sequences of efi_create_handle, efi_add_protocol.

Although this works fine there's a problem with the latter since it is
usually combined with efi_delete_handle() which blindly removes all
protocols on a handle and deletes the handle. We should try to adhere to
the EFI spec which only deletes a handle if the last instance of a protocol
has been removed. Another problem is that efi_delete_handle() never checks
for opened protocols, but the EFI spec defines that the caller is
responsible for ensuring that there are no references to a protocol
interface that is going to be removed.

So let's fix this by replacing all callsites of
efi_create_handle(), efi_add_protocol() , efi_delete_handle() with
Install/UninstallMultipleProtocol.

In order to do that redefine functions that can be used by the U-Boot
proper internally and add '_ext' variants that will be used from the
EFI API

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 19ea5e66 16-Jan-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: remove EFI_UNICODE_COLLATION_PROTOCOL

In EFI 1.10 a version of the Unicode collation protocol using ISO 639-2
language codes existed. This protocol is not part of the UEFI specification
any longer. It was however required to run the UEFI Self Certification Test
(SCT) II, version 2.6, 2017. So we implemented it for the sole purpose of
running the SCT.

As the SCT does not need the protocol anymore it is time for removal.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 59593a52 16-Jan-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: EFI_DEVICE_PATH_UTILITIES_PROTOCOL configurable

Allow the EFI_DEVICE_PATH_UTILITIES_PROTOCOL to be disabled via
configuration.

On systems that are very tight on U-Boot image size we may want to disable
the protocol. As it is required to run the UEFI Shell enable it by default.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 4cb07d8d 16-Jan-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make EFI_DT_FIXUP_PROTOCOL configurable

Allow EFI_DT_FIXUP_PROTOCOL to be disabled via configuration.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 94686f60 13-Dec-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: implement EFI_DT_FIXUP_PROTOCOL

A boot manager like GRUB can use the protocol to

* apply U-Boot's fix-ups to the a device-tree
* let U-Boot make memory reservations according to the device-tree
* install the device-tree as a configuration table

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 861072b2 07-Dec-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: remove EFI_HII_CONFIG_ROUTING_PROTOCOL

Our implementation of the EFI_HII_CONFIG_ROUTING_PROTOCOL is a mere stub,
where all services return an error code. The protocol is neither needed for
the EFI shell nor for the UEFI SCT. To reduce the code size remove it from
the U-Boot binary.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# b59c13d4 24-Sep-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: installation of EFI_RNG_PROTOCOL

Having an EFI_RNG_PROTOCOL without a backing RNG device leads to failure
to boot Linux 5.8.

Only install the EFI_RNG_PROTOCOL if we have a RNG device.

Reported-by: Scott K Logan <logans@cottsay.net>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 33c37d97 28-Dec-2019 Sughosh Ganu <sughosh.ganu@linaro.org>

efi_rng_protocol: Install the efi_rng_protocol on the root node

Install the EFI_RNG_PROTOCOL implementation for it's subsequent use by
the kernel for features like kaslr.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# b1b782d3 16-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: implement deprecated Unicode collation protocol

In EFI 1.10 a version of the Unicode collation protocol using ISO 639-2
language codes existed. This protocol is not part of the UEFI specification
any longer. Unfortunately it is required to run the UEFI Self Certification
Test (SCT) II, version 2.6, 2017. So we implement it here for the sole
purpose of running the SCT. It can be removed once a compliant SCT is
available.

The configuration option defaults to no.

Signed-off-by: Rob Clark <robdclark@gmail.com>

Most of Rob's original patch is already merged. Only the deprecated
protocol is missing. Rebase it and make it configurable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 95ab3816 15-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename Unicode collation protocol 2 variables

Rename variables to make it clear they refer to the Unicode collation
protocol identified by the EFI_UNICODE_PROTOCOL2_GUID.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 33499735 08-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make Unicode collation protocol customizable

The Unicode collation protocol is not needed for EBBR compliance. So let's
make it a customizable option.

The Unicode capitalization table is only needed by this protocol. So let it
depend on the Unicode collation protocol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 84a918e8 05-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: LoadImage() check parent image

If the parent image handle does not refer to a loaded image return
EFI_INVALID_PARAMETER.
(UEFI SCT II 2017: 3.4.1 LoadImage() - 5.1.4.1.1)

Mark our root node as a loaded image to avoid an error when using it as
parent image.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# a2a4bc3b 15-Apr-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

efi_loader: export root node handle

This is a preparatory patch.
The root node handle will be used as a dummy parent handle when invoking
an EFI image from bootefi/bootmgr command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

Rebased.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f1465c15 11-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: simplify protocol installation

By using InstallMultipleProtocolInterfaces() the coding for installing
protocol interfaces on the root node can be simplified.

Suggested-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 8ec7d5d3 07-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: assign HII protocols to root node

We should not install the HII protocols on every loaded image. It is
sufficient to install them once on the root node.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 4e6b5d65 20-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: create root node

Currently we assign a lot of protocols to loaded images though
these protocols are not related to them. Instead they should be
installed on a separate handle. Via the device path it is the
parent to the devices like the network adapter.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 05c4c9e2 06-Oct-2022 Ilias Apalodimas <ilias.apalodimas@linaro.org>

efi_loader: define internal implementations of install/uninstallmultiple

A following patch is cleaning up the core EFI code trying to remove
sequences of efi_create_handle, efi_add_protocol.

Although this works fine there's a problem with the latter since it is
usually combined with efi_delete_handle() which blindly removes all
protocols on a handle and deletes the handle. We should try to adhere to
the EFI spec which only deletes a handle if the last instance of a protocol
has been removed. Another problem is that efi_delete_handle() never checks
for opened protocols, but the EFI spec defines that the caller is
responsible for ensuring that there are no references to a protocol
interface that is going to be removed.

So let's fix this by replacing all callsites of
efi_create_handle(), efi_add_protocol() , efi_delete_handle() with
Install/UninstallMultipleProtocol.

In order to do that redefine functions that can be used by the U-Boot
proper internally and add '_ext' variants that will be used from the
EFI API

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 19ea5e66 16-Jan-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: remove EFI_UNICODE_COLLATION_PROTOCOL

In EFI 1.10 a version of the Unicode collation protocol using ISO 639-2
language codes existed. This protocol is not part of the UEFI specification
any longer. It was however required to run the UEFI Self Certification Test
(SCT) II, version 2.6, 2017. So we implemented it for the sole purpose of
running the SCT.

As the SCT does not need the protocol anymore it is time for removal.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 59593a52 16-Jan-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: EFI_DEVICE_PATH_UTILITIES_PROTOCOL configurable

Allow the EFI_DEVICE_PATH_UTILITIES_PROTOCOL to be disabled via
configuration.

On systems that are very tight on U-Boot image size we may want to disable
the protocol. As it is required to run the UEFI Shell enable it by default.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 4cb07d8d 16-Jan-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make EFI_DT_FIXUP_PROTOCOL configurable

Allow EFI_DT_FIXUP_PROTOCOL to be disabled via configuration.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 94686f60 13-Dec-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: implement EFI_DT_FIXUP_PROTOCOL

A boot manager like GRUB can use the protocol to

* apply U-Boot's fix-ups to the a device-tree
* let U-Boot make memory reservations according to the device-tree
* install the device-tree as a configuration table

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 861072b2 07-Dec-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: remove EFI_HII_CONFIG_ROUTING_PROTOCOL

Our implementation of the EFI_HII_CONFIG_ROUTING_PROTOCOL is a mere stub,
where all services return an error code. The protocol is neither needed for
the EFI shell nor for the UEFI SCT. To reduce the code size remove it from
the U-Boot binary.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# b59c13d4 24-Sep-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: installation of EFI_RNG_PROTOCOL

Having an EFI_RNG_PROTOCOL without a backing RNG device leads to failure
to boot Linux 5.8.

Only install the EFI_RNG_PROTOCOL if we have a RNG device.

Reported-by: Scott K Logan <logans@cottsay.net>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 33c37d97 28-Dec-2019 Sughosh Ganu <sughosh.ganu@linaro.org>

efi_rng_protocol: Install the efi_rng_protocol on the root node

Install the EFI_RNG_PROTOCOL implementation for it's subsequent use by
the kernel for features like kaslr.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# b1b782d3 16-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: implement deprecated Unicode collation protocol

In EFI 1.10 a version of the Unicode collation protocol using ISO 639-2
language codes existed. This protocol is not part of the UEFI specification
any longer. Unfortunately it is required to run the UEFI Self Certification
Test (SCT) II, version 2.6, 2017. So we implement it here for the sole
purpose of running the SCT. It can be removed once a compliant SCT is
available.

The configuration option defaults to no.

Signed-off-by: Rob Clark <robdclark@gmail.com>

Most of Rob's original patch is already merged. Only the deprecated
protocol is missing. Rebase it and make it configurable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 95ab3816 15-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename Unicode collation protocol 2 variables

Rename variables to make it clear they refer to the Unicode collation
protocol identified by the EFI_UNICODE_PROTOCOL2_GUID.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 33499735 08-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make Unicode collation protocol customizable

The Unicode collation protocol is not needed for EBBR compliance. So let's
make it a customizable option.

The Unicode capitalization table is only needed by this protocol. So let it
depend on the Unicode collation protocol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 84a918e8 05-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: LoadImage() check parent image

If the parent image handle does not refer to a loaded image return
EFI_INVALID_PARAMETER.
(UEFI SCT II 2017: 3.4.1 LoadImage() - 5.1.4.1.1)

Mark our root node as a loaded image to avoid an error when using it as
parent image.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# a2a4bc3b 15-Apr-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

efi_loader: export root node handle

This is a preparatory patch.
The root node handle will be used as a dummy parent handle when invoking
an EFI image from bootefi/bootmgr command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

Rebased.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f1465c15 11-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: simplify protocol installation

By using InstallMultipleProtocolInterfaces() the coding for installing
protocol interfaces on the root node can be simplified.

Suggested-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 8ec7d5d3 07-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: assign HII protocols to root node

We should not install the HII protocols on every loaded image. It is
sufficient to install them once on the root node.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 4e6b5d65 20-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: create root node

Currently we assign a lot of protocols to loaded images though
these protocols are not related to them. Instead they should be
installed on a separate handle. Via the device path it is the
parent to the devices like the network adapter.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 19ea5e66 16-Jan-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: remove EFI_UNICODE_COLLATION_PROTOCOL

In EFI 1.10 a version of the Unicode collation protocol using ISO 639-2
language codes existed. This protocol is not part of the UEFI specification
any longer. It was however required to run the UEFI Self Certification Test
(SCT) II, version 2.6, 2017. So we implemented it for the sole purpose of
running the SCT.

As the SCT does not need the protocol anymore it is time for removal.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 59593a52 16-Jan-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: EFI_DEVICE_PATH_UTILITIES_PROTOCOL configurable

Allow the EFI_DEVICE_PATH_UTILITIES_PROTOCOL to be disabled via
configuration.

On systems that are very tight on U-Boot image size we may want to disable
the protocol. As it is required to run the UEFI Shell enable it by default.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 4cb07d8d 16-Jan-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make EFI_DT_FIXUP_PROTOCOL configurable

Allow EFI_DT_FIXUP_PROTOCOL to be disabled via configuration.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 94686f60 13-Dec-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: implement EFI_DT_FIXUP_PROTOCOL

A boot manager like GRUB can use the protocol to

* apply U-Boot's fix-ups to the a device-tree
* let U-Boot make memory reservations according to the device-tree
* install the device-tree as a configuration table

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 861072b2 07-Dec-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: remove EFI_HII_CONFIG_ROUTING_PROTOCOL

Our implementation of the EFI_HII_CONFIG_ROUTING_PROTOCOL is a mere stub,
where all services return an error code. The protocol is neither needed for
the EFI shell nor for the UEFI SCT. To reduce the code size remove it from
the U-Boot binary.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# b59c13d4 24-Sep-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: installation of EFI_RNG_PROTOCOL

Having an EFI_RNG_PROTOCOL without a backing RNG device leads to failure
to boot Linux 5.8.

Only install the EFI_RNG_PROTOCOL if we have a RNG device.

Reported-by: Scott K Logan <logans@cottsay.net>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 33c37d97 28-Dec-2019 Sughosh Ganu <sughosh.ganu@linaro.org>

efi_rng_protocol: Install the efi_rng_protocol on the root node

Install the EFI_RNG_PROTOCOL implementation for it's subsequent use by
the kernel for features like kaslr.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# b1b782d3 16-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: implement deprecated Unicode collation protocol

In EFI 1.10 a version of the Unicode collation protocol using ISO 639-2
language codes existed. This protocol is not part of the UEFI specification
any longer. Unfortunately it is required to run the UEFI Self Certification
Test (SCT) II, version 2.6, 2017. So we implement it here for the sole
purpose of running the SCT. It can be removed once a compliant SCT is
available.

The configuration option defaults to no.

Signed-off-by: Rob Clark <robdclark@gmail.com>

Most of Rob's original patch is already merged. Only the deprecated
protocol is missing. Rebase it and make it configurable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 95ab3816 15-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename Unicode collation protocol 2 variables

Rename variables to make it clear they refer to the Unicode collation
protocol identified by the EFI_UNICODE_PROTOCOL2_GUID.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 33499735 08-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make Unicode collation protocol customizable

The Unicode collation protocol is not needed for EBBR compliance. So let's
make it a customizable option.

The Unicode capitalization table is only needed by this protocol. So let it
depend on the Unicode collation protocol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 84a918e8 05-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: LoadImage() check parent image

If the parent image handle does not refer to a loaded image return
EFI_INVALID_PARAMETER.
(UEFI SCT II 2017: 3.4.1 LoadImage() - 5.1.4.1.1)

Mark our root node as a loaded image to avoid an error when using it as
parent image.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# a2a4bc3b 15-Apr-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

efi_loader: export root node handle

This is a preparatory patch.
The root node handle will be used as a dummy parent handle when invoking
an EFI image from bootefi/bootmgr command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

Rebased.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f1465c15 11-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: simplify protocol installation

By using InstallMultipleProtocolInterfaces() the coding for installing
protocol interfaces on the root node can be simplified.

Suggested-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 8ec7d5d3 07-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: assign HII protocols to root node

We should not install the HII protocols on every loaded image. It is
sufficient to install them once on the root node.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 4e6b5d65 20-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: create root node

Currently we assign a lot of protocols to loaded images though
these protocols are not related to them. Instead they should be
installed on a separate handle. Via the device path it is the
parent to the devices like the network adapter.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 94686f60 13-Dec-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: implement EFI_DT_FIXUP_PROTOCOL

A boot manager like GRUB can use the protocol to

* apply U-Boot's fix-ups to the a device-tree
* let U-Boot make memory reservations according to the device-tree
* install the device-tree as a configuration table

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 861072b2 07-Dec-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: remove EFI_HII_CONFIG_ROUTING_PROTOCOL

Our implementation of the EFI_HII_CONFIG_ROUTING_PROTOCOL is a mere stub,
where all services return an error code. The protocol is neither needed for
the EFI shell nor for the UEFI SCT. To reduce the code size remove it from
the U-Boot binary.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# b59c13d4 24-Sep-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: installation of EFI_RNG_PROTOCOL

Having an EFI_RNG_PROTOCOL without a backing RNG device leads to failure
to boot Linux 5.8.

Only install the EFI_RNG_PROTOCOL if we have a RNG device.

Reported-by: Scott K Logan <logans@cottsay.net>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 33c37d97 28-Dec-2019 Sughosh Ganu <sughosh.ganu@linaro.org>

efi_rng_protocol: Install the efi_rng_protocol on the root node

Install the EFI_RNG_PROTOCOL implementation for it's subsequent use by
the kernel for features like kaslr.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# b1b782d3 16-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: implement deprecated Unicode collation protocol

In EFI 1.10 a version of the Unicode collation protocol using ISO 639-2
language codes existed. This protocol is not part of the UEFI specification
any longer. Unfortunately it is required to run the UEFI Self Certification
Test (SCT) II, version 2.6, 2017. So we implement it here for the sole
purpose of running the SCT. It can be removed once a compliant SCT is
available.

The configuration option defaults to no.

Signed-off-by: Rob Clark <robdclark@gmail.com>

Most of Rob's original patch is already merged. Only the deprecated
protocol is missing. Rebase it and make it configurable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 95ab3816 15-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename Unicode collation protocol 2 variables

Rename variables to make it clear they refer to the Unicode collation
protocol identified by the EFI_UNICODE_PROTOCOL2_GUID.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 33499735 08-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make Unicode collation protocol customizable

The Unicode collation protocol is not needed for EBBR compliance. So let's
make it a customizable option.

The Unicode capitalization table is only needed by this protocol. So let it
depend on the Unicode collation protocol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 84a918e8 05-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: LoadImage() check parent image

If the parent image handle does not refer to a loaded image return
EFI_INVALID_PARAMETER.
(UEFI SCT II 2017: 3.4.1 LoadImage() - 5.1.4.1.1)

Mark our root node as a loaded image to avoid an error when using it as
parent image.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# a2a4bc3b 15-Apr-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

efi_loader: export root node handle

This is a preparatory patch.
The root node handle will be used as a dummy parent handle when invoking
an EFI image from bootefi/bootmgr command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

Rebased.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f1465c15 11-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: simplify protocol installation

By using InstallMultipleProtocolInterfaces() the coding for installing
protocol interfaces on the root node can be simplified.

Suggested-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 8ec7d5d3 07-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: assign HII protocols to root node

We should not install the HII protocols on every loaded image. It is
sufficient to install them once on the root node.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 4e6b5d65 20-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: create root node

Currently we assign a lot of protocols to loaded images though
these protocols are not related to them. Instead they should be
installed on a separate handle. Via the device path it is the
parent to the devices like the network adapter.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 861072b2 07-Dec-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: remove EFI_HII_CONFIG_ROUTING_PROTOCOL

Our implementation of the EFI_HII_CONFIG_ROUTING_PROTOCOL is a mere stub,
where all services return an error code. The protocol is neither needed for
the EFI shell nor for the UEFI SCT. To reduce the code size remove it from
the U-Boot binary.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# b59c13d4 24-Sep-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: installation of EFI_RNG_PROTOCOL

Having an EFI_RNG_PROTOCOL without a backing RNG device leads to failure
to boot Linux 5.8.

Only install the EFI_RNG_PROTOCOL if we have a RNG device.

Reported-by: Scott K Logan <logans@cottsay.net>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 33c37d97 28-Dec-2019 Sughosh Ganu <sughosh.ganu@linaro.org>

efi_rng_protocol: Install the efi_rng_protocol on the root node

Install the EFI_RNG_PROTOCOL implementation for it's subsequent use by
the kernel for features like kaslr.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# b1b782d3 16-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: implement deprecated Unicode collation protocol

In EFI 1.10 a version of the Unicode collation protocol using ISO 639-2
language codes existed. This protocol is not part of the UEFI specification
any longer. Unfortunately it is required to run the UEFI Self Certification
Test (SCT) II, version 2.6, 2017. So we implement it here for the sole
purpose of running the SCT. It can be removed once a compliant SCT is
available.

The configuration option defaults to no.

Signed-off-by: Rob Clark <robdclark@gmail.com>

Most of Rob's original patch is already merged. Only the deprecated
protocol is missing. Rebase it and make it configurable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 95ab3816 15-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename Unicode collation protocol 2 variables

Rename variables to make it clear they refer to the Unicode collation
protocol identified by the EFI_UNICODE_PROTOCOL2_GUID.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 33499735 08-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make Unicode collation protocol customizable

The Unicode collation protocol is not needed for EBBR compliance. So let's
make it a customizable option.

The Unicode capitalization table is only needed by this protocol. So let it
depend on the Unicode collation protocol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 84a918e8 05-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: LoadImage() check parent image

If the parent image handle does not refer to a loaded image return
EFI_INVALID_PARAMETER.
(UEFI SCT II 2017: 3.4.1 LoadImage() - 5.1.4.1.1)

Mark our root node as a loaded image to avoid an error when using it as
parent image.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# a2a4bc3b 15-Apr-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

efi_loader: export root node handle

This is a preparatory patch.
The root node handle will be used as a dummy parent handle when invoking
an EFI image from bootefi/bootmgr command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

Rebased.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f1465c15 11-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: simplify protocol installation

By using InstallMultipleProtocolInterfaces() the coding for installing
protocol interfaces on the root node can be simplified.

Suggested-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 8ec7d5d3 07-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: assign HII protocols to root node

We should not install the HII protocols on every loaded image. It is
sufficient to install them once on the root node.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 4e6b5d65 20-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: create root node

Currently we assign a lot of protocols to loaded images though
these protocols are not related to them. Instead they should be
installed on a separate handle. Via the device path it is the
parent to the devices like the network adapter.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# b59c13d4 24-Sep-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: installation of EFI_RNG_PROTOCOL

Having an EFI_RNG_PROTOCOL without a backing RNG device leads to failure
to boot Linux 5.8.

Only install the EFI_RNG_PROTOCOL if we have a RNG device.

Reported-by: Scott K Logan <logans@cottsay.net>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 33c37d97 28-Dec-2019 Sughosh Ganu <sughosh.ganu@linaro.org>

efi_rng_protocol: Install the efi_rng_protocol on the root node

Install the EFI_RNG_PROTOCOL implementation for it's subsequent use by
the kernel for features like kaslr.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# b1b782d3 16-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: implement deprecated Unicode collation protocol

In EFI 1.10 a version of the Unicode collation protocol using ISO 639-2
language codes existed. This protocol is not part of the UEFI specification
any longer. Unfortunately it is required to run the UEFI Self Certification
Test (SCT) II, version 2.6, 2017. So we implement it here for the sole
purpose of running the SCT. It can be removed once a compliant SCT is
available.

The configuration option defaults to no.

Signed-off-by: Rob Clark <robdclark@gmail.com>

Most of Rob's original patch is already merged. Only the deprecated
protocol is missing. Rebase it and make it configurable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 95ab3816 15-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename Unicode collation protocol 2 variables

Rename variables to make it clear they refer to the Unicode collation
protocol identified by the EFI_UNICODE_PROTOCOL2_GUID.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 33499735 08-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make Unicode collation protocol customizable

The Unicode collation protocol is not needed for EBBR compliance. So let's
make it a customizable option.

The Unicode capitalization table is only needed by this protocol. So let it
depend on the Unicode collation protocol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 84a918e8 05-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: LoadImage() check parent image

If the parent image handle does not refer to a loaded image return
EFI_INVALID_PARAMETER.
(UEFI SCT II 2017: 3.4.1 LoadImage() - 5.1.4.1.1)

Mark our root node as a loaded image to avoid an error when using it as
parent image.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# a2a4bc3b 15-Apr-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

efi_loader: export root node handle

This is a preparatory patch.
The root node handle will be used as a dummy parent handle when invoking
an EFI image from bootefi/bootmgr command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

Rebased.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f1465c15 11-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: simplify protocol installation

By using InstallMultipleProtocolInterfaces() the coding for installing
protocol interfaces on the root node can be simplified.

Suggested-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 8ec7d5d3 07-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: assign HII protocols to root node

We should not install the HII protocols on every loaded image. It is
sufficient to install them once on the root node.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 4e6b5d65 20-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: create root node

Currently we assign a lot of protocols to loaded images though
these protocols are not related to them. Instead they should be
installed on a separate handle. Via the device path it is the
parent to the devices like the network adapter.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 33c37d97 28-Dec-2019 Sughosh Ganu <sughosh.ganu@linaro.org>

efi_rng_protocol: Install the efi_rng_protocol on the root node

Install the EFI_RNG_PROTOCOL implementation for it's subsequent use by
the kernel for features like kaslr.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# b1b782d3 16-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: implement deprecated Unicode collation protocol

In EFI 1.10 a version of the Unicode collation protocol using ISO 639-2
language codes existed. This protocol is not part of the UEFI specification
any longer. Unfortunately it is required to run the UEFI Self Certification
Test (SCT) II, version 2.6, 2017. So we implement it here for the sole
purpose of running the SCT. It can be removed once a compliant SCT is
available.

The configuration option defaults to no.

Signed-off-by: Rob Clark <robdclark@gmail.com>

Most of Rob's original patch is already merged. Only the deprecated
protocol is missing. Rebase it and make it configurable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 95ab3816 15-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename Unicode collation protocol 2 variables

Rename variables to make it clear they refer to the Unicode collation
protocol identified by the EFI_UNICODE_PROTOCOL2_GUID.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 33499735 08-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make Unicode collation protocol customizable

The Unicode collation protocol is not needed for EBBR compliance. So let's
make it a customizable option.

The Unicode capitalization table is only needed by this protocol. So let it
depend on the Unicode collation protocol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 84a918e8 05-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: LoadImage() check parent image

If the parent image handle does not refer to a loaded image return
EFI_INVALID_PARAMETER.
(UEFI SCT II 2017: 3.4.1 LoadImage() - 5.1.4.1.1)

Mark our root node as a loaded image to avoid an error when using it as
parent image.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# a2a4bc3b 15-Apr-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

efi_loader: export root node handle

This is a preparatory patch.
The root node handle will be used as a dummy parent handle when invoking
an EFI image from bootefi/bootmgr command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

Rebased.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f1465c15 11-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: simplify protocol installation

By using InstallMultipleProtocolInterfaces() the coding for installing
protocol interfaces on the root node can be simplified.

Suggested-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 8ec7d5d3 07-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: assign HII protocols to root node

We should not install the HII protocols on every loaded image. It is
sufficient to install them once on the root node.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 4e6b5d65 20-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: create root node

Currently we assign a lot of protocols to loaded images though
these protocols are not related to them. Instead they should be
installed on a separate handle. Via the device path it is the
parent to the devices like the network adapter.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# b1b782d3 16-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: implement deprecated Unicode collation protocol

In EFI 1.10 a version of the Unicode collation protocol using ISO 639-2
language codes existed. This protocol is not part of the UEFI specification
any longer. Unfortunately it is required to run the UEFI Self Certification
Test (SCT) II, version 2.6, 2017. So we implement it here for the sole
purpose of running the SCT. It can be removed once a compliant SCT is
available.

The configuration option defaults to no.

Signed-off-by: Rob Clark <robdclark@gmail.com>

Most of Rob's original patch is already merged. Only the deprecated
protocol is missing. Rebase it and make it configurable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 95ab3816 15-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename Unicode collation protocol 2 variables

Rename variables to make it clear they refer to the Unicode collation
protocol identified by the EFI_UNICODE_PROTOCOL2_GUID.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 33499735 08-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make Unicode collation protocol customizable

The Unicode collation protocol is not needed for EBBR compliance. So let's
make it a customizable option.

The Unicode capitalization table is only needed by this protocol. So let it
depend on the Unicode collation protocol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 84a918e8 05-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: LoadImage() check parent image

If the parent image handle does not refer to a loaded image return
EFI_INVALID_PARAMETER.
(UEFI SCT II 2017: 3.4.1 LoadImage() - 5.1.4.1.1)

Mark our root node as a loaded image to avoid an error when using it as
parent image.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# a2a4bc3b 15-Apr-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

efi_loader: export root node handle

This is a preparatory patch.
The root node handle will be used as a dummy parent handle when invoking
an EFI image from bootefi/bootmgr command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

Rebased.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f1465c15 11-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: simplify protocol installation

By using InstallMultipleProtocolInterfaces() the coding for installing
protocol interfaces on the root node can be simplified.

Suggested-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 8ec7d5d3 07-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: assign HII protocols to root node

We should not install the HII protocols on every loaded image. It is
sufficient to install them once on the root node.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 4e6b5d65 20-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: create root node

Currently we assign a lot of protocols to loaded images though
these protocols are not related to them. Instead they should be
installed on a separate handle. Via the device path it is the
parent to the devices like the network adapter.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 4e6b5d65 20-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: create root node

Currently we assign a lot of protocols to loaded images though
these protocols are not related to them. Instead they should be
installed on a separate handle. Via the device path it is the
parent to the devices like the network adapter.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>