blob: c43b249487be682bc3032f4200e776ebe98835b3 [file] [log] [blame]
Angel Ponsae593872020-04-04 18:50:57 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Martin Roth5c354b92019-04-22 14:55:16 -06002
Furquan Shaikh76cedd22020-05-02 10:24:23 -07003#include <acpi/acpi.h>
Raul E Rangel899be1b2021-02-05 15:50:20 -07004#include <amdblocks/memmap.h>
Felix Held0d2c0012021-04-12 23:44:14 +02005#include <amdblocks/pmlib.h>
Martin Roth81804272022-11-20 20:30:18 -07006#include <amdblocks/post_codes.h>
Martin Roth5c354b92019-04-22 14:55:16 -06007#include <commonlib/helpers.h>
8#include <console/console.h>
Elyes Haouasf743e0c2022-10-31 13:46:00 +01009#include <cpu/cpu.h>
Marshall Dawson00a22082020-01-20 23:05:31 -070010#include <fsp/api.h>
Felix Helddd737142021-03-26 00:44:35 +010011#include <program_loading.h>
Arthur Heymansbab9e2e2021-05-29 07:30:33 +020012#include <romstage_common.h>
Felix Helddd737142021-03-26 00:44:35 +010013#include <types.h>
Martin Roth5c354b92019-04-22 14:55:16 -060014
Arthur Heymansbab9e2e2021-05-29 07:30:33 +020015void __noreturn romstage_main(void)
Martin Roth5c354b92019-04-22 14:55:16 -060016{
Yuchen He1e67adb2023-07-25 21:28:36 +020017 post_code(POSTCODE_ROMSTAGE_MAIN);
Raul E Rangel5c124a92021-06-10 14:03:36 -060018
Aaron Durbinc30981c2020-08-14 16:54:44 -060019 /* Snapshot chipset state prior to any FSP call. */
20 fill_chipset_state();
21
Kyösti Mälkki9e591c42021-01-09 12:37:25 +020022 fsp_memory_init(acpi_is_wakeup_s3());
Martin Roth5c354b92019-04-22 14:55:16 -060023
Furquan Shaikhbc456502020-06-10 16:37:23 -070024 memmap_stash_early_dram_usage();
25
Marshall Dawson8f454fd2019-11-17 14:34:52 -070026 run_ramstage();
Martin Roth5c354b92019-04-22 14:55:16 -060027}