summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@secunet.com>2012-11-15 14:57:27 +0100
committerPatrick Georgi <patrick@georgi-clan.de>2012-11-19 22:06:51 +0100
commitd8e6d4085ffd10d399551a2ec75a57fd1f594fec (patch)
tree24a41d3cd82080839bc7ed98eb4870a873cee691 /src/arch
parentf943901777990554e3f5fb27b63613f6cd95c958 (diff)
downloadcoreboot-d8e6d4085ffd10d399551a2ec75a57fd1f594fec.tar.xz
bootblock: Guard CMOS rewrite in disable/enable RTC
This ensures that there's only one disable/enable cycle for the entire rewrite instead for every single byte. Change-Id: Ic06e6dcb08976d158ff784660838c0fbad875176 Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/1869 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/include/bootblock_common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/arch/x86/include/bootblock_common.h b/src/arch/x86/include/bootblock_common.h
index c9674f4a9c..4a128bce68 100644
--- a/src/arch/x86/include/bootblock_common.h
+++ b/src/arch/x86/include/bootblock_common.h
@@ -27,9 +27,11 @@ static void sanitize_cmos(void)
unsigned char *cmos_default = (unsigned char*)walkcbfs("cmos.default");
if (cmos_default) {
int i;
+ cmos_disable_rtc();
for (i = 14; i < 128; i++) {
cmos_write(cmos_default[i], i);
}
+ cmos_enable_rtc();
}
}
}