All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] efi_loader: make protocols configurable
@ 2021-01-16  8:52 Heinrich Schuchardt
  2021-01-16  8:52 ` [PATCH 1/3] efi_loader: fixup protocol, avoid forward declaration Heinrich Schuchardt
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Heinrich Schuchardt @ 2021-01-16  8:52 UTC (permalink / raw
  To: u-boot

On systems that are very tight on memory we may only want to keep those
UEFI features that are required to start Linux or GRUB.

Make the EFI_DT_FIXUP_PROTOCOL and the EFI_DEVICE_PATH_UTILITIES_PROTOCOL
configurable.

Heinrich Schuchardt (3):
  efi_loader: fixup protocol, avoid forward declaration
  efi_loader: make EFI_DT_FIXUP_PROTOCOL configurable
  efi_loader: EFI_DEVICE_PATH_UTILITIES_PROTOCOL configurable

 lib/efi_loader/Kconfig         | 15 +++++++++++++++
 lib/efi_loader/Makefile        |  2 +-
 lib/efi_loader/efi_dt_fixup.c  | 34 ++++++++++++++++++++--------------
 lib/efi_loader/efi_root_node.c |  4 +++-
 4 files changed, 39 insertions(+), 16 deletions(-)

--
2.29.2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] efi_loader: fixup protocol, avoid forward declaration
  2021-01-16  8:52 [PATCH 0/3] efi_loader: make protocols configurable Heinrich Schuchardt
@ 2021-01-16  8:52 ` Heinrich Schuchardt
  2021-01-16  8:52 ` [PATCH 2/3] efi_loader: make EFI_DT_FIXUP_PROTOCOL configurable Heinrich Schuchardt
  2021-01-16  8:52 ` [PATCH 3/3] efi_loader: EFI_DEVICE_PATH_UTILITIES_PROTOCOL configurable Heinrich Schuchardt
  2 siblings, 0 replies; 4+ messages in thread
