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
F102543823: D33667.id.diff
Wed, Nov 13, 8:36 PM
Unknown Object (File)
Wed, Oct 23, 4:04 PM
Unknown Object (File)
Oct 14 2024, 3:09 PM
Unknown Object (File)
Sep 30 2024, 11:22 PM
Unknown Object (File)
Sep 30 2024, 9:18 PM
Unknown Object (File)
Sep 30 2024, 4:14 PM
Unknown Object (File)
Sep 27 2024, 5:58 PM
Unknown Object (File)
Sep 26 2024, 5:50 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