From b2536f418fafc0839e4666e72d70f386db9f58a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Thu, 12 Sep 2019 20:22:56 +0300 Subject: drivers/pc80: Remove some __PRE_RAM__ and __SMM__ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic90df69c27d524086405238b9683a69771c1b9d5 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/35388 Reviewed-by: Furquan Shaikh Tested-by: build bot (Jenkins) --- src/drivers/pc80/rtc/mc146818rtc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/drivers/pc80') diff --git a/src/drivers/pc80/rtc/mc146818rtc.c b/src/drivers/pc80/rtc/mc146818rtc.c index e0869a933710..9ea5414f2d28 100644 --- a/src/drivers/pc80/rtc/mc146818rtc.c +++ b/src/drivers/pc80/rtc/mc146818rtc.c @@ -100,7 +100,6 @@ static void cmos_set_checksum(int range_start, int range_end, int cks_loc) #define RTC_CONTROL_DEFAULT (RTC_24H) #define RTC_FREQ_SELECT_DEFAULT (RTC_REF_CLCK_32KHZ | RTC_RATE_1024HZ) -#ifndef __SMM__ static bool __cmos_init(bool invalid) { bool cmos_invalid; @@ -109,16 +108,14 @@ static bool __cmos_init(bool invalid) size_t i; uint8_t x; -#ifndef __PRE_RAM__ /* * Avoid clearing pending interrupts and resetting the RTC control * register in the resume path because the Linux kernel relies on * this to know if it should restart the RTC timer queue if the wake * was due to the RTC alarm. */ - if (acpi_is_wakeup_s3()) + if (ENV_RAMSTAGE && acpi_is_wakeup_s3()) return false; -#endif /* __PRE_RAM__ */ printk(BIOS_DEBUG, "RTC Init\n"); @@ -200,13 +197,14 @@ static void cmos_init_vbnv(bool invalid) void cmos_init(bool invalid) { + if (ENV_SMM) + return; + if (CONFIG(VBOOT_VBNV_CMOS)) cmos_init_vbnv(invalid); else __cmos_init(invalid); } -#endif /* __SMM__ */ - /* * This routine returns the value of the requested bits. -- cgit v1.2.3