u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] x86: Fixes and improvements for coreboot
@ 2023-08-17  1:51 Simon Glass
  2023-08-17  1:51 ` [PATCH 1/9] x86: coreboot: Rearrange arch_cpu_init() Simon Glass
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Simon Glass @ 2023-08-17  1:51 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Bin Meng, Simon Glass, Anatolij Gustschin, Brandon Maier,
	Kautuk Consul, Leo Yu-Chi Liang, Marek Vasut, Marek Vasut,
	Oleksandr Suvorov, Patrick Delaunay, Stefan Bosch,
	Vladimir Zapolskiy

This little series fixes various bugs and annoyances in coreboot and
coreboot64:

- Make coreboot64 debug UART start reliably
- Avoid the long USB-init delay on startup
- Correct the timer speed on coreboo64
- Fix a bootstd cros bug (will likely be squashed into another patch)
- Fix the terribly slow console scrolling


Simon Glass (9):
  x86: coreboot: Rearrange arch_cpu_init()
  x86: Set the CPU vendor in SPL
  x86: Allow APCI in SPL
  x86: coreboot: Look for DBG2 UART in SPL too
  x86: coreboot: Enable CONFIG_SYS_NS16550_MEM32
  x86: coreboot: Drop USB init on startup
  x86: coreboot: Align options between coreboot and coreboot64
  bootstd: cros: Correct condition for reading the kernel
  x86: coreboot: Enable VIDEO_COPY

 arch/x86/cpu/coreboot/coreboot.c | 16 +++++++++-------
 arch/x86/cpu/x86_64/cpu.c        |  7 +++++++
 arch/x86/dts/coreboot.dts        |  1 +
 boot/bootmeth_cros.c             |  4 ++--
 configs/coreboot64_defconfig     | 10 +++++++++-
 configs/coreboot_defconfig       | 12 ++----------
 drivers/serial/Kconfig           |  2 +-
 drivers/video/coreboot.c         | 12 ++++++++++++
 lib/Kconfig                      |  8 ++++++++
 9 files changed, 51 insertions(+), 21 deletions(-)

-- 
2.41.0.694.ge786442a9b-goog


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

* [PATCH 1/9] x86: coreboot: Rearrange arch_cpu_init()
  2023-08-17  1:51 [PATCH 0/9] x86: Fixes and improvements for coreboot Simon Glass
@ 2023-08-17  1:51 ` Simon Glass
  2023-08-17  1:51 ` [PATCH 2/9] x86: Set the CPU vendor in SPL Simon Glass
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Glass @ 2023-08-17  1:51 UTC (permalink / raw)
  To: U-Boot Mailing List; +Cc: Bin Meng, Simon Glass

Init errors in SPL are currently ignored by this function.

Change the code to init the CPU, reporting an error if something is wrong.
After that, look for the coreboot table.

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

 arch/x86/cpu/coreboot/coreboot.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c
index d7eedbd7436e..6a551e4c6713 100644
--- a/arch/x86/cpu/coreboot/coreboot.c
+++ b/arch/x86/cpu/coreboot/coreboot.c
@@ -20,7 +20,14 @@
 
 int arch_cpu_init(void)
 {
-	int ret = get_coreboot_info(&lib_sysinfo);
+	int ret;
+
+	ret = IS_ENABLED(CONFIG_X86_RUN_64BIT) ? x86_cpu_reinit_f() :
+		 x86_cpu_init_f();
+	if (ret) 
+		return ret;
+
+	ret = get_coreboot_info(&lib_sysinfo);
 	if (ret != 0) {
 		printf("Failed to parse coreboot tables.\n");
 		return ret;
@@ -28,8 +35,7 @@ int arch_cpu_init(void)
 
 	timestamp_init();
 
-	return IS_ENABLED(CONFIG_X86_RUN_64BIT) ? x86_cpu_reinit_f() :
-		 x86_cpu_init_f();
+	return 0;
 }
 
 int checkcpu(void)
-- 
2.41.0.694.ge786442a9b-goog


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

* [PATCH 2/9] x86: Set the CPU vendor in SPL
  2023-08-17  1:51 [PATCH 0/9] x86: Fixes and improvements for coreboot Simon Glass
  2023-08-17  1:51 ` [PATCH 1/9] x86: coreboot: Rearrange arch_cpu_init() Simon Glass
