mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] efi: loader: gop: install device path to make GOP discoverable
@ 2026-05-03  8:24 Ahmad Fatoum
  2026-05-07 11:20 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2026-05-03  8:24 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The EFI GOP protocol handle was missing a device path, which meant
barebox running as EFI payload couldn't discover it during handle
enumeration. Use efi_install_multiple_protocol_interfaces() to install
both the device path and GOP protocol together.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 efi/loader/protocols/gop.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/efi/loader/protocols/gop.c b/efi/loader/protocols/gop.c
index 5bceb3f68f0f..9ada8a2da290 100644
--- a/efi/loader/protocols/gop.c
+++ b/efi/loader/protocols/gop.c
@@ -11,6 +11,7 @@
 #include <efi/guid.h>
 #include <efi/loader.h>
 #include <efi/error.h>
+#include <efi/loader/devicepath.h>
 #include <efi/loader/object.h>
 #include <efi/loader/trace.h>
 #include <efi/protocol/gop.h>
@@ -481,6 +482,8 @@ static char *fbdev = "/dev/fb0";
 static efi_status_t efi_gop_register(void *data)
 {
 	struct efi_gop_obj *gopobj;
+	struct efi_device_path *dp;
+	efi_handle_t handle;
 	u32 col, row;
 	efi_status_t ret;
 	struct fb_info *fbi;
@@ -513,14 +516,20 @@ static efi_status_t efi_gop_register(void *data)
 		return EFI_OUT_OF_RESOURCES;
 	}
 
-	/* Hook up to the device list */
+	dp = efi_dp_from_cdev(&fbi->cdev, true);
+	if (!dp)
+		return EFI_OUT_OF_RESOURCES;
+
 	efi_add_handle(&gopobj->header);
 
-	/* Fill in object data */
-	ret = efi_add_protocol(&gopobj->header, &efi_gop_guid,
-			       &gopobj->ops);
+	handle = &gopobj->header;
+
+	ret = efi_install_multiple_protocol_interfaces(&handle,
+			&efi_device_path_protocol_guid, dp,
+			&efi_gop_guid, &gopobj->ops,
+			NULL);
 	if (ret != EFI_SUCCESS) {
-		pr_err("Failure adding GOP protocol\n");
+		pr_err("Failure installing GOP protocol\n");
 		return ret;
 	}
 	gopobj->ops.query_mode = gop_query_mode;
-- 
2.47.3




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

* Re: [PATCH] efi: loader: gop: install device path to make GOP discoverable
  2026-05-03  8:24 [PATCH] efi: loader: gop: install device path to make GOP discoverable Ahmad Fatoum
@ 2026-05-07 11:20 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2026-05-07 11:20 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Sun, 03 May 2026 10:24:05 +0200, Ahmad Fatoum wrote:
> The EFI GOP protocol handle was missing a device path, which meant
> barebox running as EFI payload couldn't discover it during handle
> enumeration. Use efi_install_multiple_protocol_interfaces() to install
> both the device path and GOP protocol together.
> 
> 

Applied, thanks!

[1/1] efi: loader: gop: install device path to make GOP discoverable
      https://git.pengutronix.de/cgit/barebox/commit/?id=f67553aae7ee (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

end of thread, other threads:[~2026-05-07 11:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-03  8:24 [PATCH] efi: loader: gop: install device path to make GOP discoverable Ahmad Fatoum
2026-05-07 11:20 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox