Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/18498 )
Change subject: libpayload: Improve rtc functions ......................................................................
Patch Set 4:
(4 comments)
https://review.coreboot.org/c/coreboot/+/18498/1/payloads/libpayload/drivers... File payloads/libpayload/drivers/nvram.c:
https://review.coreboot.org/c/coreboot/+/18498/1/payloads/libpayload/drivers... PS1, Line 127: 0x04
Please use defined constants (e.g. NVRAM_RTC_BINARY).
Done
https://review.coreboot.org/c/coreboot/+/18498/4/payloads/libpayload/drivers... File payloads/libpayload/drivers/nvram.c:
https://review.coreboot.org/c/coreboot/+/18498/4/payloads/libpayload/drivers... PS4, Line 127: 0x04
maybe give it a name? RTC_BINARY_FORMAT (with 0 == BCD)
Done
https://review.coreboot.org/c/coreboot/+/18498/4/payloads/libpayload/drivers... PS4, Line 133: 0x02
RTC_24HOURS?
Done
https://review.coreboot.org/c/coreboot/+/18498/4/payloads/libpayload/drivers... PS4, Line 146: if (!(statusB & 0x02)) { : reg8 = nvram_read(NVRAM_RTC_HOURS); : time->tm_hour = reg8 & 0x7f; : time->tm_hour += (reg8 & 0x80) ? 12 : 0; : time->tm_hour %= 24; : } else : time->tm_hour = nvram_read(NVRAM_RTC_HOURS); : time->tm_year = nvram_read(NVRAM_RTC_YEAR);
factor out?
or maybe not...