blob: 76db62e3fdf32133a7a9ce53548830bf3e865fd3 [file] [log] [blame]
Patrick Georgiac959032020-05-05 22:49:26 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Mariusz Szafranskia4041332017-08-02 17:28:17 +02002
Mariusz Szafranskia4041332017-08-02 17:28:17 +02003#include <bootblock_common.h>
Mariusz Szafranskia4041332017-08-02 17:28:17 +02004#include <device/pci.h>
5#include <FsptUpd.h>
6#include <intelblocks/fast_spi.h>
Mariusz Szafranskia4041332017-08-02 17:28:17 +02007#include <soc/bootblock.h>
8#include <soc/iomap.h>
9#include <spi-generic.h>
Mariusz Szafranskia4041332017-08-02 17:28:17 +020010#include <console/console.h>
11
12const FSPT_UPD temp_ram_init_params = {
13 .FspUpdHeader = {
14 .Signature = 0x545F445055564E44ULL,
15 .Revision = 1,
16 .Reserved = {0},
17 },
18 .FsptCoreUpd = {
Subrata Banik24ab1c52019-11-25 11:57:28 +053019 /*
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 Szafranskia4041332017-08-02 17:28:17 +020032 .CodeRegionBase =
Arthur Heymans62c0b612019-02-05 21:10:01 +010033 (UINT32)(0x100000000ULL - CONFIG_ROM_SIZE),
34 .CodeRegionLength = (UINT32)CONFIG_ROM_SIZE,
Mariusz Szafranskia4041332017-08-02 17:28:17 +020035 .Reserved1 = {0},
36 },
37 .FsptConfig = {
38 .PcdFsptPort80RouteDisable = 0,
39 .ReservedTempRamInitUpd = {0},
40 },
41 .UnusedUpdSpace0 = {0},
42 .UpdTerminator = 0x55AA,
43};
44
45asmlinkage void bootblock_c_entry(uint64_t base_timestamp)
46{
47 /* Call lib/bootblock.c main */
Kyösti Mälkki101ef0b2019-08-18 06:58:42 +030048 bootblock_main_with_basetime(base_timestamp);
Mariusz Szafranskia4041332017-08-02 17:28:17 +020049};
50
51void bootblock_soc_early_init(void)
52{
53
Julius Wernercd49cce2019-03-05 16:53:33 -080054#if (CONFIG(CONSOLE_SERIAL))
Mariusz Szafranskia4041332017-08-02 17:28:17 +020055 early_uart_init();
56#endif
57};
58
59void bootblock_soc_init(void)
60{
Julius Wernercd49cce2019-03-05 16:53:33 -080061 if (CONFIG(BOOTBLOCK_CONSOLE))
Mariusz Szafranskia4041332017-08-02 17:28:17 +020062 printk(BIOS_DEBUG, "FSP TempRamInit successful...\n");
63};