From patchwork Wed Oct 1 23:05:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 471 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359975; bh=QvqK0D1odPfXDcotQukpHRiyHBr0R/0fAVG55jWZUPY=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=hESHjwPhfa4xupqppQqt3L1i/aHXXFeidItzRvQygeYLdlAgNPlmdzlvfl5UgeHQx 5KZmpONhjx0vawUhot+A95jnWrw2R9JiU4UO3Uf7QSSF/7rxqGASRw6lcpKviZeExi X8gaTkOQf3ts1lKd+8hoQBABMkf6UPRkyQ+SRx9hor2d5bq34WZii22MMWUcYJ7xy+ 80BuQrfad2JY0NKFBiYlgG7+ctQ7i17ZlAoNtmDWW3LSud6RYhSnbSwF8N+SpTqih/ zXkFBXsLem6DhI44ZLhX8m0HrCBqsfG2asCBZsS0YrHrZCO5NT8olOCxeU6M8BwZBb JzhEABJjQKZCA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 62B6567EE9 for ; Wed, 1 Oct 2025 17:06:15 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 9pW6RiE2EU0O for ; Wed, 1 Oct 2025 17:06:15 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359975; bh=QvqK0D1odPfXDcotQukpHRiyHBr0R/0fAVG55jWZUPY=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=hESHjwPhfa4xupqppQqt3L1i/aHXXFeidItzRvQygeYLdlAgNPlmdzlvfl5UgeHQx 5KZmpONhjx0vawUhot+A95jnWrw2R9JiU4UO3Uf7QSSF/7rxqGASRw6lcpKviZeExi X8gaTkOQf3ts1lKd+8hoQBABMkf6UPRkyQ+SRx9hor2d5bq34WZii22MMWUcYJ7xy+ 80BuQrfad2JY0NKFBiYlgG7+ctQ7i17ZlAoNtmDWW3LSud6RYhSnbSwF8N+SpTqih/ zXkFBXsLem6DhI44ZLhX8m0HrCBqsfG2asCBZsS0YrHrZCO5NT8olOCxeU6M8BwZBb JzhEABJjQKZCA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4D9CB67E42 for ; Wed, 1 Oct 2025 17:06:15 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359973; bh=NuQv7EKBaDuLMyFNvuKZN+iBdbH+Hsu4C1T5fBzUMbI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u0OWLIKLTtg0mAC5deGY05fEBPRjedjtud+yUag+9lWpJn1zPaNfWUK6c45yKJ/h0 ClhJaUd3uYuxCEWQPRQv6h+dyZOxojou2VhWmcpe+5DAogip6sNhWeadtc2zRTktdD txwUSPnOOx1BSE9LkXFhuMXJIjthUva+DMTINBu9kSkAu1nTIKbfRpm7oBI4L0UlkV QHoBhTGCTpqouNqmF1kMDnkpAJ0aSsUm/upeQLGGC9X9miy7yiXGAd/MxkS9ixXovJ MC9AcTtCQootiUb1icggnob5lHrH2SvHoK01xWW0RlPalA/mkIERybiXLlA+ppzmiy hhUIfvNLjeUlg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4AE6867D8D; Wed, 1 Oct 2025 17:06:13 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id xApTaNSsP-fy; Wed, 1 Oct 2025 17:06:13 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359967; bh=ovdIgoFTPeMLjmVzP4FKSS0F93bHq2nooUg6Ri43cq0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WUOkRQD4rZn7yXWGUcRGo5wcXwGqQylRal8R4iLSm7qHd5bJINzYDcgeSzCsjWP/f dD+7JWXa7DTAfzYI5mpDOvfz8BMBmdakqt8XVSZON0AFxqK35m4QvjvuylzScarcxv Ff7MQeoWOAdOoIM+UgNf3St/qq69J2yltjW/ksnBGbN+dIrC+AjrEajxK9aGOQrGp2 nmkVPwYjHhQKR9wEu4hJGXNY+bWwU0rBCwkhxeEfMInB1/+2YFB93Zumrrc/X4h/TT sbVrRszCMt5EydJizECTgOViWslxSyD0hIDyQcP6CA9rrNilywOSDeWADh3OLIjxO6 nf6nc0lBioMqQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4950B67E44; Wed, 1 Oct 2025 17:06:07 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 1 Oct 2025 17:05:31 -0600 Message-ID: <20251001230537.3324058-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251001230537.3324058-1-sjg@u-boot.org> References: <20251001230537.3324058-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: M6QPGHYSJC5DDRFFJIOHHB2KY5D57YH5 X-Message-ID-Hash: M6QPGHYSJC5DDRFFJIOHHB2KY5D57YH5 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 5/6] acpi: bgrt: Move the BGRT image into the images directory List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the BGRT image to use the same video_image linker-list approach as the other embedded image. Move it into the drivers/video/images directory and rename it to 'bgrt.bmp' since we know it is an image. Drop the old bgrt Makefile rule as it is no-longer needed. Co-developed-by: Claude Signed-off-by: Simon Glass --- drivers/video/images/Makefile | 4 ++++ .../video/images/bgrt.bmp | Bin lib/acpi/Makefile | 2 -- lib/acpi/acpi_extra.c | 22 ++++-------------- scripts/Makefile.lib | 18 -------------- 5 files changed, 8 insertions(+), 38 deletions(-) rename lib/acpi/bgrt_image.bmp => drivers/video/images/bgrt.bmp (100%) diff --git a/drivers/video/images/Makefile b/drivers/video/images/Makefile index d3aca2ee7f7..9b0d85cd2c8 100644 --- a/drivers/video/images/Makefile +++ b/drivers/video/images/Makefile @@ -3,3 +3,7 @@ # Copyright 2025 Simon Glass obj-$(CONFIG_VIDEO_LOGO) += u_boot.o + +ifdef CONFIG_$(PHASE_)GENERATE_ACPI_TABLE +obj-y += bgrt.o +endif diff --git a/lib/acpi/bgrt_image.bmp b/drivers/video/images/bgrt.bmp similarity index 100% rename from lib/acpi/bgrt_image.bmp rename to drivers/video/images/bgrt.bmp diff --git a/lib/acpi/Makefile b/lib/acpi/Makefile index a4850fcc108..4b9b1ef8029 100644 --- a/lib/acpi/Makefile +++ b/lib/acpi/Makefile @@ -12,8 +12,6 @@ obj-$(CONFIG_$(PHASE_)ACPIGEN) += acpi_table.o obj-y += acpi_extra.o obj-y += acpi_writer.o -obj-y += bgrt_image.o - # With QEMU the ACPI tables come from there, not from U-Boot ifndef CONFIG_QFW_ACPI obj-y += base.o diff --git a/lib/acpi/acpi_extra.c b/lib/acpi/acpi_extra.c index 7620f953add..709f64305b5 100644 --- a/lib/acpi/acpi_extra.c +++ b/lib/acpi/acpi_extra.c @@ -13,23 +13,6 @@ #include #include -#define BGRT_DECL(_name) \ - extern u8 __bgrt_ ## _name ## _begin[]; \ - extern u8 __bgrt_ ## _name ## _end[] - -#define BGRT_START(_name) __bgrt_ ## _name ## _begin -#define BGRT_END(_name) __bgrt_ ## _name ## _end - -BGRT_DECL(image); - -static void *bgrt_get_image(int *sizep) -{ - if (sizep) - *sizep = BGRT_END(image) - BGRT_START(image); - - return BGRT_START(image); -} - int acpi_write_bgrt(struct acpi_ctx *ctx) { struct udevice *dev; @@ -42,7 +25,10 @@ int acpi_write_bgrt(struct acpi_ctx *ctx) /* If video is available, use the screen size to centre the logo */ have_video = !uclass_first_device_err(UCLASS_VIDEO, &dev); - logo = bgrt_get_image(&size); + if (!IS_ENABLED(CONFIG_VIDEO)) + return -ENOENT; + + logo = video_image_get(bgrt, &size); /* If there's no logo data, there's nothing to report */ if (!logo) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index e812327b585..6a64760de5e 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -561,24 +561,6 @@ $(obj)/%.S: $(src)/%.bmp $(call cmd,S_image) endif -# Generate an assembly file to wrap the EFI 'Boot Graphics Resource Table' image -quiet_cmd_S_bgrt= BGRT $@ -# Modified for U-Boot -cmd_S_bgrt= \ -( \ - echo '.section .rodata.bgrt.init,"a"'; \ - echo '.balign 16'; \ - echo '.global __$(*F)_image_begin'; \ - echo '__$(*F)_image_begin:'; \ - echo '.incbin "$<" '; \ - echo '__$(*F)_image_end:'; \ - echo '.global __$(*F)_image_end'; \ - echo '.balign 16'; \ -) > $@ - -$(obj)/%_image.S: $(src)/%_image.bmp - $(call cmd,S_bgrt) - # EFI applications # A Makefile target *.efi is built as EFI application. # A Makefile target *_efi.S wraps *.efi as built-in EFI application.