add rtc_init() to romstage

The FSP clears the bit that tells us whether or not the RTC has lost
power when it sets up memory.  Because of this, we need to initialize
the RTC in romstage instead of ramstage.

Change-Id: I158e4339fc539d32cfb2428042df6156d312a5f4
Signed-off-by: Martin Roth <gaumless@gmail.com>
Signed-off-by: Martin Roth <martin.roth@se-eng.com>
Reviewed-on: http://review.coreboot.org/5735
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
This commit is contained in:
Martin Roth 2014-05-12 21:52:54 -06:00
parent 2c55b70d1a
commit 7312c54dc6
2 changed files with 4 additions and 1 deletions

View File

@ -1,3 +1,4 @@
romstage-y += mc146818rtc.c
ramstage-y += mc146818rtc.c ramstage-y += mc146818rtc.c
ramstage-y += isa-dma.c ramstage-y += isa-dma.c
ramstage-y += i8254.c ramstage-y += i8254.c

View File

@ -71,6 +71,7 @@ void rtc_init(int invalid)
unsigned char x; unsigned char x;
#endif #endif
#ifndef __PRE_RAM__
#if CONFIG_HAVE_ACPI_RESUME #if CONFIG_HAVE_ACPI_RESUME
/* /*
* Avoid clearing pending interrupts and resetting the RTC control * Avoid clearing pending interrupts and resetting the RTC control
@ -80,7 +81,8 @@ void rtc_init(int invalid)
*/ */
if (acpi_slp_type == 3) if (acpi_slp_type == 3)
return; return;
#endif #endif /* CONFIG_HAVE_ACPI_RESUME */
#endif /* __PRE_RAM__ */
printk(BIOS_DEBUG, "RTC Init\n"); printk(BIOS_DEBUG, "RTC Init\n");