blob: 5947b6b504ccf3328ab8acac0d30e998eb273342 [file] [log] [blame]
efdesign98770b8772011-06-20 21:48:37 -07001/*
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 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
Paul Menzela46a7122013-02-23 18:37:27 +010017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
efdesign98770b8772011-06-20 21:48:37 -070018 */
19
efdesign98770b8772011-06-20 21:48:37 -070020#ifndef _AGESAWRAPPER_H_
21#define _AGESAWRAPPER_H_
22
23#include <stdint.h>
24#include "Porting.h"
25#include "AGESA.h"
26
efdesign98770b8772011-06-20 21:48:37 -070027/* Define AMD Ontario APPU SSID/SVID */
28#define AMD_APU_SVID 0x1022
29#define AMD_APU_SSID 0x1234
30#define PCIE_BASE_ADDRESS CONFIG_MMCONF_BASE_ADDRESS
31
32/* Hudson-2 ACPI PmIO Space Define */
33#define SB_ACPI_BASE_ADDRESS 0x0400
34#define ACPI_MMIO_BASE 0xFED80000
35#define SB_CFG_BASE 0x000 // DWORD
36#define GPIO_BASE 0x100 // BYTE
37#define SMI_BASE 0x200 // DWORD
38#define PMIO_BASE 0x300 // DWORD
39#define PMIO2_BASE 0x400 // BYTE
40#define BIOS_RAM_BASE 0x500 // BYTE
41#define CMOS_RAM_BASE 0x600 // BYTE
42#define CMOS_BASE 0x700 // BYTE
43#define ASF_BASE 0x900 // DWORD
44#define SMBUS_BASE 0xA00 // DWORD
45#define WATCHDOG_BASE 0xB00 // ??
46#define HPET_BASE 0xC00 // DWORD
47#define IOMUX_BASE 0xD00 // BYTE
48#define MISC_BASE 0xE00
49#define SERIAL_DEBUG_BASE 0x1000
50#define GFX_DAC_BASE 0x1400
51#define CEC_BASE 0x1800
52#define XHCI_BASE 0x1C00
53#define ACPI_SMI_DATA_PORT 0xB1
54#define R_SB_ACPI_PM1_STATUS 0x00
55#define R_SB_ACPI_PM1_ENABLE 0x02
56#define R_SB_ACPI_PM_CONTROL 0x04
57#define R_SB_ACPI_EVENT_STATUS 0x20
58#define R_SB_ACPI_EVENT_ENABLE 0x24
59#define B_PWR_BTN_STATUS BIT8
60#define B_WAKEUP_STATUS BIT15
61#define B_SCI_EN BIT0
62#define SB_PM_INDEX_PORT 0xCD6
63#define SB_PM_DATA_PORT 0xCD7
64#define SB_PMIOA_REG24 0x24 // AcpiMmioEn
65#define MmioAddress( BaseAddr, Register ) \
66 ( (UINTN)BaseAddr + \
67 (UINTN)(Register) \
68 )
69#define Mmio32Ptr( BaseAddr, Register ) \
70 ( (volatile UINT32 *)MmioAddress( BaseAddr, Register ) )
71#define Mmio32( BaseAddr, Register ) \
72 *Mmio32Ptr( BaseAddr, Register )
73
74enum {
75 PICK_DMI, /* DMI Interface */
76 PICK_PSTATE, /* Acpi Pstate SSDT Table */
77 PICK_SRAT, /* SRAT Table */
78 PICK_SLIT, /* SLIT Table */
79 PICK_WHEA_MCE, /* WHEA MCE table */
80 PICK_WHEA_CMC, /* WHEA CMV table */
81 PICK_ALIB, /* SACPI SSDT table with ALIB implementation */
82};
83
84
efdesign98770b8772011-06-20 21:48:37 -070085UINT32 agesawrapper_amdinitreset (void);
86UINT32 agesawrapper_amdinitearly (void);
87UINT32 agesawrapper_amdinitenv (void);
88UINT32 agesawrapper_amdinitlate (void);
89UINT32 agesawrapper_amdinitpost (void);
90UINT32 agesawrapper_amdinitmid (void);
91
92UINT32 agesawrapper_amdreadeventlog (void);
93UINT32 agesawrapper_amdinitcpuio (void);
94UINT32 agesawrapper_amdinitmmio (void);
Kyösti Mälkki838e2112014-05-05 12:21:04 +030095UINT32 agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
efdesign98770b8772011-06-20 21:48:37 -070096void *agesawrapper_getlateinitptr (int pick);
97
Kyösti Mälkki005028e2014-06-19 23:12:15 +030098static inline UINT32 agesawrapper_amdS3Save(void) { return 0; }
efdesign98770b8772011-06-20 21:48:37 -070099#endif