[coreboot-gerrit] New patch to review for coreboot: arch/x86: Allow boot flow which runs CAR setup in bootblock

Alexandru Gagniuc (mr.nuke.me@gmail.com) gerrit at coreboot.org
Fri Oct 2 20:28:28 CET 2015


Alexandru Gagniuc (mr.nuke.me at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11784

-gerrit

commit 85968b8b2f62746a2dabb5639991f71bbba3d12c
Author: Alexandru Gagniuc <mr.nuke.me at gmail.com>
Date:   Fri Oct 2 12:42:26 2015 -0700

    arch/x86: Allow boot flow which runs CAR setup in bootblock
    
    On systems with non-memory-mapped boot media we simply do not have
    enough space for romstage. This means that CAR setup and early boot
    media (e.g. SPI) drivers need to be implemented with minimal overhead.
    The bootblock is the best place to do this.
    
    Note that this patch does introduce a somewhat awkward boot flow:
    reset(gas) -> bootblock main (romcc) -> car setup (gas) -> car (gcc)
    However, we've chosen this path as it is least intrusive on the
    existing infrastructure. In the future, we will investigate the
    possiblity of eliminating the romcc step.
    
    Change-Id: Icbf5804b66b9517f9ceb352bed86978dcf92228f
    Signed-off-by: Alexandru Gagniuc <mr.nuke.me at gmail.com>
---
 src/arch/x86/Kconfig            |  6 ++++++
 src/arch/x86/bootblock_simple.c | 27 ++++++++++++++++++++++-----
 2 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index 88b2592..59eeb87 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -56,6 +56,12 @@ config ARCH_RAMSTAGE_X86_64
 	bool
 	default n
 
+# This is a new bootflow, in which CAR setup is performed in the bootblock, then
+# calls into C code (in the bootblock)
+config CAR_BOOTBLOCK
+	bool
+	default n
+
 # This is an SMP option. It relates to starting up APs.
 # It is usually set in mainboard/*/Kconfig.
 # TODO: Improve description.
diff --git a/src/arch/x86/bootblock_simple.c b/src/arch/x86/bootblock_simple.c
index adeecf7..1c8eb02 100644
--- a/src/arch/x86/bootblock_simple.c
+++ b/src/arch/x86/bootblock_simple.c
@@ -2,6 +2,24 @@
 #include <bootblock_common.h>
 #include <halt.h>
 
+static void advance_to_romstage(unsigned long bist)
+{
+	const char* target1 = "fallback/romstage";
+	unsigned long entry;
+	entry = findstage(target1);
+	if (entry) call(entry, bist);
+	halt();
+
+}
+
+static void advance_to_car_setup(unsigned long bist)
+{
+	__asm__ volatile(
+		"jmp bootblock_pre_car_entry"
+		:: "a" (bist)
+	);
+}
+
 static void main(unsigned long bist)
 {
 	if (boot_cpu()) {
@@ -15,9 +33,8 @@ static void main(unsigned long bist)
 #endif
 	}
 
-	const char* target1 = "fallback/romstage";
-	unsigned long entry;
-	entry = findstage(target1);
-	if (entry) call(entry, bist);
-	halt();
+	if (IS_ENABLED(CONFIG_CAR_BOOTBLOCK))
+		advance_to_car_setup(bist);
+	else
+		advance_to_romstage(bist);
 }



More information about the coreboot-gerrit mailing list