summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorJinke Fan <fanjinke@hygon.cn>2019-11-05 11:39:43 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-11-08 18:56:28 +0300
commit7ad295d5196a58c22abecef62dd4f99e2f86e831 (patch)
tree49e594575be5a329ffe0b749944a0a7cf237bc1c /block
parentafe19a7ae8b6b6032d04d3895ebd5bbac7fe9f30 (diff)
downloadlinux-7ad295d5196a58c22abecef62dd4f99e2f86e831.tar.xz
rtc: Fix the AltCentury value on AMD/Hygon platform
When using following operations: date -s "21190910 19:20:00" hwclock -w to change date from 2019 to 2119 for test, it will fail on Hygon Dhyana and AMD Zen CPUs, while the same operations run ok on Intel i7 platform. MC146818 driver use function mc146818_set_time() to set register RTC_FREQ_SELECT(RTC_REG_A)'s bit4-bit6 field which means divider stage reset value on Intel platform to 0x7. While AMD/Hygon RTC_REG_A(0Ah)'s bit4 is defined as DV0 [Reference]: DV0 = 0 selects Bank 0, DV0 = 1 selects Bank 1. Bit5-bit6 is defined as reserved. DV0 is set to 1, it will select Bank 1, which will disable AltCentury register(0x32) access. As UEFI pass acpi_gbl_FADT.century 0x32 (AltCentury), the CMOS write will be failed on code: CMOS_WRITE(century, acpi_gbl_FADT.century). Correct RTC_REG_A bank select bit(DV0) to 0 on AMD/Hygon CPUs, it will enable AltCentury(0x32) register writing and finally setup century as expected. Test results on Intel i7, AMD EPYC(17h) and Hygon machine show that it works as expected. Compiling for sparc64 and alpha architectures are passed. Reference: https://www.amd.com/system/files/TechDocs/51192_Bolton_FCH_RRG.pdf section: 3.13 Real Time Clock (RTC) Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Jinke Fan <fanjinke@hygon.cn> Link: https://lore.kernel.org/r/20191105083943.115320-1-fanjinke@hygon.cn Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'block')
0 files changed, 0 insertions, 0 deletions