@ 2023-08-17  1:51 ` Simon Glass
  2023-08-17  1:51 ` [PATCH 3/9] x86: Allow APCI " Simon Glass
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Glass @ 2023-08-17  1:51 UTC (permalink / raw)
  To: U-Boot Mailing List; +Cc: Bin Meng, Simon Glass

We don't read this information in 64-bit mode, since we don't have the
macros for doing it. Set it to Intel by default. This allows the TSC timer
to work correctly.

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

 arch/x86/cpu/x86_64/cpu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/x86/cpu/x86_64/cpu.c b/arch/x86/cpu/x86_64/cpu.c
index d1c3873dd6a7..2647bff891f8 100644
--- a/arch/x86/cpu/x86_64/cpu.c
+++ b/arch/x86/cpu/x86_64/cpu.c
@@ -8,8 +8,11 @@
 #include <cpu_func.h>
 #include <debug_uart.h>
 #include <init.h>
+#include <asm/cpu.h>
 #include <asm/global_data.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int cpu_has_64bit(void)
 {
 	return true;
@@ -38,6 +41,10 @@ int x86_mp_init(void)
 
 int x86_cpu_reinit_f(void)
 {
+	/* set the vendor to Intel so that native_calibrate_tsc() works */
+	gd->arch.x86_vendor = X86_VENDOR_INTEL;
+	gd->arch.has_mtrr = true;
+
 	return 0;
 }
 
-- 
2.41.0.694.ge786442a9b-goog


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

* [PATCH 3/9] x86: Allow APCI in SPL
  2023-08-17  1:51 [PATCH 0/9] x86: Fixes and improvements for coreboot Simon Glass
  2023-08-17  1:51 ` [PATCH 1/9] x86: coreboot: Rearrange arch_cpu_init() Simon Glass
  2023-08-17  1:51 ` [PATCH 2/9] x86: Set the CPU vendor in SPL Simon Glass
@ 2023-08-17  1:51 ` Simon Glass
  2023-08-17  1:51 ` [PATCH 4/9] x86: coreboot: Look for DBG2 UART in SPL too Simon Glass
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Glass @ 2023-08-17  1:51 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Bin Meng, Simon Glass, Brandon Maier, Kautuk Consul,
	Leo Yu-Chi Liang, Marek Vasut, Oleksandr Suvorov,
	Patrick Delaunay

This is needed so we can find the DBG2 table provided by coreboot. Add a
Kconfig so it can be enabled.

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

 lib/Kconfig | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/Kconfig b/lib/Kconfig
index 42e559ad0b51..1d63099b8e18 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -289,6 +289,14 @@ config ACPI
 	  not necessarily include generation of tables
 	  (see GENERATE_ACPI_TABLE), but allows for tables to be located.
 
+config SPL_ACPI
+	bool "Enable support for ACPI libraries in SPL"
+	depends on SPL && SUPPORT_ACPI
+	help
+	  Provides library functions for dealing with ACPI tables in SPL. This
+	  does not necessarily include generation of tables
+	  (see GENERATE_ACPI_TABLE), but allows for tables to be located.
+
 config GENERATE_ACPI_TABLE
 	bool "Generate an ACPI (Advanced Configuration and Power Interface) table"
 	depends on ACPI
-- 
2.41.0.694.ge786442a9b-goog


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

* [PATCH 4/9] x86: coreboot: Look for DBG2 UART in SPL too
  2023-08-17  1:51 [PATCH 0/9] x86: Fixes and improvements for coreboot Simon Glass
                   ` (2 preceding siblings ...)
  2023-08-17  1:51 ` [PATCH 3/9] x86: Allow APCI " Simon Glass
@ 2023-08-17  1:51 ` Simon Glass
  2023-08-17  1:51 ` [PATCH 5/9] x86: coreboot: Enable CONFIG_SYS_NS16550_MEM32 Simon Glass
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Glass @ 2023-08-17  1:51 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Bin Meng, Simon Glass, Marek Vasut, Stefan Bosch, Vladimir Zapolskiy

If coreboot does not set up sysinfo for the UART, SPL currently hangs.
Use the DBG2 teechnique there as well. This allows coreboot64 to boot from
coreboot even if the console info is missing from sysinfo

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

 configs/coreboot64_defconfig | 1 +
 drivers/serial/Kconfig       | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/configs/coreboot64_defconfig b/configs/coreboot64_defconfig
index 55064d1ce66f..9f228420cfa9 100644
--- a/configs/coreboot64_defconfig
+++ b/configs/coreboot64_defconfig
@@ -55,5 +55,6 @@ CONFIG_SYS_64BIT_LBA=y
 CONFIG_SOUND=y
 CONFIG_SOUND_I8254=y
 CONFIG_CONSOLE_SCROLL_LINES=5
+CONFIG_SPL_ACPI=y
 # CONFIG_GZIP is not set
 CONFIG_CMD_CBFS=y
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 7ca42df6a7e2..27b4b9d96507 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -672,7 +672,7 @@ config COREBOOT_SERIAL
 config COREBOOT_SERIAL_FROM_DBG2
 	bool "Obtain UART from ACPI tables"
 	depends on COREBOOT_SERIAL
-	default y if !SPL
+	default y
 	help
 	  Select this to try to find a DBG2 record in the ACPI tables, in the
 	  event that coreboot does not provide information about the UART in the
-- 
2.41.0.694.ge786442a9b-goog


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

* [PATCH 5/9] x86: coreboot: Enable CONFIG_SYS_NS16550_MEM32
  2023-08-17  1:51 [PATCH 0/9] x86: Fixes and improvements for coreboot Simon Glass
                   ` (3 preceding siblings ...)
  2023-08-17  1:51 ` [PATCH 4/9] x86: coreboot: Look for DBG2 UART in SPL too Simon Glass
@ 2023-08-17  1:51 ` Simon Glass
  2023-08-17  1:51 ` [PATCH 6/9] x86: coreboot: Drop USB init on startup Simon Glass
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Glass @ 2023-08-17  1:51 UTC (permalink / raw)
  To: U-Boot Mailing List; +Cc: Bin Meng, Simon Glass

The debug UART on modern machines uses a 32-bit wide transfer. Without
this, setting debug output causes a hang or no output. It is not obvious
(when enabling CONFIG_DEBUG_UART) that this is needed.

Enable 32-bit access to avoid this trap.

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

 configs/coreboot64_defconfig | 1 +
 configs/coreboot_defconfig   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/configs/coreboot64_defconfig b/configs/coreboot64_defconfig
index 9f228420cfa9..2e80b5af92ef 100644
--- a/configs/coreboot64_defconfig
+++ b/configs/coreboot64_defconfig
@@ -52,6 +52,7 @@ CONFIG_ATAPI=y
 CONFIG_LBA48=y
 CONFIG_SYS_64BIT_LBA=y
 # CONFIG_PCI_PNP is not set
+CONFIG_SYS_NS16550_MEM32=y
 CONFIG_SOUND=y
 CONFIG_SOUND_I8254=y
 CONFIG_CONSOLE_SCROLL_LINES=5
diff --git a/configs/coreboot_defconfig b/configs/coreboot_defconfig
index 77214f1b4c06..ae44705a1d51 100644
--- a/configs/coreboot_defconfig
+++ b/configs/coreboot_defconfig
@@ -60,6 +60,7 @@ CONFIG_LBA48=y
 CONFIG_SYS_64BIT_LBA=y
 CONFIG_NVME_PCI=y
 # CONFIG_PCI_PNP is not set
+CONFIG_SYS_NS16550_MEM32=y
 CONFIG_SOUND=y
 CONFIG_SOUND_I8254=y
 CONFIG_CONSOLE_SCROLL_LINES=5
-- 
2.41.0.694.ge786442a9b-goog


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

* [PATCH 6/9] x86: coreboot: Drop USB init on startup
  2023-08-17  1:51 [PATCH 0/9] x86: Fixes and improvements for coreboot Simon Glass
                   ` (4 preceding siblings ...)
  2023-08-17  1:51 ` [PATCH 5/9] x86: coreboot: Enable CONFIG_SYS_NS16550_MEM32 Simon Glass
@ 2023-08-17  1:51 ` Simon Glass
  2023-08-17  1:51 ` [PATCH 7/9] x86: coreboot: Align options between coreboot and coreboot64 Simon Glass
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Glass @ 2023-08-17  1:51 UTC (permalink / raw)
  To: U-Boot Mailing List; +Cc: Bin Meng, Simon Glass

This is very annoying as it is quite slow on many machines. Also, U-Boot
has an existing 'preboot' mechanism to enable this feature if desired.

Drop this code so that it is possible to choose whether to init USB or
not.

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

 arch/x86/cpu/coreboot/coreboot.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c
index 6a551e4c6713..5e3af5e561bc 100644
--- a/arch/x86/cpu/coreboot/coreboot.c
+++ b/arch/x86/cpu/coreboot/coreboot.c
@@ -82,10 +82,6 @@ static void board_final_init(void)
 
 int last_stage_init(void)
 {
-	/* start usb so that usb keyboard can be used as input device */
-	if (IS_ENABLED(CONFIG_USB_KEYBOARD))
-		usb_init();
-
 	board_final_init();
 
 	return 0;
-- 
2.41.0.694.ge786442a9b-goog


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

* [PATCH 7/9] x86: coreboot: Align options between coreboot and coreboot64
  2023-08-17  1:51 [PATCH 0/9] x86: Fixes and improvements for coreboot Simon Glass
                   ` (5 preceding siblings ...)
  2023-08-17  1:51 ` [PATCH 6/9] x86: coreboot: Drop USB init on startup Simon Glass
@ 2023-08-17  1:51 ` Simon Glass
  2023-08-17  1:51 ` [PATCH 8/9] bootstd: cros: Correct condition for reading the kernel Simon Glass
  2023-08-17  1:51 ` [PATCH 9/9] x86: coreboot: Enable VIDEO_COPY Simon Glass
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Glass @ 2023-08-17  1:51 UTC (permalink / raw)
  To: U-Boot Mailing List; +Cc: Bin Meng, Simon Glass

These two builds are similar but have some different options for no good
reason. Line them up to be as similar as possible.

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

 configs/coreboot64_defconfig |  7 ++++++-
 configs/coreboot_defconfig   | 10 ----------
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/configs/coreboot64_defconfig b/configs/coreboot64_defconfig
index 2e80b5af92ef..e5cb3f3d4ebd 100644
--- a/configs/coreboot64_defconfig
+++ b/configs/coreboot64_defconfig
@@ -18,6 +18,9 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
 CONFIG_PRE_CONSOLE_BUFFER=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_LOG=y
+CONFIG_LOGF_LINE=y
+CONFIG_LOGF_FUNC=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_LAST_STAGE_INIT=y
 CONFIG_SPL_NO_BSS_LIMIT=y
@@ -51,11 +54,13 @@ CONFIG_SYS_ATA_ALT_OFFSET=0
 CONFIG_ATAPI=y
 CONFIG_LBA48=y
 CONFIG_SYS_64BIT_LBA=y
+CONFIG_NVME_PCI=y
 # CONFIG_PCI_PNP is not set
 CONFIG_SYS_NS16550_MEM32=y
 CONFIG_SOUND=y
 CONFIG_SOUND_I8254=y
 CONFIG_CONSOLE_SCROLL_LINES=5
 CONFIG_SPL_ACPI=y
+CONFIG_CMD_DHRYSTONE=y
 # CONFIG_GZIP is not set
-CONFIG_CMD_CBFS=y
+CONFIG_SMBIOS_PARSER=y
diff --git a/configs/coreboot_defconfig b/configs/coreboot_defconfig
index ae44705a1d51..790b84a87bc7 100644
--- a/configs/coreboot_defconfig
+++ b/configs/coreboot_defconfig
@@ -25,23 +25,14 @@ CONFIG_LAST_STAGE_INIT=y
 CONFIG_PCI_INIT_R=y
 CONFIG_CMD_IDE=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_PART=y
 CONFIG_CMD_SATA=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_CMD_DHCP=y
 CONFIG_BOOTP_BOOTFILESIZE=y
-CONFIG_CMD_PING=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_SOUND=y
-CONFIG_CMD_EXT2=y
-CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_CMD_FAT=y
-CONFIG_CMD_FS_GENERIC=y
 CONFIG_MAC_PARTITION=y
-CONFIG_ISO_PARTITION=y
-CONFIG_EFI_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_BOOTFILE=y
@@ -67,4 +58,3 @@ CONFIG_CONSOLE_SCROLL_LINES=5
 CONFIG_CMD_DHRYSTONE=y
 # CONFIG_GZIP is not set
 CONFIG_SMBIOS_PARSER=y
-CONFIG_CMD_CBFS=y
-- 
2.41.0.694.ge786442a9b-goog


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

* [PATCH 8/9] bootstd: cros: Correct condition for reading the kernel
  2023-08-17  1:51 [PATCH 0/9] x86: Fixes and improvements for coreboot Simon Glass
                   ` (6 preceding siblings ...)
  2023-08-17  1:51 ` [PATCH 7/9] x86: coreboot: Align options between coreboot and coreboot64 Simon Glass
@ 2023-08-17  1:51 ` Simon Glass
  2023-08-17  1:51 ` [PATCH 9/9] x86: coreboot: Enable VIDEO_COPY Simon Glass
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Glass @ 2023-08-17  1:51 UTC (permalink / raw)
  To: U-Boot Mailing List; +Cc: Bin Meng, Simon Glass

A typo prevents this code from behaving as it should. The tests pass
because they do not actually read the kernel. Fix the typo.

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

 boot/bootmeth_cros.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/boot/bootmeth_cros.c b/boot/bootmeth_cros.c
index 20e0b1e89c36..3439d31121b3 100644
--- a/boot/bootmeth_cros.c
+++ b/boot/bootmeth_cros.c
@@ -406,7 +406,7 @@ static int cros_read_file(struct udevice *dev, struct bootflow *bflow,
 	return -ENOSYS;
 }
 
-#if CONFIG_IS_ENABLED(BOOSTD_FULL)
+#if CONFIG_IS_ENABLED(BOOTSTD_FULL)
 static int cros_read_all(struct udevice *dev, struct bootflow *bflow)
 {
 	int ret;
@@ -458,7 +458,7 @@ static struct bootmeth_ops cros_bootmeth_ops = {
 	.read_bootflow	= cros_read_bootflow,
 	.read_file	= cros_read_file,
 	.boot		= cros_boot,
-#if CONFIG_IS_ENABLED(BOOSTD_FULL)
+#if CONFIG_IS_ENABLED(BOOTSTD_FULL)
 	.read_all	= cros_read_all,
 #endif /* BOOSTD_FULL */
 };
-- 
2.41.0.694.ge786442a9b-goog


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

* [PATCH 9/9] x86: coreboot: Enable VIDEO_COPY
  2023-08-17  1:51 [PATCH 0/9] x86: Fixes and improvements for coreboot Simon Glass
                   ` (7 preceding siblings ...)
  2023-08-17  1:51 ` [PATCH 8/9] bootstd: cros: Correct condition for reading the kernel Simon Glass
@ 2023-08-17  1:51 ` Simon Glass
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Glass @ 2023-08-17  1:51 UTC (permalink / raw)
  To: U-Boot Mailing List; +Cc: Bin Meng, Simon Glass, Anatolij Gustschin

At least on modern machines the write-back mechanism for the frame buffer
is quite slow when scrolling, since it must read the entire frame buffer
and write it back.

Enable the VIDEO_COPY feature to resolve this problem.

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

 arch/x86/dts/coreboot.dts    |  1 +
 configs/coreboot64_defconfig |  1 +
 configs/coreboot_defconfig   |  1 +
 drivers/video/coreboot.c     | 12 ++++++++++++
 4 files changed, 15 insertions(+)

diff --git a/arch/x86/dts/coreboot.dts b/arch/x86/dts/coreboot.dts
index f9ff5346a79b..0eb31cae42c1 100644
--- a/arch/x86/dts/coreboot.dts
+++ b/arch/x86/dts/coreboot.dts
@@ -42,6 +42,7 @@
 	};
 
 	coreboot-fb {
+		bootph-some-ram;
 		compatible = "coreboot-fb";
 	};
 };
