Re: [PATCH v2] rtc: Fix the AltCentury value on AMD/Hygon platform

From: Jinke Fan
Date: Tue Oct 08 2019 - 23:18:53 EST


On 2019/10/8 17:44, Alexandre Belloni wrote:
> On 08/10/2019 17:37:12+0800, Jinke Fan wrote:
>> When using following operations:
>> save_control = CMOS_READ(RTC_CONTROL);
>> - CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL);
>> + CMOS_WRITE((save_control | RTC_SET), RTC_CONTROL);
>
> Unrelated change.

OK, this line change will be cancelled in the patch v3.

>> save_freq_select = CMOS_READ(RTC_FREQ_SELECT);
>> - CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
>> +
>> +#if defined(CONFIG_CPU_SUP_AMD) || defined(CONFIG_CPU_SUP_HYGON)
>> + CMOS_WRITE((save_freq_select & (~RTC_DV0)), RTC_FREQ_SELECT);
>
> That does break all the other x86 platforms.

Yes, it's a mistake. In the patch v3, the modifications will be
limited to AMD/Hygon vendor id.

--
Best Regards,
Jinke Fan