Kyösti Mälkki | d610c58 | 2017-03-05 06:28:18 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2011 Advanced Micro Devices, Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | */ |
| 15 | |
| 16 | #ifndef _AGESA_HELPER_H_ |
| 17 | #define _AGESA_HELPER_H_ |
| 18 | |
Kyösti Mälkki | da74041 | 2017-03-05 18:57:03 +0200 | [diff] [blame] | 19 | #include <stddef.h> |
Kyösti Mälkki | 63fac81 | 2017-09-02 16:41:43 +0300 | [diff] [blame] | 20 | #include <arch/cpu.h> |
Kyösti Mälkki | da74041 | 2017-03-05 18:57:03 +0200 | [diff] [blame] | 21 | |
Kyösti Mälkki | d610c58 | 2017-03-05 06:28:18 +0200 | [diff] [blame] | 22 | enum { |
| 23 | PICK_DMI, /* DMI Interface */ |
| 24 | PICK_PSTATE, /* Acpi Pstate SSDT Table */ |
| 25 | PICK_SRAT, /* SRAT Table */ |
| 26 | PICK_SLIT, /* SLIT Table */ |
| 27 | PICK_WHEA_MCE, /* WHEA MCE table */ |
| 28 | PICK_WHEA_CMC, /* WHEA CMV table */ |
| 29 | PICK_ALIB, /* SACPI SSDT table with ALIB implementation */ |
| 30 | 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] | 31 | PICK_CRAT, /* Component Resource Affinity Table table */ |
| 32 | PICK_CDIT, /* Component Locality Distance Information table */ |
Kyösti Mälkki | d610c58 | 2017-03-05 06:28:18 +0200 | [diff] [blame] | 33 | }; |
| 34 | |
Kyösti Mälkki | 0e01c48 | 2017-07-27 06:15:02 +0300 | [diff] [blame] | 35 | void agesawrapper_setlateinitptr (void *Late); |
Kyösti Mälkki | d610c58 | 2017-03-05 06:28:18 +0200 | [diff] [blame] | 36 | void *agesawrapper_getlateinitptr (int pick); |
| 37 | |
| 38 | void amd_initcpuio(void); |
| 39 | void amd_initmmio(void); |
| 40 | void amd_initenv(void); |
| 41 | |
Kyösti Mälkki | da74041 | 2017-03-05 18:57:03 +0200 | [diff] [blame] | 42 | void *GetHeapBase(void); |
| 43 | void EmptyHeap(void); |
Kyösti Mälkki | da74041 | 2017-03-05 18:57:03 +0200 | [diff] [blame] | 44 | |
| 45 | #define BSP_STACK_BASE_ADDR 0x30000 |
| 46 | |
| 47 | #if 1 |
| 48 | /* This covers node 0 only. */ |
| 49 | #define HIGH_ROMSTAGE_STACK_SIZE (0x48000 - BSP_STACK_BASE_ADDR) |
| 50 | #else |
| 51 | /* This covers total of 8 nodes. */ |
| 52 | #define HIGH_ROMSTAGE_STACK_SIZE (0xA0000 - BSP_STACK_BASE_ADDR) |
| 53 | #endif |
| 54 | |
| 55 | #define HIGH_MEMORY_SCRATCH 0x30000 |
| 56 | |
Kyösti Mälkki | 63fac81 | 2017-09-02 16:41:43 +0300 | [diff] [blame] | 57 | void fixup_cbmem_to_UC(int s3resume); |
| 58 | void recover_postcar_frame(struct postcar_frame *pcf, int s3resume); |
Kyösti Mälkki | da74041 | 2017-03-05 18:57:03 +0200 | [diff] [blame] | 59 | |
Kyösti Mälkki | d4955f0 | 2017-09-08 07:14:17 +0300 | [diff] [blame] | 60 | void restore_mtrr(void); |
| 61 | void backup_mtrr(void *mtrr_store, u32 *mtrr_store_size); |
| 62 | const void *OemS3Saved_MTRR_Storage(void); |
| 63 | |
Kyösti Mälkki | d610c58 | 2017-03-05 06:28:18 +0200 | [diff] [blame] | 64 | #endif /* _AGESA_HELPER_H_ */ |