summaryrefslogtreecommitdiff
path: root/src/northbridge
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2017-02-26 10:18:45 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2017-03-08 04:08:29 +0100
commit97a4b3edf0efbbc051ec604ccdd7cf6d86c67187 (patch)
tree51f210593c31e922747d23920ff7d81c8c081253 /src/northbridge
parent1b183aa6ce78af27c2e42aa51626f76a4b5d5bb0 (diff)
binaryPI platforms: Drop any ACPI S3 support
No board with binaryPI currently supports HAVE_ACPI_RESUME. For platforms with PSP the approach is also very different from what we previously had here. Furthermore, s3_resume.[ch] files under cpu/amd/pi do not distinguish between NonVolatile and Volatile buffers of S3 storage. This means the Volatile buffer that is maintained and available in CBMEM is unnecessarily copied to SPI flash. This has been fixed on open-source AGESA directory, so development of S3 suspend support with binaryPI is better continued with that. Unfortunately there are further complications and indications that open-source AGESA may have always had a low-memory corruption issue. This has to be investigated separately before restoring or claiming S3 is supported on binaryPI. Change-Id: I81585fff7aae7bcdd55e5e95bc373e0adef43ef0 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/18501 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc@marcjonesconsulting.com>
Diffstat (limited to 'src/northbridge')
-rw-r--r--src/northbridge/amd/pi/agesawrapper.c213
1 files changed, 0 insertions, 213 deletions
diff --git a/src/northbridge/amd/pi/agesawrapper.c b/src/northbridge/amd/pi/agesawrapper.c
index 2e79f47ac6..213d784a9e 100644
--- a/src/northbridge/amd/pi/agesawrapper.c
+++ b/src/northbridge/amd/pi/agesawrapper.c
@@ -16,7 +16,6 @@
#include <AGESA.h>
#include <cbfs.h>
#include <delay.h>
-#include <cpu/amd/pi/s3_resume.h>
#include <cpu/x86/mtrr.h>
#include <cpuRegisters.h>
#include <FchPlatform.h>
@@ -24,9 +23,6 @@
#include <northbridge/amd/pi/agesawrapper.h>
#include <northbridge/amd/pi/BiosCallOuts.h>
-VOID FchInitS3LateRestore (IN FCH_DATA_BLOCK *FchDataPtr);
-VOID FchInitS3EarlyRestore (IN FCH_DATA_BLOCK *FchDataPtr);
-
void __attribute__((weak)) OemPostParams(AMD_POST_PARAMS *PostParams) {}
#define FILECODE UNASSIGNED_FILE_FILECODE
@@ -368,215 +364,6 @@ AGESA_STATUS agesawrapper_amdlaterunaptask (
return Status;
}
-#if CONFIG_HAVE_ACPI_RESUME
-
-AGESA_STATUS agesawrapper_amdinitresume(void)
-{
- AGESA_STATUS status;
- AMD_INTERFACE_PARAMS AmdParamStruct;
- AMD_RESUME_PARAMS *AmdResumeParamsPtr;
- S3_DATA_TYPE S3DataType;
-
- LibAmdMemFill (&AmdParamStruct,
- 0,
- sizeof(AMD_INTERFACE_PARAMS),
- &(AmdParamStruct.StdHeader));
-
- AmdParamStruct.AgesaFunctionName = AMD_INIT_RESUME;
- AmdParamStruct.AllocationMethod = PreMemHeap;
- AmdParamStruct.StdHeader.AltImageBasePtr = 0;
- AmdParamStruct.StdHeader.CalloutPtr = &GetBiosCallout;
- AmdParamStruct.StdHeader.Func = 0;
- AmdParamStruct.StdHeader.ImageBasePtr = 0;
- AmdCreateStruct (&AmdParamStruct);
-
- AmdResumeParamsPtr = (AMD_RESUME_PARAMS *)AmdParamStruct.NewStructPtr;
-
- AmdResumeParamsPtr->S3DataBlock.NvStorageSize = 0;
- AmdResumeParamsPtr->S3DataBlock.VolatileStorageSize = 0;
- S3DataType = S3DataTypeNonVolatile;
- OemAgesaGetS3Info (S3DataType,
- (u32 *) &AmdResumeParamsPtr->S3DataBlock.NvStorageSize,
- (void **) &AmdResumeParamsPtr->S3DataBlock.NvStorage);
-
- status = AmdInitResume ((AMD_RESUME_PARAMS *)AmdParamStruct.NewStructPtr);
-
- if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog(AmdParamStruct.StdHeader.HeapStatus);
- AmdReleaseStruct (&AmdParamStruct);
-
- return status;
-}
-
-#ifndef __PRE_RAM__
-AGESA_STATUS agesawrapper_fchs3earlyrestore(void)
-{
- AGESA_STATUS status = AGESA_SUCCESS;
-
- FCH_DATA_BLOCK FchParams;
- AMD_CONFIG_PARAMS StdHeader;
-
- StdHeader.HeapStatus = HEAP_SYSTEM_MEM;
- StdHeader.HeapBasePtr = GetHeapBase(&StdHeader) + 0x10;
- StdHeader.AltImageBasePtr = 0;
- StdHeader.CalloutPtr = &GetBiosCallout;
- StdHeader.Func = 0;
- StdHeader.ImageBasePtr = 0;
-
- LibAmdMemFill (&FchParams,
- 0,
- sizeof(FchParams),
- &StdHeader);
-
- FchParams.StdHeader = &StdHeader;
- s3_resume_init_data(&FchParams);
-
- FchInitS3EarlyRestore(&FchParams);
-
- return status;
-}
-#endif /* #ifndef __PRE_RAM__ */
-
-AGESA_STATUS agesawrapper_amds3laterestore(void)
-{
- AGESA_STATUS Status;
- AMD_INTERFACE_PARAMS AmdInterfaceParams;
- AMD_S3LATE_PARAMS AmdS3LateParams;
- AMD_S3LATE_PARAMS *AmdS3LateParamsPtr;
- S3_DATA_TYPE S3DataType;
-
- agesawrapper_amdinitcpuio();
- LibAmdMemFill (&AmdS3LateParams,
- 0,
- sizeof(AMD_S3LATE_PARAMS),
- &(AmdS3LateParams.StdHeader));
- AmdInterfaceParams.StdHeader.ImageBasePtr = 0;
- AmdInterfaceParams.AllocationMethod = ByHost;
- AmdInterfaceParams.AgesaFunctionName = AMD_S3LATE_RESTORE;
- AmdInterfaceParams.NewStructPtr = &AmdS3LateParams;
- AmdInterfaceParams.StdHeader.CalloutPtr = &GetBiosCallout;
- AmdS3LateParamsPtr = &AmdS3LateParams;
- AmdInterfaceParams.NewStructSize = sizeof(AMD_S3LATE_PARAMS);
-
- AmdCreateStruct (&AmdInterfaceParams);
-
- AmdS3LateParamsPtr->S3DataBlock.VolatileStorageSize = 0;
- S3DataType = S3DataTypeVolatile;
-
- OemAgesaGetS3Info (S3DataType,
- (u32 *) &AmdS3LateParamsPtr->S3DataBlock.VolatileStorageSize,
- (void **) &AmdS3LateParamsPtr->S3DataBlock.VolatileStorage);
-
- Status = AmdS3LateRestore (AmdS3LateParamsPtr);
- if (Status != AGESA_SUCCESS) {
- agesawrapper_amdreadeventlog(AmdInterfaceParams.StdHeader.HeapStatus);
- ASSERT(Status == AGESA_SUCCESS);
- }
-
- return Status;
-}
-
-#ifndef __PRE_RAM__
-
-AGESA_STATUS agesawrapper_fchs3laterestore(void)
-{
- AGESA_STATUS status = AGESA_SUCCESS;
-
- AMD_CONFIG_PARAMS StdHeader;
- FCH_DATA_BLOCK FchParams;
-
- StdHeader.HeapStatus = HEAP_SYSTEM_MEM;
- StdHeader.HeapBasePtr = GetHeapBase(&StdHeader) + 0x10;
- StdHeader.AltImageBasePtr = 0;
- StdHeader.CalloutPtr = &GetBiosCallout;
- StdHeader.Func = 0;
- StdHeader.ImageBasePtr = 0;
-
- LibAmdMemFill (&FchParams,
- 0,
- sizeof(FchParams),
- &StdHeader);
-
- FchParams.StdHeader = &StdHeader;
- s3_resume_init_data(&FchParams);
- FchInitS3LateRestore(&FchParams);
-
- /* PIC IRQ routine */
- for (byte = 0x0; byte < sizeof(picr_data); byte ++) {
- outb(byte, 0xC00);
- outb(picr_data[byte], 0xC01);
- }
-
- /* APIC IRQ routine */
- for (byte = 0x0; byte < sizeof(intr_data); byte ++) {
- outb(byte | 0x80, 0xC00);
- outb(intr_data[byte], 0xC01);
- }
-
- return status;
-}
-
-AGESA_STATUS agesawrapper_amdS3Save(void)
-{
- AGESA_STATUS Status;
- AMD_S3SAVE_PARAMS *AmdS3SaveParamsPtr;
- AMD_INTERFACE_PARAMS AmdInterfaceParams;
- S3_DATA_TYPE S3DataType;
-
- LibAmdMemFill (&AmdInterfaceParams,
- 0,
- sizeof(AMD_INTERFACE_PARAMS),
- &(AmdInterfaceParams.StdHeader));
-
- AmdInterfaceParams.StdHeader.ImageBasePtr = 0;
- AmdInterfaceParams.StdHeader.HeapStatus = HEAP_SYSTEM_MEM;
- AmdInterfaceParams.StdHeader.CalloutPtr = &GetBiosCallout;
- AmdInterfaceParams.AllocationMethod = PostMemDram;
- AmdInterfaceParams.AgesaFunctionName = AMD_S3_SAVE;
- AmdInterfaceParams.StdHeader.AltImageBasePtr = 0;
- AmdInterfaceParams.StdHeader.Func = 0;
-
- AmdCreateStruct(&AmdInterfaceParams);
- AmdS3SaveParamsPtr = (AMD_S3SAVE_PARAMS *)AmdInterfaceParams.NewStructPtr;
- AmdS3SaveParamsPtr->StdHeader = AmdInterfaceParams.StdHeader;
-
- Status = AmdS3Save(AmdS3SaveParamsPtr);
- if (Status != AGESA_SUCCESS) {
- agesawrapper_amdreadeventlog(AmdInterfaceParams.StdHeader.HeapStatus);
- ASSERT(Status == AGESA_SUCCESS);
- }
-
- S3DataType = S3DataTypeNonVolatile;
- printk(BIOS_DEBUG, "NvStorageSize=%x, NvStorage=%x\n",
- (unsigned int)AmdS3SaveParamsPtr->S3DataBlock.NvStorageSize,
- (unsigned int)AmdS3SaveParamsPtr->S3DataBlock.NvStorage);
-
- Status = OemAgesaSaveS3Info (
- S3DataType,
- AmdS3SaveParamsPtr->S3DataBlock.NvStorageSize,
- AmdS3SaveParamsPtr->S3DataBlock.NvStorage);
-
- printk(BIOS_DEBUG, "VolatileStorageSize=%x, VolatileStorage=%x\n",
- (unsigned int)AmdS3SaveParamsPtr->S3DataBlock.VolatileStorageSize,
- (unsigned int)AmdS3SaveParamsPtr->S3DataBlock.VolatileStorage);
-
- if (AmdS3SaveParamsPtr->S3DataBlock.VolatileStorageSize != 0) {
- S3DataType = S3DataTypeVolatile;
-
- Status = OemAgesaSaveS3Info (
- S3DataType,
- AmdS3SaveParamsPtr->S3DataBlock.VolatileStorageSize,
- AmdS3SaveParamsPtr->S3DataBlock.VolatileStorage);
- }
- OemAgesaSaveMtrr();
-
- AmdReleaseStruct (&AmdInterfaceParams);
-
- return Status;
-}
-
-#endif /* #ifndef __PRE_RAM__ */
-#endif /* CONFIG_HAVE_ACPI_RESUME */
-
AGESA_STATUS agesawrapper_amdreadeventlog (UINT8 HeapStatus)
{
AGESA_STATUS Status;