From e1b468e1a7cbea55108fb106105612e1f50c9487 Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Wed, 18 Jun 2014 09:10:53 +0300 Subject: AGESA boards: Use acpi_s3_resume_allowed() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds use of BROKEN_CAR_MIGRATE to include CBMEM symbols for the build of romstage also for boards without HAVE_ACPI_RESUME. These symbols got exposed as the use of preprocessor directives was reduced. We expect the linker to do a fair job and optimize away function bodies that are on unreachable execution paths. Change-Id: Ibf5181d3eecb87ce647abe0be01072594b05aa5f Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/6067 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan --- src/mainboard/amd/olivehill/agesawrapper.c | 2 -- src/mainboard/amd/olivehill/romstage.c | 7 ++----- src/mainboard/amd/parmer/agesawrapper.c | 2 -- src/mainboard/amd/parmer/romstage.c | 7 ++----- src/mainboard/amd/persimmon/agesawrapper.c | 2 -- src/mainboard/amd/persimmon/romstage.c | 7 ++----- src/mainboard/amd/thatcher/agesawrapper.c | 2 -- src/mainboard/amd/thatcher/romstage.c | 7 ++----- 8 files changed, 8 insertions(+), 28 deletions(-) (limited to 'src/mainboard/amd') diff --git a/src/mainboard/amd/olivehill/agesawrapper.c b/src/mainboard/amd/olivehill/agesawrapper.c index 158e758e41..8e3cb611d7 100644 --- a/src/mainboard/amd/olivehill/agesawrapper.c +++ b/src/mainboard/amd/olivehill/agesawrapper.c @@ -425,7 +425,6 @@ agesawrapper_amdlaterunaptask ( return (UINT32)Status; } -#if CONFIG_HAVE_ACPI_RESUME UINT32 agesawrapper_amdinitresume(VOID) { @@ -627,7 +626,6 @@ UINT32 agesawrapper_amdS3Save(VOID) } #endif /* #ifndef __PRE_RAM__ */ -#endif /* CONFIG_HAVE_ACPI_RESUME */ UINT32 agesawrapper_amdreadeventlog ( diff --git a/src/mainboard/amd/olivehill/romstage.c b/src/mainboard/amd/olivehill/romstage.c index dc52d16688..c979456ce2 100644 --- a/src/mainboard/amd/olivehill/romstage.c +++ b/src/mainboard/amd/olivehill/romstage.c @@ -92,9 +92,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx) } printk(BIOS_DEBUG, "Got past agesawrapper_amdinitearly\n"); -#if CONFIG_HAVE_ACPI_RESUME - if (!acpi_is_wakeup_early()) { /* Check for S3 resume */ -#endif + int s3resume = acpi_is_wakeup_early() && acpi_s3_resume_allowed(); + if (!s3resume) { post_code(0x40); val = agesawrapper_amdinitpost (); if(val) { @@ -110,7 +109,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx) printk(BIOS_DEBUG, "Got past agesawrapper_amdinitenv\n"); /* TODO: Disable cache is not ok. */ disable_cache_as_ram(); -#if CONFIG_HAVE_ACPI_RESUME } else { /* S3 detect */ printk(BIOS_INFO, "S3 detected\n"); @@ -132,7 +130,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx) post_code(0x61); prepare_for_resume(); } -#endif outb(0xEA, 0xCD6); outb(0x1, 0xcd7); diff --git a/src/mainboard/amd/parmer/agesawrapper.c b/src/mainboard/amd/parmer/agesawrapper.c index 55b31e18d5..85c1474bad 100644 --- a/src/mainboard/amd/parmer/agesawrapper.c +++ b/src/mainboard/amd/parmer/agesawrapper.c @@ -426,7 +426,6 @@ agesawrapper_amdlaterunaptask ( return (UINT32)Status; } -#if CONFIG_HAVE_ACPI_RESUME UINT32 agesawrapper_amdinitresume(VOID) { @@ -630,7 +629,6 @@ UINT32 agesawrapper_amdS3Save(VOID) } #endif /* #ifndef __PRE_RAM__ */ -#endif /* CONFIG_HAVE_ACPI_RESUME */ UINT32 agesawrapper_amdreadeventlog ( diff --git a/src/mainboard/amd/parmer/romstage.c b/src/mainboard/amd/parmer/romstage.c index 8c0afa5801..b0fa5d987c 100644 --- a/src/mainboard/amd/parmer/romstage.c +++ b/src/mainboard/amd/parmer/romstage.c @@ -76,9 +76,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx) } printk(BIOS_DEBUG, "Got past agesawrapper_amdinitearly\n"); -#if CONFIG_HAVE_ACPI_RESUME - if (!acpi_is_wakeup_early()) { /* Check for S3 resume */ -#endif + int s3resume = acpi_is_wakeup_early() && acpi_s3_resume_allowed(); + if (!s3resume) { post_code(0x40); val = agesawrapper_amdinitpost (); if(val) { @@ -93,7 +92,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx) } printk(BIOS_DEBUG, "Got past agesawrapper_amdinitenv\n"); disable_cache_as_ram(); -#if CONFIG_HAVE_ACPI_RESUME } else { /* S3 detect */ printk(BIOS_INFO, "S3 detected\n"); @@ -115,7 +113,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx) post_code(0x61); prepare_for_resume(); } -#endif post_code(0x50); copy_and_run(); diff --git a/src/mainboard/amd/persimmon/agesawrapper.c b/src/mainboard/amd/persimmon/agesawrapper.c index 8b7e48d25e..cfd0eeeb8c 100644 --- a/src/mainboard/amd/persimmon/agesawrapper.c +++ b/src/mainboard/amd/persimmon/agesawrapper.c @@ -433,7 +433,6 @@ agesawrapper_amdinitlate ( return (UINT32)Status; } -#if CONFIG_HAVE_ACPI_RESUME UINT32 agesawrapper_amdinitresume ( VOID @@ -565,7 +564,6 @@ agesawrapper_amdS3Save ( return (UINT32)Status; } #endif /* #ifndef __PRE_RAM__ */ -#endif /* CONFIG_HAVE_ACPI_RESUME */ UINT32 agesawrapper_amdlaterunaptask ( diff --git a/src/mainboard/amd/persimmon/romstage.c b/src/mainboard/amd/persimmon/romstage.c index 32b85c3b8e..f6f230990e 100644 --- a/src/mainboard/amd/persimmon/romstage.c +++ b/src/mainboard/amd/persimmon/romstage.c @@ -102,9 +102,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx) else printk(BIOS_DEBUG, "passed.\n"); -#if CONFIG_HAVE_ACPI_RESUME - if (!acpi_is_wakeup_early()) { /* Check for S3 resume */ -#endif + int s3resume = acpi_is_wakeup_early() && acpi_s3_resume_allowed(); + if (!s3resume) { post_code(0x40); printk(BIOS_DEBUG, "agesawrapper_amdinitpost "); val = agesawrapper_amdinitpost (); @@ -121,7 +120,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx) else printk(BIOS_DEBUG, "passed.\n"); -#if CONFIG_HAVE_ACPI_RESUME } else { /* S3 detect */ printk(BIOS_INFO, "S3 detected\n"); @@ -143,7 +141,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx) post_code(0x61); prepare_for_resume(); } -#endif post_code(0x50); copy_and_run(); diff --git a/src/mainboard/amd/thatcher/agesawrapper.c b/src/mainboard/amd/thatcher/agesawrapper.c index 4a97a40de1..7ab9e44ac9 100644 --- a/src/mainboard/amd/thatcher/agesawrapper.c +++ b/src/mainboard/amd/thatcher/agesawrapper.c @@ -423,7 +423,6 @@ agesawrapper_amdlaterunaptask ( return (UINT32)Status; } -#if CONFIG_HAVE_ACPI_RESUME UINT32 agesawrapper_amdinitresume(VOID) { @@ -632,7 +631,6 @@ UINT32 agesawrapper_amdS3Save(VOID) } #endif /* #ifndef __PRE_RAM__ */ -#endif /* CONFIG_HAVE_ACPI_RESUME */ UINT32 agesawrapper_amdreadeventlog ( diff --git a/src/mainboard/amd/thatcher/romstage.c b/src/mainboard/amd/thatcher/romstage.c index 063d2d9d86..10dac122e3 100644 --- a/src/mainboard/amd/thatcher/romstage.c +++ b/src/mainboard/amd/thatcher/romstage.c @@ -93,9 +93,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx) } printk(BIOS_DEBUG, "Got past agesawrapper_amdinitearly\n"); -#if CONFIG_HAVE_ACPI_RESUME - if (!acpi_is_wakeup_early()) { /* Check for S3 resume */ -#endif + int s3resume = acpi_is_wakeup_early() && acpi_s3_resume_allowed(); + if (!s3resume) { post_code(0x40); val = agesawrapper_amdinitpost (); if(val) { @@ -110,7 +109,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx) } printk(BIOS_DEBUG, "Got past agesawrapper_amdinitenv\n"); disable_cache_as_ram(); -#if CONFIG_HAVE_ACPI_RESUME } else { /* S3 detect */ printk(BIOS_INFO, "S3 detected\n"); @@ -132,7 +130,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx) post_code(0x61); prepare_for_resume(); } -#endif post_code(0x50); copy_and_run(); -- cgit v1.2.3