]> git.baikalelectronics.ru Git - uboot.git/commit
drivers: rtc: correct week day for mc146818
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 7 Jul 2018 22:07:26 +0000 (00:07 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 20 Jul 2018 19:55:04 +0000 (15:55 -0400)
commite64766683a4d37034c60d019c6eafeff63497abf
tree7041fa692e8216766f8e86dc70e85643cdc678dc
parentf3dcebfec606dd9d57df362c3024a1b3bf7243df
drivers: rtc: correct week day for mc146818

For qemu-x86 the date command produces wrong days of the week:
Date: 2018-07-06 (Saturday)    Time: 18:02:03
Date: 2018-07-07 (unknown day)    Time: 21:02:06

According to a comment in the Linux driver the mc146818 only updates the
day of the week if the register value is non-zero.

Sunday is 1, saturday is 7 unlike in U-Boot (see data sheet
https://www.nxp.com/docs/en/data-sheet/MC146818.pdf).

So let's use our library function to determine the day of the week.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
drivers/rtc/mc146818.c