All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH 21/34] x86: Move coreboot sysinfo parsing into generic x86 code
Date: Mon, 15 Mar 2021 18:00:21 +1300	[thread overview]
Message-ID: <20210315173656.21.I16a6c60c23b201753fa54027388d54edeab83207@changeid> (raw)
In-Reply-To: <20210315050034.1934660-1-sjg@chromium.org>

It is useful to be able to parse coreboot tables on any x86 build which is
booted from coreboot. Add a new Kconfig option to enable this feature and
move the code so it can be used on any board, if enabled.

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

 arch/x86/Kconfig                              | 21 +++++++++++++++++++
 arch/x86/cpu/coreboot/Makefile                |  1 -
 arch/x86/lib/Makefile                         |  1 +
 arch/x86/lib/coreboot/Makefile                |  6 ++++++
 .../tables.c => lib/coreboot/cb_sysinfo.c}    |  0
 5 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 arch/x86/lib/coreboot/Makefile
 rename arch/x86/{cpu/coreboot/tables.c => lib/coreboot/cb_sysinfo.c} (100%)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index eddf2a774ef..ef2df10d38d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1023,4 +1023,25 @@ config INTEL_GMA_SWSMISCI
 	  Select this option for Atom-based platforms which use the SWSMISCI
 	  register (0xe0) rather than the SWSCI register (0xe8).
 
+config COREBOOT_SYSINFO
+	bool "Support reading coreboot sysinfo"
+	default y if SYS_COREBOOT
+	help
+	  Select this option to read the coreboot sysinfo table on start-up,
+	  if present. This is written by coreboot before it exits and provides
+	  various pieces of information about the running system, including
+	  display, memory and build information. It is stored in
+	  struct sysinfo_t after parsing by get_coreboot_info().
+
+config SPL_COREBOOT_SYSINFO
+	bool "Support reading coreboot sysinfo"
+	depends on SPL
+	default y if COREBOOT_SYSINFO
+	help
+	  Select this option to read the coreboot sysinfo table in SPL,
+	  if present. This is written by coreboot before it exits and provides
+	  various pieces of information about the running system, including
+	  display, memory and build information. It is stored in
+	  struct sysinfo_t after parsing by get_coreboot_info().
+
 endmenu
diff --git a/arch/x86/cpu/coreboot/Makefile b/arch/x86/cpu/coreboot/Makefile
index 605f90304e3..a6cdb9a1485 100644
--- a/arch/x86/cpu/coreboot/Makefile
+++ b/arch/x86/cpu/coreboot/Makefile
@@ -20,5 +20,4 @@ else
 obj-y += sdram.o
 endif
 obj-y += coreboot.o
-obj-y += tables.o
 obj-y += timestamp.o
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 1bcbb49a61f..65d9b3bd6a3 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -15,6 +15,7 @@ ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 endif
 obj-y	+= cmd_boot.o
+obj-$(CONFIG_$(SPL_)COREBOOT_SYSINFO)	+= coreboot/
 obj-$(CONFIG_SEABIOS) += coreboot_table.o
 obj-y	+= early_cmos.o
 obj-y	+= e820.o
