Angel Pons | 4b42983 | 2020-04-02 23:48:50 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Kyösti Mälkki | d610c58 | 2017-03-05 06:28:18 +0200 | [diff] [blame] | 2 | |
| 3 | #ifndef _AGESA_HELPER_H_ |
| 4 | #define _AGESA_HELPER_H_ |
| 5 | |
Kyösti Mälkki | da74041 | 2017-03-05 18:57:03 +0200 | [diff] [blame] | 6 | #include <stddef.h> |
Kyösti Mälkki | a963acd | 2019-08-16 20:34:25 +0300 | [diff] [blame] | 7 | #include <arch/romstage.h> |
Kyösti Mälkki | da74041 | 2017-03-05 18:57:03 +0200 | [diff] [blame] | 8 | |
Kyösti Mälkki | d610c58 | 2017-03-05 06:28:18 +0200 | [diff] [blame] | 9 | enum { |
| 10 | PICK_DMI, /* DMI Interface */ |
| 11 | PICK_PSTATE, /* Acpi Pstate SSDT Table */ |
| 12 | PICK_SRAT, /* SRAT Table */ |
| 13 | PICK_SLIT, /* SLIT Table */ |
| 14 | PICK_WHEA_MCE, /* WHEA MCE table */ |
| 15 | PICK_WHEA_CMC, /* WHEA CMV table */ |
| 16 | PICK_ALIB, /* SACPI SSDT table with ALIB implementation */ |
| 17 | PICK_IVRS, /* IOMMU ACPI IVRS(I/O Virtualization Reporting Structure) table */ |
Kyösti Mälkki | 0e01c48 | 2017-07-27 06:15:02 +0300 | [diff] [blame] | 18 | PICK_CRAT, /* Component Resource Affinity Table table */ |
| 19 | PICK_CDIT, /* Component Locality Distance Information table */ |
Kyösti Mälkki | d610c58 | 2017-03-05 06:28:18 +0200 | [diff] [blame] | 20 | }; |
| 21 | |
Elyes Haouas | f9b535e | 2022-07-16 09:47:42 +0200 | [diff] [blame^] | 22 | void agesawrapper_setlateinitptr(void *Late); |
| 23 | void *agesawrapper_getlateinitptr(int pick); |
Kyösti Mälkki | d610c58 | 2017-03-05 06:28:18 +0200 | [diff] [blame] | 24 | |
| 25 | void amd_initcpuio(void); |
Kyösti Mälkki | d610c58 | 2017-03-05 06:28:18 +0200 | [diff] [blame] | 26 | void amd_initenv(void); |
| 27 | |
Kyösti Mälkki | da74041 | 2017-03-05 18:57:03 +0200 | [diff] [blame] | 28 | void *GetHeapBase(void); |
| 29 | void EmptyHeap(void); |
Kyösti Mälkki | da74041 | 2017-03-05 18:57:03 +0200 | [diff] [blame] | 30 | |
| 31 | #define BSP_STACK_BASE_ADDR 0x30000 |
| 32 | |
Kyösti Mälkki | da74041 | 2017-03-05 18:57:03 +0200 | [diff] [blame] | 33 | /* This covers node 0 only. */ |
| 34 | #define HIGH_ROMSTAGE_STACK_SIZE (0x48000 - BSP_STACK_BASE_ADDR) |
Kyösti Mälkki | da74041 | 2017-03-05 18:57:03 +0200 | [diff] [blame] | 35 | |
| 36 | #define HIGH_MEMORY_SCRATCH 0x30000 |
| 37 | |
Kyösti Mälkki | 63fac81 | 2017-09-02 16:41:43 +0300 | [diff] [blame] | 38 | void fixup_cbmem_to_UC(int s3resume); |
Kyösti Mälkki | da74041 | 2017-03-05 18:57:03 +0200 | [diff] [blame] | 39 | |
Kyösti Mälkki | d4955f0 | 2017-09-08 07:14:17 +0300 | [diff] [blame] | 40 | void restore_mtrr(void); |
Arthur Heymans | 750d57f | 2020-08-07 22:12:09 +0200 | [diff] [blame] | 41 | void backup_mtrr(void); |
Kyösti Mälkki | d4955f0 | 2017-09-08 07:14:17 +0300 | [diff] [blame] | 42 | const void *OemS3Saved_MTRR_Storage(void); |
| 43 | |
Kyösti Mälkki | d610c58 | 2017-03-05 06:28:18 +0200 | [diff] [blame] | 44 | #endif /* _AGESA_HELPER_H_ */ |