Angel Pons | ae59387 | 2020-04-04 18:50:57 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 2 | |
Furquan Shaikh | 76cedd2 | 2020-05-02 10:24:23 -0700 | [diff] [blame] | 3 | #include <acpi/acpi.h> |
Raul E Rangel | 899be1b | 2021-02-05 15:50:20 -0700 | [diff] [blame] | 4 | #include <amdblocks/memmap.h> |
Felix Held | 0d2c001 | 2021-04-12 23:44:14 +0200 | [diff] [blame] | 5 | #include <amdblocks/pmlib.h> |
Martin Roth | 8180427 | 2022-11-20 20:30:18 -0700 | [diff] [blame] | 6 | #include <amdblocks/post_codes.h> |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 7 | #include <commonlib/helpers.h> |
8 | #include <console/console.h> | ||||
Elyes Haouas | f743e0c | 2022-10-31 13:46:00 +0100 | [diff] [blame] | 9 | #include <cpu/cpu.h> |
Marshall Dawson | 00a2208 | 2020-01-20 23:05:31 -0700 | [diff] [blame] | 10 | #include <fsp/api.h> |
Felix Held | dd73714 | 2021-03-26 00:44:35 +0100 | [diff] [blame] | 11 | #include <program_loading.h> |
Arthur Heymans | bab9e2e | 2021-05-29 07:30:33 +0200 | [diff] [blame] | 12 | #include <romstage_common.h> |
Felix Held | dd73714 | 2021-03-26 00:44:35 +0100 | [diff] [blame] | 13 | #include <types.h> |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 14 | |
Arthur Heymans | bab9e2e | 2021-05-29 07:30:33 +0200 | [diff] [blame] | 15 | void __noreturn romstage_main(void) |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 16 | { |
Martin Roth | 8180427 | 2022-11-20 20:30:18 -0700 | [diff] [blame] | 17 | post_code(POST_ROMSTAGE_MAIN); |
Raul E Rangel | 5c124a9 | 2021-06-10 14:03:36 -0600 | [diff] [blame] | 18 | |
Aaron Durbin | c30981c | 2020-08-14 16:54:44 -0600 | [diff] [blame] | 19 | /* Snapshot chipset state prior to any FSP call. */ |
20 | fill_chipset_state(); | ||||
21 | |||||
Kyösti Mälkki | 9e591c4 | 2021-01-09 12:37:25 +0200 | [diff] [blame] | 22 | fsp_memory_init(acpi_is_wakeup_s3()); |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 23 | |
Furquan Shaikh | bc45650 | 2020-06-10 16:37:23 -0700 | [diff] [blame] | 24 | memmap_stash_early_dram_usage(); |
25 | |||||
Marshall Dawson | 8f454fd | 2019-11-17 14:34:52 -0700 | [diff] [blame] | 26 | run_ramstage(); |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 27 | } |