Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31557 )
Change subject: rtc: Fix rtc_calc_weekday ......................................................................
Patch Set 9:
(3 comments)
Patch Set 1:
(22 comments)
https://review.coreboot.org/#/c/31557/7/src/lib/rtc.c File src/lib/rtc.c:
https://review.coreboot.org/#/c/31557/7/src/lib/rtc.c@47 PS7, Line 47: const int C = tm->year / 100;
If I read the Wiki page right this also needs to be corrected for Jan/Feb? Maybe it would be best to […]
Good catch! I did misread that (I guess that means I should put in some unit tests...).
https://review.coreboot.org/#/c/31557/7/src/lib/rtc.c@48 PS7, Line 48: D >> 2
Is there a good reason these are shifts? If the algorithm just requires you to integer divide by 4, […]
Not particularly :) I guess this is my way of sussing out at what level the coreboot community cares about these sorts of low-level (potential) optimizations. Done.
https://review.coreboot.org/#/c/31557/7/src/lib/rtc.c@126 PS7, Line 126: (void)rtc_calc_weekday(tm);
I'm not sure we'd want to do this. […]
Fair enough. My understanding was that many systems either a) incorrectly or b) don't bother to set the weekday register (source: https://wiki.osdev.org/CMOS#Weekday_Register). I noticed it was definitely set incorrectly on my system (2019-2-21 was marked as Saturday). It's completely redundant information to store in CMOS; but I suppose you're probably right that's the driver's issue to deal with. I'll correct that at least for the driver for the system I'm using.