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)
Mon, Sep 30, 11:22 PM
Unknown Object (File)
Mon, Sep 30, 9:18 PM
Unknown Object (File)
Mon, Sep 30, 4:14 PM
Unknown Object (File)
Fri, Sep 27, 5:58 PM
Unknown Object (File)
Thu, Sep 26, 5:50 AM
Unknown Object (File)
Tue, Sep 24, 8:54 AM
Unknown Object (File)
Tue, Sep 24, 6:10 AM
Unknown Object (File)
Tue, Sep 17, 4:15 AM
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