blob: 9ef899e5ac430de68b07b9e4d7f82112770311f3 [file] [log] [blame]
Felix Helddc2d3562020-12-02 14:38:53 +01001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#include <amdblocks/amd_pci_mmconf.h>
Felix Held2e1384a2021-02-12 15:49:06 +01004#include <amdblocks/cpu.h>
Felix Helddc2d3562020-12-02 14:38:53 +01005#include <bootblock_common.h>
Felix Held10252032020-12-08 17:34:59 +01006#include <console/console.h>
Felix Heldde10d5b2022-10-14 22:59:40 +02007#include <cpu/cpu.h>
Felix Held4911c3e2020-12-08 17:39:26 +01008#include <cpu/x86/tsc.h>
Felix Held153f92a2020-12-08 17:27:30 +01009#include <soc/southbridge.h>
Kangheui Wondad067f2021-05-06 15:53:37 +100010#include <soc/psp_transfer.h>
Felix Helddc2d3562020-12-02 14:38:53 +010011#include <stdint.h>
12
13asmlinkage void bootblock_c_entry(uint64_t base_timestamp)
14{
Felix Held21bc2ca2022-01-19 22:26:31 +010015 early_cache_setup();
Felix Held2e1384a2021-02-12 15:49:06 +010016 write_resume_eip();
Felix Helddc2d3562020-12-02 14:38:53 +010017 enable_pci_mmconf();
Felix Held4911c3e2020-12-08 17:39:26 +010018
Kangheui Wonbdb08182021-06-11 14:50:18 +100019 if (CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK))
20 boot_with_psp_timestamp(base_timestamp);
21
22 /*
23 * if VBOOT_STARTS_BEFORE_BOOTBLOCK is not selected or
24 * previous step did nothing, proceed with normal bootblock main.
25 */
Felix Held4911c3e2020-12-08 17:39:26 +010026 bootblock_main_with_basetime(base_timestamp);
Felix Helddc2d3562020-12-02 14:38:53 +010027}
28
29void bootblock_soc_early_init(void)
30{
Felix Held153f92a2020-12-08 17:27:30 +010031 fch_pre_init();
Felix Helddc2d3562020-12-02 14:38:53 +010032}
33
34void bootblock_soc_init(void)
35{
Felix Held10252032020-12-08 17:34:59 +010036 u32 val = cpuid_eax(1);
37 printk(BIOS_DEBUG, "Family_Model: %08x\n", val);
Kangheui Wondad067f2021-05-06 15:53:37 +100038
39 if (CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK)) {
40 verify_psp_transfer_buf();
41 show_psp_transfer_info();
42 }
43
Felix Held153f92a2020-12-08 17:27:30 +010044 fch_early_init();
Felix Helddc2d3562020-12-02 14:38:53 +010045}