summaryrefslogtreecommitdiff
path: root/src/northbridge/amd
diff options
context:
space:
mode:
Diffstat (limited to 'src/northbridge/amd')
-rw-r--r--src/northbridge/amd/agesa/family14/state_machine.c5
-rw-r--r--src/northbridge/amd/agesa/state_machine.c18
2 files changed, 16 insertions, 7 deletions
diff --git a/src/northbridge/amd/agesa/family14/state_machine.c b/src/northbridge/amd/agesa/family14/state_machine.c
index fbc2d7e1e5..3280180f8c 100644
--- a/src/northbridge/amd/agesa/family14/state_machine.c
+++ b/src/northbridge/amd/agesa/family14/state_machine.c
@@ -57,7 +57,7 @@ void platform_AfterInitEnv(struct sysinfo *cb, AMD_ENV_PARAMS *Env)
{
amd_initenv();
#if 0
- /* FIXME: It's only in ramstage. */
+ /* FIXME: Should move the callsite from cimx/sb800 to here. */
sb_Before_Pci_Init();
#endif
}
@@ -69,10 +69,7 @@ void platform_BeforeS3LateRestore(struct sysinfo *cb, AMD_S3LATE_PARAMS *S3Late)
void platform_AfterS3LateRestore(struct sysinfo *cb, AMD_S3LATE_PARAMS *S3Late)
{
-#if 0
- /* FIXME: It's only in ramstage. */
sb_Before_Pci_Restore_Init();
-#endif
}
void platform_BeforeInitMid(struct sysinfo *cb, AMD_MID_PARAMS *Mid)
diff --git a/src/northbridge/amd/agesa/state_machine.c b/src/northbridge/amd/agesa/state_machine.c
index 0406eeea66..6892990409 100644
--- a/src/northbridge/amd/agesa/state_machine.c
+++ b/src/northbridge/amd/agesa/state_machine.c
@@ -19,6 +19,7 @@
#include <arch/acpi.h>
#include <bootstate.h>
+#include <cbmem.h>
#include <northbridge/amd/agesa/state_machine.h>
#include <northbridge/amd/agesa/agesa_helper.h>
@@ -122,7 +123,9 @@ static AGESA_STATUS amd_dispatch(struct sysinfo *cb,
platform_AfterInitResume(cb, param);
break;
}
+#endif
+#if ENV_RAMSTAGE
case AMD_INIT_ENV:
{
AMD_ENV_PARAMS *param = (void *)StdHeader;
@@ -141,8 +144,7 @@ static AGESA_STATUS amd_dispatch(struct sysinfo *cb,
platform_AfterS3LateRestore(cb, param);
break;
}
-#endif
-#if ENV_RAMSTAGE
+
case AMD_INIT_MID:
{
AMD_MID_PARAMS *param = (void *)StdHeader;
@@ -214,6 +216,7 @@ int agesa_execute_state(struct sysinfo *cb, AGESA_STRUCT_NAME func)
AMD_INTERFACE_PARAMS aip;
union {
AMD_RESET_PARAMS reset;
+ AMD_S3LATE_PARAMS s3late;
} agesa_params;
void *buf = NULL;
size_t len = 0;
@@ -228,7 +231,7 @@ int agesa_execute_state(struct sysinfo *cb, AGESA_STRUCT_NAME func)
aip.StdHeader = cb->StdHeader;
/* For these calls, heap is not available. */
- if (func == AMD_INIT_RESET) {
+ if (func == AMD_INIT_RESET || func == AMD_S3LATE_RESTORE) {
buf = (void *) &agesa_params;
len = sizeof(agesa_params);
memcpy(buf, &cb->StdHeader, sizeof(cb->StdHeader));
@@ -261,6 +264,15 @@ static void amd_bs_ramstage_init(void *arg)
struct sysinfo *cb = arg;
agesa_set_interface(cb);
+
+ if (!acpi_is_wakeup_s3())
+ agesa_execute_state(cb, AMD_INIT_ENV);
+ else {
+ /* We need HEAP from CBMEM early. */
+ if (IS_ENABLED(CONFIG_LATE_CBMEM_INIT))
+ cbmem_initialize();
+ agesa_execute_state(cb, AMD_S3LATE_RESTORE);
+ }
}
void sb_After_Pci_Restore_Init(void);