Page MenuHomeFreeBSD

atrtc: reads Century field from FADT table
ClosedPublic

Authored by austin.zhang_dell.com on Dec 27 2021, 8:27 AM.
Tags
Referenced Files
Unknown Object (File)
Tue, Apr 23, 3:09 PM
Unknown Object (File)
Sun, Apr 21, 6:33 PM
Unknown Object (File)
Sun, Apr 21, 2:38 PM
Unknown Object (File)
Sat, Apr 6, 7:59 AM
Unknown Object (File)
Feb 20 2024, 5:13 AM
Unknown Object (File)
Feb 8 2024, 8:51 PM
Unknown Object (File)
Dec 25 2023, 2:06 AM
Unknown Object (File)
Dec 22 2023, 10:33 PM
Subscribers

Details

Summary

from UEFI spec https://uefi.org/specs/ACPI/6.4/05_ACPI_Software_Programming_Model/ACPI_Software_Programming_Model.html#fixed-acpi-description-table-fadt
it described FADT->Century field as:
"The RTC CMOS RAM index to the century of data value (hundred and thousand year decimals). If this field contains a zero, then the RTC centenary feature is not supported.
If this field has a non-zero value, then this field contains an index into RTC RAM space that OSPM can use to program the centenary field."

We should use this field to decide whether need to program CENTURY register of CMOS RTC device

Test Plan

w/o patch, CMOS RTC century can't be written by date command

root@freebsd-zhanga28:~/workspace # date 199901011101
Fri Jan  1 11:01:00 UTC 1999
root@freebsd-zhanga28:~/workspace # date ; ./a.out
Fri Jan  1 11:01:04 UTC 1999
Date and Time info from CMOS:
2099-1-1-11:1:4

with this patch, CMOS RTC century can be correctly updated by date command

root@freebsd-zhanga28:~/workspace # date 199901011221
Fri Jan  1 12:21:00 UTC 1999
root@freebsd-zhanga28:~/workspace # date ; ./a.out
Fri Jan  1 12:21:03 UTC 1999
Date and Time info from CMOS:
1999-1-1-12:21:4

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable