--- zzzz-none-000/linux-4.9.279/arch/x86/kernel/rtc.c 2021-08-08 06:38:54.000000000 +0000 +++ puma7-atom-6591-750/linux-4.9.279/arch/x86/kernel/rtc.c 2023-02-08 11:43:42.000000000 +0000 @@ -1,6 +1,12 @@ /* * RTC related functions */ + + /* + * Includes Intel Corporation's changes dated: 2020. + * Changed portions - Copyright 2020, Intel Corporation. + */ + #include #include #include @@ -61,7 +67,8 @@ void mach_get_cmos_time(struct timespec *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; spin_lock_irqsave(&rtc_lock, flags); @@ -75,6 +82,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);