2020-04-04 02:37:04 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2020-12-10 00:06:12 +01:00
|
|
|
#include <amdblocks/cpu.h>
|
2020-04-04 02:37:04 +02:00
|
|
|
#include <bootblock_common.h>
|
|
|
|
#include <console/console.h>
|
2020-09-17 09:04:12 +02:00
|
|
|
#include <cpu/x86/tsc.h>
|
2020-08-13 19:06:18 +02:00
|
|
|
#include <soc/psp_transfer.h>
|
2020-04-04 02:37:04 +02:00
|
|
|
#include <soc/southbridge.h>
|
|
|
|
#include <amdblocks/amd_pci_mmconf.h>
|
|
|
|
|
|
|
|
asmlinkage void bootblock_c_entry(uint64_t base_timestamp)
|
|
|
|
{
|
2022-01-19 22:26:31 +01:00
|
|
|
early_cache_setup();
|
2020-06-05 00:42:50 +02:00
|
|
|
write_resume_eip();
|
2020-04-04 02:37:04 +02:00
|
|
|
enable_pci_mmconf();
|
|
|
|
|
2020-09-17 09:04:12 +02:00
|
|
|
/*
|
|
|
|
* base_timestamp is raw tsc value. We need to divide by tsc_freq_mhz
|
|
|
|
* when we use micro-seconds granularity for Zork
|
|
|
|
*/
|
|
|
|
base_timestamp /= tsc_freq_mhz();
|
|
|
|
|
|
|
|
if (CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK))
|
|
|
|
boot_with_psp_timestamp(base_timestamp);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* if VBOOT_STARTS_BEFORE_BOOTBLOCK is not selected or
|
|
|
|
* previous step did nothing, proceed with normal bootblock main.
|
|
|
|
*/
|
2020-04-04 02:37:04 +02:00
|
|
|
bootblock_main_with_basetime(base_timestamp);
|
|
|
|
}
|
|
|
|
|
|
|
|
void bootblock_soc_early_init(void)
|
|
|
|
{
|
|
|
|
fch_pre_init();
|
|
|
|
}
|
|
|
|
|
|
|
|
void bootblock_soc_init(void)
|
|
|
|
{
|
|
|
|
u32 val = cpuid_eax(1);
|
|
|
|
printk(BIOS_DEBUG, "Family_Model: %08x\n", val);
|
|
|
|
|
2020-10-06 23:29:28 +02:00
|
|
|
if (CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK)) {
|
|
|
|
verify_psp_transfer_buf();
|
2020-10-07 02:11:12 +02:00
|
|
|
show_psp_transfer_info();
|
2020-06-25 03:42:44 +02:00
|
|
|
}
|
|
|
|
|
2020-04-04 02:37:04 +02:00
|
|
|
fch_early_init();
|
|
|
|
}
|