--- zzzz-none-000/linux-5.15.111/arch/x86/kernel/rtc.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/arch/x86/kernel/rtc.c 2024-02-07 10:22:35.000000000 +0000 @@ -2,6 +2,12 @@ /* * RTC related functions */ + + /* + * Includes Intel Corporation's changes dated: 2020. + * Changed portions - Copyright 2020, Intel Corporation. + */ + #include #include #include @@ -62,7 +68,8 @@ void mach_get_cmos_time(struct timespec64 *now) { - unsigned int status, year, mon, day, hour, min, sec, century = 0; + unsigned int year, mon, day, hour, min, sec, century = 0; + unsigned char status; unsigned long flags; /* @@ -85,6 +92,16 @@ while ((CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)) cpu_relax(); +#ifdef CONFIG_INTEL_FORCE_RTC_BCD_ENCODING + if (RTC_ALWAYS_BCD) { + status = CMOS_READ(RTC_CONTROL); + if (status & RTC_DM_BINARY) { + CMOS_WRITE((status ^ RTC_DM_BINARY), RTC_CONTROL); + pr_info("BCD encoding mode was forced for RTC\n"); + } + } +#endif + sec = CMOS_READ(RTC_SECONDS); min = CMOS_READ(RTC_MINUTES); hour = CMOS_READ(RTC_HOURS);