blob: 0f72471c0866f38af7b6311c96b3ae6c57fd4ca7 [file] [log] [blame]
Patrick Georgi02363b52020-05-05 20:48:50 +02001/* This file is part of the coreboot project. */
Patrick Georgiac959032020-05-05 22:49:26 +02002/* SPDX-License-Identifier: GPL-2.0-or-later */
Mariusz Szafranskia4041332017-08-02 17:28:17 +02003
Mariusz Szafranskia4041332017-08-02 17:28:17 +02004#include <bootblock_common.h>
5#include <cpu/x86/mtrr.h>
6#include <device/pci.h>
7#include <FsptUpd.h>
8#include <intelblocks/fast_spi.h>
Mariusz Szafranskia4041332017-08-02 17:28:17 +02009#include <soc/bootblock.h>
10#include <soc/iomap.h>
11#include <spi-generic.h>
Mariusz Szafranskia4041332017-08-02 17:28:17 +020012#include <console/console.h>
13
14const FSPT_UPD temp_ram_init_params = {
15 .FspUpdHeader = {
16 .Signature = 0x545F445055564E44ULL,
17 .Revision = 1,
18 .Reserved = {0},
19 },
20 .FsptCoreUpd = {
Subrata Banik24ab1c52019-11-25 11:57:28 +053021 /*
22 * It is a requirement for firmware to have Firmware Interface Table
23 * (FIT), which contains pointers to each microcode update.
24 * The microcode update is loaded for all logical processors before
25 * cpu reset vector.
26 *
27 * All SoC since Gen-4 has above mechanism in place to load microcode
28 * even before hitting CPU reset vector. Hence skipping FSP-T loading
29 * microcode after CPU reset by passing '0' value to
30 * FSPT_UPD.MicrocodeRegionBase and FSPT_UPD.MicrocodeRegionLength.
31 */
32 .MicrocodeRegionBase = 0,
33 .MicrocodeRegionLength = 0,
Mariusz Szafranskia4041332017-08-02 17:28:17 +020034 .CodeRegionBase =
Arthur Heymans62c0b612019-02-05 21:10:01 +010035 (UINT32)(0x100000000ULL - CONFIG_ROM_SIZE),
36 .CodeRegionLength = (UINT32)CONFIG_ROM_SIZE,
Mariusz Szafranskia4041332017-08-02 17:28:17 +020037 .Reserved1 = {0},
38 },
39 .FsptConfig = {
40 .PcdFsptPort80RouteDisable = 0,
41 .ReservedTempRamInitUpd = {0},
42 },
43 .UnusedUpdSpace0 = {0},
44 .UpdTerminator = 0x55AA,
45};
46
47asmlinkage void bootblock_c_entry(uint64_t base_timestamp)
48{
49 /* Call lib/bootblock.c main */
Kyösti Mälkki101ef0b2019-08-18 06:58:42 +030050 bootblock_main_with_basetime(base_timestamp);
Mariusz Szafranskia4041332017-08-02 17:28:17 +020051};
52
53void bootblock_soc_early_init(void)
54{
55
Julius Wernercd49cce2019-03-05 16:53:33 -080056#if (CONFIG(CONSOLE_SERIAL))
Mariusz Szafranskia4041332017-08-02 17:28:17 +020057 early_uart_init();
58#endif
59};
60
61void bootblock_soc_init(void)
62{
Julius Wernercd49cce2019-03-05 16:53:33 -080063 if (CONFIG(BOOTBLOCK_CONSOLE))
Mariusz Szafranskia4041332017-08-02 17:28:17 +020064 printk(BIOS_DEBUG, "FSP TempRamInit successful...\n");
65};