blob: c5dfbdaa1806ec915797cdcb5583d5bea378f9dc [file] [log] [blame]
Felix Held3c44c622022-01-10 20:57:29 +01001/* SPDX-License-Identifier: GPL-2.0-only */
2
3/* TODO: Check if this is still correct */
4
5#include <acpi/acpi.h>
6#include <amdblocks/acpimmio.h>
7#include <amdblocks/memmap.h>
8#include <amdblocks/pmlib.h>
9#include <arch/cpu.h>
10#include <console/console.h>
11#include <fsp/api.h>
12#include <program_loading.h>
Arthur Heymansbab9e2e2021-05-29 07:30:33 +020013#include <romstage_common.h>
Felix Held3c44c622022-01-10 20:57:29 +010014
Arthur Heymansbab9e2e2021-05-29 07:30:33 +020015void __noreturn romstage_main(void)
Felix Held3c44c622022-01-10 20:57:29 +010016{
Felix Held3c44c622022-01-10 20:57:29 +010017 post_code(0x40);
18
Felix Held3c44c622022-01-10 20:57:29 +010019 /* Snapshot chipset state prior to any FSP call */
20 fill_chipset_state();
21
22 fsp_memory_init(acpi_is_wakeup_s3());
23
24 /* Fixup settings FSP-M should not be changing */
25 fch_disable_legacy_dma_io();
26
27 memmap_stash_early_dram_usage();
28
29 run_ramstage();
Arthur Heymansbab9e2e2021-05-29 07:30:33 +020030 die("failed to load ramstage\n");
Felix Held3c44c622022-01-10 20:57:29 +010031}