Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36287 )
Change subject: lib/cbmem_top.c: Add some romstage helper functions to save cbmem_top
......................................................................
lib/cbmem_top.c: Add some romstage helper functions to save cbmem_top
With complicated vendor reference code or blobs it is not always easy
to figure out ourselves where the top of lower memory is and we have
to rely on the output of the vendor code. This adds a helper function
to save a value return by the vendor code to be used to implement
cbmem_top.
Change-Id: I4c547e7c19bfaf60db348a5cba2e23091ff06450
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/include/cbmem.h
M src/lib/Kconfig
M src/lib/cbmem_top.c
3 files changed, 23 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/87/36287/1
diff --git a/src/include/cbmem.h b/src/include/cbmem.h
index a6cd277..a2326df 100644
--- a/src/include/cbmem.h
+++ b/src/include/cbmem.h
@@ -161,6 +161,10 @@
uintptr_t restore_top_of_low_cacheable(void);
#endif
+/* If CONFIG_CBMEM_TOP_MEM is selected cbmem_top will return the value
+ of the function argument. */
+void save_top_mem(uintptr_t ramtop);
+
/*
* Returns 0 for the stages where we know that cbmem does not come online.
* Even if this function returns 1 for romstage, depending upon the point in
diff --git a/src/lib/Kconfig b/src/lib/Kconfig
index aede4b3..bf77320 100644
--- a/src/lib/Kconfig
+++ b/src/lib/Kconfig
@@ -30,6 +30,12 @@
Select this if stages run after romstage get the cbmem_top
pointer the function arguments when called from romstage.
+config CBMEM_TOP_SAVE
+ bool
+ help
+ Select this on platforms if you want to save a variable during
+ containing the top of lower memory at which cbmem will be installed.
+
config FLATTENED_DEVICE_TREE
bool
help
diff --git a/src/lib/cbmem_top.c b/src/lib/cbmem_top.c
index 6eee0d5..016b548 100644
--- a/src/lib/cbmem_top.c
+++ b/src/lib/cbmem_top.c
@@ -25,5 +25,18 @@
is implemented */
return cbmem_top_romstage();
}
+#endif
+#if CONFIG(CBMEM_TOP_SAVE)
+static uintptr_t cbmem_top_p;
+
+void save_top_mem(uintptr_t ramtop)
+{
+ cbmem_top_p = ramtop;
+}
+
+void *cbmem_top_romstage(void)
+{
+ return (void *)cbmem_top_p;
+}
#endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/36287
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4c547e7c19bfaf60db348a5cba2e23091ff06450
Gerrit-Change-Number: 36287
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35821 )
Change subject: [RFC]arch/x86: Only use BOOTBLOCK_NORMAL with an CMOS option table
......................................................................
[RFC]arch/x86: Only use BOOTBLOCK_NORMAL with an CMOS option table
There is no explicit dependency on an option table since the reboot
counter and the normal/fallback byte is at a fixed offset.
I don't feel strongly about imposing this...
Change-Id: I2126e71c72951d11960f5d27d25eaa838854057d
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/arch/x86/Kconfig
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/21/35821/1
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index 502e774..9d26692 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -255,6 +255,7 @@
bool "Always load fallback"
config BOOTBLOCK_NORMAL
+ depends on USE_OPTION_TABLE
select CONFIGURABLE_CBFS_PREFIX
bool "Switch to normal if CMOS says so"
--
To view, visit https://review.coreboot.org/c/coreboot/+/35821
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2126e71c72951d11960f5d27d25eaa838854057d
Gerrit-Change-Number: 35821
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35823 )
Change subject: [RFC]arch/x86: Only allow normal and fallback cbfs prefixes
......................................................................
[RFC]arch/x86: Only allow normal and fallback cbfs prefixes
Using other cbfsprefixes is errorprone: It requires a properly
formatted cbfs file to be present (an error in the cbfsfile will
render the system unbootable) and to correctly enter the cbfs prefix
in menuconfig. Therefore remove this functionality that merely allows
to use different names.
Change-Id: I7399b144fe122badd53d518543868c6ecb14fe21
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/Kconfig
M src/arch/x86/bootblock_normal.c
2 files changed, 3 insertions(+), 20 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/23/35823/1
diff --git a/src/Kconfig b/src/Kconfig
index 4c71f28..5b2a615 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -48,13 +48,10 @@
config CBFS_PREFIX_NORMAL
bool "normal"
-config CBFS_PREFIX_DIY
- bool "Define your own cbfs prefix"
-
endchoice
config CBFS_PREFIX
- string "CBFS prefix to use" if CBFS_PREFIX_DIY
+ string
default "fallback" if !CONFIGURABLE_CBFS_PREFIX || CBFS_PREFIX_FALLBACK
default "normal" if CBFS_PREFIX_NORMAL
help
diff --git a/src/arch/x86/bootblock_normal.c b/src/arch/x86/bootblock_normal.c
index 905ecb2..c55eda2 100644
--- a/src/arch/x86/bootblock_normal.c
+++ b/src/arch/x86/bootblock_normal.c
@@ -16,18 +16,9 @@
#include <pc80/mc146818rtc.h>
#include <halt.h>
-static const char *get_fallback(const char *stagelist)
-{
- while (*stagelist)
- stagelist++;
- return ++stagelist;
-}
-
static void main(unsigned long bist)
{
u8 boot_mode;
- const char *default_filenames =
- "normal/romstage\0fallback/romstage";
if (boot_cpu()) {
bootblock_mainboard_init();
@@ -44,20 +35,15 @@
boot_mode = boot_use_normal(cmos_read(RTC_BOOT_BYTE));
}
- char *normal_candidate = (char *)walkcbfs("coreboot-stages");
-
- if (!normal_candidate)
- normal_candidate = default_filenames;
-
unsigned long entry;
if (boot_mode) {
- entry = findstage(normal_candidate);
+ entry = findstage("normal/romstage");
if (entry)
call(entry, bist);
}
- entry = findstage(get_fallback(normal_candidate));
+ entry = findstage("fallback/romstage");
if (entry)
call(entry, bist);
--
To view, visit https://review.coreboot.org/c/coreboot/+/35823
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7399b144fe122badd53d518543868c6ecb14fe21
Gerrit-Change-Number: 35823
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33361
Change subject: soc/intel/block/cpu: Add a MP init choice selection
......................................................................
soc/intel/block/cpu: Add a MP init choice selection
Add a choice to select the MP init method for clarity.
Change-Id: I2a7490948f729f1ae9fd2537bf6cbe9ada51f968
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/soc/intel/common/block/cpu/Kconfig
1 file changed, 21 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/33361/1
diff --git a/src/soc/intel/common/block/cpu/Kconfig b/src/soc/intel/common/block/cpu/Kconfig
index 8cc572d..6082ce3 100644
--- a/src/soc/intel/common/block/cpu/Kconfig
+++ b/src/soc/intel/common/block/cpu/Kconfig
@@ -51,18 +51,34 @@
ENHANCED NEM guarantees that modified data is always
kept in cache while clean data is replaced.
-config USE_INTEL_FSP_MP_INIT
+choice
+ prompt "Multiple Processor (MP) Initialization Options"
+ default MP_USE_COREBOOT_NATIVE_MP_INIT if !PLATFORM_USES_FSP2_1
+ default MP_USE_INTEL_FSP_TO_CALL_COREBOOT_PUBLISH_MP_PPI if PLATFORM_USES_FSP2_1
+
+config MP_USE_COREBOOT_NATIVE_MP_INIT
+ bool "Perform MP Initialization by coreboot"
+
+config MP_USE_INTEL_FSP_MP_INIT
bool "Perform MP Initialization by FSP"
- default n
+ select USE_INTEL_FSP_MP_INIT
+
+config MP_USE_INTEL_FSP_TO_CALL_COREBOOT_PUBLISH_MP_PPI
+ bool "Perform MP Initialization by FSP using coreboot MP PPI service"
+ depends on FSP_USES_MP_SERVICES_PPI
+ select USE_INTEL_FSP_TO_CALL_COREBOOT_PUBLISH_MP_PPI
+
+endchoice
+
+config USE_INTEL_FSP_MP_INIT
+ bool
depends on !USE_INTEL_FSP_TO_CALL_COREBOOT_PUBLISH_MP_PPI
help
This option allows FSP to perform multiprocessor initialization.
config USE_INTEL_FSP_TO_CALL_COREBOOT_PUBLISH_MP_PPI
- bool "Perform MP Initialization by FSP using coreboot MP PPI service"
+ bool
depends on FSP_USES_MP_SERVICES_PPI
- default y if PLATFORM_USES_FSP2_1
- default n
help
This option allows FSP to make use of MP services PPI published by
coreboot to perform multiprocessor initialization.
--
To view, visit https://review.coreboot.org/c/coreboot/+/33361
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2a7490948f729f1ae9fd2537bf6cbe9ada51f968
Gerrit-Change-Number: 33361
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33555
Change subject: util/cbfstool/fit.c: Bail out when there are not enough FIT entries
......................................................................
util/cbfstool/fit.c: Bail out when there are not enough FIT entries
Bail out when there are not enough empty FIT enties to add all
microcode entries.
Change-Id: If86678a1eaaa0c5ff571f25bd6bfdb26ac93a946
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M util/cbfstool/fit.c
1 file changed, 8 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/55/33555/1
diff --git a/util/cbfstool/fit.c b/util/cbfstool/fit.c
index aeb1755..2fee9e3 100644
--- a/util/cbfstool/fit.c
+++ b/util/cbfstool/fit.c
@@ -238,7 +238,7 @@
static int parse_microcode_blob(struct cbfs_image *image,
struct cbfs_file *mcode_file,
struct microcode_entry *mcus,
- int total_entries, int *mcus_found)
+ int *mcus_found)
{
int num_mcus;
uint32_t current_offset;
@@ -272,9 +272,6 @@
file_length -= mcus[num_mcus].size;
num_mcus++;
- /* Reached limit of FIT entries. */
- if (num_mcus == total_entries)
- break;
if (file_length < sizeof(struct microcode_header))
break;
}
@@ -319,13 +316,18 @@
return 1;
}
- if (parse_microcode_blob(image, mcode_file, mcus, empty_entries,
- &mcus_found)) {
+ if (parse_microcode_blob(image, mcode_file, mcus, &mcus_found)) {
ERROR("Couldn't parse microcode blob.\n");
ret = 1;
goto out;
}
+ if (mcus_found > empty_entries) {
+ ERROR("Not enough empty FIT entries for all microcode update entries.\n");
+ ret = 1;
+ goto out;
+ }
+
add_microcodde_entries(fit, image, mcus_found, mcus, offset_fn, 0);
update_fit_checksum(fit);
--
To view, visit https://review.coreboot.org/c/coreboot/+/33555
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If86678a1eaaa0c5ff571f25bd6bfdb26ac93a946
Gerrit-Change-Number: 33555
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange