summaryrefslogtreecommitdiff
path: root/src/drivers/pc80
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2019-09-12 20:22:56 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2019-09-13 19:29:46 +0000
commitb2536f418fafc0839e4666e72d70f386db9f58a7 (patch)
treefc25f83a7c4799def38c5d365a7e9bd9ed33baca /src/drivers/pc80
parentb590a04f78ca69e45b075afa01f054a42e255ef6 (diff)
drivers/pc80: Remove some __PRE_RAM__ and __SMM__
Change-Id: Ic90df69c27d524086405238b9683a69771c1b9d5 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/35388 Reviewed-by: Furquan Shaikh <furquan@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers/pc80')
-rw-r--r--src/drivers/pc80/rtc/mc146818rtc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/drivers/pc80/rtc/mc146818rtc.c b/src/drivers/pc80/rtc/mc146818rtc.c
index e0869a9337..9ea5414f2d 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.