Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15472
-gerrit
commit 9411d66e431b75a61244c28507b6e69ddf549436
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Sun Jun 26 15:44:05 2016 +0300
AMD k8 fam10: Fix romstage handoff
It is not possible for cbmem_add() to complete succesfully before
cbmem_recovery() is called. Adding more tables on S3 resume path
is also not possible.
Change-Id: Ic14857eeef2932562acee4a36f59c22ff4ca1a84
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/cpu/amd/car/post_cache_as_ram.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/cpu/amd/car/post_cache_as_ram.c b/src/cpu/amd/car/post_cache_as_ram.c
index 7c03888..1951084 100644
--- a/src/cpu/amd/car/post_cache_as_ram.c
+++ b/src/cpu/amd/car/post_cache_as_ram.c
@@ -133,19 +133,22 @@ void post_cache_as_ram(void)
if ((*lower_stack_boundary) != 0xdeadbeef)
printk(BIOS_WARNING, "BSP overran lower stack boundary. Undefined behaviour may result!\n");
- struct romstage_handoff *handoff;
- handoff = romstage_handoff_find_or_add();
- if (handoff != NULL)
- handoff->s3_resume = acpi_is_wakeup_s3();
- else
- printk(BIOS_DEBUG, "Romstage handoff structure not added!\n");
-
int s3resume = acpi_is_wakeup_s3();
- if (s3resume)
+
+ if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT) || s3resume)
cbmem_recovery(s3resume);
prepare_romstage_ramstack(s3resume);
+ if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT)) {
+ struct romstage_handoff *handoff;
+ handoff = romstage_handoff_find_or_add();
+ if (handoff != NULL)
+ handoff->s3_resume = s3resume;
+ else
+ printk(BIOS_DEBUG, "Romstage handoff structure not added!\n");
+ }
+
/* from here don't store more data in CAR */
if (family >= 0x1f && family <= 0x3f) {
/* Family 10h and 12h, 11h until shown otherwise */
Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15477
-gerrit
commit ca025e05c5d522b45aab939b39dcaadf89d10ff5
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Mon Jun 27 13:09:56 2016 +0300
ACPI S3: Drop early resume backup
No longer needed as low memory backup is implemented as part of
the ramstage loader, after MTRRs are set to write-back cache for
better performance.
Change-Id: I5f5ad94bae2afef915927b9737c79431b6f75f22
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/arch/x86/acpi_s3.c | 10 ----------
src/arch/x86/include/arch/acpi.h | 2 --
2 files changed, 12 deletions(-)
diff --git a/src/arch/x86/acpi_s3.c b/src/arch/x86/acpi_s3.c
index c744eb5..5404332 100644
--- a/src/arch/x86/acpi_s3.c
+++ b/src/arch/x86/acpi_s3.c
@@ -151,16 +151,6 @@ void backup_ramstage_section(uintptr_t base, size_t size)
backup_mem->valid = 1;
}
-/* Make backup of low-memory region, relying on the base and size
- * of the ramstage that was loaded before entry to ACPI S3.
- *
- * DEPRECATED
- */
-void acpi_prepare_for_resume(void)
-{
- backup_ramstage_section(0, 0);
-}
-
/* Let's prepare the ACPI S3 Resume area now already, so we can rely on
* it being there during reboot time. If this fails, ACPI resume will
* be disabled. We assume that ramstage does not change while in suspend,
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index f40b9df..6fecd8c 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -634,14 +634,12 @@ int acpi_is_wakeup(void);
int acpi_is_wakeup_s3(void);
int acpi_is_wakeup_s4(void);
#endif
-void acpi_prepare_for_resume(void);
#else
#define acpi_slp_type 0
static inline int acpi_is_wakeup(void) { return 0; }
static inline int acpi_is_wakeup_s3(void) { return 0; }
static inline int acpi_is_wakeup_s4(void) { return 0; }
-static inline void acpi_prepare_for_resume(void) { }
#endif
static inline uintptr_t acpi_align_current(uintptr_t current)
Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15470
-gerrit
commit cf14e049d9b40dfff478579286d6d8299151e7fa
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Mon Jun 27 12:14:39 2016 +0300
AGESA: Delay ACPI S3 backup until ramstage loader
Change-Id: I59773161f22c1ec6a52050245f9ad3e6cc74a934
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/cpu/amd/agesa/s3_resume.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/cpu/amd/agesa/s3_resume.c b/src/cpu/amd/agesa/s3_resume.c
index c5436ed..8d47e7f 100644
--- a/src/cpu/amd/agesa/s3_resume.c
+++ b/src/cpu/amd/agesa/s3_resume.c
@@ -91,9 +91,4 @@ void prepare_for_resume(void)
printk(BIOS_DEBUG, "CAR disabled.\n");
set_resume_cache();
- /*
- * Copy the system memory that is in the ramstage area to the
- * reserved area.
- */
- acpi_prepare_for_resume();
}
Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15471
-gerrit
commit bb32b67f59f6cc5046377110bd522751a26ba89d
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Mon Jun 27 12:14:49 2016 +0300
AMD binaryPI: Delay ACPI S3 backup until ramstage loader
Change-Id: I482cf93fe5dfab95817c87c32aad33df2e0a6439
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/cpu/amd/pi/s3_resume.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/cpu/amd/pi/s3_resume.c b/src/cpu/amd/pi/s3_resume.c
index 830d174..b6e1e92 100644
--- a/src/cpu/amd/pi/s3_resume.c
+++ b/src/cpu/amd/pi/s3_resume.c
@@ -287,10 +287,5 @@ void prepare_for_resume(void)
printk(BIOS_DEBUG, "CAR disabled.\n");
set_resume_cache();
- /*
- * Copy the system memory that is in the ramstage area to the
- * reserved area.
- */
- acpi_prepare_for_resume();
}
#endif
Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15469
-gerrit
commit e15c5457a50d62f448d179f992bf8e56b76d9520
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Mon Jun 27 12:13:48 2016 +0300
intel post-car: Delay ACPI S3 backup until ramstage loader
Change-Id: If0060b9ad8703a3d6524004fb69cb2171f8d89a3
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/mainboard/lenovo/t400/romstage.c | 1 -
src/mainboard/lenovo/x200/romstage.c | 1 -
src/mainboard/lenovo/x201/romstage.c | 1 -
src/mainboard/packardbell/ms2290/romstage.c | 1 -
src/mainboard/roda/rk9/romstage.c | 1 -
src/northbridge/intel/i945/early_init.c | 1 -
src/northbridge/intel/sandybridge/early_init.c | 1 -
7 files changed, 7 deletions(-)
diff --git a/src/mainboard/lenovo/t400/romstage.c b/src/mainboard/lenovo/t400/romstage.c
index f518775..0e7309d 100644
--- a/src/mainboard/lenovo/t400/romstage.c
+++ b/src/mainboard/lenovo/t400/romstage.c
@@ -179,7 +179,6 @@ void mainboard_romstage_entry(unsigned long bist)
* this is not a resume. In that case we just create the cbmem toc.
*/
if (s3resume && cbmem_initted) {
- acpi_prepare_for_resume();
/* Magic for S3 resume */
pci_write_config32(PCI_DEV(0, 0, 0), D0F0_SKPD, SKPAD_ACPI_S3_MAGIC);
diff --git a/src/mainboard/lenovo/x200/romstage.c b/src/mainboard/lenovo/x200/romstage.c
index 1deab65..db1d62f 100644
--- a/src/mainboard/lenovo/x200/romstage.c
+++ b/src/mainboard/lenovo/x200/romstage.c
@@ -179,7 +179,6 @@ void mainboard_romstage_entry(unsigned long bist)
* this is not a resume. In that case we just create the cbmem toc.
*/
if (s3resume && cbmem_initted) {
- acpi_prepare_for_resume();
/* Magic for S3 resume */
pci_write_config32(PCI_DEV(0, 0, 0), D0F0_SKPD, SKPAD_ACPI_S3_MAGIC);
diff --git a/src/mainboard/lenovo/x201/romstage.c b/src/mainboard/lenovo/x201/romstage.c
index 2bfa19c..7b8d7f9 100644
--- a/src/mainboard/lenovo/x201/romstage.c
+++ b/src/mainboard/lenovo/x201/romstage.c
@@ -282,7 +282,6 @@ void mainboard_romstage_entry(unsigned long bist)
* this is not a resume. In that case we just create the cbmem toc.
*/
if (s3resume) {
- acpi_prepare_for_resume();
/* Magic for S3 resume */
pci_write_config32(PCI_DEV(0, 0x00, 0), SKPAD, 0xcafed00d);
diff --git a/src/mainboard/packardbell/ms2290/romstage.c b/src/mainboard/packardbell/ms2290/romstage.c
index 92ee021..04c9513 100644
--- a/src/mainboard/packardbell/ms2290/romstage.c
+++ b/src/mainboard/packardbell/ms2290/romstage.c
@@ -272,7 +272,6 @@ void mainboard_romstage_entry(unsigned long bist)
* this is not a resume. In that case we just create the cbmem toc.
*/
if (s3resume) {
- acpi_prepare_for_resume();
/* Magic for S3 resume */
pci_write_config32(PCI_DEV(0, 0x00, 0), SKPAD, 0xcafed00d);
diff --git a/src/mainboard/roda/rk9/romstage.c b/src/mainboard/roda/rk9/romstage.c
index fc0c8d3..e8bd1e2 100644
--- a/src/mainboard/roda/rk9/romstage.c
+++ b/src/mainboard/roda/rk9/romstage.c
@@ -192,7 +192,6 @@ void mainboard_romstage_entry(unsigned long bist)
* this is not a resume. In that case we just create the cbmem toc.
*/
if (s3resume && cbmem_initted) {
- acpi_prepare_for_resume();
/* Magic for S3 resume */
pci_write_config32(PCI_DEV(0, 0, 0), D0F0_SKPD, SKPAD_ACPI_S3_MAGIC);
diff --git a/src/northbridge/intel/i945/early_init.c b/src/northbridge/intel/i945/early_init.c
index ade120f..3164f25 100644
--- a/src/northbridge/intel/i945/early_init.c
+++ b/src/northbridge/intel/i945/early_init.c
@@ -900,7 +900,6 @@ static void i945_prepare_resume(int s3resume)
* this is not a resume. In that case we just create the cbmem toc.
*/
if (s3resume && cbmem_was_initted) {
- acpi_prepare_for_resume();
/* Magic for S3 resume */
pci_write_config32(PCI_DEV(0, 0x00, 0), SKPAD,
diff --git a/src/northbridge/intel/sandybridge/early_init.c b/src/northbridge/intel/sandybridge/early_init.c
index a013ec3..86d1c00 100644
--- a/src/northbridge/intel/sandybridge/early_init.c
+++ b/src/northbridge/intel/sandybridge/early_init.c
@@ -234,7 +234,6 @@ void northbridge_romstage_finalize(int s3resume)
*/
if (s3resume) {
- acpi_prepare_for_resume();
/* Magic for S3 resume */
pci_write_config32(PCI_DEV(0, 0x00, 0), SKPAD, 0xcafed00d);