From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Jiang Liu To: Benjamin Herrenschmidt , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "Rafael J. Wysocki" , Bjorn Helgaas , Randy Dunlap , Yinghai Lu , Len Brown , x86@kernel.org Cc: Jiang Liu , Konrad Rzeszutek Wilk , Andrew Morton , Tony Luck , Joerg Roedel , Paul Gortmaker , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, sfi-devel@simplefirmware.org Subject: [RFC Patch Part1 V1 24/30] x86, SFI, irq: provide basic irqdomain support Date: Fri, 16 May 2014 16:05:44 +0800 Message-Id: <1400227550-5935-25-git-send-email-jiang.liu@linux.intel.com> In-Reply-To: <1400227550-5935-1-git-send-email-jiang.liu@linux.intel.com> References: <1400227550-5935-1-git-send-email-jiang.liu@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: Enhance SFI to provide basic support of irqdomain with identity mapping between GSIs and IRQs. Signed-off-by: Jiang Liu --- arch/x86/platform/sfi/sfi.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/x86/platform/sfi/sfi.c b/arch/x86/platform/sfi/sfi.c index 3bd7cf642680..2c3522dfa05d 100644 --- a/arch/x86/platform/sfi/sfi.c +++ b/arch/x86/platform/sfi/sfi.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -70,6 +71,12 @@ static int __init sfi_parse_cpus(struct sfi_table_header *table) #endif /* CONFIG_X86_LOCAL_APIC */ #ifdef CONFIG_X86_IO_APIC +static struct irq_domain_ops sfi_ioapic_irqdomain_ops; + +static struct irq_domain *sfi_ioapic_create_irqdomain(int ioapic, void *arg) +{ + return mp_irqdomain_create(ioapic, NULL, &sfi_ioapic_irqdomain_ops); +} static int __init sfi_parse_ioapic(struct sfi_table_header *table) { @@ -82,7 +89,8 @@ static int __init sfi_parse_ioapic(struct sfi_table_header *table) pentry = (struct sfi_apic_table_entry *)sb->pentry; for (i = 0; i < num; i++) { - mp_register_ioapic(i, pentry->phys_addr, gsi_top, NULL, NULL); + mp_register_ioapic(i, pentry->phys_addr, gsi_top, + sfi_ioapic_create_irqdomain, NULL); pentry++; } -- 1.7.10.4