arch/arm64,arm: Prepare for !SEPARATE_ROMSTAGE
Prepare platforms for linking romstage code in the bootblock. Change-Id: Ic20799b4d6e3f62cd05791a2bd275000a12cc83c Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63420 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
parent
a91821b677
commit
3e914d3726
9 changed files with 83 additions and 19 deletions
|
@ -5,6 +5,7 @@
|
|||
#include <cbmem.h>
|
||||
#include <console/console.h>
|
||||
#include <program_loading.h>
|
||||
#include <romstage_common.h>
|
||||
#include <timestamp.h>
|
||||
|
||||
__weak void platform_romstage_main(void) { /* no-op, for bring-up */ }
|
||||
|
@ -15,8 +16,13 @@ void main(void)
|
|||
timestamp_add_now(TS_ROMSTAGE_START);
|
||||
|
||||
console_init();
|
||||
exception_init();
|
||||
|
||||
exception_init();
|
||||
romstage_main();
|
||||
}
|
||||
|
||||
void __noreturn romstage_main(void)
|
||||
{
|
||||
platform_romstage_main();
|
||||
cbmem_initialize_empty();
|
||||
platform_romstage_postram();
|
||||
|
|
|
@ -3,12 +3,16 @@
|
|||
#include <cbmem.h>
|
||||
#include <console/console.h>
|
||||
#include <program_loading.h>
|
||||
#include <romstage_common.h>
|
||||
|
||||
void main(void)
|
||||
{
|
||||
console_init();
|
||||
romstage_main();
|
||||
}
|
||||
|
||||
void __noreturn romstage_main(void)
|
||||
{
|
||||
cbmem_initialize_empty();
|
||||
|
||||
run_ramstage();
|
||||
}
|
||||
|
|
|
@ -4,17 +4,18 @@
|
|||
#include <armv7.h>
|
||||
#include <cbmem.h>
|
||||
#include <console/console.h>
|
||||
#include <program_loading.h>
|
||||
#include <device/i2c_simple.h>
|
||||
#include <drivers/maxim/max77686/max77686.h>
|
||||
#include <program_loading.h>
|
||||
#include <romstage_common.h>
|
||||
#include <soc/clk.h>
|
||||
#include <soc/cpu.h>
|
||||
#include <soc/dmc.h>
|
||||
#include <soc/gpio.h>
|
||||
#include <soc/i2c.h>
|
||||
#include <soc/setup.h>
|
||||
#include <soc/periph.h>
|
||||
#include <soc/power.h>
|
||||
#include <soc/setup.h>
|
||||
#include <soc/trustzone.h>
|
||||
#include <soc/wakeup.h>
|
||||
#include <timestamp.h>
|
||||
|
@ -119,12 +120,22 @@ static struct mem_timings *setup_clock(void)
|
|||
|
||||
void main(void)
|
||||
{
|
||||
struct mem_timings *mem;
|
||||
int is_resume = (get_wakeup_state() != IS_NOT_WAKEUP);
|
||||
|
||||
timestamp_init(timestamp_get());
|
||||
timestamp_add_now(TS_ROMSTAGE_START);
|
||||
|
||||
/*
|
||||
* From the clocks comment below it looks like serial console won't
|
||||
* work in the bootblock so keep in the romstage_main flow even with
|
||||
* !CONFIG SEPARATE_ROMSTAGE.
|
||||
*/
|
||||
romstage_main();
|
||||
}
|
||||
|
||||
void __noreturn romstage_main(void)
|
||||
{
|
||||
struct mem_timings *mem;
|
||||
int is_resume = (get_wakeup_state() != IS_NOT_WAKEUP);
|
||||
|
||||
/* Clock must be initialized before console_init, otherwise you may need
|
||||
* to re-initialize serial console drivers again. */
|
||||
mem = setup_clock();
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <device/i2c_simple.h>
|
||||
#include <drivers/maxim/max77802/max77802.h>
|
||||
#include <program_loading.h>
|
||||
#include <romstage_common.h>
|
||||
#include <soc/clk.h>
|
||||
#include <soc/cpu.h>
|
||||
#include <soc/dmc.h>
|
||||
|
@ -202,6 +203,19 @@ static void simple_spi_test(void)
|
|||
#endif
|
||||
|
||||
void main(void)
|
||||
{
|
||||
timestamp_init(timestamp_get());
|
||||
timestamp_add_now(TS_ROMSTAGE_START);
|
||||
|
||||
/*
|
||||
* From the clocks comment below it looks like serial console won't
|
||||
* work in the bootblock so keep in the romstage_main flow even with
|
||||
* !CONFIG SEPARATE_ROMSTAGE.
|
||||
*/
|
||||
romstage_main();
|
||||
}
|
||||
|
||||
void __noreturn romstage_main(void)
|
||||
{
|
||||
|
||||
extern struct mem_timings mem_timings;
|
||||
|
@ -211,9 +225,6 @@ void main(void)
|
|||
exynos5420_config_smp();
|
||||
power_init_failed = setup_power(is_resume);
|
||||
|
||||
timestamp_init(timestamp_get());
|
||||
timestamp_add_now(TS_ROMSTAGE_START);
|
||||
|
||||
/* Clock must be initialized before console_init, otherwise you may need
|
||||
* to re-initialize serial console drivers again. */
|
||||
system_clock_init();
|
||||
|
|
|
@ -8,11 +8,12 @@
|
|||
#include <console/console.h>
|
||||
#include <device/mmio.h>
|
||||
#include <program_loading.h>
|
||||
#include <soc/sdram.h>
|
||||
#include <romstage_common.h>
|
||||
#include <soc/clock.h>
|
||||
#include <soc/pwm.h>
|
||||
#include <soc/grf.h>
|
||||
#include <soc/pwm.h>
|
||||
#include <soc/rk808.h>
|
||||
#include <soc/sdram.h>
|
||||
#include <soc/tsadc.h>
|
||||
#include <symbols.h>
|
||||
#include <timestamp.h>
|
||||
|
@ -68,6 +69,12 @@ void main(void)
|
|||
|
||||
console_init();
|
||||
exception_init();
|
||||
|
||||
romstage_main();
|
||||
}
|
||||
|
||||
void __noreturn romstage_main(void)
|
||||
{
|
||||
configure_l2ctlr();
|
||||
tsadc_init();
|
||||
|
||||
|
|
|
@ -8,11 +8,12 @@
|
|||
#include <console/console.h>
|
||||
#include <device/mmio.h>
|
||||
#include <program_loading.h>
|
||||
#include <soc/sdram.h>
|
||||
#include <romstage_common.h>
|
||||
#include <soc/clock.h>
|
||||
#include <soc/pwm.h>
|
||||
#include <soc/grf.h>
|
||||
#include <soc/pwm.h>
|
||||
#include <soc/rk808.h>
|
||||
#include <soc/sdram.h>
|
||||
#include <soc/tsadc.h>
|
||||
#include <symbols.h>
|
||||
#include <timestamp.h>
|
||||
|
@ -62,6 +63,12 @@ void main(void)
|
|||
|
||||
console_init();
|
||||
exception_init();
|
||||
|
||||
romstage_main();
|
||||
}
|
||||
|
||||
void __noreturn romstage_main(void)
|
||||
{
|
||||
configure_l2ctlr();
|
||||
tsadc_init();
|
||||
|
||||
|
|
|
@ -2,17 +2,18 @@
|
|||
|
||||
#include <arch/cache.h>
|
||||
#include <arch/exception.h>
|
||||
#include <device/mmio.h>
|
||||
#include <armv7.h>
|
||||
#include <assert.h>
|
||||
#include <cbmem.h>
|
||||
#include <console/console.h>
|
||||
#include <device/mmio.h>
|
||||
#include <program_loading.h>
|
||||
#include <soc/sdram.h>
|
||||
#include <romstage_common.h>
|
||||
#include <soc/clock.h>
|
||||
#include <soc/pwm.h>
|
||||
#include <soc/grf.h>
|
||||
#include <soc/pwm.h>
|
||||
#include <soc/rk808.h>
|
||||
#include <soc/sdram.h>
|
||||
#include <soc/tsadc.h>
|
||||
#include <symbols.h>
|
||||
#include <timestamp.h>
|
||||
|
@ -68,6 +69,12 @@ void main(void)
|
|||
|
||||
console_init();
|
||||
exception_init();
|
||||
|
||||
romstage_main();
|
||||
}
|
||||
|
||||
void __noreturn romstage_main(void)
|
||||
{
|
||||
configure_l2ctlr();
|
||||
tsadc_init();
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <program_loading.h>
|
||||
#include <console/console.h>
|
||||
#include <cbmem.h>
|
||||
#include <romstage_common.h>
|
||||
|
||||
#include <soc/ti/am335x/sdram.h>
|
||||
#include "ddr3.h"
|
||||
|
@ -48,7 +49,11 @@ void main(void)
|
|||
{
|
||||
console_init();
|
||||
printk(BIOS_INFO, "Hello from romstage.\n");
|
||||
romstage_main();
|
||||
}
|
||||
|
||||
void __noreturn romstage_main(void)
|
||||
{
|
||||
config_ddr(400, &ioregs_bonelt, &ddr3_beagleblack_data, &ddr3_beagleblack_cmd_ctrl_data,
|
||||
&ddr3_beagleblack_emif_reg_data, 0);
|
||||
|
||||
|
|
|
@ -6,13 +6,14 @@
|
|||
#include <console/console.h>
|
||||
#include <lib.h>
|
||||
#include <program_loading.h>
|
||||
#include <romstage_common.h>
|
||||
#include <soc/addressmap.h>
|
||||
#include <soc/ccplex.h>
|
||||
#include <soc/clock.h>
|
||||
#include <soc/nvidia/tegra/apbmisc.h>
|
||||
#include <soc/romstage.h>
|
||||
#include <soc/sdram.h>
|
||||
#include <soc/sdram_configs.h>
|
||||
#include <soc/romstage.h>
|
||||
#include <soc/nvidia/tegra/apbmisc.h>
|
||||
#include <symbols.h>
|
||||
#include <vendorcode/google/chromeos/chromeos.h>
|
||||
|
||||
|
@ -26,6 +27,11 @@ void romstage(void)
|
|||
console_init();
|
||||
exception_init();
|
||||
|
||||
romstage_main();
|
||||
}
|
||||
|
||||
void __noreturn romstage_main(void)
|
||||
{
|
||||
printk(BIOS_INFO, "T210: romstage here\n");
|
||||
|
||||
#if CONFIG(BOOTROM_SDRAM_INIT)
|
||||
|
|
Loading…
Reference in a new issue