blob: dcc336083f524d13131cf1521e0e6cf18f00d596 [file] [log] [blame]
Kyösti Mälkkid610c582017-03-05 06:28:18 +02001/*
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älkkida740412017-03-05 18:57:03 +020019#include <stddef.h>
Kyösti Mälkkia963acd2019-08-16 20:34:25 +030020#include <arch/romstage.h>
Kyösti Mälkkida740412017-03-05 18:57:03 +020021
Kyösti Mälkkid610c582017-03-05 06:28:18 +020022enum {
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älkki0e01c482017-07-27 06:15:02 +030031 PICK_CRAT, /* Component Resource Affinity Table table */
32 PICK_CDIT, /* Component Locality Distance Information table */
Kyösti Mälkkid610c582017-03-05 06:28:18 +020033};
34
Kyösti Mälkki0e01c482017-07-27 06:15:02 +030035void agesawrapper_setlateinitptr (void *Late);
Kyösti Mälkkid610c582017-03-05 06:28:18 +020036void *agesawrapper_getlateinitptr (int pick);
37
38void amd_initcpuio(void);
39void amd_initmmio(void);
40void amd_initenv(void);
41
Kyösti Mälkkida740412017-03-05 18:57:03 +020042void *GetHeapBase(void);
43void EmptyHeap(void);
Kyösti Mälkkida740412017-03-05 18:57:03 +020044
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älkki63fac812017-09-02 16:41:43 +030057void fixup_cbmem_to_UC(int s3resume);
58void recover_postcar_frame(struct postcar_frame *pcf, int s3resume);
Kyösti Mälkkida740412017-03-05 18:57:03 +020059
Kyösti Mälkkid4955f02017-09-08 07:14:17 +030060void restore_mtrr(void);
61void backup_mtrr(void *mtrr_store, u32 *mtrr_store_size);
62const void *OemS3Saved_MTRR_Storage(void);
63
Kyösti Mälkkid610c582017-03-05 06:28:18 +020064#endif /* _AGESA_HELPER_H_ */