aboutsummaryrefslogtreecommitdiff
path: root/src/soc/amd/stoneyridge/bootblock
diff options
context:
space:
mode:
authorRichard Spiegel <richard.spiegel@amd.corp-partner.google.com>2018-04-04 10:35:21 -0700
committerMartin Roth <martinroth@google.com>2018-04-10 17:09:22 +0000
commit6d61db0d2cec4a3b141da77bcf5675b8b154c8b7 (patch)
tree8e2d52d4603121327fad16fee5f929e80dd35f60 /src/soc/amd/stoneyridge/bootblock
parent09a16e6a323e16b0428c4cbd3beae38d394aa91e (diff)
soc/amd/stoneyridege: Create AP jump structure
As part of moving AGESA calls from bootblock to romstage, create infrastructure to pass a pointer to the AP cores, so they can jump directly to romstage. BUG=b:74236170 TEST=Build and boot grunt, actual test will be performed at a later patch. Change-Id: If716d1c1970746f2ad90ef71ae9062c99f219897 Signed-off-by: Richard Spiegel <richard.spiegel@silverbackltd.com> Reviewed-on: https://review.coreboot.org/25526 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc/amd/stoneyridge/bootblock')
-rw-r--r--src/soc/amd/stoneyridge/bootblock/bootblock.c66
1 files changed, 40 insertions, 26 deletions
diff --git a/src/soc/amd/stoneyridge/bootblock/bootblock.c b/src/soc/amd/stoneyridge/bootblock/bootblock.c
index db5c9b62b9..6ee2095b23 100644
--- a/src/soc/amd/stoneyridge/bootblock/bootblock.c
+++ b/src/soc/amd/stoneyridge/bootblock/bootblock.c
@@ -30,21 +30,7 @@
#include <soc/southbridge.h>
#include <amdblocks/psp.h>
#include <timestamp.h>
-
-asmlinkage void bootblock_c_entry(uint64_t base_timestamp)
-{
- /*
- * Call lib/bootblock.c main with BSP, shortcut for APs
- * todo: rearchitect AGESA entry points to remove need
- * to run amdinitreset, amdinitearly from bootblock.
- * Remove AP shortcut.
- */
- if (!boot_cpu())
- bootblock_soc_early_init(); /* APs will not return */
-
- /* TSC cannot be relied upon. Override the TSC value passed in. */
- bootblock_main_with_timestamp(timestamp_get());
-}
+#include <halt.h>
/* Set the MMIO Configuration Base Address and Bus Range. */
static void amd_initmmio(void)
@@ -66,15 +52,48 @@ static void amd_initmmio(void)
set_var_mtrr(mtrr, FLASH_BASE_ADDR, CONFIG_ROM_SIZE, MTRR_TYPE_WRPROT);
}
-void bootblock_soc_early_init(void)
+/*
+ * To move AGESA calls to romstage, just move agesa_call() and bsp_agesa_call()
+ * to romstage.c. Also move the call to bsp_agesa_call() to the marked location
+ * in romstage.c.
+ */
+static void agesa_call(void)
+{
+ post_code(0x37);
+ do_agesawrapper(agesawrapper_amdinitreset, "amdinitreset");
+
+ post_code(0x38);
+ /* APs will not exit amdinitearly */
+ do_agesawrapper(agesawrapper_amdinitearly, "amdinitearly");
+}
+
+static void bsp_agesa_call(void)
+{
+ set_ap_entry_ptr(agesa_call); /* indicate the path to the AP */
+ agesa_call();
+}
+
+asmlinkage void bootblock_c_entry(uint64_t base_timestamp)
{
amd_initmmio();
+ /*
+ * Call lib/bootblock.c main with BSP, shortcut for APs
+ */
+ if (!boot_cpu()) {
+ void (*ap_romstage_entry)(void) =
+ (void (*)(void))get_ap_entry_ptr();
- if (!boot_cpu())
- bootblock_soc_init(); /* APs will not return */
+ ap_romstage_entry(); /* execution does not return */
+ halt();
+ }
- bootblock_fch_early_init();
+ /* TSC cannot be relied upon. Override the TSC value passed in. */
+ bootblock_main_with_timestamp(timestamp_get());
+}
+void bootblock_soc_early_init(void)
+{
+ bootblock_fch_early_init();
post_code(0x90);
}
@@ -118,15 +137,10 @@ void bootblock_soc_init(void)
u32 val = cpuid_eax(1);
printk(BIOS_DEBUG, "Family_Model: %08x\n", val);
- if (boot_cpu() && IS_ENABLED(CONFIG_SOC_AMD_PSP_SELECTABLE_SMU_FW))
+ if (IS_ENABLED(CONFIG_SOC_AMD_PSP_SELECTABLE_SMU_FW))
load_smu_fw1();
- post_code(0x37);
- do_agesawrapper(agesawrapper_amdinitreset, "amdinitreset");
-
- post_code(0x38);
- /* APs will not exit amdinitearly */
- do_agesawrapper(agesawrapper_amdinitearly, "amdinitearly");
+ bsp_agesa_call();
/* Initialize any early i2c buses. */
i2c_soc_early_init();