Felix Held | dc2d356 | 2020-12-02 14:38:53 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <amdblocks/amd_pci_mmconf.h> |
Felix Held | 2e1384a | 2021-02-12 15:49:06 +0100 | [diff] [blame] | 4 | #include <amdblocks/cpu.h> |
Felix Held | dc2d356 | 2020-12-02 14:38:53 +0100 | [diff] [blame] | 5 | #include <bootblock_common.h> |
Felix Held | 1025203 | 2020-12-08 17:34:59 +0100 | [diff] [blame] | 6 | #include <console/console.h> |
Felix Held | de10d5b | 2022-10-14 22:59:40 +0200 | [diff] [blame] | 7 | #include <cpu/cpu.h> |
Felix Held | 4911c3e | 2020-12-08 17:39:26 +0100 | [diff] [blame] | 8 | #include <cpu/x86/tsc.h> |
Felix Held | 153f92a | 2020-12-08 17:27:30 +0100 | [diff] [blame] | 9 | #include <soc/southbridge.h> |
Kangheui Won | dad067f | 2021-05-06 15:53:37 +1000 | [diff] [blame] | 10 | #include <soc/psp_transfer.h> |
Felix Held | dc2d356 | 2020-12-02 14:38:53 +0100 | [diff] [blame] | 11 | #include <stdint.h> |
| 12 | |
| 13 | asmlinkage void bootblock_c_entry(uint64_t base_timestamp) |
| 14 | { |
Felix Held | 21bc2ca | 2022-01-19 22:26:31 +0100 | [diff] [blame] | 15 | early_cache_setup(); |
Felix Held | 2e1384a | 2021-02-12 15:49:06 +0100 | [diff] [blame] | 16 | write_resume_eip(); |
Felix Held | dc2d356 | 2020-12-02 14:38:53 +0100 | [diff] [blame] | 17 | enable_pci_mmconf(); |
Felix Held | 4911c3e | 2020-12-08 17:39:26 +0100 | [diff] [blame] | 18 | |
Kangheui Won | bdb0818 | 2021-06-11 14:50:18 +1000 | [diff] [blame] | 19 | 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 Held | 4911c3e | 2020-12-08 17:39:26 +0100 | [diff] [blame] | 26 | bootblock_main_with_basetime(base_timestamp); |
Felix Held | dc2d356 | 2020-12-02 14:38:53 +0100 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | void bootblock_soc_early_init(void) |
| 30 | { |
Felix Held | 153f92a | 2020-12-08 17:27:30 +0100 | [diff] [blame] | 31 | fch_pre_init(); |
Felix Held | dc2d356 | 2020-12-02 14:38:53 +0100 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | void bootblock_soc_init(void) |
| 35 | { |
Felix Held | 1025203 | 2020-12-08 17:34:59 +0100 | [diff] [blame] | 36 | u32 val = cpuid_eax(1); |
| 37 | printk(BIOS_DEBUG, "Family_Model: %08x\n", val); |
Kangheui Won | dad067f | 2021-05-06 15:53:37 +1000 | [diff] [blame] | 38 | |
| 39 | if (CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK)) { |
| 40 | verify_psp_transfer_buf(); |
| 41 | show_psp_transfer_info(); |
| 42 | } |
| 43 | |
Felix Held | 153f92a | 2020-12-08 17:27:30 +0100 | [diff] [blame] | 44 | fch_early_init(); |
Felix Held | dc2d356 | 2020-12-02 14:38:53 +0100 | [diff] [blame] | 45 | } |