From patchwork Sat Nov 7 10:52:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noam Camus X-Patchwork-Id: 541249 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1A7281409A0 for ; Sat, 7 Nov 2015 21:55:56 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zv1A2-0005kN-ED; Sat, 07 Nov 2015 10:55:54 +0000 Received: from mail-db3on0070.outbound.protection.outlook.com ([157.55.234.70] helo=emea01-db3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zv19z-0005h8-0i for linux-snps-arc@lists.infradead.org; Sat, 07 Nov 2015 10:55:52 +0000 Received: from AM3PR02CA0023.eurprd02.prod.outlook.com (10.242.240.23) by AM3PR02MB1027.eurprd02.prod.outlook.com (10.163.182.153) with Microsoft SMTP Server (TLS) id 15.1.318.15; Sat, 7 Nov 2015 10:55:28 +0000 Received: from AM1FFO11FD026.protection.gbl (2a01:111:f400:7e00::197) by AM3PR02CA0023.outlook.office365.com (2a01:111:e400:8800::23) with Microsoft SMTP Server (TLS) id 15.1.318.15 via Frontend Transport; Sat, 7 Nov 2015 10:55:28 +0000 Authentication-Results: spf=fail (sender IP is 212.179.42.66) smtp.mailfrom=ezchip.com; lakedaemon.net; dkim=none (message not signed) header.d=none; lakedaemon.net; dmarc=none action=none header.from=ezchip.com; Received-SPF: Fail (protection.outlook.com: domain of ezchip.com does not designate 212.179.42.66 as permitted sender) receiver=protection.outlook.com; client-ip=212.179.42.66; helo=ezex10.ezchip.com; Received: from ezex10.ezchip.com (212.179.42.66) by AM1FFO11FD026.mail.protection.outlook.com (10.174.64.215) with Microsoft SMTP Server (TLS) id 15.1.325.5 via Frontend Transport; Sat, 7 Nov 2015 10:55:27 +0000 Received: from localhost.localdomain (10.1.3.132) by ezex10.ezchip.com (10.1.1.4) with Microsoft SMTP Server (TLS) id 14.3.224.2; Sat, 7 Nov 2015 12:55:03 +0200 From: Noam Camus To: Subject: [PATCH v2 04/19] irqchip: add nps Internal and external irqchips Date: Sat, 7 Nov 2015 12:52:22 +0200 Message-ID: <1446893557-29748-5-git-send-email-noamc@ezchip.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1446297327-16298-1-git-send-email-noamc@ezchip.com> References: <1446297327-16298-1-git-send-email-noamc@ezchip.com> MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-11.0.0.1191-8.000.1202-21926.006 X-TM-AS-Result: No--18.145100-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD026; 1:UtuId74e6LDX1CRWqWclJY+PuybZonsjoFO2jNf6aNPU9dzx1rSD+xvQ4VDwTG0V3XM5Vu5HeBM8fQHx4yOw70yAb5CfIcmsPHBI7L8oahIlk3JWtIKaPFGid0P4drC59Ohm3AVX4aP94edbz+ilAOfAVZNckkGxbfSjkEL7fPPuL9I2npRCAliJTPFVzDtZHt4XRK+eTMHlPobTj+Z1C0N89Hn4ZVbuj/mTSC3FgggnVSwty/hDlZmqQ1WT2Cqy8QeL49tBf1Z958atFWKqKfE7fUHsil5D+G6c3Ggia6RQMEg0a749QXDByNFhScQeFyUwz2iEHURTpYvqehT8Vffwbk0l9pujHTLv4lTB29H0vt6rTw0LnQVucrHmbBGz5wD5a1HxDQs8P0RjbJtl0A== X-Forefront-Antispam-Report: CIP:212.179.42.66; CTRY:IL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(50466002)(105606002)(92566002)(76176999)(48376002)(87936001)(5008740100001)(229853001)(110136002)(189998001)(33646002)(85426001)(106466001)(2351001)(5007970100001)(47776003)(50986999)(50226001)(11100500001)(5003940100001)(49486002)(5001970100001)(86362001)(6806005)(19580405001)(104016004)(36756003)(2950100001)(19580395003)(5001920100001)(77096005)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM3PR02MB1027; H:ezex10.ezchip.com; FPR:; SPF:Fail; PTR:ezmail.ezchip.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM3PR02MB1027; 2:/AJQZNPKkPPHGunn96FdzQ1Ro4kJx6cDDyceniwWIaDWipJbrE+UaOsMD4R5OWzMm7SUYuBcT8kay8P0wupDX+EbfCmrfgl657dCNGYUMv3No0XP+YgO8wo+CzAWyGpBIgcasCO8PO+4zQtYxfHHycGfTB9aQx7VJPt+rvrBLqk=; 3:Jt6rAt8kpfZl5em63GSdsR0lbd5+8UdKjshh/kAlif6EEbUUrM6fBZPMUhbQ3O8UtpyynvKog/MXusY0CIvcAhVagXgwkMtRz51FDQCNUORFGXtm0ylZhvgRe2VhE4HANe5FnwU8LWR9exicI/QZJEg0DExn9+u/eYidB2ODHDjk0GvVnA4DPB9+n8NrViiflbRTzY5I9ING7ffmPQdej7NeLam7/mFsY4tAUpiadjo=; 25:kf7weVoj3Klwi4wdoZmQzPA/8x79+T2QHXLr0wPi8sdQ1ekrsWu81P01F6Th5rKRfWzBA4wKgSjnohdw54Afgi3ixYZWxC5u86OIyH8KDT2F0vaLaymX9RZQ1ETX2IcYkCi9JpbxZbjScIn+NddLvEWlqU88S4alOkT2DmQyZw1/MR/Rbo4OlY7+x4y0HjopfvLRwhQVhuW7ZSvZBMQaxTzmsVDkg6oEIjLlm1OJq/L/+s9ny2byihng1EYlReViFCXSoJdTh7EcktSfhbrF4A==; 20:IfwqjI4oDrmiodPkZzuqVqYjH29GkAeXHVWcRe+phwN7BXPYYOisb5i+A7nDtfchRp4lE2TBTJ1dQH8tQBCyimmHrlX9Gk8onNcAGBK4dl0q/7rNfPknQOJb7n6OOGVxM4pLRWKzvQyf0QUQxveZ5TZdgEqVI5S/PD+HQ8MHn6Q= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM3PR02MB1027; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(121898900299872); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(10201501046)(3002001); SRVR:AM3PR02MB1027; BCL:0; PCL:0; RULEID:; SRVR:AM3PR02MB1027; X-Microsoft-Exchange-Diagnostics: 1; AM3PR02MB1027; 4:qfj/XQ1dwL7A5hJmJBn3ifHV5N3j8tbCN7F3b8Qm1EtfmXXhmds3/DMwUA1XjR/t0LwsTzipog4d5lkNrUffpdMZU5qMhpxTspIGnczCNOqyzizWotrdsaUntES2dGjPdlkLpPIfICNQz75fw2LD7baCMqkuqNrqJxPWsV4NU9uXLIZpM5z7eWQchqfPEbW6vrIzYLBDNCuUPzqhrH3axx3ztKXHE6ZEfLHSz4c3EThYMv+ekyfTrRB3MdyveujWEe/QUXpN4pn2SGOgBTpGZx97cA5HW8kZ3gkffKh0MJZogBMMp/O+7pwEC0bvQLbQmNdc/7m7mMmMyuW7iNFiccloHE934+rMnx/GT/KKOQgzLjVn+dNNHO6XSuZXJVfi X-Forefront-PRVS: 0753EA505A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM3PR02MB1027; 23:elhl+pk6Jc3ysCYFe7W8a/7pBhqoO+Q7KUW8kKI90?= =?us-ascii?Q?d1YLocDgtqgR6bXFO0BYZPn5uxtwfeBl1LuxXMp9YDbpQY0ViKF2V180+5l2?= =?us-ascii?Q?wGFgeQvQM+Peuk3cmEOyrwssrD3pp/+9W7bu8l8UkYljDGiErq4ImxVQxrRO?= =?us-ascii?Q?c74lzMuPw1YagYSiNI8DPBvsL5+5rK5g6qAPX6oU1sBHBOEX4Kp6dy7RTMpx?= =?us-ascii?Q?8mjsI2JpydC8XQYJ2hzF9WQYXmKlTbEsxlHzWb8MxbUjUnjuyiVneO/4VJke?= =?us-ascii?Q?XoyoS3oKQzZFz4PPU8DE+ahxoHIbs81mVzM5ZYL0w0dhjgmL0VawMyuaGFMw?= =?us-ascii?Q?pebVNwCrow5Ap9g3RUp2SukMNS1jwYSxcybmZsBVAwVkirC/JkXLtSvieafc?= =?us-ascii?Q?7TI80A2hT5IMc9bQSy6vkJqLgk5BCeStTQJ4rDfelfyshrihLlRZ25y3Pybd?= =?us-ascii?Q?4dH8+P0IOqTl1h085hcT3lZzm+qPq7nCMpZ4lZlHv09fDOmDDGp7StMecrgd?= =?us-ascii?Q?/zD9BmnN+pMQHtuCIX9B0kW4B28fUUSXj8HTzoVXgmYNp7AnXmA82vJtp0Pm?= =?us-ascii?Q?lrvEs7Cg6c3zXCtqIJru+7A4YrWvk43ZQwrKeinQ9M6AGyFQ7nRzQ9JsRZ5R?= =?us-ascii?Q?DLkxidI3/vMc9f84id/cIU360e+vsFyJbNNgK51ztZ5EZ/U8dWHDPGrek31T?= =?us-ascii?Q?zJGTACqoaCYgKQMxUmmhtm3wJH6W0sbQGBLm2hgwiaH6pJizINhUjogCgQKW?= =?us-ascii?Q?KLBvtpmCmJzSL16f4sVDP5KgMk93qIMYBnWMA0bx8IPY5xN8lHdbuOmAxG2s?= =?us-ascii?Q?LWWv325J855bdiEb3hRTAgea+wLPVSTVo3HobThvrFrT8pF3Gfte2yCucrrG?= =?us-ascii?Q?GHk5EF5LVtihUoaSexOI4YxcdnBC1hfIVbOWFTZhkgbn4nyiQW5aPT3QsmeZ?= =?us-ascii?Q?S//oUEKyYrFOoJB9xWCZjBMuMBavhJzxYy+zvCv7ikn3isGtGJ6xpZSF55AS?= =?us-ascii?Q?Z+0f9VlE2ybvqTLg/0OC+bKMYh8Sr2HlWN/RGGdwjNtasnXRjI5thiO/C2sF?= =?us-ascii?Q?jUizFo=3D?= X-Microsoft-Exchange-Diagnostics: 1; AM3PR02MB1027; 5:12D1YK5XR9hTx9XH3VfguRabe2961EDJyJYEFrPuAatr5NIcx+7c7AyRsTMf1aESLNvw/jYYE9fsyuAjb05S/BcitTQRNUgeCErL1NOlmu7QW68XFtsK+qhD0nNBsb94rsfh/Rt0YRAGNBiR48jSXg==; 24:+1j0yrUbpTUhyL+ML45Cac05lfm07I3vhlzGmnV99AjXQ8Bbu5tQT0FvHm9deIBnwvwzMHcoTyLTGpbDw+2aQfL8wWddC6JHRKtFQFubaws=; 20:Wnq14OD+Zl9darV0NtGuyPaR/m85159nq5O3ZZMC4L2MFyDpM6Wg9KHSMPrUIEwQlVteUrdZu+LjvD4CASEWqA== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2015 10:55:27.1080 (UTC) X-MS-Exchange-CrossTenant-Id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3; Ip=[212.179.42.66]; Helo=[ezex10.ezchip.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR02MB1027 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151107_025551_564959_13D08F45 X-CRM114-Status: GOOD ( 17.79 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [157.55.234.70 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [157.55.234.70 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gilf@ezchip.com, Jason Cooper , Marc Zyngier , talz@ezchip.com, linux-kernel@vger.kernel.org, cmetcalf@ezchip.com, Noam Camus , Thomas Gleixner Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Noam Camus Adding EZchip NPS400 support. NPS internal interrupts are internally handled at Multi Thread Manager (MTM) that is signaled for deactivating an interrupt. External interrupts is handled also at Global Interrupt Controller (GIC) e.g. serial and network devices. Signed-off-by: Noam Camus Cc: Thomas Gleixner Cc: Jason Cooper Cc: Marc Zyngier --- .../interrupt-controller/ezchip,nps400-ic.txt | 17 ++ drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-eznps.c | 222 ++++++++++++++++++++ 3 files changed, 240 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/ezchip,nps400-ic.txt create mode 100644 drivers/irqchip/irq-eznps.c diff --git a/Documentation/devicetree/bindings/interrupt-controller/ezchip,nps400-ic.txt b/Documentation/devicetree/bindings/interrupt-controller/ezchip,nps400-ic.txt new file mode 100644 index 0000000..888b2b9 --- /dev/null +++ b/Documentation/devicetree/bindings/interrupt-controller/ezchip,nps400-ic.txt @@ -0,0 +1,17 @@ +EZchip NPS Interrupt Controller + +Required properties: + +- compatible : should be "ezchip,nps400-ic" +- interrupt-controller : Identifies the node as an interrupt controller +- #interrupt-cells : Specifies the number of cells needed to encode an + interrupt source. The value shall be 1. + + +Example: + +intc: interrupt-controller { + compatible = "ezchip,nps400-ic"; + interrupt-controller; + #interrupt-cells = <1>; +}; diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile index bb3048f..decfc87 100644 --- a/drivers/irqchip/Makefile +++ b/drivers/irqchip/Makefile @@ -55,3 +55,4 @@ obj-$(CONFIG_RENESAS_H8S_INTC) += irq-renesas-h8s.o obj-$(CONFIG_ARCH_SA1100) += irq-sa11x0.o obj-$(CONFIG_INGENIC_IRQ) += irq-ingenic.o obj-$(CONFIG_IMX_GPCV2) += irq-imx-gpcv2.o +obj-$(CONFIG_ARC_PLAT_EZNPS) += irq-eznps.o diff --git a/drivers/irqchip/irq-eznps.c b/drivers/irqchip/irq-eznps.c new file mode 100644 index 0000000..78f3667 --- /dev/null +++ b/drivers/irqchip/irq-eznps.c @@ -0,0 +1,222 @@ +/* + * Copyright(c) 2015 EZchip Technologies. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * The full GNU General Public License is included in this distribution in + * the file called "COPYING". + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define NPS_MSU_EN_CFG 0x80 + +/* Messaging and Scheduling Unit: + * Provides message management for a CPU cluster. + */ +static void __init eznps_configure_msu(void) +{ + int cpu; + struct nps_host_reg_msu_en_cfg { + union { + struct { + u32 __reserved1:11, + rtc_en:1, ipc_en:1, gim_1_en:1, + gim_0_en:1, ipi_en:1, buff_e_rls_bmuw:1, + buff_e_alc_bmuw:1, buff_i_rls_bmuw:1, + buff_i_alc_bmuw:1, buff_e_rls_bmue:1, + buff_e_alc_bmue:1, buff_i_rls_bmue:1, + buff_i_alc_bmue:1, __reserved2:1, + buff_e_pre_en:1, buff_i_pre_en:1, + pmuw_ja_en:1, pmue_ja_en:1, + pmuw_nj_en:1, pmue_nj_en:1, msu_en:1; + }; + u32 value; + }; + }; + struct nps_host_reg_msu_en_cfg msu_en_cfg = {.value = 0}; + + msu_en_cfg.msu_en = 1; + msu_en_cfg.ipi_en = 1; + msu_en_cfg.gim_0_en = 1; + msu_en_cfg.gim_1_en = 1; + + /* Enable IPI and GIM messages on all clusters */ + for (cpu = 0 ; cpu < eznps_max_cpus; cpu += eznps_cpus_per_cluster) + iowrite32be(msu_en_cfg.value, + nps_host_reg(cpu, NPS_MSU_BLKID, NPS_MSU_EN_CFG)); +} + +/* Global Interrupt Manager: + * Configures and manages up to 64 interrupts from peripherals, + * 16 interrupts from CPUs (virtual interrupts) and ECC interrupts. + * Receives the interrupts and transmits them to relevant CPU. + */ +static void __init eznps_configure_gim(void) +{ + u32 reg_value; + u32 gim_int_lines; + struct nps_host_reg_gim_p_int_dst gim_p_int_dst = {.value = 0}; + + gim_int_lines = NPS_GIM_UART_LINE; + gim_int_lines |= NPS_GIM_DBG_LAN_TX_DONE_LINE; + gim_int_lines |= NPS_GIM_DBG_LAN_RX_RDY_LINE; + + /* + * IRQ polarity + * low or high level + * negative or positive edge + */ + reg_value = ioread32be(REG_GIM_P_INT_POL_0); + reg_value &= ~gim_int_lines; + iowrite32be(reg_value, REG_GIM_P_INT_POL_0); + + /* IRQ type level or edge */ + reg_value = ioread32be(REG_GIM_P_INT_SENS_0); + reg_value |= NPS_GIM_DBG_LAN_TX_DONE_LINE; + iowrite32be(reg_value, REG_GIM_P_INT_SENS_0); + + /* + * GIM interrupt select type for + * dbg_lan TX and RX interrupts + * should be type 1 + * type 0 = IRQ line 6 + * type 1 = IRQ line 7 + */ + gim_p_int_dst.is = 1; + iowrite32be(gim_p_int_dst.value, REG_GIM_P_INT_DST_10); + iowrite32be(gim_p_int_dst.value, REG_GIM_P_INT_DST_11); + + /* + * CTOP IRQ lines should be defined + * as blocking in GIM + */ + iowrite32be(gim_int_lines, REG_GIM_P_INT_BLK_0); + + /* Enable CTOP IRQ lines in GIM */ + iowrite32be(gim_int_lines, REG_GIM_P_INT_EN_0); +} + +/* + * NPS400 core includes a Interrupt Controller (IC) support. + * All cores can deactivate level irqs at first level control + * at cores mesh layer called MTM. + * For devices out side chip e.g. uart, network there is another + * level called Global Interrupt Manager (GIM). + * This second level can control level and edge interrupt. + */ + +static void nps400_irq_mask(struct irq_data *data) +{ + unsigned int ienb; + + ienb = read_aux_reg(AUX_IENABLE); + ienb &= ~(1 << data->irq); + write_aux_reg(AUX_IENABLE, ienb); +} + +static void nps400_irq_unmask(struct irq_data *data) +{ + unsigned int ienb; + + ienb = read_aux_reg(AUX_IENABLE); + ienb |= (1 << data->irq); + write_aux_reg(AUX_IENABLE, ienb); +} + +static void nps400_irq_eoi_global(struct irq_data *data) +{ + write_aux_reg(CTOP_AUX_IACK, 1 << data->irq); + + /* Don't ack before all device access is done */ + mb(); + + __asm__ __volatile__ ( + " .word %0\n" + : + : "i"(CTOP_INST_RSPI_GIC_0_R12) + : "memory"); +} + +static void nps400_irq_eoi(struct irq_data *data) +{ + write_aux_reg(CTOP_AUX_IACK, 1 << data->irq); +} + + +static struct irq_chip nps400_irq_chip_fasteoi = { + .name = "NPS400 IC Global", + .irq_mask = nps400_irq_mask, + .irq_unmask = nps400_irq_unmask, + .irq_eoi = nps400_irq_eoi_global, +}; + +static struct irq_chip nps400_irq_chip_percpu = { + .name = "NPS400 IC", + .irq_mask = nps400_irq_mask, + .irq_unmask = nps400_irq_unmask, + .irq_eoi = nps400_irq_eoi, +}; + +static int nps400_irq_map(struct irq_domain *d, unsigned int irq, + irq_hw_number_t hw) +{ + switch (irq) { + case TIMER0_IRQ: +#if defined(CONFIG_SMP) + case IPI_IRQ: +#endif + irq_set_chip_and_handler(irq, &nps400_irq_chip_percpu, + handle_percpu_irq); + break; + default: + irq_set_chip_and_handler(irq, &nps400_irq_chip_fasteoi, + handle_fasteoi_irq); + break; + } + + return 0; +} + +static const struct irq_domain_ops nps400_irq_ops = { + .xlate = irq_domain_xlate_onecell, + .map = nps400_irq_map, +}; + +static struct irq_domain *nps400_root_domain; + +static int __init nps400_of_init(struct device_node *node, + struct device_node *parent) +{ + if (parent) + panic("DeviceTree incore ic not a root irq controller\n"); + + eznps_configure_msu(); + eznps_configure_gim(); + + nps400_root_domain = irq_domain_add_legacy(node, NR_CPU_IRQS, 0, 0, + &nps400_irq_ops, NULL); + + if (!nps400_root_domain) + panic("nps400 root irq domain not avail\n"); + + /* with this we don't need to export nps400_root_domain */ + irq_set_default_host(nps400_root_domain); + + return 0; +} +IRQCHIP_DECLARE(ezchip_nps400_ic, "ezchip,nps400-ic", nps400_of_init);