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>
diff --git a/src/drivers/pc80/Makefile.inc b/src/drivers/pc80/Makefile.inc
index 4d0a280..d216e2c 100644
--- a/src/drivers/pc80/Makefile.inc
+++ b/src/drivers/pc80/Makefile.inc
@@ -1,3 +1,4 @@
+romstage-y += mc146818rtc.c
 ramstage-y += mc146818rtc.c
 ramstage-y += isa-dma.c
 ramstage-y += i8254.c
diff --git a/src/drivers/pc80/mc146818rtc.c b/src/drivers/pc80/mc146818rtc.c
index 51cd6c3..6f8a4eb 100644
--- a/src/drivers/pc80/mc146818rtc.c
+++ b/src/drivers/pc80/mc146818rtc.c
@@ -71,6 +71,7 @@
 	unsigned char x;
 #endif
 
+#ifndef __PRE_RAM__
 #if CONFIG_HAVE_ACPI_RESUME
 	/*
 	 * Avoid clearing pending interrupts and resetting the RTC control
@@ -80,7 +81,8 @@
 	 */
 	if (acpi_slp_type == 3)
 		return;
-#endif
+#endif /* CONFIG_HAVE_ACPI_RESUME */
+#endif /* __PRE_RAM__ */
 
 	printk(BIOS_DEBUG, "RTC Init\n");