Skip to content

Commit 35d4769

Browse files
matnymanIngo Molnar
authored andcommitted
x86/rtc, mrst: Don't register a platform RTC device for for Intel MID platforms
Intel MID x86 platforms have a memory mapped virtual RTC instead. No MID platform have the default ports (and accessing them may do weird stuff). Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: feng.tang@intel.com Cc: Feng Tang <feng.tang@intel.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent a7a2804 commit 35d4769

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎arch/x86/include/asm/mrst.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,20 @@ enum mrst_cpu_type {
3131
};
3232

3333
extern enum mrst_cpu_type __mrst_cpu_chip;
34+
35+
#ifdef CONFIG_X86_INTEL_MID
36+
3437
static inline enum mrst_cpu_type mrst_identify_cpu(void)
3538
{
3639
return __mrst_cpu_chip;
3740
}
3841

42+
#else /* !CONFIG_X86_INTEL_MID */
43+
44+
#define mrst_identify_cpu() (0)
45+
46+
#endif /* !CONFIG_X86_INTEL_MID */
47+
3948
enum mrst_timer_options {
4049
MRST_TIMER_DEFAULT,
4150
MRST_TIMER_APBT_ONLY,

‎arch/x86/kernel/rtc.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <asm/vsyscall.h>
1313
#include <asm/x86_init.h>
1414
#include <asm/time.h>
15+
#include <asm/mrst.h>
1516

1617
#ifdef CONFIG_X86_32
1718
/*
@@ -242,6 +243,10 @@ static __init int add_rtc_cmos(void)
242243
if (of_have_populated_dt())
243244
return 0;
244245

246+
/* Intel MID platforms don't have ioport rtc */
247+
if (mrst_identify_cpu())
248+
return -ENODEV;
249+
245250
platform_device_register(&rtc_device);
246251
dev_info(&rtc_device.dev,
247252
"registered platform RTC device (no PNP device found)\n");

0 commit comments

Comments
 (0)