diff --git a/arch/x86/lib/coreboot/Makefile b/arch/x86/lib/coreboot/Makefile
new file mode 100644
index 00000000000..b5250d916b2
--- /dev/null
+++ b/arch/x86/lib/coreboot/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier:	GPL-2.0+
+#
+# Copyright 2021 Google LLC
+#
+
+obj-y += cb_sysinfo.o
diff --git a/arch/x86/cpu/coreboot/tables.c b/arch/x86/lib/coreboot/cb_sysinfo.c
similarity index 100%
rename from arch/x86/cpu/coreboot/tables.c
rename to arch/x86/lib/coreboot/cb_sysinfo.c
-- 
2.31.0.rc2.261.g7f71774620-goog

  parent reply	other threads:[~2021-03-15  5:00 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15  5:00 [PATCH 00/34] x86: Enhancements for booting from coreboot Simon Glass
2021-03-15  5:00 ` [PATCH 01/34] x86: coral: Free the ACPI GPIOs after using them Simon Glass
2021-03-15  5:00 ` [PATCH 02/34] x86: coral: Add information about building / running Simon Glass
2021-03-15  5:00 ` [PATCH 03/34] x86: p2sb: Drop LOG_DEBUG Simon Glass
2021-03-15  5:00 ` [PATCH 04/34] x86: Probe device if needed in intel_gpio_xlate() Simon Glass
2021-03-15  5:00 ` [PATCH 05/34] x86: coral: Put the eMMC first Simon Glass
2021-03-16 21:38   ` Jaehoon Chung
2021-03-27  3:18   ` Simon Glass
2021-03-15  5:00 ` [PATCH 06/34] x86: coral: Update the SD card-detect GPIO Simon Glass
2021-03-16 21:39   ` Jaehoon Chung
2021-03-27  3:18   ` Simon Glass
2021-03-15  5:00 ` [PATCH 07/34] tegra: i2c: Drop LOG_DEBUG Simon Glass
2021-03-15  5:00 ` [PATCH 08/34] mmc: pci_mmc: Set up the card detect Simon Glass
2021-03-15  5:00 ` [PATCH 09/34] cbfs: Add support for attributes Simon Glass
2021-03-15  5:00 ` [PATCH 10/34] cbfs: Rename new_node to node Simon Glass
2021-03-15  5:00 ` [PATCH 11/34] smbios: Allow writing to the coreboot version string Simon Glass
2021-03-15  5:00 ` [PATCH 12/34] cbfs: Allow access to CBFS without a header Simon Glass
2021-03-15  5:00 ` [PATCH 13/34] cbfs: Allow file traversal with any CBFS Simon Glass
2021-03-15  5:00 ` [PATCH 14/34] cbfs: Factor out filling a cache node into a new function Simon Glass
2021-03-15  5:00 ` [PATCH 15/34] cbfs: Simplify file iteration Simon Glass
2021-03-15  5:00 ` [PATCH 16/34] cbfs: Support reading compression information Simon Glass
2021-03-15  5:00 ` [PATCH 17/34] cbfs: Drop unnecessary cast in file_cbfs_fill_cache() Simon Glass
2021-03-15  5:00 ` [PATCH 18/34] x86: Make coreboot sysinfo available to any x86 board Simon Glass
2021-03-15  5:00 ` [PATCH 19/34] x86: Move coreboot timestamp info into coreboot_tables.h Simon Glass
2021-03-15  5:00 ` [PATCH 20/34] x86: coreboot: Sync up timestamp codes Simon Glass
2021-03-15  5:00 ` Simon Glass [this message]
2021-03-15  5:00 ` [PATCH 22/34] x86: coreboot: Update parsing of the latest sysinfo Simon Glass
2021-03-15  5:00 ` [PATCH 23/34] x86: Allow installing an e820 when booting from coreboot Simon Glass
2021-03-15  5:00 ` [PATCH 24/34] x86: Add a command to display coreboot sysinfo Simon Glass
2021-03-15  5:00 ` [PATCH 25/34] cmd: Add missing check for CONFIG_SYS_LONGHELP Simon Glass
2021-03-15  5:00 ` [PATCH 26/34] video: Fix video on coreboot with the copy buffer Simon Glass
2021-03-15  5:00 ` [PATCH 27/34] x86: video: Allow coreboot video to be used on any x86 board Simon Glass
2021-03-15  5:00 ` [PATCH 28/34] x86: fsp: Don't enable FSP graphics if booted from coreboot Simon Glass
2021-03-15  5:00 ` [PATCH 29/34] dm: core: Add CBFS support to flashmap Simon Glass
2021-03-15  5:00 ` [PATCH 30/34] x86: coral: Avoid build error with !CONFIG_ACPIGEN Simon Glass
2021-03-15  5:00 ` [PATCH 31/34] x86: coral: Allow init of debug UART in U-Boot proper Simon Glass
2021-03-15  5:00 ` [PATCH 32/34] x86: coral: Fall back to coreboot video when FSP missing Simon Glass
2021-03-15  5:00 ` [PATCH 33/34] x86: fsp: Don't notify if booted from coreboot Simon Glass
2021-03-15  5:00 ` [PATCH 34/34] x86: coreboot: Don't setup MTRR when booting " Simon Glass
2021-03-27  3:18 ` Simon Glass
2021-03-27  3:18 ` [PATCH 33/34] x86: fsp: Don't notify if booted " Simon Glass
2021-03-27  3:18 ` [PATCH 32/34] x86: coral: Fall back to coreboot video when FSP missing Simon Glass
2021-03-27  3:18 ` [PATCH 31/34] x86: coral: Allow init of debug UART in U-Boot proper Simon Glass
2021-03-27  3:18 ` [PATCH 30/34] x86: coral: Avoid build error with !CONFIG_ACPIGEN Simon Glass
2021-03-27  3:18 ` [PATCH 29/34] dm: core: Add CBFS support to flashmap Simon Glass
2021-03-27  3:18 ` [PATCH 28/34] x86: fsp: Don't enable FSP graphics if booted from coreboot Simon Glass
2021-03-27  3:18 ` [PATCH 27/34] x86: video: Allow coreboot video to be used on any x86 board Simon Glass
2021-03-27  3:18 ` [PATCH 26/34] video: Fix video on coreboot with the copy buffer Simon Glass
2021-03-27  3:18 ` [PATCH 25/34] cmd: Add missing check for CONFIG_SYS_LONGHELP Simon Glass
2021-03-27  3:18 ` [PATCH 24/34] x86: Add a command to display coreboot sysinfo Simon Glass
2021-03-27  3:18 ` [PATCH 23/34] x86: Allow installing an e820 when booting from coreboot Simon Glass
2021-03-27  3:18 ` [PATCH 22/34] x86: coreboot: Update parsing of the latest sysinfo Simon Glass
2021-03-27  3:18 ` [PATCH 21/34] x86: Move coreboot sysinfo parsing into generic x86 code Simon Glass
2021-03-27  3:18 ` [PATCH 20/34] x86: coreboot: Sync up timestamp codes Simon Glass
2021-03-27  3:18 ` [PATCH 19/34] x86: Move coreboot timestamp info into coreboot_tables.h Simon Glass
2021-03-27  3:18 ` [PATCH 18/34] x86: Make coreboot sysinfo available to any x86 board Simon Glass
2021-03-27  3:18 ` [PATCH 17/34] cbfs: Drop unnecessary cast in file_cbfs_fill_cache() Simon Glass
2021-03-27  3:18 ` [PATCH 15/34] cbfs: Simplify file iteration Simon Glass
2021-03-27  3:18 ` [PATCH 14/34] cbfs: Factor out filling a cache node into a new function Simon Glass
2021-03-27  3:18 ` [PATCH 11/34] smbios: Allow writing to the coreboot version string Simon Glass
2021-03-27  3:18 ` [PATCH 10/34] cbfs: Rename new_node to node Simon Glass
2021-03-27  3:18 ` [PATCH 08/34] mmc: pci_mmc: Set up the card detect Simon Glass
2021-03-27  3:18 ` [PATCH 07/34] tegra: i2c: Drop LOG_DEBUG Simon Glass
2021-03-27  3:18 ` [PATCH 04/34] x86: Probe device if needed in intel_gpio_xlate() Simon Glass
2021-03-27  3:18 ` [PATCH 03/34] x86: p2sb: Drop LOG_DEBUG Simon Glass
2021-03-27  3:18 ` [PATCH 02/34] x86: coral: Add information about building / running Simon Glass
2021-03-27  3:18 ` [PATCH 01/34] x86: coral: Free the ACPI GPIOs after using them 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=20210315173656.21.I16a6c60c23b201753fa54027388d54edeab83207@changeid \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.