u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Bin Meng <bmeng.cn@gmail.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Simon Glass <sjg@chromium.org>
Subject: [PATCH 25/38] x86: Allow video-BIOS code to be built for SPL
Date: Fri, 31 Mar 2023 10:32:14 +1300	[thread overview]
Message-ID: <20230331103047.25.I5d7962e5f9d12c176625cd77882e45ababdb590a@changeid> (raw)
In-Reply-To: <20230330213227.2142353-1-sjg@chromium.org>

With qemu-x86_64 we need to run the video BIOS while in 32-bit mode, i.e.
SPL. Add a Kconfig option for this, adjust the Makefile rules and use
CONFIG_IS_ENABLED() where needed.

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

 arch/x86/lib/Makefile |  7 ++++---
 arch/x86/lib/bios.c   |  2 +-
 drivers/pci/pci_rom.c | 28 ++++++++++++++--------------
 3 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index b0612ae6dd5f..90a7618ecfde 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -4,16 +4,17 @@
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 
 obj-y	+= bdinfo.o
-ifndef CONFIG_X86_64
-ifndef CONFIG_TPL_BUILD
+
+ifndef CONFIG_$(SPL_TPL_)X86_64
 obj-y += bios.o
 obj-y += bios_asm.o
 obj-y += bios_interrupts.o
 endif
-endif
+
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_X86_32BIT_INIT) += string.o
 endif
+
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 endif
diff --git a/arch/x86/lib/bios.c b/arch/x86/lib/bios.c
index b28db31308f0..e2b422bec1ed 100644
--- a/arch/x86/lib/bios.c
+++ b/arch/x86/lib/bios.c
@@ -23,7 +23,7 @@
 static int (*int_handler[256])(void);
 
 /* to have a common register file for interrupt handlers */
-#ifndef CONFIG_BIOSEMU
+#if !CONFIG_IS_ENABLED(BIOSEMU)
 X86EMU_sysEnv _X86EMU_env;
 #endif
 
diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c
index dab0f1979068..2d9a2a899ef7 100644
--- a/drivers/pci/pci_rom.c
+++ b/drivers/pci/pci_rom.c
@@ -344,20 +344,20 @@ int dm_pci_run_vga_bios(struct udevice *dev, int (*int15_handler)(void),
 	}
 
 	if (emulate) {
-#ifdef CONFIG_BIOSEMU
-		BE_VGAInfo *info;
-
-		log_debug("Running video BIOS with emulator...");
-		ret = biosemu_setup(dev, &info);
-		if (ret)
-			goto err;
-		biosemu_set_interrupt_handler(0x15, int15_handler);
-		ret = biosemu_run(dev, (uchar *)ram, 1 << 16, info,
-				  true, vesa_mode, &mode_info);
-		log_debug("done\n");
-		if (ret)
-			goto err;
-#endif
+		if (CONFIG_IS_ENABLED(BIOSEMU)) {
+			BE_VGAInfo *info;
+
+			log_debug("Running video BIOS with emulator...");
+			ret = biosemu_setup(dev, &info);
+			if (ret)
+				goto err;
+			biosemu_set_interrupt_handler(0x15, int15_handler);
+			ret = biosemu_run(dev, (uchar *)ram, 1 << 16, info,
+					  true, vesa_mode, &mode_info);
+			log_debug("done\n");
+			if (ret)
+				goto err;
+		}
 	} else {
 #if defined(CONFIG_X86) && (CONFIG_IS_ENABLED(X86_32BIT_INIT) || CONFIG_TPL)
 		log_debug("Running video BIOS...");
-- 
2.40.0.348.gf938b09366-goog


  parent reply	other threads:[~2023-03-30 21:38 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 21:31 [PATCH 00/38] x86: Use qemu-x86_64 to boot EFI installers Simon Glass
2023-03-30 21:31 ` [PATCH 01/38] x86: Tidy up availability of string functions Simon Glass
2023-03-30 21:31 ` [PATCH 02/38] x86: Allow listing MTRRs in SPL Simon Glass
2023-03-30 22:10   ` Heinrich Schuchardt
2023-04-20 16:30     ` Simon Glass
2023-03-30 21:31 ` [PATCH 03/38] bios_emulator: Add Kconfig and adjust Makefile for SPL Simon Glass
2023-03-30 21:31 ` [PATCH 04/38] bios_emulator: Drop VIDEO_IO_OFFSET Simon Glass
2023-03-30 21:31 ` [PATCH 05/38] x86: Tidy up EFI code in interrupt_init() Simon Glass
2023-03-30 21:31 ` [PATCH 06/38] x86: Set high bits of the mtrr base registrer Simon Glass
2023-03-30 21:31 ` [PATCH 07/38] x86: Add a comment for board_init_f_r_trampoline() Simon Glass
2023-03-30 22:16   ` Heinrich Schuchardt
2023-03-30 21:31 ` [PATCH 08/38] x86: Show the CPU physical address size with bdinfo Simon Glass
2023-03-30 21:31 ` [PATCH 09/38] x86: Correct get_sp() implementation for 64-bit Simon Glass
2023-03-30 21:31 ` [PATCH 10/38] x86: Show an error when a BINS exception occurs Simon Glass
2023-03-30 22:23   ` Heinrich Schuchardt
2023-03-30 21:32 ` [PATCH 11/38] acpi: Add a comment to set the acpi tables Simon Glass
2023-03-30 21:32 ` [PATCH 12/38] bdinfo: Show the RAM top and approximate stack pointer Simon Glass
2023-03-30 21:32 ` [PATCH 13/38] part: Allow setting the partition-table type Simon Glass
2023-03-30 22:27   ` Heinrich Schuchardt
2023-03-30 23:49     ` Simon Glass
2023-03-31  0:12       ` Heinrich Schuchardt
2023-03-31  1:16         ` Simon Glass
2023-03-30 21:32 ` [PATCH 14/38] qfw: Show the file address if available Simon Glass
2023-03-30 22:31   ` Heinrich Schuchardt
2023-03-30 23:48     ` Simon Glass
2023-03-31  9:44     ` Mark Kettenis
2023-03-30 21:32 ` [PATCH 15/38] log: Tidy up an ambiguous comment Simon Glass
2023-03-30 21:32 ` [PATCH 16/38] video: Allow building video drivers for SPL Simon Glass
2023-03-30 21:32 ` [PATCH 17/38] qfw: Set the address of the ACPI tables Simon Glass
2023-03-30 21:32 ` [PATCH 18/38] efi: Show all known UUIDs with CONFIG_CMD_EFIDEBUG Simon Glass
2023-03-30 22:38   ` Heinrich Schuchardt
2023-03-30 23:48     ` Simon Glass
2023-03-31  0:27       ` Heinrich Schuchardt
2023-03-31  1:16         ` Simon Glass
2023-03-31  6:46           ` Heinrich Schuchardt
2023-04-01  6:31             ` Simon Glass
2023-03-30 21:32 ` [PATCH 19/38] x86: Improve the trampoline in 64-bit mode Simon Glass
2023-03-30 21:32 ` [PATCH 20/38] Show the malloc base with the bdinfo command Simon Glass
2023-03-30 21:32 ` [PATCH 21/38] nvme: Provide more useful debugging messages Simon Glass
2023-03-30 21:32 ` [PATCH 22/38] pci: Support autoconfig in SPL Simon Glass
2023-03-30 21:32 ` [PATCH 23/38] pci: Allow the video BIOS to work in SPL with QEMU Simon Glass
2023-03-30 21:32 ` [PATCH 24/38] pci: Tidy up logging and reporting for video BIOS Simon Glass
2023-03-30 21:32 ` Simon Glass [this message]
2023-03-30 21:32 ` [PATCH 26/38] x86: Pass video settings from SPL to U-Boot proper Simon Glass
2023-03-30 21:32 ` [PATCH 27/38] x86: Init video in SPL if enabled Simon Glass
2023-03-30 21:32 ` [PATCH 28/38] pci: Adjust video BIOS debugging to be SPL-friendly Simon Glass
2023-03-30 21:32 ` [PATCH 29/38] pci: Mask the ROM address in case it is already enabled Simon Glass
2023-03-30 21:32 ` [PATCH 30/38] x86: Enable display for QEMU 64-bit Simon Glass
2023-03-30 21:32 ` [PATCH 31/38] x86: Allow logging to be used in SPL reliably Simon Glass
2023-03-30 21:32 ` [PATCH 32/38] fs: fat: Shrink the size of a few strings Simon Glass
2023-03-30 22:48   ` Heinrich Schuchardt
2023-03-30 23:49     ` Simon Glass
2023-03-31  0:00       ` Heinrich Schuchardt
2023-03-31  1:16         ` Simon Glass
2023-03-31  6:51           ` Heinrich Schuchardt
2023-03-31  7:33             ` Ilias Apalodimas
2023-03-31 10:19               ` Heinrich Schuchardt
2023-03-30 21:32 ` [PATCH 33/38] fs: fat: Support reading from a larger block size Simon Glass
2023-03-30 22:55   ` Heinrich Schuchardt
2023-03-31 10:23     ` Heinrich Schuchardt
2023-04-20 16:30       ` Simon Glass
2023-03-30 21:32 ` [PATCH 34/38] x86: Enable useful options for qemu-86_64 Simon Glass
2023-03-30 21:32 ` [PATCH 35/38] x86: Record the start and end of the tables Simon Glass
2023-03-30 21:32 ` [PATCH 36/38] sandbox: Correct header order in board file Simon Glass
2023-03-30 21:32 ` [PATCH 37/38] sandbox: Install ACPI tables on startup Simon Glass
2023-03-30 21:32 ` [PATCH 38/38] efi: Use the installed ACPI tables Simon Glass
2023-03-30 21:53   ` Heinrich Schuchardt
2023-03-30 23:48     ` Simon Glass
2023-04-19  1:45 ` [PATCH 00/38] x86: Use qemu-x86_64 to boot EFI installers Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230331103047.25.I5d7962e5f9d12c176625cd77882e45ababdb590a@changeid \
    --to=sjg@chromium.org \
    --cc=bmeng.cn@gmail.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).