diff --git a/configs/coreboot64_defconfig b/configs/coreboot64_defconfig
index e5cb3f3d4ebd..54360255c691 100644
--- a/configs/coreboot64_defconfig
+++ b/configs/coreboot64_defconfig
@@ -59,6 +59,7 @@ CONFIG_NVME_PCI=y
 CONFIG_SYS_NS16550_MEM32=y
 CONFIG_SOUND=y
 CONFIG_SOUND_I8254=y
+CONFIG_VIDEO_COPY=y
 CONFIG_CONSOLE_SCROLL_LINES=5
 CONFIG_SPL_ACPI=y
 CONFIG_CMD_DHRYSTONE=y
diff --git a/configs/coreboot_defconfig b/configs/coreboot_defconfig
index 790b84a87bc7..78694d635532 100644
--- a/configs/coreboot_defconfig
+++ b/configs/coreboot_defconfig
@@ -54,6 +54,7 @@ CONFIG_NVME_PCI=y
 CONFIG_SYS_NS16550_MEM32=y
 CONFIG_SOUND=y
 CONFIG_SOUND_I8254=y
+CONFIG_VIDEO_COPY=y
 CONFIG_CONSOLE_SCROLL_LINES=5
 CONFIG_CMD_DHRYSTONE=y
 # CONFIG_GZIP is not set