From: Heinrich Schuchardt @ 2021-01-16  8:52 UTC (permalink / raw
  To: u-boot

Avoid a forward declaration.

Add a missing function description.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 lib/efi_loader/efi_dt_fixup.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/lib/efi_loader/efi_dt_fixup.c b/lib/efi_loader/efi_dt_fixup.c
index 5f0ae5c338..c2f2daef33 100644
--- a/lib/efi_loader/efi_dt_fixup.c
+++ b/lib/efi_loader/efi_dt_fixup.c
@@ -10,16 +10,6 @@
 #include <efi_loader.h>
 #include <mapmem.h>

-static efi_status_t EFIAPI efi_dt_fixup(struct efi_dt_fixup_protocol *this,
-					void *dtb,
-					efi_uintn_t *buffer_size,
-					u32 flags);
-
-struct efi_dt_fixup_protocol efi_dt_fixup_prot = {
-	.revision = EFI_DT_FIXUP_PROTOCOL_REVISION,
-	.fixup = efi_dt_fixup
-};
-
 const efi_guid_t efi_guid_dt_fixup_protocol = EFI_DT_FIXUP_PROTOCOL_GUID;

 /**
@@ -102,6 +92,18 @@ void efi_carve_out_dt_rsv(void *fdt)
 	}
 }

+/**
+ * efi_dt_fixup() - fix up device tree
+ *
+ * This function implements the Fixup() service of the
+ * EFI Device Tree Fixup Protocol.
+ *
+ * @this:		instance of the protocol
+ * @dtb:		device tree provided by caller
+ * @buffer_size:	size of buffer for the device tree including free space
+ * @flags:		bit field designating action to be performed
+ * Return:		status code
+ */
 static efi_status_t EFIAPI efi_dt_fixup(struct efi_dt_fixup_protocol *this,
 					void *dtb,
 					efi_uintn_t *buffer_size,
@@ -158,3 +160,8 @@ static efi_status_t EFIAPI efi_dt_fixup(struct efi_dt_fixup_protocol *this,
 out:
 	return EFI_EXIT(ret);
 }
+
+struct efi_dt_fixup_protocol efi_dt_fixup_prot = {
+	.revision = EFI_DT_FIXUP_PROTOCOL_REVISION,
+	.fixup = efi_dt_fixup
+};
--
2.29.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] efi_loader: make EFI_DT_FIXUP_PROTOCOL configurable
  2021-01-16  8:52 [PATCH 0/3] efi_loader: make protocols configurable Heinrich Schuchardt
  2021-01-16  8:52 ` [PATCH 1/3] efi_loader: fixup protocol, avoid forward declaration Heinrich Schuchardt
@ 2021-01-16  8:52 ` Heinrich Schuchardt
  2021-01-16  8:52 ` [PATCH 3/3] efi_loader: EFI_DEVICE_PATH_UTILITIES_PROTOCOL configurable Heinrich Schuchardt
  2 siblings, 0 replies; 4+ messages in thread
From: Heinrich Schuchardt @ 2021-01-16  8:52 UTC (permalink / raw
  To: u-boot

Allow EFI_DT_FIXUP_PROTOCOL to be disabled via configuration.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 lib/efi_loader/Kconfig         | 8 ++++++++
 lib/efi_loader/efi_dt_fixup.c  | 7 +++----
 lib/efi_loader/efi_root_node.c | 2 +-
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
index 106f789b4d..227cfa5ca4 100644
--- a/lib/efi_loader/Kconfig
+++ b/lib/efi_loader/Kconfig
@@ -208,6 +208,14 @@ config EFI_DEVICE_PATH_TO_TEXT
 	  The device path to text protocol converts device nodes and paths to
 	  human readable strings.

+config EFI_DT_FIXUP
+	bool "Device tree fixup protocol"
+	depends on !GENERATE_ACPI_TABLE
+	default y
+	help
+	  The EFI device-tree fix-up protocol provides a function to let the
+	  firmware apply fix-ups. This may be used by boot loaders.
+
 config EFI_LOADER_HII
 	bool "HII protocols"
 	default y
diff --git a/lib/efi_loader/efi_dt_fixup.c b/lib/efi_loader/efi_dt_fixup.c
index c2f2daef33..3850ab3b0f 100644
--- a/lib/efi_loader/efi_dt_fixup.c
+++ b/lib/efi_loader/efi_dt_fixup.c
@@ -104,10 +104,9 @@ void efi_carve_out_dt_rsv(void *fdt)
  * @flags:		bit field designating action to be performed
  * Return:		status code
  */
-static efi_status_t EFIAPI efi_dt_fixup(struct efi_dt_fixup_protocol *this,
-					void *dtb,
-					efi_uintn_t *buffer_size,
-					u32 flags)
+static efi_status_t __maybe_unused EFIAPI
+efi_dt_fixup(struct efi_dt_fixup_protocol *this, void *dtb,
+	     efi_uintn_t *buffer_size, u32 flags)
 {
 	efi_status_t ret;
 	size_t required_size;
diff --git a/lib/efi_loader/efi_root_node.c b/lib/efi_loader/efi_root_node.c
index b411a12cf6..8383fce943 100644
--- a/lib/efi_loader/efi_root_node.c
+++ b/lib/efi_loader/efi_root_node.c
@@ -61,7 +61,7 @@ efi_status_t efi_root_node_register(void)
 			 /* Device path utilities protocol */
 			 &efi_guid_device_path_utilities_protocol,
 			 (void *)&efi_device_path_utilities,
-#if !CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE)
+#ifdef CONFIG_EFI_DT_FIXUP
 			 /* Device-tree fix-up protocol */
 			 &efi_guid_dt_fixup_protocol,
 			 (void *)&efi_dt_fixup_prot,
--
2.29.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] efi_loader: EFI_DEVICE_PATH_UTILITIES_PROTOCOL configurable
  2021-01-16  8:52 [PATCH 0/3] efi_loader: make protocols configurable Heinrich Schuchardt
  2021-01-16  8:52 ` [PATCH 1/3] efi_loader: fixup protocol, avoid forward declaration Heinrich Schuchardt
  2021-01-16  8:52 ` [PATCH 2/3] efi_loader: make EFI_DT_FIXUP_PROTOCOL configurable Heinrich Schuchardt
@ 2021-01-16  8:52 ` Heinrich Schuchardt
  2 siblings, 0 replies; 4+ messages in thread
From: Heinrich Schuchardt @ 2021-01-16  8:52 UTC (permalink / raw
  To: u-boot

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>
---
 lib/efi_loader/Kconfig         | 7 +++++++
 lib/efi_loader/Makefile        | 2 +-
 lib/efi_loader/efi_root_node.c | 2 ++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
index 227cfa5ca4..038cdc9b6e 100644
--- a/lib/efi_loader/Kconfig
+++ b/lib/efi_loader/Kconfig
@@ -208,6 +208,13 @@ config EFI_DEVICE_PATH_TO_TEXT
 	  The device path to text protocol converts device nodes and paths to
 	  human readable strings.

+config EFI_DEVICE_PATH_UTIL
+	bool "Device path utilities protocol"
+	default y
+	help
+	  The device path utilities protocol creates and manipulates device
+	  paths and device nodes. It is required to run the EFI Shell.
+
 config EFI_DT_FIXUP
 	bool "Device tree fixup protocol"
 	depends on !GENERATE_ACPI_TABLE
diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
index a6355d240a..10b42e8847 100644
--- a/lib/efi_loader/Makefile
+++ b/lib/efi_loader/Makefile
@@ -28,7 +28,7 @@ obj-$(CONFIG_EFI_CAPSULE_FIRMWARE) += efi_firmware.o
 obj-y += efi_console.o
 obj-y += efi_device_path.o
 obj-$(CONFIG_EFI_DEVICE_PATH_TO_TEXT) += efi_device_path_to_text.o
-obj-y += efi_device_path_utilities.o
+obj-$(CONFIG_EFI_DEVICE_PATH_UTIL) += efi_device_path_utilities.o
 ifeq ($(CONFIG_GENERATE_ACPI_TABLE),)
 obj-y += efi_dt_fixup.o
 endif
diff --git a/lib/efi_loader/efi_root_node.c b/lib/efi_loader/efi_root_node.c
index 8383fce943..4d59890a7e 100644
--- a/lib/efi_loader/efi_root_node.c
+++ b/lib/efi_loader/efi_root_node.c
@@ -58,9 +58,11 @@ efi_status_t efi_root_node_register(void)
 			 &efi_guid_device_path_to_text_protocol,
 			 (void *)&efi_device_path_to_text,
 #endif
+#ifdef EFI_DEVICE_PATH_UTIL
 			 /* Device path utilities protocol */
 			 &efi_guid_device_path_utilities_protocol,
 			 (void *)&efi_device_path_utilities,
+#endif
 #ifdef CONFIG_EFI_DT_FIXUP
 			 /* Device-tree fix-up protocol */
 			 &efi_guid_dt_fixup_protocol,
--
2.29.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-16  8:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-16  8:52 [PATCH 0/3] efi_loader: make protocols configurable Heinrich Schuchardt
2021-01-16  8:52 ` [PATCH 1/3] efi_loader: fixup protocol, avoid forward declaration Heinrich Schuchardt
2021-01-16  8:52 ` [PATCH 2/3] efi_loader: make EFI_DT_FIXUP_PROTOCOL configurable Heinrich Schuchardt
2021-01-16  8:52 ` [PATCH 3/3] efi_loader: EFI_DEVICE_PATH_UTILITIES_PROTOCOL configurable Heinrich Schuchardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.