Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 3 | #include <acpi/acpi.h> |
| 4 | #include <amdblocks/acpimmio.h> |
| 5 | #include <amdblocks/memmap.h> |
| 6 | #include <amdblocks/pmlib.h> |
Martin Roth | 8180427 | 2022-11-20 20:30:18 -0700 | [diff] [blame] | 7 | #include <amdblocks/post_codes.h> |
Martin Roth | 300338f | 2022-10-14 14:55:25 -0600 | [diff] [blame] | 8 | #include <amdblocks/stb.h> |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 9 | #include <console/console.h> |
Elyes Haouas | f743e0c | 2022-10-31 13:46:00 +0100 | [diff] [blame] | 10 | #include <cpu/cpu.h> |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 11 | #include <fsp/api.h> |
| 12 | #include <program_loading.h> |
Arthur Heymans | bab9e2e | 2021-05-29 07:30:33 +0200 | [diff] [blame] | 13 | #include <romstage_common.h> |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 14 | |
Arthur Heymans | bab9e2e | 2021-05-29 07:30:33 +0200 | [diff] [blame] | 15 | void __noreturn romstage_main(void) |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 16 | { |
Martin Roth | 8180427 | 2022-11-20 20:30:18 -0700 | [diff] [blame] | 17 | post_code(POST_ROMSTAGE_MAIN); |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 18 | |
Martin Roth | 300338f | 2022-10-14 14:55:25 -0600 | [diff] [blame] | 19 | if (CONFIG(WRITE_STB_BUFFER_TO_CONSOLE)) |
| 20 | write_stb_to_console(); |
| 21 | |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 22 | /* Snapshot chipset state prior to any FSP call */ |
| 23 | fill_chipset_state(); |
| 24 | |
| 25 | fsp_memory_init(acpi_is_wakeup_s3()); |
| 26 | |
| 27 | /* Fixup settings FSP-M should not be changing */ |
| 28 | fch_disable_legacy_dma_io(); |
| 29 | |
| 30 | memmap_stash_early_dram_usage(); |
| 31 | |
| 32 | run_ramstage(); |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 33 | } |