Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752275AbcKONBN (ORCPT ); Tue, 15 Nov 2016 08:01:13 -0500 Received: from mail-dm3nam03on0072.outbound.protection.outlook.com ([104.47.41.72]:37371 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751989AbcKONBJ (ORCPT ); Tue, 15 Nov 2016 08:01:09 -0500 X-Greylist: delayed 2057 seconds by postgrey-1.27 at vger.kernel.org; Tue, 15 Nov 2016 08:01:09 EST Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; imgtec.com; dkim=none (message not signed) header.d=none;imgtec.com; dmarc=bestguesspass action=none header.from=xilinx.com; X-IncomingTopHeaderMarker: OriginalChecksum:;UpperCasedChecksum:;SizeAsReceived:1796;Count:20 Subject: Re: [Patch v7 7/7] powerpc/virtex: Use generic xilinx irqchip driver To: Zubair Lutfullah Kakakhel , , , , References: <20161114121351.10924-1-Zubair.Kakakhel@imgtec.com> <20161114121351.10924-8-Zubair.Kakakhel@imgtec.com> CC: , , , From: Michal Simek Message-ID: <92d4f856-aef5-721f-bb18-bfc5a3f53573@xilinx.com> Date: Tue, 15 Nov 2016 13:28:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161114121351.10924-8-Zubair.Kakakhel@imgtec.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22700.004 X-TM-AS-User-Approved-Sender: Yes;Yes X-IncomingHeaderCount: 20 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(24454002)(189002)(199003)(36756003)(356003)(87936001)(65826007)(64126003)(50986999)(4326007)(6666003)(2950100002)(50466002)(626004)(2906002)(54356999)(83506001)(33646002)(230700001)(5660300001)(76176999)(81156014)(77096005)(229853002)(86362001)(31696002)(9786002)(8936002)(65956001)(31686004)(65806001)(106466001)(81166006)(63266004)(2201001)(47776003)(23746002)(7846002)(36386004)(5001770100001)(189998001)(4001350100001)(8676002)(92566002)(305945005)(41533002)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR02MB2871;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;PTR:unknown-60-83.xilinx.com;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;CY1NAM02FT039;1:+gUmCHL7tgSdNok3oGolD9fpAHVMDcvJybAAaskabJCl/9qyDtXlyXx3E36m9L3tHsYuEAYu8mFtEtnGxRoHKbl4dxcxw/LNKKRNHMza9oAkIAjVyaN9mQYR3T1g3kQljTB1LRbF8H26bnf20BaLQAi2OlUJHZbrJgfYeIuarU4gv2muikHUKgCx7dGWBr8HZEkEZ3xvVVnbQNp1oi0KFlz00DIQM8telzPWfKZfCLA0/Gy1e7JgOn+/Aj+ZFPHIINGiBZKNVnu/29gmFGO5pKa5zuu0hmJbJ/dC0MjRKEdW2u8XzEVRtglhyaubAhDkWtTHAcE0XtUw4FTkdaOKfHoi/Zzj+3MLLjse5Aq0JzrbMUX2aPkAk95y9ZxuEBbXxjxZf9zkog7CSAwCewm6bipI1wDiZ1wGYtrgwyXt1mYdvs7L7fEaYHbQ9sp0Dg7bhWafx+G83aUDWqnWb15MGlZzAPXd1M1GpV8YsObAZZPdVIyQYbo9lf5Qs7cuz0TMHPlE6hqsN17PUe+EfQuNwo7g/uOjNgfaUumcq2Az6Zl58li+/b7or+8Hd1a89I1tWUOri4al04N4Y1+AkDisLuMYU2tH1JP0fHxSDIims60= X-Microsoft-Exchange-Diagnostics: 1;CY4PR02MB2871;2:NXZ4mngfiEZjTgb1XBUeoEC0+P49aFrfFFzjm2pGcFJWSQ4/u/nQIg2SGrn3CDYNfdHIr+k9MuJErBbCYsjeS0hQ8CmV9oXhO+DKTh42bK4jxBQuRZy9lHktG+ffQ53v5QP3vgPX/445nuWJbWcUVDivtoVUoNvvlSwvEWZNTjA=;3:0225rBNSsxkMDXyiINrBKZVw2cry/FKFLBYkE09gQtuvOTRUqfBdAa2dYR0CrRCtWP2d12A97HbRAi4vdu9BukVub86u8j/c8mpHzsHQvYmoaW7j8Ig6my88K5Mjp0VlHYza7qIKn1jG7/ywUCauz0fdTFMGPoeFJ4935b4TwcHLofgSYBf9yHjg+d9/swFftwYwxHWFWqmw/yG12aM0HQQ6tEUED3ZVDVpKhkYoU1M+Fgdg5cQVdKUFbOWCTAoX8Cxp5nS9vEv5HOqWZyFjVRNBJGehoE5WWPEj1MNfjV8= X-MS-Office365-Filtering-Correlation-Id: 75b376fa-882e-429a-6a48-08d40d52e882 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(8251501002);SRVR:CY4PR02MB2871; X-Microsoft-Exchange-Diagnostics: 1;CY4PR02MB2871;25:0/rTPwVV6Y8DJsb/2109PxwNjFF+A7x38gLDUFVnas6ildrAxfz7Cc9oiDycZVFW8DN1dTmMiS/OR9jQyh4fFkA0E0IJSSblqLF0lQs6tHaGvTDMM3NJdIXEjhUi8ONY/9FfjcPSBvS46zkEfixXUx6UGQV/19+KxDKIKIOKV7SHpKYZtiI03l8r7Ejmu00zHKQueKYXz4y7I6ITUznvT1yRHE8r1ePTpK2i/3boL1NfYP1TWv9poAIw7BEMBtbp/e5hymVntqPcCbnuTF9njrOsd6cXdcNz0wNqBVeVJfymygf2q1zJ5UJHcpZ7lupaNVUtybzYZzd/x6FpaKdN5tvD+FuXw9sBmQLV4bUH2tgZbk1J9bJIPPIj2K5TYW2uGc8F029QL8Pdw+bPorqtQXsw78m3FJG7J88Rtn56ZVTNNF6M3jYhYmKbfWhG+IYio4zOvoI0NRn4rp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rg7oihlhxrT8qUuFP00fBNdKDeOmEEh+Gx6rdqQydhT5WL/7uAM9l4nQgjTQeKJR9RNUO3YTW1PIr0qufpRvzF6cYl4xy5LXXOw45CIIMxILB1O3hacQfPHEWQZfwfKklNAEqZD+Q4LjXb6uTeSFCsC9fnZ2cMlzpi07J16KiSTeclDOJL1verNcY7EZUUmZ1NocwUzMwe X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6060326)(601004)(2401047)(8121501046)(13023025)(5005006)(13017025)(13018025)(13015025)(13024025)(10201501046)(3002001)(6055026)(6061324);SRVR:CY4PR02MB2871;BCL:0;PCL:0;RULEID:;SRVR:CY4PR02MB2871; X-Microsoft-Exchange-Diagnostics: 1;CY4PR02MB2871;4:gMLiqkfoiQk6QunGITyfuo2UFx7n6Qw0LcbvTE+/J/DejpEJwmYkDtjk4eH91Pv1obpiorqtF1sZJjba/enkVaUdOXHSLFhZs26Qun4opEgZ1Jf5G8uWe8C1XRXDn4iVKFQX12t2n0uW0SojhqGBTowIKGpI+zhwvvAjuLdTbxT2lLCcAnC5bB2WOyK8/1Yzprd8KturnHaCNgqKRzya9aS1JoGlCta/WUfHkKF1EK6igngyy7XgMv/rWoiN9CT5EcYYBNhU3r6JL+bFmxB41OXq1hxhLmKxSmYUjGXguaCHUdPeYmWkoZfcicPQagbnMWh9dwy9RIH8rlDoOELzogyWZ1l7JTo1gJDZeqI4hYFN63ukuYZYXxRh3oG7yMyHU7j+i69Y8Ea+a8gkUUGWskfr2nwgPJMxhWC6vPO+Ij6EzEzctl1kGIcklOTOLKGmoMfdc0yfkLWj1w9nx627+WzoR+1ykZRoqqTLQTtXhOGFctLLKs14BaYF0ZhFp9VgLmFQ8M9ADcaHSZb4YUuCyVuuPwULZVI2Q9aXRIJczCSmfqLkcKU/nKoJ5LbigkJnTYxzWk9f23pYNOGcELBtig== X-Forefront-PRVS: 012792EC17 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;CY4PR02MB2871;23:pDWjNO59tXjmhEB1FhSVXlQDZLjVL9ud47Oor?= =?Windows-1252?Q?biEifG0MADCTdyIRIln7ksT4U/jxdGdk+mVeR/pcduNyITP8DAKTojgh?= =?Windows-1252?Q?mer8egzCl90ZcdlTnmu5XA8Hbb0Ow4cPkFssWZ2zCBhByDoDjrD+3qCK?= =?Windows-1252?Q?mZRJ6m+S3JZ2ZGgzNrM343KW0vLTIPFkT5FmK/QbnaWCgMp5MNt9qD/F?= =?Windows-1252?Q?aajm4C5xfPfBuBg0xPKy3WBJQxLGcwRiVjUVf4PwSWiceyG7AOVlfbFt?= =?Windows-1252?Q?Fx2OTlEqqpFYuq6gHj2VDBD00rG0dIyb+RGXUr7d8HMRPXIa9mVnN6SJ?= =?Windows-1252?Q?EpiTnAKqhcTK1h/18Kfx4gvVDWjIwbN3ZwuYrbT7eORAuZzeRmTAROQM?= =?Windows-1252?Q?+O3i5DUy28AuKX4iul3xRVKZ5SIZgDRTmky7ZGGD7+0wHweOVaQ68e+g?= =?Windows-1252?Q?ksHPO7QifFwTzS/Dm6Oj/Of8NkLYhVWnbf6t8eu7V7wod7vx+d8As0Pc?= =?Windows-1252?Q?GFc6s+z4f6ZH2uzeSil0iZRm23W9CU5wJFGlgep4u8z27wRXO9ZIbJoW?= =?Windows-1252?Q?sP02Z2bJ+ohkWHN5NXtK9Vyl1E4uB992QRL02ilO3P+MkoL0Y9m0foqo?= =?Windows-1252?Q?gg3ZyaQqq/ee8Kvt6oQR0WSTvMs4eH6DCIjSdoDiexQyVM2eHAPK7lxo?= =?Windows-1252?Q?4bqszZleQTOlmxtyh7o2/BM6y/xd00yDUN4V+qfcSJSmIwaLA/O9pidz?= =?Windows-1252?Q?SgUgM/mZ2fvXfsiU4bK60cKHQeCRNWoaHCHXCvDM0OwBs5pLTcogL3RR?= =?Windows-1252?Q?Wi7myXN8oGvpfGwe8JzEqkKNdTn7XZ3iF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ZK/MM3X+OdWznzHYyXdoQsMPEC2zuhdEvU7EjLj10dKg==;24:MB1e62j0b2ZAEGoyBIhgU+O58U3YbArKUwdL8OpeYHgXMckgwZKBvn6Tw5vhHZRo7ti/yAmfkzKwe1tYjf6SUaAUBBvbrpTAqbFdizN7RkY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR02MB2871;7:91JcJkc5PAksu81g5xl0QgR7jewO+6rc3PJDjWKKiI1mFinrTDfsG5Di1kBmS2dncGQfW0lRq0zqQVb/1DilOMTT8AbAEVcX+Qn/aEAVsSs/bE+CUISolBDkmmtkGFbb5trPYnp9mJDa7rVzZVZM4ldd2z/zc4aSJ4pY/mv4erQFxpFVXFmbms0scnPQey8uM2umKo4wQIfFlseeFe/XVSRFdAO4e1ioGcfVIeVdAbp2/J1fy2LRIhjsouvlOaPCC2k03h0/EyjsW9Zp+V9h1t4/ATln1UxAYURW92XuGDBXj3UPsfWMLhdDs58xjL1zO72YKi7GZhWJCqLe98XpdlPRr7QAX+bjawTKb7GlsPg= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2016 12:28:27.4484 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR02MB2871 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 11024 Lines: 341 On 14.11.2016 13:13, Zubair Lutfullah Kakakhel wrote: > The Xilinx interrupt controller driver is now available in drivers/irqchip. > Switch to using that driver. > > Signed-off-by: Zubair Lutfullah Kakakhel > Acked-by: Michael Ellerman (powerpc) > > --- > V6 - V7 > Rebase to v4.9-rc5 > > V5 -> V6 Added Acked-by Micheal Ellerman > > V5 New patch > > Tested on virtex440-ml507 using qemu > --- > arch/powerpc/include/asm/xilinx_intc.h | 2 +- > arch/powerpc/platforms/40x/Kconfig | 1 + > arch/powerpc/platforms/40x/virtex.c | 2 +- > arch/powerpc/platforms/44x/Kconfig | 1 + > arch/powerpc/platforms/44x/virtex.c | 2 +- > arch/powerpc/sysdev/xilinx_intc.c | 211 +-------------------------------- > drivers/irqchip/irq-xilinx-intc.c | 3 +- > 7 files changed, 9 insertions(+), 213 deletions(-) > > diff --git a/arch/powerpc/include/asm/xilinx_intc.h b/arch/powerpc/include/asm/xilinx_intc.h > index 343612f..3192d7f 100644 > --- a/arch/powerpc/include/asm/xilinx_intc.h > +++ b/arch/powerpc/include/asm/xilinx_intc.h > @@ -14,7 +14,7 @@ > #ifdef __KERNEL__ > > extern void __init xilinx_intc_init_tree(void); > -extern unsigned int xilinx_intc_get_irq(void); > +extern unsigned int xintc_get_irq(void); > > #endif /* __KERNEL__ */ > #endif /* _ASM_POWERPC_XILINX_INTC_H */ > diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig > index e3257f2..1d7c1b1 100644 > --- a/arch/powerpc/platforms/40x/Kconfig > +++ b/arch/powerpc/platforms/40x/Kconfig > @@ -64,6 +64,7 @@ config XILINX_VIRTEX_GENERIC_BOARD > default n > select XILINX_VIRTEX_II_PRO > select XILINX_VIRTEX_4_FX > + select XILINX_INTC > help > This option enables generic support for Xilinx Virtex based boards. > > diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c > index 91a08ea..e3d5e09 100644 > --- a/arch/powerpc/platforms/40x/virtex.c > +++ b/arch/powerpc/platforms/40x/virtex.c > @@ -48,7 +48,7 @@ define_machine(virtex) { > .probe = virtex_probe, > .setup_arch = xilinx_pci_init, > .init_IRQ = xilinx_intc_init_tree, > - .get_irq = xilinx_intc_get_irq, > + .get_irq = xintc_get_irq, > .restart = ppc4xx_reset_system, > .calibrate_decr = generic_calibrate_decr, > }; > diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig > index 48fc180..25b8d64 100644 > --- a/arch/powerpc/platforms/44x/Kconfig > +++ b/arch/powerpc/platforms/44x/Kconfig > @@ -241,6 +241,7 @@ config XILINX_VIRTEX440_GENERIC_BOARD > depends on 44x > default n > select XILINX_VIRTEX_5_FXT > + select XILINX_INTC > help > This option enables generic support for Xilinx Virtex based boards > that use a 440 based processor in the Virtex 5 FXT FPGA architecture. > diff --git a/arch/powerpc/platforms/44x/virtex.c b/arch/powerpc/platforms/44x/virtex.c > index a7e0802..3eb13ed 100644 > --- a/arch/powerpc/platforms/44x/virtex.c > +++ b/arch/powerpc/platforms/44x/virtex.c > @@ -54,7 +54,7 @@ define_machine(virtex) { > .probe = virtex_probe, > .setup_arch = xilinx_pci_init, > .init_IRQ = xilinx_intc_init_tree, > - .get_irq = xilinx_intc_get_irq, > + .get_irq = xintc_get_irq, > .calibrate_decr = generic_calibrate_decr, > .restart = ppc4xx_reset_system, > }; > diff --git a/arch/powerpc/sysdev/xilinx_intc.c b/arch/powerpc/sysdev/xilinx_intc.c > index 0f52d79..4a86dcf 100644 > --- a/arch/powerpc/sysdev/xilinx_intc.c > +++ b/arch/powerpc/sysdev/xilinx_intc.c > @@ -29,194 +29,7 @@ > #include > #include > #include > - > -/* > - * INTC Registers > - */ > -#define XINTC_ISR 0 /* Interrupt Status */ > -#define XINTC_IPR 4 /* Interrupt Pending */ > -#define XINTC_IER 8 /* Interrupt Enable */ > -#define XINTC_IAR 12 /* Interrupt Acknowledge */ > -#define XINTC_SIE 16 /* Set Interrupt Enable bits */ > -#define XINTC_CIE 20 /* Clear Interrupt Enable bits */ > -#define XINTC_IVR 24 /* Interrupt Vector */ > -#define XINTC_MER 28 /* Master Enable */ > - > -static struct irq_domain *master_irqhost; > - > -#define XILINX_INTC_MAXIRQS (32) > - > -/* The following table allows the interrupt type, edge or level, > - * to be cached after being read from the device tree until the interrupt > - * is mapped > - */ > -static int xilinx_intc_typetable[XILINX_INTC_MAXIRQS]; > - > -/* Map the interrupt type from the device tree to the interrupt types > - * used by the interrupt subsystem > - */ > -static unsigned char xilinx_intc_map_senses[] = { > - IRQ_TYPE_EDGE_RISING, > - IRQ_TYPE_EDGE_FALLING, > - IRQ_TYPE_LEVEL_HIGH, > - IRQ_TYPE_LEVEL_LOW, > -}; > - > -/* > - * The interrupt controller is setup such that it doesn't work well with > - * the level interrupt handler in the kernel because the handler acks the > - * interrupt before calling the application interrupt handler. To deal with > - * that, we use 2 different irq chips so that different functions can be > - * used for level and edge type interrupts. > - * > - * IRQ Chip common (across level and edge) operations > - */ > -static void xilinx_intc_mask(struct irq_data *d) > -{ > - int irq = irqd_to_hwirq(d); > - void * regs = irq_data_get_irq_chip_data(d); > - pr_debug("mask: %d\n", irq); > - out_be32(regs + XINTC_CIE, 1 << irq); > -} > - > -static int xilinx_intc_set_type(struct irq_data *d, unsigned int flow_type) > -{ > - return 0; > -} > - > -/* > - * IRQ Chip level operations > - */ > -static void xilinx_intc_level_unmask(struct irq_data *d) > -{ > - int irq = irqd_to_hwirq(d); > - void * regs = irq_data_get_irq_chip_data(d); > - pr_debug("unmask: %d\n", irq); > - out_be32(regs + XINTC_SIE, 1 << irq); > - > - /* ack level irqs because they can't be acked during > - * ack function since the handle_level_irq function > - * acks the irq before calling the inerrupt handler > - */ > - out_be32(regs + XINTC_IAR, 1 << irq); > -} > - > -static struct irq_chip xilinx_intc_level_irqchip = { > - .name = "Xilinx Level INTC", > - .irq_mask = xilinx_intc_mask, > - .irq_mask_ack = xilinx_intc_mask, > - .irq_unmask = xilinx_intc_level_unmask, > - .irq_set_type = xilinx_intc_set_type, > -}; > - > -/* > - * IRQ Chip edge operations > - */ > -static void xilinx_intc_edge_unmask(struct irq_data *d) > -{ > - int irq = irqd_to_hwirq(d); > - void *regs = irq_data_get_irq_chip_data(d); > - pr_debug("unmask: %d\n", irq); > - out_be32(regs + XINTC_SIE, 1 << irq); > -} > - > -static void xilinx_intc_edge_ack(struct irq_data *d) > -{ > - int irq = irqd_to_hwirq(d); > - void * regs = irq_data_get_irq_chip_data(d); > - pr_debug("ack: %d\n", irq); > - out_be32(regs + XINTC_IAR, 1 << irq); > -} > - > -static struct irq_chip xilinx_intc_edge_irqchip = { > - .name = "Xilinx Edge INTC", > - .irq_mask = xilinx_intc_mask, > - .irq_unmask = xilinx_intc_edge_unmask, > - .irq_ack = xilinx_intc_edge_ack, > - .irq_set_type = xilinx_intc_set_type, > -}; > - > -/* > - * IRQ Host operations > - */ > - > -/** > - * xilinx_intc_xlate - translate virq# from device tree interrupts property > - */ > -static int xilinx_intc_xlate(struct irq_domain *h, struct device_node *ct, > - const u32 *intspec, unsigned int intsize, > - irq_hw_number_t *out_hwirq, > - unsigned int *out_flags) > -{ > - if ((intsize < 2) || (intspec[0] >= XILINX_INTC_MAXIRQS)) > - return -EINVAL; > - > - /* keep a copy of the interrupt type til the interrupt is mapped > - */ > - xilinx_intc_typetable[intspec[0]] = xilinx_intc_map_senses[intspec[1]]; > - > - /* Xilinx uses 2 interrupt entries, the 1st being the h/w > - * interrupt number, the 2nd being the interrupt type, edge or level > - */ > - *out_hwirq = intspec[0]; > - *out_flags = xilinx_intc_map_senses[intspec[1]]; > - > - return 0; > -} > -static int xilinx_intc_map(struct irq_domain *h, unsigned int virq, > - irq_hw_number_t irq) > -{ > - irq_set_chip_data(virq, h->host_data); > - > - if (xilinx_intc_typetable[irq] == IRQ_TYPE_LEVEL_HIGH || > - xilinx_intc_typetable[irq] == IRQ_TYPE_LEVEL_LOW) { > - irq_set_chip_and_handler(virq, &xilinx_intc_level_irqchip, > - handle_level_irq); > - } else { > - irq_set_chip_and_handler(virq, &xilinx_intc_edge_irqchip, > - handle_edge_irq); > - } > - return 0; > -} > - > -static const struct irq_domain_ops xilinx_intc_ops = { > - .map = xilinx_intc_map, > - .xlate = xilinx_intc_xlate, > -}; > - > -struct irq_domain * __init > -xilinx_intc_init(struct device_node *np) > -{ > - struct irq_domain * irq; > - void * regs; > - > - /* Find and map the intc registers */ > - regs = of_iomap(np, 0); > - if (!regs) { > - pr_err("xilinx_intc: could not map registers\n"); > - return NULL; > - } > - > - /* Setup interrupt controller */ > - out_be32(regs + XINTC_IER, 0); /* disable all irqs */ > - out_be32(regs + XINTC_IAR, ~(u32) 0); /* Acknowledge pending irqs */ > - out_be32(regs + XINTC_MER, 0x3UL); /* Turn on the Master Enable. */ > - > - /* Allocate and initialize an irq_domain structure. */ > - irq = irq_domain_add_linear(np, XILINX_INTC_MAXIRQS, &xilinx_intc_ops, > - regs); > - if (!irq) > - panic(__FILE__ ": Cannot allocate IRQ host\n"); > - > - return irq; > -} > - > -int xilinx_intc_get_irq(void) > -{ > - void * regs = master_irqhost->host_data; > - pr_debug("get_irq:\n"); > - return irq_linear_revmap(master_irqhost, in_be32(regs + XINTC_IVR)); > -} > +#include > > #if defined(CONFIG_PPC_I8259) > /* > @@ -265,31 +78,11 @@ static void __init xilinx_i8259_setup_cascade(void) > static inline void xilinx_i8259_setup_cascade(void) { return; } > #endif /* defined(CONFIG_PPC_I8259) */ > > -static const struct of_device_id xilinx_intc_match[] __initconst = { > - { .compatible = "xlnx,opb-intc-1.00.c", }, > - { .compatible = "xlnx,xps-intc-1.00.a", }, > - {} > -}; > - > /* > * Initialize master Xilinx interrupt controller > */ > void __init xilinx_intc_init_tree(void) > { > - struct device_node *np; > - > - /* find top level interrupt controller */ > - for_each_matching_node(np, xilinx_intc_match) { > - if (!of_get_property(np, "interrupts", NULL)) > - break; > - } > - BUG_ON(!np); > - > - master_irqhost = xilinx_intc_init(np); > - BUG_ON(!master_irqhost); > - > - irq_set_default_host(master_irqhost); > - of_node_put(np); > - > + irqchip_init(); > xilinx_i8259_setup_cascade(); > } > diff --git a/drivers/irqchip/irq-xilinx-intc.c b/drivers/irqchip/irq-xilinx-intc.c > index d330917..3db7ab1 100644 > --- a/drivers/irqchip/irq-xilinx-intc.c > +++ b/drivers/irqchip/irq-xilinx-intc.c > @@ -237,4 +237,5 @@ static int __init xilinx_intc_of_init(struct device_node *intc, > > } > > -IRQCHIP_DECLARE(xilinx_intc, "xlnx,xps-intc-1.00.a", xilinx_intc_of_init); > +IRQCHIP_DECLARE(xilinx_intc_xps, "xlnx,xps-intc-1.00.a", xilinx_intc_of_init); > +IRQCHIP_DECLARE(xilinx_intc_opb, "xlnx,opb-intc-1.00.c", xilinx_intc_of_init); > Looks reasonable. Acked-by: Michal Simek Thanks, Michal