From nobody Tue Dec 23 23:49:45 2025 Received: from CHN02-SH0-obe.outbound.protection.partner.outlook.cn (mail-sh0chn02on2051.outbound.protection.partner.outlook.cn [139.219.146.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A36738DFA; Tue, 30 Jan 2024 06:14:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=139.219.146.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706595297; cv=fail; b=LK+BZMNAmbfnKBbm6AVFwHFBHubSoGh2JgT7EwcV7vWYMC+a8wHyPrYSzoE8WMhvYr5WKWJn9aOJ9Fv5WeufFI7RlhLfclo8a7EUxpQ25UG7uJumRRwbBoMMDxXCbvMhvp/v8Vs+Ioafg7VENJ3qP4chV9CYiksAgyCc3AItcxA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706595297; c=relaxed/simple; bh=0yiPhBPD0XmSqNgTotKrvpZyiaRRfpNFEnfcDBEKB/Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=q2liyVZYkzJPAYvFmxpeL+xq6oznGPWFK5///8McD5Vh52zkmV77wcXRkl9o95By1m7jhsFmQoLbW2Sffnq3TZp9SeZGewY8tVAjj495gwAKy8sz2ZjiEOTiX+tTjSLn8mDvci8UPJ8QOmq+FYqtzhM8pLC97R8DiUYuc+V21KA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com; spf=pass smtp.mailfrom=starfivetech.com; arc=fail smtp.client-ip=139.219.146.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starfivetech.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n7K0g3MQN9ls9iPWS0crvGWHiHE45WruiE3gu00ytar7MU0AA95UmEuXY6rKt4uPtxsVXjAFUXjIaSQVS0TVDFl/t+dsYkYaSAigq9f/8yWXIRPsoUi9C+i2ENY2F/AwlWhaLkNzF0n4vcrthiz0OlxXA4aEOPEKGUkckzngJd/mKRA3K2w0aprf4jHMtz3yzRXXnDkakOxWRcoN651LTN8l67sQ2lKyA2sVNwweUP/FPN5RUkjaj26Sci0Dvu+soh0IHiXyE3K8BNDDXlZswV/peWmqt7NwZxLO9Pwl6lEB0+ckGoXJiBaVlhgPUQMafBQDJGjC9gS6pk6hbQ8QDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/WITnoB2inaLbaJX02D9zOEJin+aUqaAEOe2KuvSRp8=; b=gK8vmOAK3FLa+GBMRWgco8BNwZHjWfFy/AQ6BBerR/pOLMNIyPG3MSIStU1Abpmnj7yW3SsmDGXFAVTDu3IsM0cCHKjl1nuX743W9m4NQl86oHNC0kiAbNI877YhXvJan/oXa007E9IpZtnTEz7pyWtGK57pFQcKWzon32NZK67VYerVVDRzGfLvzWBxToLfp5YlcHqr9VQc7SsZlxtgm5sKIiCJtlioCItltWilX/zhmKfGjSAlXQwUHtR4wYe4x2MyavG/7hJjUatyho2vL30Jq/i8OkA7DXzHx/CYmWfJ48cQ/b5iQBx6tBUybVcksX/2KxtChqJonTCQi9bwVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:25::10) by SHXPR01MB0878.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:1e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.28; Tue, 30 Jan 2024 05:58:50 +0000 Received: from SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn ([fe80::148c:e1dd:302a:196b]) by SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn ([fe80::148c:e1dd:302a:196b%6]) with mapi id 15.20.7228.022; Tue, 30 Jan 2024 05:58:50 +0000 From: Changhuang Liang To: Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: Ley Foon Tan , Jack Zhu , Changhuang Liang , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 1/2] dt-bindings: interrupt-controller: Add starfive,jh8100-intc Date: Mon, 29 Jan 2024 21:58:42 -0800 Message-Id: <20240130055843.216342-2-changhuang.liang@starfivetech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240130055843.216342-1-changhuang.liang@starfivetech.com> References: <20240130055843.216342-1-changhuang.liang@starfivetech.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: NT0PR01CA0006.CHNPR01.prod.partner.outlook.cn (2406:e500:c510::8) To SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:25::10) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SHXPR01MB0671:EE_|SHXPR01MB0878:EE_ X-MS-Office365-Filtering-Correlation-Id: 406087dd-c546-4ba2-8524-08dc21588829 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 075SCM2BfAxPxveIG4Eporp41xi5YoMFXPVk34kFSfcfvj1PyDeyG6K0t6LF5XMDzDnDU2zk9UJZYgfSMULeqPwCworOs75zRlfjNADKCgqqVQsYZUPoe57XnGbaA3P3FyYdZ7wwSyR/vMlLQ10S78yqn9FmGX9YPuKc9o+5vLU3GGNDfGlJI0A9RB/Ceg1bW/TOHoSf+N6cnQqN/7UpruGkf//U9qRAla9eDrfxWYlZug8TnH3PhmYLJNLTdjgYUkGMoYRZNYL4yzF6FYYLPkYJIWeAn09k7R7PiKgI9uCX6BVGRs32r9freA7RXTEmZ2ifIAD7pflcoLaOKgzlZ5Ep3I9fp7YQhvTk4y/NSD8OW9gGbIQiFSXUJRG1BCExe/ABZFAZxvQs1gSOtFxEee/4pt8RINmDsBFPxsdjl/9UgSAVRNtLjVpYqdQTiAhZDzRKIBvYNN/DXSIYYIhVccrzf/zwuzWvD4qQ4uuKDMbKPapBh+6hiS8nB4Eykug0QM4PAUN+4op+4U0wb+UNOxoXh2arl8sSfeJxLYdz7GMYanpGCTyVzFHf+v6tnXV1tAxvRbBOJYA+4jP+g67xq1IRU5P4yOxwEU+4DwRvu48= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230031)(396003)(346002)(366004)(39830400003)(136003)(230273577357003)(230173577357003)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(26005)(41300700001)(1076003)(41320700001)(36756003)(38350700005)(2616005)(508600001)(40160700002)(40180700001)(54906003)(83380400001)(52116002)(6666004)(966005)(38100700002)(8676002)(5660300002)(110136005)(86362001)(66556008)(66476007)(4326008)(44832011)(2906002)(66946007)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?7G3+02eqoec4Vl5lp5BC/oXOF4urikTnYZlWQGi1U+OKuppGYDjhBlT+VUDF?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aoszHaM+0MwE9m3wtP?= =?us-ascii?Q?DzcG6KAwAOX/2hEFS6geHSl4TM+CALoBDygL5605QLWNl5yYHRAR8a67ni9P?= =?us-ascii?Q?6gQspEVlL9uG8ABY3QbGUx0oFI1nAoyqqDuIT7g+BS1BqkS6UBCt+DHtT2VW?= =?us-ascii?Q?gwutEosytRuSsgeOvNfTuT9QBNdB8LwxGahShP20mO4cVQAKjEjx2aFg0V7d?= =?us-ascii?Q?/JgR6uom/QdMD+Q2PpwPKyZs4oFO2eM2+O8hNb6r1VadG/GmXxFsM1ENRvSK?= =?us-ascii?Q?PXWCi7wS09SIg/FrWnXpvDpHOrZdbwVKTpHnINn4ZDUUBzIyhiJ6qUQkw8SW?= =?us-ascii?Q?znRYKcRCvhj5kaSbfhnemUk+wmW2NzwCy5coUYJk3deoj1FuBmFrftNyJcbg?= =?us-ascii?Q?OZFy4c21uPeMve5SbthkxhfzYJ7r/fzBmf1vsw80bRdyAB98B6+0SJ0OMP2F?= =?us-ascii?Q?di/KHj483nEYtbp/H3sMXkYXYO6Zbb56KGIoPaZMMPLVUbE7ZcVKG9MoHvBV?= =?us-ascii?Q?mhUUvYCedjko+d26vMaRJlY4OmSxVxQ6/NqSyKg4KhXIlVo4gvQ0EXHGp/90?= =?us-ascii?Q?5kGWSu/cXTxJG6ZkozoMaf40Xzi+Znzj2TczxiO8qUrKs3qVoX5TbwJdKB/b?= =?us-ascii?Q?aIh9t9SjDDDiaOjRKPM23hHTZND/oXYa98lA7o66t1vJs+NSf1cdcqoxJTA+?= =?us-ascii?Q?0BFvJM5Rwz7m5sQwMvdwqmY=3D?= X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 406087dd-c546-4ba2-8524-08dc21588829 X-MS-Exchange-CrossTenant-AuthSource: SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2024 05:58:50.6182 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WQE8kAgjBUkic6TIcAjUSq7OistxClxjw8dkSdX/gN0i7tbtOgcoGMeqzaQwELYfpAS4FVhSx98lEqy3xH/XaEtsL/30tC7dENS9ZZDXyD3zdQx4q2cRCqYrEvlPdApV X-MS-Exchange-Transport-CrossTenantHeadersStamped: SHXPR01MB0878 Content-Type: text/plain; charset="utf-8" StarFive SoCs like the JH8100 use a interrupt controller. Add a binding for it. Signed-off-by: Changhuang Liang Reviewed-by: Ley Foon Tan Reviewed-by: Krzysztof Kozlowski --- .../starfive,jh8100-intc.yaml | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/= starfive,jh8100-intc.yaml diff --git a/Documentation/devicetree/bindings/interrupt-controller/starfiv= e,jh8100-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller= /starfive,jh8100-intc.yaml new file mode 100644 index 000000000000..ada5788602d6 --- /dev/null +++ b/Documentation/devicetree/bindings/interrupt-controller/starfive,jh810= 0-intc.yaml @@ -0,0 +1,61 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/interrupt-controller/starfive,jh8100-in= tc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive External Interrupt Controller + +description: + StarFive SoC JH8100 contain a external interrupt controller. It can be u= sed + to handle high-level input interrupt signals. It also send the output + interrupt signal to RISC-V PLIC. + +maintainers: + - Changhuang Liang + +properties: + compatible: + const: starfive,jh8100-intc + + reg: + maxItems: 1 + + clocks: + description: APB clock for the interrupt controller + maxItems: 1 + + resets: + description: APB reset for the interrupt controller + maxItems: 1 + + interrupts: + maxItems: 1 + + interrupt-controller: true + + "#interrupt-cells": + const: 1 + +required: + - compatible + - reg + - clocks + - resets + - interrupts + - interrupt-controller + - "#interrupt-cells" + +additionalProperties: false + +examples: + - | + interrupt-controller@12260000 { + compatible =3D "starfive,jh8100-intc"; + reg =3D <0x12260000 0x10000>; + clocks =3D <&syscrg_ne 76>; + resets =3D <&syscrg_ne 13>; + interrupts =3D <45>; + interrupt-controller; + #interrupt-cells =3D <1>; + }; --=20 2.25.1 From nobody Tue Dec 23 23:49:45 2025 Received: from CHN02-SH0-obe.outbound.protection.partner.outlook.cn (mail-sh0chn02on2062.outbound.protection.partner.outlook.cn [139.219.146.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 592AB38F82; Tue, 30 Jan 2024 06:32:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=139.219.146.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706596346; cv=fail; b=c7ZgTV85LK63PEFQ1we5m3z7MoUWaBNx5+c9FFL9avnYcch10XFhBkHmQnl78HJq9VCvT4z7iR6dUGfxahLwc9paFqwVLJq9jb1Loq06AzRlw4sqeurXNB3b4wJJKTmFnoytPz9FOLq/7el8OliqMFYW5110XKEawdQemJ6XBw0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706596346; c=relaxed/simple; bh=yk7frkv5danfETUUdgxdaQ4ybQ0Q614XCBFahvs9iQw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=U7xFYaRt5n2eiHCjfpD8Q5eaUYChSxDnUeRsuqXQYCYoY0/HmcA3VNPUAH604OuPEb24d2Zk7vTuZRUb1B8vqJAvahVaH61xPQ/m74d7G0Q1PgFcK3UIhiXz9/TI7HNum3kt9g4gVHJ8/oGPiKUkpjA3uXitqP8bGZsLBydiL28= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com; spf=pass smtp.mailfrom=starfivetech.com; arc=fail smtp.client-ip=139.219.146.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starfivetech.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H+qXNmq7mHy+u+EQ3+R9uS2mEiSJ73a8E6vGtzjwQK+Rb23eYQU2yQQReUCdbMnKIPVRj3S8As+2JSpTd2v9t3j4SiFEzewMuoWBPTjIImDZIk4QuP9gfsoMvOcggGkSNBTNfOTHLTGO1m0iP1z9B02t+ny3h3sg+LdVRtwjleQuYGDWNL/xkE2Xa7gWZgENyB1goNdj3YFDed6jVb1fHLECV3Rtmf+X/XmVaArYxi/jnIhSR/14ZWHQRZpjy90Akg22boDYJZYYpK0Lt3fyxhcYyFtc07I4ZbRgnCUrsxDzH6Wpt900+A4lV9ozGRovIv/k2//v6eApH/iJiRsRPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8mGUyLJl1yAY6240/Gzp6AVO3eFqx0inKkbU7vmNsqE=; b=Io2Qr3D6br0VvswFTa3hzvoU5i9QZVK9N2XqWHof0hiaycFWsAbIRbVKGyQtGr5/M3Rzaoy6c0XwpwuG+53XODtlkFP+iukAB+UVkLR2s+bmYXM1voyso852nAquzlxOlpMJTrSwWR3BSedk+p6G1PH36C6vpNhe+P4EqrCm+wTDRGry0DeHLLoEKGao11T1LqtaBJlZri+Yzw2cW/xNvumUpSflcQRb6JY6aM5WnrUzh4cxQdV0XH+wKclTGnh2fDTD/nyLsSazpviBf4Gn3ekWYl1e8STmcUNGt9SencJ7ZDkOpZ5hzw04gwX7J0oXgRmbxTtHiQGgpPnrC8fahA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:25::10) by SHXPR01MB0878.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:1e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.28; Tue, 30 Jan 2024 05:58:51 +0000 Received: from SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn ([fe80::148c:e1dd:302a:196b]) by SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn ([fe80::148c:e1dd:302a:196b%6]) with mapi id 15.20.7228.022; Tue, 30 Jan 2024 05:58:51 +0000 From: Changhuang Liang To: Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: Ley Foon Tan , Jack Zhu , Changhuang Liang , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 2/2] irqchip: Add StarFive external interrupt controller Date: Mon, 29 Jan 2024 21:58:43 -0800 Message-Id: <20240130055843.216342-3-changhuang.liang@starfivetech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240130055843.216342-1-changhuang.liang@starfivetech.com> References: <20240130055843.216342-1-changhuang.liang@starfivetech.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: NT0PR01CA0006.CHNPR01.prod.partner.outlook.cn (2406:e500:c510::8) To SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:25::10) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SHXPR01MB0671:EE_|SHXPR01MB0878:EE_ X-MS-Office365-Filtering-Correlation-Id: 153e6806-d3e0-4d5a-43c2-08dc2158888b X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6sQyF50dEMIkxakgP9qCXHGfJf/dbprsohGwuViZzTzvZ7c2yZnEB6C2XEECLioo4C64lgvKfezNY46U54oqxKUxAKhuyNdVIvkzyQkWtf0mCUb8OltBHIS2USZTmPM3nr9Sg+dhuM3N+J83eeVh258j31dviiIiuIFUSHCJcsxOCo3dSyX9UC+7up0ROoQ6YwttO/11wH8QTd8rJe/P+JeC8HVmLksSMSr+izNMVFQnYIRcy3+xzMUW19Tj6SDA/hHKN/OlwSHWWS1FALzux/1X2gEqRoBue2jcmbld6maN/yFJ2/vQUfQS1D4AKFsVYj5CewpusdOOwSmeohmlQ84LPHIJcvRoAJtV/u71vbiyI3Fb6f1QDX+6ZDYh4UHPEfGfMXA46I5Kj3+z5gqCKyEUYdc1eccFuyFboQd1nN9192vhB63Hp3XokvIOG7DUIRPZjW64m4CVQ7gf84AR5IUc0dlWyxoj140s7IRpqKZ6ADQi+MA01kdYRP2qU87eW8w+KyZjiYOOukLPzLlwv3rVa8sVtNqzPz9GZSNnc1TjHx9/xBTu1RU9HZtqygdKXe8OLW3hQmXXdHoKgRSAbM2Logk8QXtYTefWuvunlj8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230031)(396003)(346002)(366004)(39830400003)(136003)(230273577357003)(230173577357003)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(26005)(41300700001)(1076003)(41320700001)(36756003)(38350700005)(2616005)(508600001)(40160700002)(40180700001)(54906003)(83380400001)(52116002)(6666004)(38100700002)(8676002)(5660300002)(110136005)(86362001)(66556008)(66476007)(4326008)(44832011)(2906002)(66946007)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?yJZcHg3MqUTHoDXdBhk3aDFnjJafDP8b8comWMe2rqHR7eobeAjX65anO8h7?= =?us-ascii?Q?sBkQMx54tkDzHc002iwGmpYOy9nwXHPsmy+eenwXqf7qLtRZBjMA3hmeoVSU?= =?us-ascii?Q?uGabrD5R0XO4cLmVid3XqBR31P/po8Mk59OwvELTLLhbbIYa1G61T2C5wowD?= =?us-ascii?Q?XJvNTqp2F7+eQ0/d8aHpMr1Ih7YIjT8uue8V6HN4zFga7HD7lZeKwK7r8C1x?= =?us-ascii?Q?ZDB6GZ0v37Wfw+Nk7LUrfHiuMtGKPjmQ6VLb+fJp3FJmBusX3aQa3MDfeGHx?= =?us-ascii?Q?l9/bzxFG4hRy3YDbKmztwVZkQkpF3+Bfo9VS34AfmmwH2Oo7uHUOzYpwbYCy?= =?us-ascii?Q?vNtOcpcs7Wj6iLUsAo+9s54ZveFh0gK0PS+fpw1ZAwR58nvqtQCh8FU86MGX?= =?us-ascii?Q?x2/okiPsltk3BnmYCyzE5vMkbzxgREtRgzmx7quWYx4KzF8EO6xAslgtFCJw?= =?us-ascii?Q?tfyTVW8kR62HluH3iGHYcyKw10ikxJRs+SoJyI1v/wfZNf6eV0bECrStNKhY?= =?us-ascii?Q?fcK1XEQ1RIPk64c4+ggjF1WubyGKahaH9f54WZZwibASygFQVSSZDzot/ssM?= =?us-ascii?Q?Bu8nOwbdQIdj7y8wTqUNzHfCJDc04VaNV8HhxPQlDnuwO8OR7LL5CULn/Osm?= =?us-ascii?Q?JUSzvqVmuCFRLkDsl4B/lkAl28M+hzW3j25ODB7DroqEJgU9FZEXPXa3j16U?= =?us-ascii?Q?2mw9pE7bNEJ0gg0zFhe+7b9CP6jqCidBt8rrKMqj8Qt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c=3D?= X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 153e6806-d3e0-4d5a-43c2-08dc2158888b X-MS-Exchange-CrossTenant-AuthSource: SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2024 05:58:51.2728 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: W7Ht1j+BStyO6XlMZ85i6lhNHM+pNU78urFyFd/XETKut/qh4bFPQMemtr75OKpDJQTizSh1p7DdUBlKRDYJT5Lce1Ii8RCV+frK4PI2maAveKFubIHnUh3BGjluTC3c X-MS-Exchange-Transport-CrossTenantHeadersStamped: SHXPR01MB0878 Content-Type: text/plain; charset="utf-8" Add StarFive external interrupt controller for JH8100 SoC. Signed-off-by: Changhuang Liang Reviewed-by: Ley Foon Tan --- MAINTAINERS | 6 + drivers/irqchip/Kconfig | 11 ++ drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-starfive-jh8100-intc.c | 180 +++++++++++++++++++++ 4 files changed, 198 insertions(+) create mode 100644 drivers/irqchip/irq-starfive-jh8100-intc.c diff --git a/MAINTAINERS b/MAINTAINERS index 8d1052fa6a69..ef678f04c830 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20956,6 +20956,12 @@ F: Documentation/devicetree/bindings/phy/starfive,= jh7110-usb-phy.yaml F: drivers/phy/starfive/phy-jh7110-pcie.c F: drivers/phy/starfive/phy-jh7110-usb.c =20 +STARFIVE JH8100 EXTERNAL INTERRUPT CONTROLLER DRIVER +M: Changhuang Liang +S: Supported +F: Documentation/devicetree/bindings/interrupt-controller/starfive,jh8100-= intc.yaml +F: drivers/irqchip/irq-starfive-jh8100-intc.c + STATIC BRANCH/CALL M: Peter Zijlstra M: Josh Poimboeuf diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig index f7149d0f3d45..72c07a12f5e1 100644 --- a/drivers/irqchip/Kconfig +++ b/drivers/irqchip/Kconfig @@ -546,6 +546,17 @@ config SIFIVE_PLIC select IRQ_DOMAIN_HIERARCHY select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP =20 +config STARFIVE_JH8100_INTC + bool "StarFive JH8100 External Interrupt Controller" + depends on ARCH_STARFIVE || COMPILE_TEST + default ARCH_STARFIVE + select IRQ_DOMAIN_HIERARCHY + help + This enables support for the INTC chip found in StarFive JH8100 + SoC. + + If you don't know what to do here, say Y. + config EXYNOS_IRQ_COMBINER bool "Samsung Exynos IRQ combiner support" if COMPILE_TEST depends on (ARCH_EXYNOS && ARM) || COMPILE_TEST diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile index ffd945fe71aa..ec4a18380998 100644 --- a/drivers/irqchip/Makefile +++ b/drivers/irqchip/Makefile @@ -96,6 +96,7 @@ obj-$(CONFIG_CSKY_MPINTC) +=3D irq-csky-mpintc.o obj-$(CONFIG_CSKY_APB_INTC) +=3D irq-csky-apb-intc.o obj-$(CONFIG_RISCV_INTC) +=3D irq-riscv-intc.o obj-$(CONFIG_SIFIVE_PLIC) +=3D irq-sifive-plic.o +obj-$(CONFIG_STARFIVE_JH8100_INTC) +=3D irq-starfive-jh8100-intc.o obj-$(CONFIG_IMX_IRQSTEER) +=3D irq-imx-irqsteer.o obj-$(CONFIG_IMX_INTMUX) +=3D irq-imx-intmux.o obj-$(CONFIG_IMX_MU_MSI) +=3D irq-imx-mu-msi.o diff --git a/drivers/irqchip/irq-starfive-jh8100-intc.c b/drivers/irqchip/i= rq-starfive-jh8100-intc.c new file mode 100644 index 000000000000..344f7d871518 --- /dev/null +++ b/drivers/irqchip/irq-starfive-jh8100-intc.c @@ -0,0 +1,180 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * StarFive JH8100 External Interrupt Controller driver + * + * Copyright (C) 2023 StarFive Technology Co., Ltd. + * + * Author: Changhuang Liang + */ + +#define pr_fmt(fmt) "irq-starfive-jh8100: " fmt + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define STARFIVE_INTC_SRC0_CLEAR 0x10 +#define STARFIVE_INTC_SRC0_MASK 0x14 +#define STARFIVE_INTC_SRC0_INT 0x1c + +#define STARFIVE_INTC_SRC_IRQ_NUM 32 + +struct starfive_irq_chip { + void __iomem *base; + struct irq_domain *root_domain; + struct clk *clk; +}; + +static void starfive_intc_mod(struct starfive_irq_chip *irqc, u32 reg, u32= mask, u32 data) +{ + u32 value; + + value =3D ioread32(irqc->base + reg) & ~mask; + data &=3D mask; + data |=3D value; + iowrite32(data, irqc->base + reg); +} + +static void starfive_intc_unmask(struct irq_data *d) +{ + struct starfive_irq_chip *irqc =3D irq_data_get_irq_chip_data(d); + + starfive_intc_mod(irqc, STARFIVE_INTC_SRC0_MASK, BIT(d->hwirq), 0); +} + +static void starfive_intc_mask(struct irq_data *d) +{ + struct starfive_irq_chip *irqc =3D irq_data_get_irq_chip_data(d); + + starfive_intc_mod(irqc, STARFIVE_INTC_SRC0_MASK, BIT(d->hwirq), BIT(d->hw= irq)); +} + +static struct irq_chip intc_dev =3D { + .name =3D "starfive jh8100 intc", + .irq_unmask =3D starfive_intc_unmask, + .irq_mask =3D starfive_intc_mask, +}; + +static int starfive_intc_map(struct irq_domain *d, unsigned int irq, irq_h= w_number_t hwirq) +{ + irq_domain_set_info(d, irq, hwirq, &intc_dev, d->host_data, + handle_level_irq, NULL, NULL); + + return 0; +} + +static const struct irq_domain_ops starfive_intc_domain_ops =3D { + .xlate =3D irq_domain_xlate_onecell, + .map =3D starfive_intc_map, +}; + +static void starfive_intc_irq_handler(struct irq_desc *desc) +{ + struct irq_chip *chip =3D irq_desc_get_chip(desc); + struct starfive_irq_chip *irqc =3D irq_data_get_irq_handler_data(&desc->i= rq_data); + unsigned long value =3D 0; + int hwirq; + + chained_irq_enter(chip, desc); + + value =3D ioread32(irqc->base + STARFIVE_INTC_SRC0_INT); + while (value) { + hwirq =3D ffs(value) - 1; + + generic_handle_domain_irq(irqc->root_domain, hwirq); + + starfive_intc_mod(irqc, STARFIVE_INTC_SRC0_CLEAR, BIT(hwirq), BIT(hwirq)= ); + starfive_intc_mod(irqc, STARFIVE_INTC_SRC0_CLEAR, BIT(hwirq), 0); + + clear_bit(hwirq, &value); + } + + chained_irq_exit(chip, desc); +} + +static int __init starfive_intc_init(struct device_node *intc, + struct device_node *parent) +{ + struct starfive_irq_chip *irqc; + struct reset_control *rst; + int ret; + int parent_irq; + + irqc =3D kzalloc(sizeof(*irqc), GFP_KERNEL); + if (!irqc) + return -ENOMEM; + + irqc->base =3D of_iomap(intc, 0); + if (!irqc->base) { + pr_err("Unable to map IC registers\n"); + ret =3D -ENXIO; + goto err_free; + } + + rst =3D of_reset_control_get_exclusive(intc, NULL); + if (IS_ERR(rst)) { + pr_err("Unable to get reset control %pe\n", rst); + ret =3D PTR_ERR(rst); + goto err_unmap; + } + + irqc->clk =3D of_clk_get(intc, 0); + if (IS_ERR(irqc->clk)) { + pr_err("Unable to get clock\n"); + ret =3D PTR_ERR(irqc->clk); + goto err_rst; + } + + ret =3D reset_control_deassert(rst); + if (ret) + goto err_clk; + + ret =3D clk_prepare_enable(irqc->clk); + if (ret) + goto err_clk; + + irqc->root_domain =3D irq_domain_add_linear(intc, STARFIVE_INTC_SRC_IRQ_N= UM, + &starfive_intc_domain_ops, irqc); + if (!irqc->root_domain) { + pr_err("Unable to create IRQ domain\n"); + ret =3D -EINVAL; + goto err_clk; + } + + parent_irq =3D of_irq_get(intc, 0); + if (parent_irq < 0) { + pr_err("Failed to get main IRQ: %d\n", parent_irq); + ret =3D parent_irq; + goto err_clk; + } + + irq_set_chained_handler_and_data(parent_irq, starfive_intc_irq_handler, i= rqc); + + pr_info("Interrupt controller register, nr_irqs %d\n", STARFIVE_INTC_SRC_= IRQ_NUM); + + return 0; + +err_clk: + clk_put(irqc->clk); +err_rst: + reset_control_put(rst); +err_unmap: + iounmap(irqc->base); +err_free: + kfree(irqc); + return ret; +} + +IRQCHIP_PLATFORM_DRIVER_BEGIN(starfive_intc) +IRQCHIP_MATCH("starfive,jh8100-intc", starfive_intc_init) +IRQCHIP_PLATFORM_DRIVER_END(starfive_intc) + +MODULE_DESCRIPTION("StarFive JH8100 External Interrupt Controller"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Changhuang Liang "); --=20 2.25.1