aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/amd/agesa/romstage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/amd/agesa/romstage.c')
-rw-r--r--src/drivers/amd/agesa/romstage.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/drivers/amd/agesa/romstage.c b/src/drivers/amd/agesa/romstage.c
index 48a81c57df..dbf8bd6070 100644
--- a/src/drivers/amd/agesa/romstage.c
+++ b/src/drivers/amd/agesa/romstage.c
@@ -11,6 +11,7 @@
* GNU General Public License for more details.
*/
+#include <amdblocks/biosram.h>
#include <arch/acpi.h>
#include <arch/cpu.h>
#include <arch/romstage.h>
@@ -26,6 +27,8 @@
#include <northbridge/amd/agesa/agesa_helper.h>
#include <northbridge/amd/agesa/state_machine.h>
+void __weak board_BeforeAgesa(struct sysinfo *cb) { }
+
void __weak platform_once(struct sysinfo *cb)
{
board_BeforeAgesa(cb);
@@ -39,6 +42,11 @@ static void fill_sysinfo(struct sysinfo *cb)
agesa_set_interface(cb);
}
+/* APs will enter directly here from bootblock, bypassing verstage
+ * and potential fallback / normal bootflow detection.
+ */
+static void ap_romstage_main(void);
+
static void romstage_main(void)
{
struct postcar_frame pcf;
@@ -48,13 +56,15 @@ static void romstage_main(void)
int cbmem_initted = 0;
/* Enable PCI MMIO configuration. */
- amd_initmmio();
+ if (CONFIG(ROMCC_BOOTBLOCK))
+ amd_initmmio();
fill_sysinfo(cb);
if (initial_apic_id == 0) {
- timestamp_init(timestamp_get());
+ if (CONFIG(ROMCC_BOOTBLOCK))
+ timestamp_init(timestamp_get());
timestamp_add_now(TS_START_ROMSTAGE);
platform_once(cb);
@@ -65,6 +75,9 @@ static void romstage_main(void)
printk(BIOS_DEBUG, "APIC %02d: CPU Family_Model = %08x\n",
initial_apic_id, cpuid_eax(1));
+ if (!CONFIG(ROMCC_BOOTBLOCK))
+ set_ap_entry_ptr(ap_romstage_main);
+
agesa_execute_state(cb, AMD_INIT_RESET);
agesa_execute_state(cb, AMD_INIT_EARLY);
@@ -105,7 +118,8 @@ static void ap_romstage_main(void)
struct sysinfo *cb = &romstage_state;
/* Enable PCI MMIO configuration. */
- amd_initmmio();
+ if (CONFIG(ROMCC_BOOTBLOCK))
+ amd_initmmio();
fill_sysinfo(cb);
@@ -117,6 +131,7 @@ static void ap_romstage_main(void)
halt();
}
+#if CONFIG(ROMCC_BOOTBLOCK)
/* This wrapper enables easy transition away from ROMCC_BOOTBLOCK
* keeping changes in cache_as_ram.S easy to manage.
*/
@@ -129,3 +144,9 @@ asmlinkage void ap_bootblock_c_entry(void)
{
ap_romstage_main();
}
+#else
+asmlinkage void car_stage_entry(void)
+{
+ romstage_main();
+}
+#endif