summaryrefslogtreecommitdiff
path: root/src/northbridge/amd/pi
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2017-07-27 06:15:02 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2017-08-02 04:39:29 +0000
commit0e01c4841ddcd2216ab21d3f009024bfc8879908 (patch)
tree9a5549784be1f764864151bc5458acb11e627b55 /src/northbridge/amd/pi
parent6cb4ee31edf0e89f8a4fa01322e90d56194091b4 (diff)
AGESA: Use common handler for ACPI tables
Change-Id: I2d6ab1026f1105f1fea97682442a169409248c39 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/20815 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/northbridge/amd/pi')
-rw-r--r--src/northbridge/amd/pi/Makefile.inc2
-rw-r--r--src/northbridge/amd/pi/agesawrapper.c66
-rw-r--r--src/northbridge/amd/pi/agesawrapper.h1
3 files changed, 5 insertions, 64 deletions
diff --git a/src/northbridge/amd/pi/Makefile.inc b/src/northbridge/amd/pi/Makefile.inc
index a0bfe54bf1..c12c405098 100644
--- a/src/northbridge/amd/pi/Makefile.inc
+++ b/src/northbridge/amd/pi/Makefile.inc
@@ -23,7 +23,7 @@ romstage-y += agesawrapper.c
ramstage-y += agesawrapper.c
romstage-y += ../agesa/def_callouts.c
-ramstage-y += ../agesa/def_callouts.c
+ramstage-y += ../agesa/def_callouts.c ../agesa/acpi_tables.c
romstage-y += ramtop.c
ramstage-y += ramtop.c
diff --git a/src/northbridge/amd/pi/agesawrapper.c b/src/northbridge/amd/pi/agesawrapper.c
index cdff105755..4274d40b6c 100644
--- a/src/northbridge/amd/pi/agesawrapper.c
+++ b/src/northbridge/amd/pi/agesawrapper.c
@@ -28,20 +28,6 @@ void __attribute__((weak)) OemPostParams(AMD_POST_PARAMS *PostParams) {}
#define FILECODE UNASSIGNED_FILE_FILECODE
-#ifndef __PRE_RAM__
-/* ACPI table pointers returned by AmdInitLate */
-static void *DmiTable = NULL;
-static void *AcpiPstate = NULL;
-static void *AcpiSrat = NULL;
-static void *AcpiSlit = NULL;
-
-static void *AcpiWheaMce = NULL;
-static void *AcpiWheaCmc = NULL;
-static void *AcpiAlib = NULL;
-static void *AcpiIvrs = NULL;
-static void *AcpiCrat = NULL;
-#endif /* #ifndef __PRE_RAM__ */
-
AGESA_STATUS agesawrapper_amdinitreset(void)
{
AGESA_STATUS status;
@@ -223,34 +209,6 @@ AGESA_STATUS agesawrapper_amdinitenv(void)
return status;
}
-#ifndef __PRE_RAM__
-VOID* agesawrapper_getlateinitptr (int pick)
-{
- switch (pick) {
- case PICK_DMI:
- return DmiTable;
- case PICK_PSTATE:
- return AcpiPstate;
- case PICK_SRAT:
- return AcpiSrat;
- case PICK_SLIT:
- return AcpiSlit;
- case PICK_WHEA_MCE:
- return AcpiWheaMce;
- case PICK_WHEA_CMC:
- return AcpiWheaCmc;
- case PICK_ALIB:
- return AcpiAlib;
- case PICK_IVRS:
- return AcpiIvrs;
- case PICK_CRAT:
- return AcpiCrat;
- default:
- return NULL;
- }
-}
-#endif /* #ifndef __PRE_RAM__ */
-
AGESA_STATUS agesawrapper_amdinitmid(void)
{
AGESA_STATUS status;
@@ -320,27 +278,9 @@ AGESA_STATUS agesawrapper_amdinitlate(void)
ASSERT(Status == AGESA_SUCCESS);
}
- DmiTable = AmdLateParams->DmiTable;
- AcpiPstate = AmdLateParams->AcpiPState;
-#if IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_PI_00630F01) || IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_PI_00730F01)
- AcpiSrat = AmdLateParams->AcpiSrat;
- AcpiSlit = AmdLateParams->AcpiSlit;
-#endif
-
- AcpiWheaMce = AmdLateParams->AcpiWheaMce;
- AcpiWheaCmc = AmdLateParams->AcpiWheaCmc;
- AcpiAlib = AmdLateParams->AcpiAlib;
- AcpiIvrs = AmdLateParams->AcpiIvrs;
- AcpiCrat = AmdLateParams->AcpiCrat;
-
- printk(BIOS_DEBUG, "DmiTable:%x, AcpiPstatein: %x, AcpiSrat:%x,"
- "AcpiSlit:%x, Mce:%x, Cmc:%x,"
- "Alib:%x, AcpiIvrs:%x in %s\n",
- (unsigned int)DmiTable, (unsigned int)AcpiPstate, (unsigned int)AcpiSrat,
- (unsigned int)AcpiSlit, (unsigned int)AcpiWheaMce, (unsigned int)AcpiWheaCmc,
- (unsigned int)AcpiAlib, (unsigned int)AcpiIvrs, __func__);
-
- /* AmdReleaseStruct (&AmdParamStruct); */
+ agesawrapper_setlateinitptr(AmdLateParams);
+
+ /* No AmdReleaseStruct(&AmdParamStruct), we need AmdLateParams later. */
return Status;
}
#endif /* #ifndef __PRE_RAM__ */
diff --git a/src/northbridge/amd/pi/agesawrapper.h b/src/northbridge/amd/pi/agesawrapper.h
index a6a05bb8b1..5cc3ab107f 100644
--- a/src/northbridge/amd/pi/agesawrapper.h
+++ b/src/northbridge/amd/pi/agesawrapper.h
@@ -39,6 +39,7 @@ AGESA_STATUS agesawrapper_amdinitlate(void);
AGESA_STATUS agesawrapper_amdinitpost(void);
AGESA_STATUS agesawrapper_amdinitmid(void);
AGESA_STATUS agesawrapper_amdreadeventlog(UINT8 HeapStatus);
+void agesawrapper_setlateinitptr (void *Late);
void *agesawrapper_getlateinitptr(int pick);
AGESA_STATUS agesawrapper_amdlaterunaptask(UINT32 Func, UINTN Data, void *ConfigPtr);
AGESA_STATUS agesawrapper_amdS3Save(void);