diff --git a/drivers/video/coreboot.c b/drivers/video/coreboot.c
index c586475e41ed..5b718ae3e5a5 100644
--- a/drivers/video/coreboot.c
+++ b/drivers/video/coreboot.c
@@ -73,6 +73,17 @@ err:
 	return ret;
 }
 
+static int coreboot_video_bind(struct udevice *dev)
+{
+	struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);
+
+	/* Set the maximum supported resolution */
+	uc_plat->size = 4096 * 2160 * 4;
+	log_debug("%s: Frame buffer size %x\n", __func__, uc_plat->size);
+
+	return 0;
+}
+
 static const struct udevice_id coreboot_video_ids[] = {
 	{ .compatible = "coreboot-fb" },
 	{ }
@@ -82,5 +93,6 @@ U_BOOT_DRIVER(coreboot_video) = {
 	.name	= "coreboot_video",
 	.id	= UCLASS_VIDEO,
 	.of_match = coreboot_video_ids,
+	.bind	= coreboot_video_bind,
 	.probe	= coreboot_video_probe,
 };
-- 
2.41.0.694.ge786442a9b-goog


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

end of thread, other threads:[~2023-08-17  1:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-17  1:51 [PATCH 0/9] x86: Fixes and improvements for coreboot Simon Glass
2023-08-17  1:51 ` [PATCH 1/9] x86: coreboot: Rearrange arch_cpu_init() Simon Glass
2023-08-17  1:51 ` [PATCH 2/9] x86: Set the CPU vendor in SPL Simon Glass
2023-08-17  1:51 ` [PATCH 3/9] x86: Allow APCI " Simon Glass
2023-08-17  1:51 ` [PATCH 4/9] x86: coreboot: Look for DBG2 UART in SPL too Simon Glass
2023-08-17  1:51 ` [PATCH 5/9] x86: coreboot: Enable CONFIG_SYS_NS16550_MEM32 Simon Glass
2023-08-17  1:51 ` [PATCH 6/9] x86: coreboot: Drop USB init on startup Simon Glass
2023-08-17  1:51 ` [PATCH 7/9] x86: coreboot: Align options between coreboot and coreboot64 Simon Glass
2023-08-17  1:51 ` [PATCH 8/9] bootstd: cros: Correct condition for reading the kernel Simon Glass
2023-08-17  1:51 ` [PATCH 9/9] x86: coreboot: Enable VIDEO_COPY Simon Glass

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).