Enable user selectable bootblocks, and provide a bootblock that

selects between "fallback" and "normal", in addition to the
already present "fallback"-only bootblock.

Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5157 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Patrick Georgi 2010-02-24 13:58:23 +00:00
parent d3428b071e
commit c9fa96d04c
6 changed files with 64 additions and 16 deletions

View File

@ -49,6 +49,24 @@ config BIG_BOOTBLOCK
default n if TINY_BOOTBLOCK default n if TINY_BOOTBLOCK
default y default y
choice
prompt "Bootblock behaviour"
default BOOTBLOCK_SIMPLE
depends on TINY_BOOTBLOCK
config BOOTBLOCK_SIMPLE
bool "Always load fallback"
config BOOTBLOCK_NORMAL
bool "Switch to normal if CMOS says so"
endchoice
config BOOTBLOCK_SOURCE
string
default "bootblock_simple.c" if BOOTBLOCK_SIMPLE
default "bootblock_normal.c" if BOOTBLOCK_NORMAL
config UPDATE_IMAGE config UPDATE_IMAGE
bool "Update existing coreboot.rom image" bool "Update existing coreboot.rom image"
default n default n

View File

@ -63,7 +63,7 @@ $(obj)/mainboard/$(MAINBOARDDIR)/bootblock.o: $(obj)/mainboard/$(MAINBOARDDIR)/b
$(obj)/mainboard/$(MAINBOARDDIR)/bootblock.s: $(obj)/bootblock/bootblock.c $(obj)/mainboard/$(MAINBOARDDIR)/bootblock.s: $(obj)/bootblock/bootblock.c
$(CC) -x assembler-with-cpp -DASSEMBLY -E -I$(src)/include -I$(src)/arch/i386/include -I$(obj) -I$(obj)/bootblock -include $(obj)/config.h -I. -I$(src) $< > $@.new && mv $@.new $@ $(CC) -x assembler-with-cpp -DASSEMBLY -E -I$(src)/include -I$(src)/arch/i386/include -I$(obj) -I$(obj)/bootblock -include $(obj)/config.h -I. -I$(src) $< > $@.new && mv $@.new $@
$(obj)/mainboard/$(MAINBOARDDIR)/bootblock.inc: $(src)/arch/i386/init/bootblock.c $(obj)/romcc $(obj)/mainboard/$(MAINBOARDDIR)/bootblock.inc: $(src)/arch/i386/init/$(subst ",,$(CONFIG_BOOTBLOCK_SOURCE)) $(obj)/romcc
$(obj)/romcc $(bootblock_romccflags) -O2 $(ROMCCFLAGS) $(INCLUDES) $< -o $@ $(obj)/romcc $(bootblock_romccflags) -O2 $(ROMCCFLAGS) $(INCLUDES) $< -o $@
$(obj)/bootblock.elf: $(obj)/mainboard/$(MAINBOARDDIR)/bootblock.o $(obj)/bootblock/ldscript.ld $(obj)/bootblock.elf: $(obj)/mainboard/$(MAINBOARDDIR)/bootblock.o $(obj)/bootblock/ldscript.ld

View File

@ -95,7 +95,7 @@ endif
endif endif
ifeq ($(CONFIG_TINY_BOOTBLOCK),y) ifeq ($(CONFIG_TINY_BOOTBLOCK),y)
include $(src)/arch/i386/Makefile.tinybootblock.inc include $(src)/arch/i386/Makefile.bootblock.inc
else else
include $(src)/arch/i386/Makefile.bigbootblock.inc include $(src)/arch/i386/Makefile.bigbootblock.inc
endif endif

View File

@ -31,17 +31,3 @@ static void call(unsigned long addr, unsigned long bist)
{ {
asm volatile ("jmp *%0\n\t" : : "r" (addr), "a" (bist)); asm volatile ("jmp *%0\n\t" : : "r" (addr), "a" (bist));
} }
static void main(unsigned long bist)
{
if (boot_cpu()) {
bootblock_northbridge_init();
bootblock_southbridge_init();
}
const char* target1 = "fallback/romstage";
unsigned long entry;
entry = findstage(target1);
if (entry) call(entry, bist);
asm volatile ("1:\n\thlt\n\tjmp 1b\n\t");
}

View File

@ -0,0 +1,29 @@
#include <bootblock_common.h>
#include <arch/io.h>
#include "arch/romcc_io.h"
#include "pc80/mc146818rtc_early.c"
static void main(unsigned long bist)
{
if (boot_cpu()) {
bootblock_northbridge_init();
bootblock_southbridge_init();
}
unsigned long entry;
if (do_normal_boot())
entry = findstage("normal/romstage");
else
entry = findstage("fallback/romstage");
if (entry) call(entry, bist);
/* run fallback if normal can't be found */
entry = findstage("fallback/romstage");
if (entry) call(entry, bist);
/* duh. we're stuck */
asm volatile ("1:\n\thlt\n\tjmp 1b\n\t");
}

View File

@ -0,0 +1,15 @@
#include <bootblock_common.h>
static void main(unsigned long bist)
{
if (boot_cpu()) {
bootblock_northbridge_init();
bootblock_southbridge_init();
}
const char* target1 = "fallback/romstage";
unsigned long entry;
entry = findstage(target1);
if (entry) call(entry, bist);
asm volatile ("1:\n\thlt\n\tjmp 1b\n\t");
}