From patchwork Thu Oct 2 15:45:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 480 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=1759420006; bh=XFcWmtuR/MTjKo/XjTMuFwXGTezi/Je66Qmd9ty6eAE=; 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=sUuGc1TCT2cD5d2igSypu+NMUlL0B3j4OJ7IZF88tmzRMzb9NFr2J/3PCC6j7zsi3 LJudx/a7pmfCn2I3jamLNv1J+6c9lp7vdzt+zS1fXB3dJNgl1LyzKW00rm/JFQj/Ug JMfSY+MHAdFZko1kBDaUJsULOgqDOagwYUEPGR0lX8IDZ9h+x8W9QChAMXldV+LmbF 8d6X5im5P419dPdlSETn3tAaFQoCd6Nq01ylteJXMJ/5CpwKQ5fTNzkd8sah6LCqL1 afeOvk4PSUbIH+WnepcynMzaww30KZib9q3Y5BhR/bZMJWs1mpEg3a7w1k9Z1pVjLg See6pVYGhQHlQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F2B1667EC6 for ; Thu, 2 Oct 2025 09:46:46 -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 0yfjjLhW5z-c for ; Thu, 2 Oct 2025 09:46:46 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759420004; bh=XFcWmtuR/MTjKo/XjTMuFwXGTezi/Je66Qmd9ty6eAE=; 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=XiX02vYJ1HiueT7Frjl/37jPUj9sEZznZlIk3FoyvzyttwqXeC0wGrx2UUh9A49k8 6sIsvIPZgTvjBvpdGWDitNt/PECgCbMm37v4iTrvJaxozUMpBu4jfuZWw0YOADfrq6 JKSNaVWsNznFi5jNpYR4XG26fNtElJPC35axuOfnUxqdHeoDmVaZTq1zQZfa9wi8m3 zeMA+nl4dsbWm6lQ7lZnFdp4mPGQvI0+y1/v23k9+4Vq2CvOaudUI9DJcDslnLKhTZ syYik1AxGh8iUSfXcd1OgL8XqQQrD3EZ1HeyC/qhYFYsIzRTagNRNivC3lLzNapSpB SISn0ymr84Nuw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EF18267F28 for ; Thu, 2 Oct 2025 09:46:44 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759420003; bh=6lOOEbjbW5mb77XHGBtsik+x4mzTdiiqBaIvmVniQH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pz+M5kj97ZJMycckvWekV+MIacLfkbW/O5z2DuQrZgomOEyHjSFJ/K58z2BCS2Skx NZFe1AW0ZfEcsAhGleoj+UHzlxHLWEa+thLdCmTquwuKZlkzk7iy9ehtr2J0jin9Id V6P70YdECIvzcd6lo0H0ZDMR+QRUGCVGltb5FKlufKw2xaJs00z3zJJ1xFO9eiDqIu C1HBylHBpfuzOYV3/kJUnc/AXUyRMC6o9nCsP9paFExVTmuN4oWEHh+N2Mv9syIvqP kBeykuaxVKszs0xTqQS1WAbxki8VrNRsel91wsYgSDsfmLt03mPYZmNdUdZLxmNxKw 1oqQu5VTyPZ5g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 07A9667E4D; Thu, 2 Oct 2025 09:46:43 -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 6dJoz9w8qmPu; Thu, 2 Oct 2025 09:46:42 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759420001; bh=Y0eyfZyr492i7qaULrS1E6cMqG0zikADEtsLtBBFdwk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PDsG/0aAFmsjHc3hD5GoY3ezT539HOifmrHLEg+8Ff85bwDe2IWbvti911o/kJ5DH BU5pgveBLbHHPmQ67mQ8I+LuhBGIuVu7Y8AGMVW0FJCXpOSgNsb2vxhshI4Ew7pk5E +5xwb59TMLPW+T1Ia7L9RA2TgQPn/wu9NoV9XiHPfjfwL7pzcNV9F1by8X5uP+Pij6 ilPEkJ2skxhSjNgA88cHHDRnX1rW4vxJWILY+nEfpnP1GrPTfOcP5VXHMfR2s1ypds tDFaT0yalQVeta49zGV7Ma/qhZUQNVf7m7bsKIjM6JC7p5hKb2OQmSQWsFw2nF+1d2 meTquIYptqoRw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3F2CB67D8D; Thu, 2 Oct 2025 09:46:41 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 2 Oct 2025 09:45:48 -0600 Message-ID: <20251002154554.4129220-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251002154554.4129220-1-sjg@u-boot.org> References: <20251002154554.4129220-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NL45AFFQD5GR5LZPGMQLAB3TETUJIVPV X-Message-ID-Hash: NL45AFFQD5GR5LZPGMQLAB3TETUJIVPV 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 v2 8/9] 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 --- (no changes since v1) 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.