Refactor bootblock initialisation
Makes it a bit easier to implement mainboard-specific behaviour while executing the bootblock. Change-Id: I04e87f89efb4fad1c0e20b62ea6a50329a286205 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/1844 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
90ca3b6bd7
commit
f90224845d
|
@ -1,22 +1,28 @@
|
||||||
#include <cpu/x86/lapic/boot_cpu.c>
|
#include <cpu/x86/lapic/boot_cpu.c>
|
||||||
|
#include <arch/cbfs.h>
|
||||||
|
|
||||||
#ifdef CONFIG_BOOTBLOCK_CPU_INIT
|
#ifdef CONFIG_BOOTBLOCK_CPU_INIT
|
||||||
#include CONFIG_BOOTBLOCK_CPU_INIT
|
#include CONFIG_BOOTBLOCK_CPU_INIT
|
||||||
#else
|
|
||||||
static void bootblock_cpu_init(void) { }
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_BOOTBLOCK_NORTHBRIDGE_INIT
|
#ifdef CONFIG_BOOTBLOCK_NORTHBRIDGE_INIT
|
||||||
#include CONFIG_BOOTBLOCK_NORTHBRIDGE_INIT
|
#include CONFIG_BOOTBLOCK_NORTHBRIDGE_INIT
|
||||||
#else
|
|
||||||
static void bootblock_northbridge_init(void) { }
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_BOOTBLOCK_SOUTHBRIDGE_INIT
|
#ifdef CONFIG_BOOTBLOCK_SOUTHBRIDGE_INIT
|
||||||
#include CONFIG_BOOTBLOCK_SOUTHBRIDGE_INIT
|
#include CONFIG_BOOTBLOCK_SOUTHBRIDGE_INIT
|
||||||
#else
|
|
||||||
static void bootblock_southbridge_init(void) { }
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <arch/cbfs.h>
|
static void bootblock_mainboard_init(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_BOOTBLOCK_NORTHBRIDGE_INIT
|
||||||
|
bootblock_northbridge_init();
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_BOOTBLOCK_SOUTHBRIDGE_INIT
|
||||||
|
bootblock_southbridge_init();
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_BOOTBLOCK_CPU_INIT
|
||||||
|
bootblock_cpu_init();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#if CONFIG_USE_OPTION_TABLE
|
#if CONFIG_USE_OPTION_TABLE
|
||||||
#include <pc80/mc146818rtc.h>
|
#include <pc80/mc146818rtc.h>
|
||||||
|
|
|
@ -13,9 +13,7 @@ static void main(unsigned long bist)
|
||||||
const char *default_filenames = "normal/romstage\0fallback/romstage";
|
const char *default_filenames = "normal/romstage\0fallback/romstage";
|
||||||
|
|
||||||
if (boot_cpu()) {
|
if (boot_cpu()) {
|
||||||
bootblock_northbridge_init();
|
bootblock_mainboard_init();
|
||||||
bootblock_southbridge_init();
|
|
||||||
bootblock_cpu_init();
|
|
||||||
|
|
||||||
#if CONFIG_USE_OPTION_TABLE
|
#if CONFIG_USE_OPTION_TABLE
|
||||||
sanitize_cmos();
|
sanitize_cmos();
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
static void main(unsigned long bist)
|
static void main(unsigned long bist)
|
||||||
{
|
{
|
||||||
if (boot_cpu()) {
|
if (boot_cpu()) {
|
||||||
bootblock_northbridge_init();
|
bootblock_mainboard_init();
|
||||||
bootblock_southbridge_init();
|
|
||||||
bootblock_cpu_init();
|
|
||||||
|
|
||||||
#if CONFIG_USE_OPTION_TABLE
|
#if CONFIG_USE_OPTION_TABLE
|
||||||
sanitize_cmos();
|
sanitize_cmos();
|
||||||
|
|
Loading…
Reference in New Issue