bootblocks: use run_romstage()
Instead of sprinkling the cbfs calls around (as well as getting return values incorrect) use the common run_romstage() to perform the necessary work to load and run romstage. Change-Id: Id59f47febf5122cb3ee60f9741cfb58cb60ccab5 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/8711 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
committed by
Aaron Durbin
parent
e4f3e7a9c6
commit
f5d7f605ab
@@ -24,16 +24,13 @@
|
|||||||
#include <bootblock_common.h>
|
#include <bootblock_common.h>
|
||||||
#include <cbfs.h>
|
#include <cbfs.h>
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <halt.h>
|
#include <program_loading.h>
|
||||||
|
|
||||||
__attribute__((weak)) void bootblock_soc_init(void) { /* do nothing */ }
|
__attribute__((weak)) void bootblock_soc_init(void) { /* do nothing */ }
|
||||||
__attribute__((weak)) void bootblock_mainboard_init(void) { /* do nothing */ }
|
__attribute__((weak)) void bootblock_mainboard_init(void) { /* do nothing */ }
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
const char *stage_name = "fallback/romstage";
|
|
||||||
void *entry;
|
|
||||||
|
|
||||||
bootblock_soc_init();
|
bootblock_soc_init();
|
||||||
bootblock_mainboard_init();
|
bootblock_mainboard_init();
|
||||||
|
|
||||||
@@ -42,8 +39,5 @@ void main(void)
|
|||||||
exception_init();
|
exception_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, stage_name);
|
run_romstage();
|
||||||
|
|
||||||
if (entry) stage_exit(entry);
|
|
||||||
halt();
|
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
#include <bootblock_common.h>
|
#include <bootblock_common.h>
|
||||||
#include <cbfs.h>
|
#include <cbfs.h>
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <halt.h>
|
#include <program_loading.h>
|
||||||
#include <smp/node.h>
|
#include <smp/node.h>
|
||||||
|
|
||||||
__attribute__((weak)) void bootblock_soc_init(void) { /* do nothing */ }
|
__attribute__((weak)) void bootblock_soc_init(void) { /* do nothing */ }
|
||||||
@@ -33,9 +33,6 @@ __attribute__((weak)) void bootblock_mainboard_init(void) { /* do nothing */ }
|
|||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
const char *stage_name = "fallback/romstage";
|
|
||||||
void *entry;
|
|
||||||
|
|
||||||
bootblock_soc_init();
|
bootblock_soc_init();
|
||||||
bootblock_mainboard_init();
|
bootblock_mainboard_init();
|
||||||
|
|
||||||
@@ -44,8 +41,5 @@ void main(void)
|
|||||||
exception_init();
|
exception_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, stage_name);
|
run_romstage();
|
||||||
|
|
||||||
if (entry) stage_exit(entry);
|
|
||||||
halt();
|
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
#include <arch/exception.h>
|
#include <arch/exception.h>
|
||||||
#include <cbfs.h>
|
#include <cbfs.h>
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <halt.h>
|
#include <program_loading.h>
|
||||||
|
|
||||||
static int boot_cpu(void)
|
static int boot_cpu(void)
|
||||||
{
|
{
|
||||||
@@ -39,9 +39,6 @@ static int boot_cpu(void)
|
|||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
const char *stage_name = CONFIG_CBFS_PREFIX"/romstage";
|
|
||||||
void *entry = NULL;
|
|
||||||
|
|
||||||
/* Globally disable MMU, caches, and branch prediction (these should
|
/* Globally disable MMU, caches, and branch prediction (these should
|
||||||
* be disabled by default on reset) */
|
* be disabled by default on reset) */
|
||||||
dcache_mmu_disable();
|
dcache_mmu_disable();
|
||||||
@@ -64,10 +61,5 @@ void main(void)
|
|||||||
exception_init();
|
exception_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, stage_name);
|
run_romstage();
|
||||||
|
|
||||||
printk(BIOS_SPEW, "stage_name %s, entry %p\n", stage_name, entry);
|
|
||||||
|
|
||||||
if (entry) stage_exit(entry);
|
|
||||||
halt();
|
|
||||||
}
|
}
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#include <arch/exception.h>
|
#include <arch/exception.h>
|
||||||
#include <cbfs.h>
|
#include <cbfs.h>
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
|
#include <program_loading.h>
|
||||||
|
|
||||||
static int boot_cpu(void)
|
static int boot_cpu(void)
|
||||||
{
|
{
|
||||||
@@ -39,9 +40,6 @@ static int boot_cpu(void)
|
|||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
const char *stage_name = CONFIG_CBFS_PREFIX"/romstage";
|
|
||||||
void *entry = NULL;
|
|
||||||
|
|
||||||
/* Globally disable MMU, caches, and branch prediction (these should
|
/* Globally disable MMU, caches, and branch prediction (these should
|
||||||
* be disabled by default on reset) */
|
* be disabled by default on reset) */
|
||||||
dcache_mmu_disable();
|
dcache_mmu_disable();
|
||||||
@@ -64,10 +62,5 @@ void main(void)
|
|||||||
exception_init();
|
exception_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, stage_name);
|
run_romstage();
|
||||||
|
|
||||||
printk(BIOS_SPEW, "stage_name %s, entry %p\n", stage_name, entry);
|
|
||||||
|
|
||||||
if (entry) stage_exit(entry);
|
|
||||||
hlt();
|
|
||||||
}
|
}
|
||||||
|
@@ -18,28 +18,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <arch/exception.h>
|
#include <arch/exception.h>
|
||||||
#include <arch/hlt.h>
|
|
||||||
#include <bootblock_common.h>
|
#include <bootblock_common.h>
|
||||||
#include <cbfs.h>
|
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <arch/stages.h>
|
#include <program_loading.h>
|
||||||
|
|
||||||
// the qemu part of all this is very, very non-hardware like.
|
// the qemu part of all this is very, very non-hardware like.
|
||||||
// so it gets its own bootblock.
|
// so it gets its own bootblock.
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
void *entry;
|
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) {
|
if (IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) {
|
||||||
console_init();
|
console_init();
|
||||||
exception_init();
|
exception_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, CONFIG_CBFS_PREFIX"/romstage");
|
run_romstage();
|
||||||
if (! entry) {
|
|
||||||
printk(BIOS_EMERG, "AAAAAAAAAAAAAA no romstage!\n");
|
|
||||||
while (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
stage_exit(entry);
|
|
||||||
}
|
}
|
||||||
|
@@ -20,19 +20,16 @@
|
|||||||
#include <arch/exception.h>
|
#include <arch/exception.h>
|
||||||
#include <arch/hlt.h>
|
#include <arch/hlt.h>
|
||||||
#include <bootblock_common.h>
|
#include <bootblock_common.h>
|
||||||
#include <cbfs.h>
|
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
|
#include <program_loading.h>
|
||||||
#include <soc/clock.h>
|
#include <soc/clock.h>
|
||||||
#include <soc/nvidia/tegra/apbmisc.h>
|
#include <soc/nvidia/tegra/apbmisc.h>
|
||||||
#include <arch/stages.h>
|
|
||||||
|
|
||||||
#include "pinmux.h"
|
#include "pinmux.h"
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
void *entry;
|
|
||||||
|
|
||||||
// enable pinmux clamp inputs
|
// enable pinmux clamp inputs
|
||||||
clamp_tristate_inputs();
|
clamp_tristate_inputs();
|
||||||
|
|
||||||
@@ -68,15 +65,5 @@ void main(void)
|
|||||||
|
|
||||||
printk(BIOS_INFO, "T132 bootblock: Mainboard bootblock init done\n");
|
printk(BIOS_INFO, "T132 bootblock: Mainboard bootblock init done\n");
|
||||||
|
|
||||||
entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA,
|
run_romstage();
|
||||||
CONFIG_CBFS_PREFIX "/romstage");
|
|
||||||
|
|
||||||
if (entry) {
|
|
||||||
printk(BIOS_INFO, "T132 bootblock: jumping to romstage\n");
|
|
||||||
stage_exit(entry);
|
|
||||||
} else {
|
|
||||||
printk(BIOS_INFO, "T132 bootblock: fallback/romstage not found\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
hlt();
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user