1 // SPDX-License-Identifier: GPL-2.0-only
3 * Intel Merrifield legacy RTC initialization file
5 * (C) Copyright 2017 Intel Corporation
7 * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
10 #include <linux/init.h>
12 #include <asm/hw_irq.h>
13 #include <asm/intel-mid.h>
14 #include <asm/io_apic.h>
16 #include <asm/x86_init.h>
18 static int __init mrfld_legacy_rtc_alloc_irq(void)
20 struct irq_alloc_info info;
23 if (!x86_platform.legacy.rtc)
26 ioapic_set_alloc_attr(&info, NUMA_NO_NODE, 1, 0);
27 ret = mp_map_gsi_to_irq(RTC_IRQ, IOAPIC_MAP_ALLOC, &info);
29 pr_info("Failed to allocate RTC interrupt. Disabling RTC\n");
30 x86_platform.legacy.rtc = 0;
37 static int __init mrfld_legacy_rtc_init(void)
39 if (intel_mid_identify_cpu() != INTEL_MID_CPU_CHIP_TANGIER)
42 return mrfld_legacy_rtc_alloc_irq();
44 arch_initcall(mrfld_legacy_rtc_init);