AGESA binaryPI: Unify agesawrapper header
Change-Id: I54c8553bc057798e595b28f6cbc07f7125ae074f
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/20594
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
diff --git a/src/northbridge/amd/agesa/agesawrapper.h b/src/northbridge/amd/agesa/agesawrapper.h
index 40b5f22..367e724 100644
--- a/src/northbridge/amd/agesa/agesawrapper.h
+++ b/src/northbridge/amd/agesa/agesawrapper.h
@@ -16,7 +16,7 @@
#ifndef _AGESAWRAPPER_H_
#define _AGESAWRAPPER_H_
-#if IS_ENABLED(CONFIG_AGESA_LEGACY_WRAPPER)
+#if IS_ENABLED(CONFIG_AGESA_LEGACY_WRAPPER) || IS_ENABLED(CONFIG_CPU_AMD_PI)
#include <stdint.h>
#include "Porting.h"
@@ -39,6 +39,19 @@
#define AGESA_EVENTLOG(status, stdheader) \
agesawrapper_trace(status, stdheader, __func__)
+#else
+
+/* Defined to make unused agesa_main() build. */
+static inline int agesawrapper_amdinitreset(void) { return -1; }
+static inline int agesawrapper_amdinitearly(void) { return -1; }
+static inline int agesawrapper_amdinitenv(void) { return -1; }
+static inline int agesawrapper_amdinitpost(void) { return -1; }
+static inline int agesawrapper_amdinitresume(void) { return -1; }
+static inline int agesawrapper_amds3laterestore(void) { return -1; }
+
+#endif
+
+#if IS_ENABLED(CONFIG_AGESA_LEGACY_WRAPPER)
struct OEM_HOOK
{
/* romstage */
@@ -50,17 +63,13 @@
};
extern const struct OEM_HOOK OemCustomize;
+#endif
-#else
+#if IS_ENABLED(CONFIG_CPU_AMD_PI)
+const void *agesawrapper_locate_module (const CHAR8 name[8]);
-/* Defined to make unused agesa_main() build. */
-static inline int agesawrapper_amdinitreset(void) { return -1; }
-static inline int agesawrapper_amdinitearly(void) { return -1; }
-static inline int agesawrapper_amdinitenv(void) { return -1; }
-static inline int agesawrapper_amdinitpost(void) { return -1; }
-static inline int agesawrapper_amdinitresume(void) { return -1; }
-static inline int agesawrapper_amds3laterestore(void) { return -1; }
-
-#endif /* IS_ENABLED(CONFIG_AGESA_LEGACY_WRAPPER) */
+VOID OemCustomizeInitEarly (IN OUT AMD_EARLY_PARAMS *InitEarly);
+void OemPostParams(AMD_POST_PARAMS *PostParams);
+#endif
#endif /* _AGESAWRAPPER_H_ */
diff --git a/src/northbridge/amd/pi/00630F01/northbridge.c b/src/northbridge/amd/pi/00630F01/northbridge.c
index 4af0182..abe7f1f 100644
--- a/src/northbridge/amd/pi/00630F01/northbridge.c
+++ b/src/northbridge/amd/pi/00630F01/northbridge.c
@@ -34,6 +34,7 @@
#include <Topology.h>
#include <cpu/amd/amdfam15.h>
#include <cpuRegisters.h>
+#include <northbridge/amd/agesa/agesa_helper.h>
#include <northbridge/amd/pi/agesawrapper.h>
#include <northbridge/amd/pi/agesawrapper_call.h>
#include "northbridge.h"
diff --git a/src/northbridge/amd/pi/00660F01/northbridge.c b/src/northbridge/amd/pi/00660F01/northbridge.c
index 00740f1..32feff4 100644
--- a/src/northbridge/amd/pi/00660F01/northbridge.c
+++ b/src/northbridge/amd/pi/00660F01/northbridge.c
@@ -34,6 +34,7 @@
#include <Topology.h>
#include <cpu/amd/amdfam15.h>
#include <cpuRegisters.h>
+#include <northbridge/amd/agesa/agesa_helper.h>
#include <northbridge/amd/pi/agesawrapper.h>
#include <northbridge/amd/pi/agesawrapper_call.h>
#include "northbridge.h"
diff --git a/src/northbridge/amd/pi/00730F01/northbridge.c b/src/northbridge/amd/pi/00730F01/northbridge.c
index ce1eb53..2643c02 100644
--- a/src/northbridge/amd/pi/00730F01/northbridge.c
+++ b/src/northbridge/amd/pi/00730F01/northbridge.c
@@ -34,6 +34,7 @@
#include <Topology.h>
#include <cpu/amd/amdfam16.h>
#include <cpuRegisters.h>
+#include <northbridge/amd/agesa/agesa_helper.h>
#include <northbridge/amd/pi/agesawrapper.h>
#include <northbridge/amd/pi/agesawrapper_call.h>
#include "northbridge.h"
diff --git a/src/northbridge/amd/pi/agesawrapper.c b/src/northbridge/amd/pi/agesawrapper.c
index 3ee29e3..2fb708b 100644
--- a/src/northbridge/amd/pi/agesawrapper.c
+++ b/src/northbridge/amd/pi/agesawrapper.c
@@ -21,6 +21,7 @@
#include <cpuRegisters.h>
#include <FchPlatform.h>
#include <heapManager.h>
+#include <northbridge/amd/agesa/agesa_helper.h>
#include <northbridge/amd/agesa/state_machine.h>
#include <northbridge/amd/pi/agesawrapper.h>
#include <northbridge/amd/agesa/BiosCallOuts.h>
diff --git a/src/northbridge/amd/pi/agesawrapper.h b/src/northbridge/amd/pi/agesawrapper.h
index ed94a47..e697bb4 100644
--- a/src/northbridge/amd/pi/agesawrapper.h
+++ b/src/northbridge/amd/pi/agesawrapper.h
@@ -13,49 +13,5 @@
* GNU General Public License for more details.
*/
-#ifndef _AGESAWRAPPER_H_
-#define _AGESAWRAPPER_H_
-
-#include <stdint.h>
-#include "Porting.h"
-#include "AGESA.h"
-
-enum {
- PICK_DMI, /* DMI Interface */
- PICK_PSTATE, /* Acpi Pstate SSDT Table */
- PICK_SRAT, /* SRAT Table */
- PICK_SLIT, /* SLIT Table */
- PICK_WHEA_MCE, /* WHEA MCE table */
- PICK_WHEA_CMC, /* WHEA CMV table */
- PICK_ALIB, /* SACPI SSDT table with ALIB implementation */
- PICK_IVRS, /* IOMMU ACPI IVRS(I/O Virtualization Reporting Structure) table */
- PICK_CRAT,
-};
-
-AGESA_STATUS agesawrapper_amdinitreset(void);
-AGESA_STATUS agesawrapper_amdinitearly(void);
-AGESA_STATUS agesawrapper_amdinitenv(void);
-AGESA_STATUS agesawrapper_amdinitlate(void);
-AGESA_STATUS agesawrapper_amdinitpost(void);
-AGESA_STATUS agesawrapper_amdinitmid(void);
-void agesawrapper_setlateinitptr (void *Late);
-void *agesawrapper_getlateinitptr(int pick);
-AGESA_STATUS agesawrapper_amdS3Save(void);
-AGESA_STATUS agesawrapper_amdinitresume(void);
-AGESA_STATUS agesawrapper_amds3laterestore(void);
-
-AGESA_STATUS agesawrapper_fchs3earlyrestore(void);
-AGESA_STATUS agesawrapper_fchs3laterestore(void);
-
-VOID OemCustomizeInitEarly (IN OUT AMD_EARLY_PARAMS *InitEarly);
-const void *agesawrapper_locate_module (const CHAR8 name[8]);
-
-void OemPostParams(AMD_POST_PARAMS *PostParams);
-
-/* TBD: use agesa_helper.h: */
-void amd_initcpuio(void);
-void amd_initmmio(void);
-void *GetHeapBase(void);
-void EmptyHeap(void);
-
-#endif /* _AGESAWRAPPER_H_ */
+/* Use a common header file until references get removed. */
+#include <../agesa/agesawrapper.h>