From 0e6d0edccea45c4dd8e3d7af25b3667330433699 Mon Sep 17 00:00:00 2001 From: Zheng Bao Date: Fri, 9 Nov 2012 19:55:04 +0800 Subject: mc146818rtc: Remove the hyphen to build on NetBSD and Darwin http://netbsd.gw.com/cgi-bin/man-cgi?date++NetBSD-current The NetBSD manual tells us the date in NetBSD doesn't take any flags to enable or disable padding in the format. By default, date pads numeric fields with zeroes. This will convert the number to octal one. So add "0x" to convert it to BCD directly. Change-Id: Icd44312acf01b8232f1da1fbaa70630d09007b40 Signed-off-by: Zheng Bao Signed-off-by: zbao Reviewed-on: http://review.coreboot.org/1804 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Anton Kochkov --- src/drivers/pc80/mc146818rtc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/pc80/mc146818rtc.c b/src/drivers/pc80/mc146818rtc.c index aee4df71e1..6e75943a42 100644 --- a/src/drivers/pc80/mc146818rtc.c +++ b/src/drivers/pc80/mc146818rtc.c @@ -87,10 +87,10 @@ static void rtc_update_cmos_date(u8 has_century) cmos_write(0, RTC_CLK_SECOND); cmos_write(0, RTC_CLK_MINUTE); cmos_write(1, RTC_CLK_HOUR); - cmos_write(RTC_TO_BCD(COREBOOT_BUILD_WEEKDAY) + 1, RTC_CLK_DAYOFWEEK); - cmos_write(RTC_TO_BCD(COREBOOT_BUILD_DAY), RTC_CLK_DAYOFMONTH); - cmos_write(RTC_TO_BCD(COREBOOT_BUILD_MONTH), RTC_CLK_MINUTE); - cmos_write(RTC_TO_BCD(COREBOOT_BUILD_YEAR), RTC_CLK_YEAR); + cmos_write(COREBOOT_BUILD_WEEKDAY_BCD + 1, RTC_CLK_DAYOFWEEK); + cmos_write(COREBOOT_BUILD_DAY_BCD, RTC_CLK_DAYOFMONTH); + cmos_write(COREBOOT_BUILD_MONTH_BCD, RTC_CLK_MINUTE); + cmos_write(COREBOOT_BUILD_YEAR_BCD, RTC_CLK_YEAR); if (has_century) cmos_write(0x20, RTC_CLK_ALTCENTURY); } -- cgit v1.2.3