Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751978AbdHGDYN (ORCPT ); Sun, 6 Aug 2017 23:24:13 -0400 Received: from mail-bl2nam02on0088.outbound.protection.outlook.com ([104.47.38.88]:17372 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751868AbdHGDYL (ORCPT ); Sun, 6 Aug 2017 23:24:11 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; From: Zhao Qiang To: CC: , , , , Zhao Qiang Subject: [PATCH v10 1/4] irqchip/qeic: move qeic driver from drivers/soc/fsl/qe Date: Mon, 7 Aug 2017 11:07:13 +0800 Message-ID: <1502075236-24078-2-git-send-email-qiang.zhao@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1502075236-24078-1-git-send-email-qiang.zhao@nxp.com> References: <1502075236-24078-1-git-send-email-qiang.zhao@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131465498463583285;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(336005)(39860400002)(39450400003)(39840400002)(39380400002)(39850400002)(39400400002)(39410400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(97736004)(48376002)(626005)(8676002)(189998001)(50226002)(81166006)(81156014)(8936002)(5003940100001)(47776003)(86362001)(575784001)(104016004)(2906002)(68736007)(2950100002)(76176999)(50986999)(53936002)(6666003)(54906002)(356003)(106466001)(77096006)(2351001)(6916009)(110136004)(38730400002)(33646002)(36756003)(50466002)(8656003)(5660300001)(4326008)(305945005)(85426001)(105606002)(498600001)(2004002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0301MB0906;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2FFO11FD012;1:7kHzIrWN8vAbTar6U+xb17rTWZNTpBs8ukp+lqR9Z9?= =?us-ascii?Q?mB1oSc6CfXPcce+c5Zoc2GwGp1H51JOEi93rKSD/nXqdwl5hzM2Ka/Al9HfL?= =?us-ascii?Q?V5fwESIFDziTNoQWTNox+Q19vdsHZFWgq4RSCf69LezRSBFxjgUuzDi2zaWh?= =?us-ascii?Q?s0KIdw2YoROM35iMRPKU217QPt3tKrEgLnjPdmQ0SGNcK7HY5t9OI3+7+qIQ?= =?us-ascii?Q?fwo0a44zzaDkoOmUOamB48mIK6Hs8e7B+P1G8nvxHyFXN7P6mdVq+zT1A8St?= =?us-ascii?Q?j/2k1/r2EJh4yut+E4u+qoIP0eMwvGyynu67ZCZWMl/H6hFecLKNbBf4iswe?= =?us-ascii?Q?SdKRGoziEk/WmsbSWJqHIGj/XcNR4BnlOJiw9PvQwBi52usX7A1l7EVk0GHz?= =?us-ascii?Q?/UmXUhyIrjTdR6psaljWLZ3PGee2o96lLkHoNOUi1SZG585ABni3jJCcqsGI?= =?us-ascii?Q?Gi/GZtTCDbRMog9jjra+Pvd38S2Eqsl84ufTbbYC9bsOu2GuIYjJdGBOUO+S?= =?us-ascii?Q?pOzY6U36qzkIboxbfKvrDOTDpboabi+ONvckh+UKYqRZbF7EQCcJinPGZQdD?= =?us-ascii?Q?bkqhFY9A1qxCrf5N2eI9KejnDelgZ0HEykeY3UvFku9j1mJHkZNH8ucRGCZ8?= =?us-ascii?Q?jNbSKNRzHLYCOIFA/w31bya4vsV4T7ppmZVFeVC/U2RQzrMrNNC6j45j4o26?= =?us-ascii?Q?nFvCHYvBgr9rNjm7ZGny/PDlZ6untSiCaP7wHpqYseOTlmalnplvNY1KL9Sj?= =?us-ascii?Q?Qiimy4hX4lA+/KhfQOqwqK1vidIY9lhKTmap/Cmu2TbSf9+KRyN6d52T5C/L?= =?us-ascii?Q?zEq0T8KyEZd5soEF+4GvLj8lRwt7nmbwPdm5rV1QMjMrpZmQX8vSOhe8hGdO?= =?us-ascii?Q?vz1r2g4y1l4uMUmLklufEyO7v+vxwpTo1QfYbsXJtuf5o5Ow4uFkvq4E7NqC?= =?us-ascii?Q?VVoFAGuzQtwL90e9KhN9akx1TD/5ZaY0fbZGPfBw=3D=3D?= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b5a61361-4ba2-4438-3c35-08d4dd43c29b X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603031)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY1PR0301MB0906; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0906;3:QDQzDFpodPrKnPmbnVUL84rAFYqPLclZe1BAMgZd6GBS+9aCdUyPz9NEJQcyq4cT8rlZeIDaIT7WsZ7iNaFhtuqU6dl1Bovx0F2T19WDqiLU0zKA2/gxCocjfrxUZwjqu5MVCKWvP6u4dZNHUqFfef3D9Dbd0JkDqQacziS0z1iWLWRnvyjX3j0S2Sbi8YiLdWAgXk+Kk/nPwME2zQ66oRFJyG7s+sf4g2R2yarxmGZ6vV2MgQRlmXzHOCdVSUFSK6WkTqpEwknYMKFqoIcBhJgcBUIAy+xqJLPUX+lokkx9CIZDbLqWP9ZZSJa6OdAeJA2JszPBzYgUZ9YmBXWklEXRGqP00tA7whGzx69kEe8=;25:W+ZeCkMGomdEBTLeZGSZFmqh6sbDORVjQFC3XFWyKwVwP/VaFzRs4+nYrH/7bKMfCabi38PHLHiXk8BLRahU9AwyZnzi9u6O11hvUjV7jbh6MdG0SgpWou5Nxs7XEhMtysS+CzJ7MepVQPozFHs8dkslDPG2jEuqWfNbIbIEEWitRLHfB+ZrBmflHzg1QeXy0qoFWpAN3v36CtKlwtO4eonOfE0Fj60U7YZ3OaDgjw1yAnIaF6Ic/XW1NOprMXjyofkeo1zcTFsYO6A2p+u09Hc0GrLOMWO42C/4kS7DAuW9sTBAjaAgElk4qVZ17VZ+iNAML92qvWZtV58FxR2oBg== X-MS-TrafficTypeDiagnostic: CY1PR0301MB0906: X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0906;31:RyuY3H4l4OtQP7AT48njcp374cl1DgIlvMBDM/HRaisrqIhyJ5Lcug8GH4AarXVxs4+r9x/hCLlx8CJRcQDV5RuFgdtI4yhbwHPgVRLg/LuD2owbO4lFKS6gMxa31s30xYb+Shmlj149JYJFbv2Nfy/LJ5lCsu9R5ezpc3hucyEiaTwJtce9gxK5f/hgQBzwHfhjDoWJp2MznNMBADIjSqMPu6PVn5n42XCXPvXKg1U=;4:mp4qXlYFTrukYvzP8zqdaDpADirDCPFZdN7wUT32LBbuMaXxqaTJe9fV4aZWOJxj3kaSmy4OrQVPJyZHKwU2Pn1LVRgAAdmKaVxohJWCF+dPn3+r5kKlmeBBbJSR+hVllc4mPOGlUjVKzrwYoGWHtoDVRgbCC7N/gpN8Lu4tYV3yjkVDwg0DF0UREGw6lT9Ues6zK8RQjXbLiWxw/Y32ao2/Zq3fhDm5OPV+P91/cNeU7Cn0/Iml5JbNbedw09xTsApUG59lAo2qiNn/5boF5b2pAW4jm3HlGDtD19w7EdyKqHFpbxrNhYUU+Sw6gevFJPOBuPW912kL7hj/CA2S1z5ySIjtN1FdqImGrn7cuX4= X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(185117386973197)(101931422205132); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(5005006)(13016025)(8121501046)(13018025)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6096035)(20161123563025)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123556025)(20161123561025)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR0301MB0906;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR0301MB0906; X-Forefront-PRVS: 0392679D18 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0301MB0906;23:tYimXSU6+xuG3MrH3/cagxEdElz097VLSf8+Peo?= =?us-ascii?Q?X8tbKzr9h0UsJvA8VVq9ux+vh3nloQK7uS27BpuAdqgzFG8/WUpQmICPHbr/?= =?us-ascii?Q?fm3dh8FulZTeiEy0Q5kO9Eo3/dtdk2+x+4Y2HFa+UNFawm8OrhKUIlRyvyER?= =?us-ascii?Q?iid88mmQlfmVnP0CRzcUjpaGW3m9zj33kp9YFJJHgILk4LTeeGNxRp0Krenc?= =?us-ascii?Q?7GWDwZj8HA9iuqta1IDshZ6ED2FICFRmiunOg41kSv8Z3XGvFi95lw0bZKxk?= =?us-ascii?Q?NORtl6mtAROU4phdxH1Lju7Lwxgsxol7z2TWC0mDoY1ky3VwomP233WErkGW?= =?us-ascii?Q?kJgndGJ6RsAsG2sVFsWdklZYsOWI++XppU4AMvWcLLxCpDw5Wy26PE8sABRv?= =?us-ascii?Q?7CzQcl6BwmY6k7ECbgrhJDgv+lXjR2pZB1j2k1HMgzscPwLRp2smLW63xCNd?= =?us-ascii?Q?rC2iitc9xkTLhfDZ3iXhpJLgkFq575XcDY7BFhr8A5VM5bj7mxW0oiI5AVGp?= =?us-ascii?Q?r6G46NbIfUn2Zu9ZLENSZ2D5TXD6UC1peTZbOzSyNLrLAIDr6y7vbBxgqNTB?= =?us-ascii?Q?9fRrapZqMzDAFlH3pE8jlCXPSFqpL493uny7si1/860bIhBcS26tXYRPo26Q?= =?us-ascii?Q?FTqhsTRzUqISVk+GT1LOcilw9JuXq0aKvSJiaVHA8kyJb4gjCkebL/FeYNlw?= =?us-ascii?Q?sGDqUBNB5l1MvjwZQJ+RpIYJbpYVWnN1riye9mpg/JYR/MVL3PllXp6mdRHS?= =?us-ascii?Q?QxYBvCTwdBt+19bpAQv6eujbuuBpmtnW2iVMhshd2skLFdAGnAAKKJU03H/O?= =?us-ascii?Q?rCy74tJTJc32kgeD8fHUKXWJSo5R+6rQGOlCfIGxJoyAN8Xirqn+2cJGWR0q?= =?us-ascii?Q?pDtSFEX7KcvYrAQAfNpWgThWUApOusbjknlaKEkQtjVmqjTpEgCBdpSFykPV?= =?us-ascii?Q?B5IzSY5GfIjeZMz/jlvMO/os/idI05f4d4qUA3eWZMynOvwESaSYyBPRMM1B?= =?us-ascii?Q?Frbq4Tq8xp7MbCuMRU5YXCmIimHNLZD/S7MZsyhPDlelAZ4BP24+Cbq/EqOm?= =?us-ascii?Q?MumI7t7XsAg23rWF+j9onBOMWfG4OCkoYc8LgVRHkeKh1VFvmBtr81apGsgM?= =?us-ascii?Q?DlQCFdUHWg19Lmg7DpGXKLzR9pcIVXChcLFKx32h/f0T5q94Fi9YKwCcJt17?= =?us-ascii?Q?N5bRTYqN6UHD0FQ4qQQHguJzNAJe9D54Wcyfr1qyxN+S/TPuT0TzuHLc8Izl?= =?us-ascii?Q?9m9K/ihWaGwFHCszbhP1B0li4cn97pub8cq+RhjcmSyrTIKXUD6bTL3RV5cB?= =?us-ascii?Q?dZXy5ha39DgxMhrLHshypktsjox4c5NywzT0bnYEDfHrS?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0906;6:i0TCDceCTXdv4sG/Vxq/dzxVwV0ZJbKZX2miykKNhnGHaCVetFsC12S+Syz60UtCB8KUlkaOkI0J60DNkkZM3Jt6imsR26JsckFH+uutkBORbeqX/ce4bJyB12wiS5nFK6xdCpso7O/En3ifiZe3SqL1gVrSt4j5zqBjYjxED2DZzN/wilpvNSVCPkgeu4wWjmqyWiL5K4duZF9s9yRtvlaMN3bPy2SaISynivn73+JWTTx7QYfKu0njyJjKS1hmhVNaJaABsjDKf4fpCYZFNb+IMM+/M21m1JUu9l8v66xaYECUTU6RXKLKB6GynzmOpaxHwxVyefHEHJb02LCOhw==;5:EqRAZYON03CScQlKte2Sb8w6A+JsvqaXlU0x4chqE6RmfLeT4C5B3JNThr3pidclXm7xdn4WcrFPxWUC5BITddhecP/FuLaHQ9fdO4L3TV81pEqcvVduKwbsFx1Oxk4EATnUFevP1sJV1kU57QxBmA==;24:IMUOckYHh/HhjqK1KocFXaZKZbB9evifzSw5z+alJuGhQSOCZuT+FMMiTIdnTvzqf9nF56QTP9UYCV22rzRqvrL+wBweRbaXgrwSb52lsk0=;7:VQ63DZPAN6D8mFyAUs824kAnpTFa6V6LB+IFXn/t39dkCzPR+EsilAiOux4wog4qOYJe2PYduBynLWPaKS1uA4d4pGoD5viBp+pfQU7Z09O7Ak8WQvBaHWdcprVDP24IyzIVjsoHLmKUlnHDjhjMgvDyvpvxicqep/lnBGDsfqryaSiNIfJPlPm0dh2sK2gfhqjMx7RzkJRVwB+gSTNkMedrejsVZVr5f7wqZzONT1w= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2017 03:24:06.1555 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB0906 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7751 Lines: 279 move the driver from drivers/soc/fsl/qe to drivers/irqchip, merge qe_ic.h and qe_ic.c into irq-qeic.c. Signed-off-by: Zhao Qiang --- MAINTAINERS | 6 ++ drivers/irqchip/Makefile | 1 + drivers/{soc/fsl/qe/qe_ic.c => irqchip/irq-qeic.c} | 95 ++++++++++++++++++- drivers/soc/fsl/qe/Makefile | 2 +- drivers/soc/fsl/qe/qe_ic.h | 103 --------------------- 5 files changed, 100 insertions(+), 107 deletions(-) rename drivers/{soc/fsl/qe/qe_ic.c => irqchip/irq-qeic.c} (85%) delete mode 100644 drivers/soc/fsl/qe/qe_ic.h diff --git a/MAINTAINERS b/MAINTAINERS index 567343b..1288329 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5462,6 +5462,12 @@ F: drivers/soc/fsl/qe/ F: include/soc/fsl/*qe*.h F: include/soc/fsl/*ucc*.h +FREESCALE QEIC DRIVERS +M: Qiang Zhao +L: linux-kernel@vger.kernel.org +S: Maintained +F: drivers/irqchip/irq-qeic.c + FREESCALE QUICC ENGINE UCC ETHERNET DRIVER M: Li Yang L: netdev@vger.kernel.org diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile index e88d856..b8eae87 100644 --- a/drivers/irqchip/Makefile +++ b/drivers/irqchip/Makefile @@ -78,3 +78,4 @@ obj-$(CONFIG_EZNPS_GIC) += irq-eznps.o obj-$(CONFIG_ARCH_ASPEED) += irq-aspeed-vic.o irq-aspeed-i2c-ic.o obj-$(CONFIG_STM32_EXTI) += irq-stm32-exti.o obj-$(CONFIG_QCOM_IRQ_COMBINER) += qcom-irq-combiner.o +obj-$(CONFIG_QUICC_ENGINE) += irq-qeic.o diff --git a/drivers/soc/fsl/qe/qe_ic.c b/drivers/irqchip/irq-qeic.c similarity index 85% rename from drivers/soc/fsl/qe/qe_ic.c rename to drivers/irqchip/irq-qeic.c index ec2ca86..9b4660c 100644 --- a/drivers/soc/fsl/qe/qe_ic.c +++ b/drivers/irqchip/irq-qeic.c @@ -1,7 +1,7 @@ /* - * arch/powerpc/sysdev/qe_lib/qe_ic.c + * drivers/irqchip/irq-qeic.c * - * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) 2016 Freescale Semiconductor, Inc. All rights reserved. * * Author: Li Yang * Based on code from Shlomi Gridish @@ -30,7 +30,96 @@ #include #include -#include "qe_ic.h" +#define NR_QE_IC_INTS 64 + +/* QE IC registers offset */ +#define QEIC_CICR 0x00 +#define QEIC_CIVEC 0x04 +#define QEIC_CRIPNR 0x08 +#define QEIC_CIPNR 0x0c +#define QEIC_CIPXCC 0x10 +#define QEIC_CIPYCC 0x14 +#define QEIC_CIPWCC 0x18 +#define QEIC_CIPZCC 0x1c +#define QEIC_CIMR 0x20 +#define QEIC_CRIMR 0x24 +#define QEIC_CICNR 0x28 +#define QEIC_CIPRTA 0x30 +#define QEIC_CIPRTB 0x34 +#define QEIC_CRICR 0x3c +#define QEIC_CHIVEC 0x60 + +/* Interrupt priority registers */ +#define CIPCC_SHIFT_PRI0 29 +#define CIPCC_SHIFT_PRI1 26 +#define CIPCC_SHIFT_PRI2 23 +#define CIPCC_SHIFT_PRI3 20 +#define CIPCC_SHIFT_PRI4 13 +#define CIPCC_SHIFT_PRI5 10 +#define CIPCC_SHIFT_PRI6 7 +#define CIPCC_SHIFT_PRI7 4 + +/* CICR priority modes */ +#define CICR_GWCC 0x00040000 +#define CICR_GXCC 0x00020000 +#define CICR_GYCC 0x00010000 +#define CICR_GZCC 0x00080000 +#define CICR_GRTA 0x00200000 +#define CICR_GRTB 0x00400000 +#define CICR_HPIT_SHIFT 8 +#define CICR_HPIT_MASK 0x00000300 +#define CICR_HP_SHIFT 24 +#define CICR_HP_MASK 0x3f000000 + +/* CICNR */ +#define CICNR_WCC1T_SHIFT 20 +#define CICNR_ZCC1T_SHIFT 28 +#define CICNR_YCC1T_SHIFT 12 +#define CICNR_XCC1T_SHIFT 4 + +/* CRICR */ +#define CRICR_RTA1T_SHIFT 20 +#define CRICR_RTB1T_SHIFT 28 + +/* Signal indicator */ +#define SIGNAL_MASK 3 +#define SIGNAL_HIGH 2 +#define SIGNAL_LOW 0 + +struct qe_ic { + /* Control registers offset */ + u32 __iomem *regs; + + /* The remapper for this QEIC */ + struct irq_domain *irqhost; + + /* The "linux" controller struct */ + struct irq_chip hc_irq; + + /* VIRQ numbers of QE high/low irqs */ + unsigned int virq_high; + unsigned int virq_low; +}; + +/* + * QE interrupt controller internal structure + */ +struct qe_ic_info { + /* location of this source at the QIMR register. */ + u32 mask; + + /* Mask register offset */ + u32 mask_reg; + + /* + * for grouped interrupts sources - the interrupt + * code as appears at the group priority register + */ + u8 pri_code; + + /* Group priority register offset */ + u32 pri_reg; +}; static DEFINE_RAW_SPINLOCK(qe_ic_lock); diff --git a/drivers/soc/fsl/qe/Makefile b/drivers/soc/fsl/qe/Makefile index 2031d38..51e4726 100644 --- a/drivers/soc/fsl/qe/Makefile +++ b/drivers/soc/fsl/qe/Makefile @@ -1,7 +1,7 @@ # # Makefile for the linux ppc-specific parts of QE # -obj-$(CONFIG_QUICC_ENGINE)+= qe.o qe_common.o qe_ic.o qe_io.o +obj-$(CONFIG_QUICC_ENGINE)+= qe.o qe_common.o qe_io.o obj-$(CONFIG_CPM) += qe_common.o obj-$(CONFIG_UCC) += ucc.o obj-$(CONFIG_UCC_SLOW) += ucc_slow.o diff --git a/drivers/soc/fsl/qe/qe_ic.h b/drivers/soc/fsl/qe/qe_ic.h deleted file mode 100644 index 926a2ed..0000000 --- a/drivers/soc/fsl/qe/qe_ic.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * drivers/soc/fsl/qe/qe_ic.h - * - * QUICC ENGINE Interrupt Controller Header - * - * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. - * - * Author: Li Yang - * Based on code from Shlomi Gridish - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - */ -#ifndef _POWERPC_SYSDEV_QE_IC_H -#define _POWERPC_SYSDEV_QE_IC_H - -#include - -#define NR_QE_IC_INTS 64 - -/* QE IC registers offset */ -#define QEIC_CICR 0x00 -#define QEIC_CIVEC 0x04 -#define QEIC_CRIPNR 0x08 -#define QEIC_CIPNR 0x0c -#define QEIC_CIPXCC 0x10 -#define QEIC_CIPYCC 0x14 -#define QEIC_CIPWCC 0x18 -#define QEIC_CIPZCC 0x1c -#define QEIC_CIMR 0x20 -#define QEIC_CRIMR 0x24 -#define QEIC_CICNR 0x28 -#define QEIC_CIPRTA 0x30 -#define QEIC_CIPRTB 0x34 -#define QEIC_CRICR 0x3c -#define QEIC_CHIVEC 0x60 - -/* Interrupt priority registers */ -#define CIPCC_SHIFT_PRI0 29 -#define CIPCC_SHIFT_PRI1 26 -#define CIPCC_SHIFT_PRI2 23 -#define CIPCC_SHIFT_PRI3 20 -#define CIPCC_SHIFT_PRI4 13 -#define CIPCC_SHIFT_PRI5 10 -#define CIPCC_SHIFT_PRI6 7 -#define CIPCC_SHIFT_PRI7 4 - -/* CICR priority modes */ -#define CICR_GWCC 0x00040000 -#define CICR_GXCC 0x00020000 -#define CICR_GYCC 0x00010000 -#define CICR_GZCC 0x00080000 -#define CICR_GRTA 0x00200000 -#define CICR_GRTB 0x00400000 -#define CICR_HPIT_SHIFT 8 -#define CICR_HPIT_MASK 0x00000300 -#define CICR_HP_SHIFT 24 -#define CICR_HP_MASK 0x3f000000 - -/* CICNR */ -#define CICNR_WCC1T_SHIFT 20 -#define CICNR_ZCC1T_SHIFT 28 -#define CICNR_YCC1T_SHIFT 12 -#define CICNR_XCC1T_SHIFT 4 - -/* CRICR */ -#define CRICR_RTA1T_SHIFT 20 -#define CRICR_RTB1T_SHIFT 28 - -/* Signal indicator */ -#define SIGNAL_MASK 3 -#define SIGNAL_HIGH 2 -#define SIGNAL_LOW 0 - -struct qe_ic { - /* Control registers offset */ - volatile u32 __iomem *regs; - - /* The remapper for this QEIC */ - struct irq_domain *irqhost; - - /* The "linux" controller struct */ - struct irq_chip hc_irq; - - /* VIRQ numbers of QE high/low irqs */ - unsigned int virq_high; - unsigned int virq_low; -}; - -/* - * QE interrupt controller internal structure - */ -struct qe_ic_info { - u32 mask; /* location of this source at the QIMR register. */ - u32 mask_reg; /* Mask register offset */ - u8 pri_code; /* for grouped interrupts sources - the interrupt - code as appears at the group priority register */ - u32 pri_reg; /* Group priority register offset */ -}; - -#endif /* _POWERPC_SYSDEV_QE_IC_H */ -- 2.1.0.27.g96db324