Patrick Georgi | ac95903 | 2020-05-05 22:49:26 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Mariusz Szafranski | a404133 | 2017-08-02 17:28:17 +0200 | [diff] [blame] | 2 | |
Mariusz Szafranski | a404133 | 2017-08-02 17:28:17 +0200 | [diff] [blame] | 3 | #include <bootblock_common.h> |
Mariusz Szafranski | a404133 | 2017-08-02 17:28:17 +0200 | [diff] [blame] | 4 | #include <device/pci.h> |
| 5 | #include <FsptUpd.h> |
| 6 | #include <intelblocks/fast_spi.h> |
Mariusz Szafranski | a404133 | 2017-08-02 17:28:17 +0200 | [diff] [blame] | 7 | #include <soc/bootblock.h> |
| 8 | #include <soc/iomap.h> |
| 9 | #include <spi-generic.h> |
Mariusz Szafranski | a404133 | 2017-08-02 17:28:17 +0200 | [diff] [blame] | 10 | #include <console/console.h> |
| 11 | |
| 12 | const FSPT_UPD temp_ram_init_params = { |
| 13 | .FspUpdHeader = { |
| 14 | .Signature = 0x545F445055564E44ULL, |
| 15 | .Revision = 1, |
| 16 | .Reserved = {0}, |
| 17 | }, |
| 18 | .FsptCoreUpd = { |
Subrata Banik | 24ab1c5 | 2019-11-25 11:57:28 +0530 | [diff] [blame] | 19 | /* |
| 20 | * It is a requirement for firmware to have Firmware Interface Table |
| 21 | * (FIT), which contains pointers to each microcode update. |
| 22 | * The microcode update is loaded for all logical processors before |
| 23 | * cpu reset vector. |
| 24 | * |
| 25 | * All SoC since Gen-4 has above mechanism in place to load microcode |
| 26 | * even before hitting CPU reset vector. Hence skipping FSP-T loading |
| 27 | * microcode after CPU reset by passing '0' value to |
| 28 | * FSPT_UPD.MicrocodeRegionBase and FSPT_UPD.MicrocodeRegionLength. |
| 29 | */ |
| 30 | .MicrocodeRegionBase = 0, |
| 31 | .MicrocodeRegionLength = 0, |
Mariusz Szafranski | a404133 | 2017-08-02 17:28:17 +0200 | [diff] [blame] | 32 | .CodeRegionBase = |
Arthur Heymans | 62c0b61 | 2019-02-05 21:10:01 +0100 | [diff] [blame] | 33 | (UINT32)(0x100000000ULL - CONFIG_ROM_SIZE), |
| 34 | .CodeRegionLength = (UINT32)CONFIG_ROM_SIZE, |
Mariusz Szafranski | a404133 | 2017-08-02 17:28:17 +0200 | [diff] [blame] | 35 | .Reserved1 = {0}, |
| 36 | }, |
| 37 | .FsptConfig = { |
| 38 | .PcdFsptPort80RouteDisable = 0, |
| 39 | .ReservedTempRamInitUpd = {0}, |
| 40 | }, |
| 41 | .UnusedUpdSpace0 = {0}, |
| 42 | .UpdTerminator = 0x55AA, |
| 43 | }; |
| 44 | |
| 45 | asmlinkage void bootblock_c_entry(uint64_t base_timestamp) |
| 46 | { |
| 47 | /* Call lib/bootblock.c main */ |
Kyösti Mälkki | 101ef0b | 2019-08-18 06:58:42 +0300 | [diff] [blame] | 48 | bootblock_main_with_basetime(base_timestamp); |
Mariusz Szafranski | a404133 | 2017-08-02 17:28:17 +0200 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | void bootblock_soc_early_init(void) |
| 52 | { |
| 53 | |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 54 | #if (CONFIG(CONSOLE_SERIAL)) |
Mariusz Szafranski | a404133 | 2017-08-02 17:28:17 +0200 | [diff] [blame] | 55 | early_uart_init(); |
| 56 | #endif |
| 57 | }; |
| 58 | |
| 59 | void bootblock_soc_init(void) |
| 60 | { |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 61 | if (CONFIG(BOOTBLOCK_CONSOLE)) |
Mariusz Szafranski | a404133 | 2017-08-02 17:28:17 +0200 | [diff] [blame] | 62 | printk(BIOS_DEBUG, "FSP TempRamInit successful...\n"); |
| 63 | }; |