Commit f01f4ffd authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: cmos: Revert "rtc: Fix the AltCentury value on AMD/Hygon platform"

There are multiple reports of this patch breaking RTC time setting for AMD
platforms.

This reverts commit 7ad295d5.

Cc: Jinke Fan <fanjinke@hygon.cn>
Link: https://lore.kernel.org/r/CABXGCsMLob0DC25JS8wwAYydnDoHBSoMh2_YLPfqm3TTvDE-Zw@mail.gmail.com
Fixes: 7ad295d5 ("rtc: Fix the AltCentury value on AMD/Hygon platform")
Link: https://lore.kernel.org/r/20200104043110.707810-1-alexandre.belloni@bootlin.comSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 653997ee
...@@ -172,20 +172,7 @@ int mc146818_set_time(struct rtc_time *time) ...@@ -172,20 +172,7 @@ int mc146818_set_time(struct rtc_time *time)
save_control = CMOS_READ(RTC_CONTROL); save_control = CMOS_READ(RTC_CONTROL);
CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL); CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL);
save_freq_select = CMOS_READ(RTC_FREQ_SELECT); save_freq_select = CMOS_READ(RTC_FREQ_SELECT);
CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
#ifdef CONFIG_X86
if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
boot_cpu_data.x86 == 0x17) ||
boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) {
CMOS_WRITE((save_freq_select & (~RTC_DIV_RESET2)),
RTC_FREQ_SELECT);
save_freq_select &= ~RTC_DIV_RESET2;
} else
CMOS_WRITE((save_freq_select | RTC_DIV_RESET2),
RTC_FREQ_SELECT);
#else
CMOS_WRITE((save_freq_select | RTC_DIV_RESET2), RTC_FREQ_SELECT);
#endif
#ifdef CONFIG_MACH_DECSTATION #ifdef CONFIG_MACH_DECSTATION
CMOS_WRITE(real_yrs, RTC_DEC_YEAR); CMOS_WRITE(real_yrs, RTC_DEC_YEAR);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment