Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752080AbdHGDYp (ORCPT ); Sun, 6 Aug 2017 23:24:45 -0400 Received: from mail-bl2nam02on0061.outbound.protection.outlook.com ([104.47.38.61]:37568 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752023AbdHGDY2 (ORCPT ); Sun, 6 Aug 2017 23:24:28 -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 4/4] irqchip/qeic: remove PPCisms for QEIC Date: Mon, 7 Aug 2017 11:07:16 +0800 Message-ID: <1502075236-24078-5-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: 131465498641330526;(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)(39450400003)(39860400002)(39410400002)(39850400002)(39840400002)(39400400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(50944005)(199003)(189002)(5660300001)(85426001)(575784001)(86362001)(8656003)(47776003)(104016004)(5003940100001)(33646002)(110136004)(38730400002)(54906002)(2906002)(68736007)(36756003)(4326008)(106466001)(105606002)(2351001)(48376002)(50986999)(77096006)(76176999)(498600001)(50466002)(626005)(97736004)(6666003)(305945005)(53936002)(81156014)(50226002)(2950100002)(6916009)(81166006)(189998001)(356003)(8936002)(8676002)(2004002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR0301MB0900;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL2FFO11FD043;1:Cc/JGigcraiasErEPTN7eOIpN3kBBUbBXXEkqB386P?= =?us-ascii?Q?eMCpreeJN8iPPXyiSIQkJ+BGXLS5y8h////BZfyJOIWzX6MbgAYIRNBgkM47?= =?us-ascii?Q?PtCMAOEQFmnOspWcsWJqhh8NUfpWxYysii+83woCJOR4puLdABsKcYthR+AC?= =?us-ascii?Q?r0dAPiNqsmSjjkZKwGA7gQwKyD0jP5eOynT+zxJfNUvRx7RB4eDBdQ25FBo4?= =?us-ascii?Q?jcKMFYY7sh4IQ4BQgJJccPEu+zX322wnTprlr1w4wFZmaGN4Uz4hKeTxTNd8?= =?us-ascii?Q?Ys9ECBv/qXEODLGKTQSwVEPMbEqvtx5Hi4ZL4lwyqiO3HXGXH9WGBuE4rP2I?= =?us-ascii?Q?h8FN9ls72YAqNozBiFcIOVeinNEf10BCRxrIxDi34zvQafrAxiisox2wes6F?= =?us-ascii?Q?7bL5jP3DXYDr+wYcq3jjf/sa8e2ZcalMAKVMJ6i1Hg0ZtMVhmy/3f30MNQDC?= =?us-ascii?Q?eh44uSjqyz0ClUdU0KfyZxLSwJvM1+q42iMT7NEdLhLgSNK+Lrd0yFCXwbtL?= =?us-ascii?Q?xJNZws6zLrehAiCv/wtb2dkE2UAHnj0hMx3KxegEi6Vd4jT+MU9IiGkp4t9y?= =?us-ascii?Q?jfScYHDdiezQoJmKM5YP3z4lq1wOYCI+KIfJvv9wgr8URpnCKTUIkTE7Vnp6?= =?us-ascii?Q?4lV/iNE+BUIAlZ3eUJr5XjE0KdsOanxO63+rtUKxv3Pg5MnFiw4AQfBa6DSo?= =?us-ascii?Q?XZoNQgy3efZUWuebbYtv4X/OxvQIowUgdorCAXp+CeHpMniYNKd/TiIMmOTQ?= =?us-ascii?Q?S6VBx6xyTtClPlaKVcUK2khifh65YhtdJPTGQfP3PYcaFVmTnWs7uJJwYFBw?= =?us-ascii?Q?5N19yREr/Ed9rYBMhGwvjTzOL828mEPyrrDx0yUecndIO/rFozsJS2U6dnjk?= =?us-ascii?Q?ouVqukn+gNMY7I0153/84GrBvrURN5N0L0PQbM2iZpuzoJSAtCINi/+Nd/jL?= =?us-ascii?Q?k/aAv/7MyZb5flOWWGVjpgmBeCMDSQ9aIVsGgYeA=3D=3D?= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a63c7bfa-bacb-4688-0ffd-08d4dd43cd31 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:BN3PR0301MB0900; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0301MB0900;3:GKEbdnbWEBK0ITX/1gLwHjxQUqXfMzG5JoUDGFq70WNeHRQGQixfF3u7ZwnCEqxWxS0ieISVdhIONJn+79B7Qsf16Z5RDDHGgiOVFYkqb1BGQlwWyJY4jqxpI4pWRr2fnhAYs9zkQ8RPLdsT/i1LL8dYD3c3WDt6OIK0JIh6LS/FXLyaqzX1mb4ocZ6Md0y+IZeBxoS/30e9/mRABZ0lLgW5XS/aypu2xFNfuD8kECpYFwv+Kat5x/e+QK3QSwMUr4MBAuE5KAvTnpeKtICJ4Pg7sSFOzbmy3jEWQKzP/La37RBIb02BNw0XbeNzQJujQE6cLgAGcyeOOS9PCvAhqgxbWh+ph9I0GqP8GSunmFk=;25:3E8/Y+y9OTOao6Q34hi+hZeANJo1fkMv3DzO0Sb+8RyB/vmsbdip8Tf+P+T0eud14gzk6oIHOj2PJ8EC0S60t1YoZkLAg+XXz+yYqnPxiHAQ7WZA9nL4Z2XEzGlHJ+vqicasL+8zCSYa+n/RU8DpSkB0+xT4qCLBW4+JfcdxI+BP8dnI7Wmjjxoq1btiqsORquNpTR8qumO7k02qFjFGExGct+fKzQNeTvhTLYDlcFeh7yBWPSWFyOiUlt2QXPHQ/uNzkYts7hcZwpWfVC45DgQE4di74F4xMc66iu4mnnnW8aoB1FCOhEJ/8Lf/yB7soqCZjBmzpmHPHyhRSCcIbw== X-MS-TrafficTypeDiagnostic: BN3PR0301MB0900: X-Microsoft-Exchange-Diagnostics: 1;BN3PR0301MB0900;31:nyMNshFyGTzJhQflrCa8eNyL3KBImOLpgFXR/iocKompVFvPHhFTbMqzyf5rRb0BienkETjgqr34qW249q64LkxVb2XOb6zqcLwifRXKsPDAsiwd11zM0aJm0CY2v5cXGsD46k87Ox3FQ5FUBj0LW6LZEWcrIvFIJ3Y/VuN0BGAPYiZVaiOcdWBF+SLyHKx/09PuOERsyScjmnAO0KKUUnauuhOQcXziwjN9ugmplM0=;4:48VQOub9xQB08W/vOtuzZ/mK+ZaXrEZJQf6WZWMAfN7GtbwjrsbqxMu8p7bYUlLwV4Mk++ZY49kTV9+lrnepVk2nejmaj72ztkjZp6vO6guoHMjIqdBl2fPQpCE4sfoKlxfM7Ajpd+zK7X2ehsHO2RGo77jYz8yunDYGcccVs19opAojIPYA49oF/M5fEoOVG6nje8geME9tULbEoClrWhe8UBZZlH+85pCPZKDxICZqwLvUYmG3Npvt1aK951TCGLiXds2o/85UfU/IWeX8XkHxfOfr0Zy/SNxUloZWXtjbqJ6vglz7GiTCVZo6uPmhNOS2PPo33/4RQ1PvG/34oA== X-Exchange-Antispam-Report-Test: UriScan:(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)(13018025)(8121501046)(5005006)(13016025)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123556025)(20161123561025)(20161123563025)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN3PR0301MB0900;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN3PR0301MB0900; X-Forefront-PRVS: 0392679D18 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN3PR0301MB0900;23:igaKLvRinLGtcYF8RyKyudBb3jN9Z4sBVsL+CYt?= =?us-ascii?Q?bnD7h10nyOFmhX+mvyHHp9QIr+2xTyX9iu4he4nYFPqtkfybls0/tPsYX5Mr?= =?us-ascii?Q?NePzHUFMJPB+5B11IaR/Ku76cQ3QU4iXGoFKtx+PBtSU3H9piXaY9NTxp01f?= =?us-ascii?Q?4DGAtjshYdLLDDm1GBLMU8lDrHZa6yPd/8R06Kw2ZNVXu5zuznwW41R6B6v7?= =?us-ascii?Q?8VFxqkz0l9XIpJqGWyS9ARDP9+XweO4c3CfuwoP5XQn07/mPuJmXVsqkTeKL?= =?us-ascii?Q?kJeT5dwXwWQO77cxEVMWcb7k4vY4D5mfMxR/MQd02TlhIyuP+0KkT1M4Py7O?= =?us-ascii?Q?/iP6i5MNr3mzio+jn7jKXWqeaZ3vX+qFhK2jGQ3caV4fyO7SHvaSC2XdVrbQ?= =?us-ascii?Q?4k/J0L2oXpOAthg8MHOZ7JQFIvQ2lvBW+nH9cdZ/ddc8GmC0YBZAuBy85eJV?= =?us-ascii?Q?mumakNhS0cf5fB2+RbsmIit5856URa1dIoFWAJVQ8JI6RhdvJcEMtoG9Papx?= =?us-ascii?Q?IdOGJA0gEeysWlwHHb28k4VjEmoBaQlL00cjMdVK+dP5x0HDtLZUK9XXxVvR?= =?us-ascii?Q?fmvr/vnlxOSeHXr6XQg+DW76929Ie0L5jNQkZjR3gkZr8a+Pr6EPCxFUTx3G?= =?us-ascii?Q?vJk0Iryot7Ico6sJz30lii1MPzaT93qPHBitby/sS8OGGLWbazSsKB9Mv+3I?= =?us-ascii?Q?Os28JIsMggxgCtzoksTufqBdFI4J+w1OiJ9x1y9fXm2Ky8UXLZq8+RZLt4kX?= =?us-ascii?Q?hIP99mbrAudYE00DHIO5bnAJPV0YTFlMP+IUXCZ8mw+U1T4inGFKCen+Fm97?= =?us-ascii?Q?DBuQw8QdMpgdtW3OkA9DBbefzSKrJbXP/gIrtNSTi+PV3cyUmP402jzCfpTH?= =?us-ascii?Q?9brPbQP22m+fsJSUQyV9ZqneSjev4+SH53EhxIpJO+deCHhEuh8XSm2j9GqC?= =?us-ascii?Q?NTiCwS7ToBU8rnmdewSpCwT//nWNHAxvnGf0HJHNdc6xew6tAEUfj+2lm8X0?= =?us-ascii?Q?QPrKLvC+kFji+ZiPSxM31huyJ1RxAnxcZfynEwsnHoTa3OQOsORLbsTEqeDh?= =?us-ascii?Q?h+GkuzAGuMiVOwCMipFIPAK4Ma8HMgSRHm+nIpunE5tLMMB/ebNu7LXBpMqU?= =?us-ascii?Q?1yt22uUBGyn0/2Hf9aByUJB4d8JxYai28a+YoLgCE+TVIFMd0HSDh91PPVXJ?= =?us-ascii?Q?tYni2JtfMM13aoosT78B6VAtbZZPyaz5lKyCiUAneBoWxCcI4H58QrFHL7WE?= =?us-ascii?Q?pNAILmtMsxdsIMOuOi8BiieKfmGdYbWH3+Iep/9pY3UnrwdvArGIXB3qBGLR?= =?us-ascii?Q?BLP0nLCYRDMPowwJ388jBN2N2K8NLvExgHcN3liY7fBIkhkEL7epgR/7L31Z?= =?us-ascii?Q?MpsN/dA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BN3PR0301MB0900;6:75Cw2kLqXNZSNZsP2AKN0dgwYu1cMCdcTpN4rDJG5fRw8VG/Jd+7jXPBD1HC9Hu7AOzw2pEXJk0zsqoCBbOLxCr+YOYWyVJScZDDdFp/J0tjdAarCcrbRInx580xIaK7j+nLO8TR/mvZi04B9FCCWbQGNDQqUBNLOrOObIG9skmc4c/HqmZv+4+FX6sChguD/LNGHWDzKFrbGb0ycqbTUlP/Eh7hPQRdVLZHkeVfWW/dgn9VPDez1BBk4u/UIX6izDmTkQOHmS8x76eIDvBSJ3bmmOY6XjccMAaZCsoDME/NtiuzK8GOMdkCPyJYDjR4r48tKvn2fH6xXihYGpk6xA==;5:ZIEEMgyWc68UXwEMqq4Rcqp+Ybl9livOmOOx4suVGVAg3sggGVO+gfsyNSUKPux9KIIq1FN3xxk5FPA/xYB0E/qW7qElwAHDAufh6ky99/6dZ4Y5QzWPPKOHPeFeOlbcOKv7kytMihkeHM7EETfF1g==;24:p0H96i0PF8ZMn1E0V/5igzazMDHg9FQe+ZiHc3lc7XbM9aA7dZW7Yj8QaQ2lIqVDfYfQDeyw+HNDERXyaqwpNbQS7z9fQmBSSElqvEfcjvU=;7:z33M5rsk1UfalYbhAbvAkdRv4puSUT97FolGU7tgf37B1VKX6HsbHDYDAaP3BSdAhVHuNmSTsrrLZ9XOAelaxIV+880cQ2XL/VsbtQwRrVj7FOPViN5AYTb8mCckibzx0rxUfeYHVROhwngrtGNJMg4cM5TU2kCsPCaZ/xxJgMl/iNlyLUqZ8r/pi7xOyG81K6Zw3ZIFyQHgRwmQP02fYtYn7MYLGlFC22pP1mbepFY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2017 03:24:23.9614 (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: BN3PR0301MB0900 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 17882 Lines: 558 QEIC was supported on PowerPC, and dependent on PPC, Now it is supported on other platforms, so remove PPCisms. Signed-off-by: Zhao Qiang --- arch/powerpc/platforms/83xx/km83xx.c | 1 - arch/powerpc/platforms/83xx/misc.c | 1 - arch/powerpc/platforms/83xx/mpc832x_mds.c | 1 - arch/powerpc/platforms/83xx/mpc832x_rdb.c | 1 - arch/powerpc/platforms/83xx/mpc836x_mds.c | 1 - arch/powerpc/platforms/83xx/mpc836x_rdk.c | 1 - arch/powerpc/platforms/85xx/corenet_generic.c | 1 - arch/powerpc/platforms/85xx/mpc85xx_mds.c | 1 - arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 1 - arch/powerpc/platforms/85xx/twr_p102x.c | 1 - drivers/irqchip/irq-qeic.c | 188 +++++++++++--------------- include/soc/fsl/qe/qe_ic.h | 132 ------------------ 12 files changed, 80 insertions(+), 250 deletions(-) delete mode 100644 include/soc/fsl/qe/qe_ic.h diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c index d8642a4..b1cef0a 100644 --- a/arch/powerpc/platforms/83xx/km83xx.c +++ b/arch/powerpc/platforms/83xx/km83xx.c @@ -38,7 +38,6 @@ #include #include #include -#include #include "mpc83xx.h" diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c index c09a135..07a0e61 100644 --- a/arch/powerpc/platforms/83xx/misc.c +++ b/arch/powerpc/platforms/83xx/misc.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c index bb7b25a..a1cadf4 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c @@ -37,7 +37,6 @@ #include #include #include -#include #include "mpc83xx.h" diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c index d7c9b18..6c66527 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c index 4fc3051..9234d63 100644 --- a/arch/powerpc/platforms/83xx/mpc836x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c @@ -45,7 +45,6 @@ #include #include #include -#include #include "mpc83xx.h" diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c index 93f024f..82fa344 100644 --- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c +++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c index 1b385ac..9ca27b1 100644 --- a/arch/powerpc/platforms/85xx/corenet_generic.c +++ b/arch/powerpc/platforms/85xx/corenet_generic.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index 06f34a9..8102e5f 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include "smp.h" diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c index 000d385..f806b6b 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include diff --git a/arch/powerpc/platforms/85xx/twr_p102x.c b/arch/powerpc/platforms/85xx/twr_p102x.c index 6be9b33..4f620f2 100644 --- a/arch/powerpc/platforms/85xx/twr_p102x.c +++ b/arch/powerpc/platforms/85xx/twr_p102x.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/drivers/irqchip/irq-qeic.c b/drivers/irqchip/irq-qeic.c index a2d8084..26bfcbd 100644 --- a/drivers/irqchip/irq-qeic.c +++ b/drivers/irqchip/irq-qeic.c @@ -18,8 +18,11 @@ #include #include #include +#include #include #include +#include +#include #include #include #include @@ -27,9 +30,8 @@ #include #include #include -#include +#include #include -#include #define NR_QE_IC_INTS 64 @@ -87,6 +89,43 @@ #define SIGNAL_HIGH 2 #define SIGNAL_LOW 0 +#define NUM_OF_QE_IC_GROUPS 6 + +/* Flags when we init the QE IC */ +#define QE_IC_SPREADMODE_GRP_W 0x00000001 +#define QE_IC_SPREADMODE_GRP_X 0x00000002 +#define QE_IC_SPREADMODE_GRP_Y 0x00000004 +#define QE_IC_SPREADMODE_GRP_Z 0x00000008 +#define QE_IC_SPREADMODE_GRP_RISCA 0x00000010 +#define QE_IC_SPREADMODE_GRP_RISCB 0x00000020 + +#define QE_IC_LOW_SIGNAL 0x00000100 +#define QE_IC_HIGH_SIGNAL 0x00000200 + +#define QE_IC_GRP_W_PRI0_DEST_SIGNAL_HIGH 0x00001000 +#define QE_IC_GRP_W_PRI1_DEST_SIGNAL_HIGH 0x00002000 +#define QE_IC_GRP_X_PRI0_DEST_SIGNAL_HIGH 0x00004000 +#define QE_IC_GRP_X_PRI1_DEST_SIGNAL_HIGH 0x00008000 +#define QE_IC_GRP_Y_PRI0_DEST_SIGNAL_HIGH 0x00010000 +#define QE_IC_GRP_Y_PRI1_DEST_SIGNAL_HIGH 0x00020000 +#define QE_IC_GRP_Z_PRI0_DEST_SIGNAL_HIGH 0x00040000 +#define QE_IC_GRP_Z_PRI1_DEST_SIGNAL_HIGH 0x00080000 +#define QE_IC_GRP_RISCA_PRI0_DEST_SIGNAL_HIGH 0x00100000 +#define QE_IC_GRP_RISCA_PRI1_DEST_SIGNAL_HIGH 0x00200000 +#define QE_IC_GRP_RISCB_PRI0_DEST_SIGNAL_HIGH 0x00400000 +#define QE_IC_GRP_RISCB_PRI1_DEST_SIGNAL_HIGH 0x00800000 +#define QE_IC_GRP_W_DEST_SIGNAL_SHIFT (12) + +/* QE interrupt sources groups */ +enum qe_ic_grp_id { + QE_IC_GRP_W = 0, /* QE interrupt controller group W */ + QE_IC_GRP_X, /* QE interrupt controller group X */ + QE_IC_GRP_Y, /* QE interrupt controller group Y */ + QE_IC_GRP_Z, /* QE interrupt controller group Z */ + QE_IC_GRP_RISCA, /* QE interrupt controller RISC group A */ + QE_IC_GRP_RISCB /* QE interrupt controller RISC group B */ +}; + struct qe_ic { /* Control registers offset */ u32 __iomem *regs; @@ -265,15 +304,15 @@ static struct qe_ic_info qe_ic_info[] = { }, }; -static inline u32 qe_ic_read(volatile __be32 __iomem * base, unsigned int reg) +static u32 qe_ic_read(__be32 __iomem *base, unsigned int reg) { - return in_be32(base + (reg >> 2)); + return ioread32be(base + (reg >> 2)); } -static inline void qe_ic_write(volatile __be32 __iomem * base, unsigned int reg, +static void qe_ic_write(__be32 __iomem *base, unsigned int reg, u32 value) { - out_be32(base + (reg >> 2), value); + iowrite32be(value, base + (reg >> 2)); } static inline struct qe_ic *qe_ic_from_irq(unsigned int virq) @@ -375,8 +414,8 @@ static const struct irq_domain_ops qe_ic_host_ops = { .xlate = irq_domain_xlate_onetwocell, }; -/* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ -unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic) +/* Return an interrupt vector or 0 if no interrupt is pending. */ +static unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic) { int irq; @@ -386,13 +425,13 @@ unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic) irq = qe_ic_read(qe_ic->regs, QEIC_CIVEC) >> 26; if (irq == 0) - return NO_IRQ; + return 0; return irq_linear_revmap(qe_ic->irqhost, irq); } -/* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ -unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic) +/* Return an interrupt vector or 0 if no interrupt is pending. */ +static unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic) { int irq; @@ -402,11 +441,38 @@ unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic) irq = qe_ic_read(qe_ic->regs, QEIC_CHIVEC) >> 26; if (irq == 0) - return NO_IRQ; + return 0; return irq_linear_revmap(qe_ic->irqhost, irq); } +static void qe_ic_cascade_mpic(struct irq_desc *desc, int is_high) +{ + struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); + struct irq_chip *chip = irq_desc_get_chip(desc); + unsigned int cascade_irq; + + if (is_high) + cascade_irq = qe_ic_get_high_irq(qe_ic); + else + cascade_irq = qe_ic_get_low_irq(qe_ic); + + if (cascade_irq != 0) + generic_handle_irq(cascade_irq); + + chip->irq_eoi(&desc->irq_data); +} + +static void qe_ic_cascade_low_mpic(struct irq_desc *desc) +{ + qe_ic_cascade_mpic(desc, 0); +} + +static void qe_ic_cascade_high_mpic(struct irq_desc *desc) +{ + qe_ic_cascade_mpic(desc, 1); +} + static int __init qe_ic_init(struct device_node *node, unsigned int flags) { struct qe_ic *qe_ic; @@ -443,7 +509,7 @@ static int __init qe_ic_init(struct device_node *node, unsigned int flags) qe_ic->virq_high = irq_of_parse_and_map(node, 0); qe_ic->virq_low = irq_of_parse_and_map(node, 1); - if (qe_ic->virq_low == NO_IRQ) { + if (qe_ic->virq_low == 0) { pr_err("Failed to map QE_IC low IRQ\n"); ret = -ENOMEM; goto err_domain_remove; @@ -475,7 +541,7 @@ static int __init qe_ic_init(struct device_node *node, unsigned int flags) irq_set_handler_data(qe_ic->virq_low, qe_ic); irq_set_chained_handler(qe_ic->virq_low, qe_ic_cascade_low_mpic); - if (qe_ic->virq_high != NO_IRQ && + if (qe_ic->virq_high != 0 && qe_ic->virq_high != qe_ic->virq_low) { irq_set_handler_data(qe_ic->virq_high, qe_ic); irq_set_chained_handler(qe_ic->virq_high, @@ -493,100 +559,6 @@ static int __init qe_ic_init(struct device_node *node, unsigned int flags) return ret; } -void qe_ic_set_highest_priority(unsigned int virq, int high) -{ - struct qe_ic *qe_ic = qe_ic_from_irq(virq); - unsigned int src = virq_to_hw(virq); - u32 temp = 0; - - temp = qe_ic_read(qe_ic->regs, QEIC_CICR); - - temp &= ~CICR_HP_MASK; - temp |= src << CICR_HP_SHIFT; - - temp &= ~CICR_HPIT_MASK; - temp |= (high ? SIGNAL_HIGH : SIGNAL_LOW) << CICR_HPIT_SHIFT; - - qe_ic_write(qe_ic->regs, QEIC_CICR, temp); -} - -/* Set Priority level within its group, from 1 to 8 */ -int qe_ic_set_priority(unsigned int virq, unsigned int priority) -{ - struct qe_ic *qe_ic = qe_ic_from_irq(virq); - unsigned int src = virq_to_hw(virq); - u32 temp; - - if (priority > 8 || priority == 0) - return -EINVAL; - if (WARN_ONCE(src >= ARRAY_SIZE(qe_ic_info), - "%s: Invalid hw irq number for QEIC\n", __func__)) - return -EINVAL; - if (qe_ic_info[src].pri_reg == 0) - return -EINVAL; - - temp = qe_ic_read(qe_ic->regs, qe_ic_info[src].pri_reg); - - if (priority < 4) { - temp &= ~(0x7 << (32 - priority * 3)); - temp |= qe_ic_info[src].pri_code << (32 - priority * 3); - } else { - temp &= ~(0x7 << (24 - priority * 3)); - temp |= qe_ic_info[src].pri_code << (24 - priority * 3); - } - - qe_ic_write(qe_ic->regs, qe_ic_info[src].pri_reg, temp); - - return 0; -} - -/* Set a QE priority to use high irq, only priority 1~2 can use high irq */ -int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high) -{ - struct qe_ic *qe_ic = qe_ic_from_irq(virq); - unsigned int src = virq_to_hw(virq); - u32 temp, control_reg = QEIC_CICNR, shift = 0; - - if (priority > 2 || priority == 0) - return -EINVAL; - if (WARN_ONCE(src >= ARRAY_SIZE(qe_ic_info), - "%s: Invalid hw irq number for QEIC\n", __func__)) - return -EINVAL; - - switch (qe_ic_info[src].pri_reg) { - case QEIC_CIPZCC: - shift = CICNR_ZCC1T_SHIFT; - break; - case QEIC_CIPWCC: - shift = CICNR_WCC1T_SHIFT; - break; - case QEIC_CIPYCC: - shift = CICNR_YCC1T_SHIFT; - break; - case QEIC_CIPXCC: - shift = CICNR_XCC1T_SHIFT; - break; - case QEIC_CIPRTA: - shift = CRICR_RTA1T_SHIFT; - control_reg = QEIC_CRICR; - break; - case QEIC_CIPRTB: - shift = CRICR_RTB1T_SHIFT; - control_reg = QEIC_CRICR; - break; - default: - return -EINVAL; - } - - shift += (2 - priority) * 2; - temp = qe_ic_read(qe_ic->regs, control_reg); - temp &= ~(SIGNAL_MASK << shift); - temp |= (high ? SIGNAL_HIGH : SIGNAL_LOW) << shift; - qe_ic_write(qe_ic->regs, control_reg, temp); - - return 0; -} - static int __init init_qe_ic(struct device_node *node, struct device_node *parent) { diff --git a/include/soc/fsl/qe/qe_ic.h b/include/soc/fsl/qe/qe_ic.h deleted file mode 100644 index 6113699..0000000 --- a/include/soc/fsl/qe/qe_ic.h +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. - * - * Authors: Shlomi Gridish - * Li Yang - * - * Description: - * QE IC external definitions and structure. - * - * 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 _ASM_POWERPC_QE_IC_H -#define _ASM_POWERPC_QE_IC_H - -#include - -struct device_node; -struct qe_ic; - -#define NUM_OF_QE_IC_GROUPS 6 - -/* Flags when we init the QE IC */ -#define QE_IC_SPREADMODE_GRP_W 0x00000001 -#define QE_IC_SPREADMODE_GRP_X 0x00000002 -#define QE_IC_SPREADMODE_GRP_Y 0x00000004 -#define QE_IC_SPREADMODE_GRP_Z 0x00000008 -#define QE_IC_SPREADMODE_GRP_RISCA 0x00000010 -#define QE_IC_SPREADMODE_GRP_RISCB 0x00000020 - -#define QE_IC_LOW_SIGNAL 0x00000100 -#define QE_IC_HIGH_SIGNAL 0x00000200 - -#define QE_IC_GRP_W_PRI0_DEST_SIGNAL_HIGH 0x00001000 -#define QE_IC_GRP_W_PRI1_DEST_SIGNAL_HIGH 0x00002000 -#define QE_IC_GRP_X_PRI0_DEST_SIGNAL_HIGH 0x00004000 -#define QE_IC_GRP_X_PRI1_DEST_SIGNAL_HIGH 0x00008000 -#define QE_IC_GRP_Y_PRI0_DEST_SIGNAL_HIGH 0x00010000 -#define QE_IC_GRP_Y_PRI1_DEST_SIGNAL_HIGH 0x00020000 -#define QE_IC_GRP_Z_PRI0_DEST_SIGNAL_HIGH 0x00040000 -#define QE_IC_GRP_Z_PRI1_DEST_SIGNAL_HIGH 0x00080000 -#define QE_IC_GRP_RISCA_PRI0_DEST_SIGNAL_HIGH 0x00100000 -#define QE_IC_GRP_RISCA_PRI1_DEST_SIGNAL_HIGH 0x00200000 -#define QE_IC_GRP_RISCB_PRI0_DEST_SIGNAL_HIGH 0x00400000 -#define QE_IC_GRP_RISCB_PRI1_DEST_SIGNAL_HIGH 0x00800000 -#define QE_IC_GRP_W_DEST_SIGNAL_SHIFT (12) - -/* QE interrupt sources groups */ -enum qe_ic_grp_id { - QE_IC_GRP_W = 0, /* QE interrupt controller group W */ - QE_IC_GRP_X, /* QE interrupt controller group X */ - QE_IC_GRP_Y, /* QE interrupt controller group Y */ - QE_IC_GRP_Z, /* QE interrupt controller group Z */ - QE_IC_GRP_RISCA, /* QE interrupt controller RISC group A */ - QE_IC_GRP_RISCB /* QE interrupt controller RISC group B */ -}; - -#ifdef CONFIG_QUICC_ENGINE -unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic); -unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic); -#else -static inline unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic) -{ return 0; } -static inline unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic) -{ return 0; } -#endif /* CONFIG_QUICC_ENGINE */ - -void qe_ic_set_highest_priority(unsigned int virq, int high); -int qe_ic_set_priority(unsigned int virq, unsigned int priority); -int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high); - -static inline void qe_ic_cascade_low_ipic(struct irq_desc *desc) -{ - struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); - unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic); - - if (cascade_irq != NO_IRQ) - generic_handle_irq(cascade_irq); -} - -static inline void qe_ic_cascade_high_ipic(struct irq_desc *desc) -{ - struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); - unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic); - - if (cascade_irq != NO_IRQ) - generic_handle_irq(cascade_irq); -} - -static inline void qe_ic_cascade_low_mpic(struct irq_desc *desc) -{ - struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); - unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic); - struct irq_chip *chip = irq_desc_get_chip(desc); - - if (cascade_irq != NO_IRQ) - generic_handle_irq(cascade_irq); - - chip->irq_eoi(&desc->irq_data); -} - -static inline void qe_ic_cascade_high_mpic(struct irq_desc *desc) -{ - struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); - unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic); - struct irq_chip *chip = irq_desc_get_chip(desc); - - if (cascade_irq != NO_IRQ) - generic_handle_irq(cascade_irq); - - chip->irq_eoi(&desc->irq_data); -} - -static inline void qe_ic_cascade_muxed_mpic(struct irq_desc *desc) -{ - struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); - unsigned int cascade_irq; - struct irq_chip *chip = irq_desc_get_chip(desc); - - cascade_irq = qe_ic_get_high_irq(qe_ic); - if (cascade_irq == NO_IRQ) - cascade_irq = qe_ic_get_low_irq(qe_ic); - - if (cascade_irq != NO_IRQ) - generic_handle_irq(cascade_irq); - - chip->irq_eoi(&desc->irq_data); -} - -#endif /* _ASM_POWERPC_QE_IC_H */ -- 2.1.0.27.g96db324