From patchwork Wed Feb 21 02:26:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changhuang Liang X-Patchwork-Id: 203864 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp790362dyc; Tue, 20 Feb 2024 18:27:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXmR4XvmSHggqSn1MW4VPEZU02/jFCLG6y3sPU6+JBEJKhOkslFpS3Q5FCM6yycSfiONi0GOeyrR18frOoO9DlD7s708w== X-Google-Smtp-Source: AGHT+IGLduRCxZZB9KcwRAYPlURdnCg9215HLMxaufhKdvQn7LyJbOlBPCbc6mcV0Kv39fGyMTj1 X-Received: by 2002:a05:6358:3a04:b0:178:f895:5978 with SMTP id g4-20020a0563583a0400b00178f8955978mr24618232rwe.10.1708482472868; Tue, 20 Feb 2024 18:27:52 -0800 (PST) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id fn13-20020a056a002fcd00b006e085b3c0e8si6291144pfb.236.2024.02.20.18.27.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 18:27:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73953-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-73953-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73953-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 19A77B2352C for ; Wed, 21 Feb 2024 02:27:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 839ACF9FD; Wed, 21 Feb 2024 02:27:18 +0000 (UTC) Received: from CHN02-SH0-obe.outbound.protection.partner.outlook.cn (mail-sh0chn02on2107.outbound.protection.partner.outlook.cn [139.219.146.107]) (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 A9BD7FBF5; Wed, 21 Feb 2024 02:27:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=139.219.146.107 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708482436; cv=fail; b=CFukQzy3KtE0PhH1anbt6noohUBMI9d41VEKhj8/Eze/keFdsK6Izv3v1sIiz0+M1xCdex5B13a5+R0N3SvHtzkh47pUCSnD7HyoYs+eJoM+HLnU8Qr61v/Cbe1NdvnWFjdPapVs2AbZSkJ93O7Hn013zwRLezRJRF/3GZ273QY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708482436; c=relaxed/simple; bh=0yiPhBPD0XmSqNgTotKrvpZyiaRRfpNFEnfcDBEKB/Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=XTN+kC9ak4CpG0a9fKne0lk3Y+pkRmIizaGaPMBiHf62VNjy0Ica63QCb5biL3CD+v2V4cNWGkXDjZYHdLS52LWNM8ydVK8Yfel3gw+AhnoCf7qOmDFUpPxarwUWtf82PnxxwaTn10tk0ylF9cTFkhv7FlPWIrJDsNvIHtR/FlM= 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.107 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=bYphHt/ZE7/WW4oMho8/nSdDgTuiUXqTL/KirQi1FoMR058jgIzc0BpieXoL+OxLERzI8iqq+HuGa/8KXNEK9xIjwf8uX/wSuFN+z+Ih0gSCMwoZyPvuWKEhFOkgeSIFFL99yadZQbM74K5CIPKp4t0eUz0bPQZTC3FbreUFd0r/Ng6YXDOJdXjgGZcsFHzCG6wN8A1736EoZQR6ByA9MYxCj3MLARqWtb82AsLn/bak4KMctUNDPq5RaRUcqXveX51UIhoUojE+3vh2ZAbyISr5fyXQ4NqVW5o9aBdBln4qR0TI4d4TB0hmdC/nMGO2SVlwrxLCnw30emA/TekJOA== 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=Hu884T8+8lxMoJ5vmreoSi9FzRwH0ODEDDVKYJPMDma4Uo4v2UEc3y5Lw5Xn6C7HhdL2Fs92PM6uchF/68NqOyWnoYzHbv3bLgCeUsHQpuJy6bbdeMkENuEylEmS8lqIIgyRqGG+1sgH5jAgkYf76TUJgryjQiaxQKAyRTbwUl/8JKw6h/pTY9OqQAcmtCQ/WB4jHrVd32Vp3ZmZe53dlQ69OZ4JGBlJQg8oYieIzGTda+GJp99AlrO6nzxeNYQiCdj8Tu9ENxbIUgBHcv1qT9Si0n//4kgpePjPWIW8weUjJo9bnW9w07+JStbKy8aTlktUmQ6Sk17IKdNYclaUZQ== 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 SHXPR01MB0541.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:1d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.47; Wed, 21 Feb 2024 02:26:57 +0000 Received: from SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn ([fe80::b0af:4c9d:2058:a344]) by SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn ([fe80::b0af:4c9d:2058:a344%6]) with mapi id 15.20.7249.041; Wed, 21 Feb 2024 02:26:57 +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 v3 1/2] dt-bindings: interrupt-controller: Add starfive,jh8100-intc Date: Tue, 20 Feb 2024 18:26:46 -0800 Message-Id: <20240221022647.5297-2-changhuang.liang@starfivetech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240221022647.5297-1-changhuang.liang@starfivetech.com> References: <20240221022647.5297-1-changhuang.liang@starfivetech.com> X-ClientProxiedBy: BJSPR01CA0019.CHNPR01.prod.partner.outlook.cn (2406:e500:c211:c::31) 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_|SHXPR01MB0541:EE_ X-MS-Office365-Filtering-Correlation-Id: 0698c184-d017-4e57-a605-08dc328493a3 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FRc5WpOotvYnCnEYnk5jLIAC0lz8JX/HitHeg4Rs/LaDbd4U7APzS36TJoDRClDCzX4S39ScC7wSVOfrzXXYuJpBzy69TMgpv0B9lv7WlmcAc7ymE3T3MZEvcYxASqu8YOecBVw/v8ahtEb1LAP6rMreVn01sjs7aMTpBMfe+bSbXnG690TkWV5/+573BmDwAMBVgQKjE00CnObQXLgQ6z4gorRxYsmccGMpRZK78lFFrq6kUASr/vQza0Xph33gTUhr+WfKR+3ewiCjEjXlOx5TSb9HKQfP/kZMBaWgK1NbtE02dDocODlBpAbaIq3wTukR3QDmdWZOw6wrwBGoxWYAzNsVkcImzefDecqf6Clim1WTLZQYRbPEiNlCmfkSAXYUzdbjW5S5cSD8j08pZAi8fuRyPA/HVwdXitKCyNfVRMLOoNTGOWgx15Kuie/j6vbmAMz/fqYsuCjaNIkhXDrfX3kOXhRDYpEj2NcfunOCSAUEbvv5X7ddmMpcG08XCMutO2yTPZEbkVsiDrrggFRqbeuB96S0Lab5PaMD1JZHg1XJQ0PEPmwyvCxQgg5f 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)(230273577357003)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DVIWLxGACHa1VkGgzINQsXB5ERRI+WtbEBEClutGuphW0MeHOegrKr7bbRqWNQw9KECCkHHQJmDN/WlDX7bhN50gDqE80VM+i4azBQno0JhUV57EVZ3qVjkz/I8RkNhmczsDe7RZHJz4hb8bcmBcv0y01GPgMM6Sla7vDuwW6G7y8BDqarE8YgsRxZWifrrLQgJzi+dDnZcj8bUPzcYDk2Z8Wl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R6vlAIY4ybfgtUpxSNC+FW97Oqzp/zVmgGsVk9/zmuqtNjWMil5UED0vKkytdjpLE/AklZDR3MjF8fuBX+gDNs4Bw7/BePStniy54YCW678+W23tH/gnA2YE70Up23n91u6TfR87pggsrcaUKY6GoZ1K/z45QXb5KTNTo+aPuhNB1cIVQi3P/2OHHh0sLxKk2q+Iu+1+qfy2WoN34vw3SOt/gtcXID90/VYKfobBTsCqBkmlmNZSKRjTRckWLCbcnWzvGvKuO4ShBZ9o7QyX1Rq7kFsDaDcoXZzs5LYlJPezGZo9rkheJD8xhQvYMKvroqXBpXZmcSkK3kvrsTJ+ReWOfZo40LMEc0k= X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0698c184-d017-4e57-a605-08dc328493a3 X-MS-Exchange-CrossTenant-AuthSource: SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2024 02:26:57.4793 (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: +ALY7mwbUhGr+4IgZypD/YXXDsXsIJMQAET2f0v+oOdrpVOog94Vzc5XAUwSYY85hDfxf6eBiRTAT+Swg8GWjv3J+K4qKoZZRbzI6F3GcOMiM8M+DH4eYn8uIHgAysP8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SHXPR01MB0541 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791473717086745268 X-GMAIL-MSGID: 1791473717086745268 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/starfive,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,jh8100-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-intc.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 used + 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 = "starfive,jh8100-intc"; + reg = <0x12260000 0x10000>; + clocks = <&syscrg_ne 76>; + resets = <&syscrg_ne 13>; + interrupts = <45>; + interrupt-controller; + #interrupt-cells = <1>; + }; From patchwork Wed Feb 21 02:26:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changhuang Liang X-Patchwork-Id: 203865 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp790386dyc; Tue, 20 Feb 2024 18:27:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVieFGLr3I1rrxkHA7iJTy7QzVqOF5ROYTrKxEVweewB2/lMxxpBya6Vc8tPmGwEPH9X3EklS3OOB5aVYsDCdZk61rKkA== X-Google-Smtp-Source: AGHT+IGWyixpK4h88PUna5mfcAmRh2VzhyLj1YNDpNm2z3Wszuwy2yOCbgeoWdyvJILeAl3b1wWj X-Received: by 2002:a05:6a21:6315:b0:19c:8505:a232 with SMTP id wu21-20020a056a21631500b0019c8505a232mr18250155pzb.40.1708482475546; Tue, 20 Feb 2024 18:27:55 -0800 (PST) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id jb18-20020a170903259200b001dba356b96fsi7067678plb.420.2024.02.20.18.27.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 18:27:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73954-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-73954-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73954-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5B6AD28594A for ; Wed, 21 Feb 2024 02:27:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D583C17C67; Wed, 21 Feb 2024 02:27:21 +0000 (UTC) Received: from CHN02-SH0-obe.outbound.protection.partner.outlook.cn (mail-sh0chn02on2107.outbound.protection.partner.outlook.cn [139.219.146.107]) (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 8E0BA154B1; Wed, 21 Feb 2024 02:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=139.219.146.107 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708482438; cv=fail; b=JLWIRVP0wajZqzcfcGRbW54210HbgDDjqoEgcyG1fuqKMUN3nn/++jIt4pWBvGq68Rt526fkvUwfe/h6e0Mjus8MHLDTxG29IvNT+4NqEDTxCD+/gqIkPGwbKJnPmaLyDAf0zKS1XDEqvcPqJCDn/pFr2RvYEOdp/UOZGXZIrdg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708482438; c=relaxed/simple; bh=ZE0Gm2H+R05ae9LneQuPHiJAJ/fZ02DBSgPAltY/Bvs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=gVbjP4qUQ7BcvBOOCDZhwzKQItA+wPxPYhvh3z72cZFsdRqXuFx+uFZGqdTBtH5WRcWtWAqjJZeFeX6N59cqSs3Vhq1elfUWXoWgvHZpgsT9wzvuisZ5sXDaEeEWjZLAw0yuRt4/8OCbQ3bh+On+vbSELN3gEahDsKHqgCCUPaE= 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.107 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=l6x7ziNT3IkcJY/gICyQ9PB66+dTNhsGpsx014FgRpn9hNCXJenM0R/Pr4/Znu40uDkwXMgNmtj9lb2W96hnixxxi8QE4BydRsjw9oPY1VXDO3ZlEqdlvvdE03s5PWapNGAqloLQsZmU1fDoIur7EKHs8F3GvNLIS0SGvKQAFnLUzwxUuhV2ZXuFCuAK5uiYBuun7irLS/sUucE/4Zvb70pwaYEEuQndaUEumZen6ArXRBSdQttsD3WZU1QW9H0388efQvEPB/XcszxS7iPFzM3freI32xt82yMJQHjPfJqhxMqUpq4B64BfuSywr3SYNXTs2JEqBaHqzPEHbBiUlA== 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=n3J7vJaxM3jUR4q2zFdrL8tMpvILc/3hyS2EV4Da33U=; b=ZtuxRYII+dGq5YcC0S2Gwkb8cIBKvOZlLWjcz4vu9apG4HQHR6f9gcKz4GUVQCy1ijz4aDXLgzpfgvlwIov9ojjjWEn19H2hhVBZKx4+Rkv0t9q8NO+y3iEFlqizXtipBu78v459CjcgbiNDDwR3lbM5OUOA6qDrlomo3NYBUqSC2mGS8YITj3ELA8uSechry60KShQVje8NexMjdOAB9HovINn0R/qkCB20mNo+0xmD55j9jE4MUStMa4DTCw56jHrJOcYdzkcAg5P6Nn8Tk+h7VNfB82JZFPOq+kTzJG5YwsuNETsyV3CneNsW864Q4eQypFxJcct2K9HV0Hf5Qw== 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 SHXPR01MB0541.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:1d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.47; Wed, 21 Feb 2024 02:26:58 +0000 Received: from SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn ([fe80::b0af:4c9d:2058:a344]) by SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn ([fe80::b0af:4c9d:2058:a344%6]) with mapi id 15.20.7249.041; Wed, 21 Feb 2024 02:26:58 +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 v3 2/2] irqchip: Add StarFive external interrupt controller Date: Tue, 20 Feb 2024 18:26:47 -0800 Message-Id: <20240221022647.5297-3-changhuang.liang@starfivetech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240221022647.5297-1-changhuang.liang@starfivetech.com> References: <20240221022647.5297-1-changhuang.liang@starfivetech.com> X-ClientProxiedBy: BJSPR01CA0019.CHNPR01.prod.partner.outlook.cn (2406:e500:c211:c::31) 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_|SHXPR01MB0541:EE_ X-MS-Office365-Filtering-Correlation-Id: f489f186-4bdd-4dcb-878f-08dc3284944a X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6Woz1ujBEkuwWc+292NIvwvvjMfx9O0fdHJivF1Mumje+y2xWSRYw5toBk6fUjoXdHnzx8WCtk+bLeY10xKFoo+Y0DO4o1bd+qJmS/szzYGD9EZcQNFO58XUhmtbGaFJ9gI7TvlpDxuwnxbziHSmii7zwd8WC1oL1scUMEXYMpwgPSZFQ2zXmjMReY2jDMSw83QZ/cbRPIp2RrghVjGbWoq6fASY1GtXEknFhJSp9bYDpPmadMct8mnamOJVP4s2RF4dLZ1B+ONeFmAISd3LkCRkIZR/1jXr9UCj1z6anKOHXtF13UxoMzy8/aTUlroXeavBN5nHA7LqhqTeCZcknn/7NSim+oElBE9ZV6oWGxbX9atnEYnkHLqGYHQheyvsTNclxH+ZG+jxQpCBrdODB0NJ+5XfV+wRKanWMnYMYBH1BLO5qyjGG4loRBZekhp44vqzVNJMrGscfKRl/LY7UZRi4AL+PZcqXPaW+ZY1k1Z5ejfR9ifBpPHSETcWYbmuB78K6nXEfczxcD0pQ/XEgy2I/1bwOgdEgfSKFGsivl2iHRvtfjYwxAWWVNKr8ScQ 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)(230273577357003)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xHfz9b23cDFwsQqY2KdXA7DSfQKtuf3e5fqVoVw5Uy+4AJtvcCLuxWDuG0cQNYeG+L5hv+mmauCdW8A/7tgPbIzR4OuBAl07kF/SErFFZkgMJv5YoHaKdnVXR1NGQ8ygaeSwZDmAcxWjQYYjHCe5go8leYh4t94YwZPGTJPfJfLF5nxVxJbqIcfQOOLOXJ71QVkB5/uwUddvp+f0QI2U/Us175T/y19gQkqv41H9MGcoNrPuAvFLpjSArbioJ6qkHlb9YY1vcmel2BQvFtAKbCgb5ifPaURCmj8oS7RmUN/wJ5r7IqdWciObtinJonKYHKaJziGgbDCp7NbiqqktNmEVBP2oPIrW8vn/mfWOz2gSifCMR3oR26ewR+dwByx7uXDnEs+VS0inYq3A8V12fRrS5JTZRcf4eltAB/R+F/WUPrdak+/furXDzUQTsqnBD/3oAS6eirgLFQRY97TLHLGPGWpfYl95sKnv9mL8MG9sy7SXm/m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jV9+o5qUP0q1XJt/0mklF+uVVoHcuQ6PClKJJ6QjZN1wiB5adCGu6wtYnc78iVXxt68= X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: f489f186-4bdd-4dcb-878f-08dc3284944a X-MS-Exchange-CrossTenant-AuthSource: SHXPR01MB0671.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2024 02:26:58.5937 (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: s34lNXclK3AHkJKJsWt6gfQwVIHRUKbW8Gqv7QA7diiQexHUEmptfWTssQdAR/h2IHDI5Hn3TNougpUxszO8OBVrSzON/sg/+wDNLycXsUWQL3kz8Jw3922KLMA0aMrZ X-MS-Exchange-Transport-CrossTenantHeadersStamped: SHXPR01MB0541 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791473720467708174 X-GMAIL-MSGID: 1791473720467708174 Add StarFive external interrupt controller for JH8100 SoC. Signed-off-by: Changhuang Liang Reviewed-by: Ley Foon Tan Reviewed-by: Philipp Zabel --- MAINTAINERS | 6 + drivers/irqchip/Kconfig | 11 ++ drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-starfive-jh8100-intc.c | 208 +++++++++++++++++++++ 4 files changed, 226 insertions(+) create mode 100644 drivers/irqchip/irq-starfive-jh8100-intc.c diff --git a/MAINTAINERS b/MAINTAINERS index 73d898383e51..3359d5016f00 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20960,6 +20960,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 +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 +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) += irq-csky-mpintc.o obj-$(CONFIG_CSKY_APB_INTC) += irq-csky-apb-intc.o obj-$(CONFIG_RISCV_INTC) += irq-riscv-intc.o obj-$(CONFIG_SIFIVE_PLIC) += irq-sifive-plic.o +obj-$(CONFIG_STARFIVE_JH8100_INTC) += irq-starfive-jh8100-intc.o obj-$(CONFIG_IMX_IRQSTEER) += irq-imx-irqsteer.o obj-$(CONFIG_IMX_INTMUX) += irq-imx-intmux.o obj-$(CONFIG_IMX_MU_MSI) += irq-imx-mu-msi.o diff --git a/drivers/irqchip/irq-starfive-jh8100-intc.c b/drivers/irqchip/irq-starfive-jh8100-intc.c new file mode 100644 index 000000000000..0e6e10c321ff --- /dev/null +++ b/drivers/irqchip/irq-starfive-jh8100-intc.c @@ -0,0 +1,208 @@ +// 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 *domain; + raw_spinlock_t lock; +}; + +static void starfive_intc_bit_set(struct starfive_irq_chip *irqc, + u32 reg, u32 bit_mask) +{ + u32 value; + + value = ioread32(irqc->base + reg); + value |= bit_mask; + iowrite32(value, irqc->base + reg); +} + +static void starfive_intc_bit_clear(struct starfive_irq_chip *irqc, + u32 reg, u32 bit_mask) +{ + u32 value; + + value = ioread32(irqc->base + reg); + value &= ~bit_mask; + iowrite32(value, irqc->base + reg); +} + +static void starfive_intc_unmask(struct irq_data *d) +{ + struct starfive_irq_chip *irqc = irq_data_get_irq_chip_data(d); + unsigned long flags; + + raw_spin_lock_irqsave(&irqc->lock, flags); + starfive_intc_bit_clear(irqc, STARFIVE_INTC_SRC0_MASK, BIT(d->hwirq)); + raw_spin_unlock_irqrestore(&irqc->lock, flags); +} + +static void starfive_intc_mask(struct irq_data *d) +{ + struct starfive_irq_chip *irqc = irq_data_get_irq_chip_data(d); + unsigned long flags; + + raw_spin_lock_irqsave(&irqc->lock, flags); + starfive_intc_bit_set(irqc, STARFIVE_INTC_SRC0_MASK, BIT(d->hwirq)); + raw_spin_unlock_irqrestore(&irqc->lock, flags); +} + +static struct irq_chip intc_dev = { + .name = "StarFive JH8100 INTC", + .irq_unmask = starfive_intc_unmask, + .irq_mask = starfive_intc_mask, +}; + +static int starfive_intc_map(struct irq_domain *d, unsigned int irq, + irq_hw_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 = { + .xlate = irq_domain_xlate_onecell, + .map = starfive_intc_map, +}; + +static void starfive_intc_irq_handler(struct irq_desc *desc) +{ + struct starfive_irq_chip *irqc = irq_data_get_irq_handler_data(&desc->irq_data); + struct irq_chip *chip = irq_desc_get_chip(desc); + unsigned long value; + int hwirq; + + chained_irq_enter(chip, desc); + + value = ioread32(irqc->base + STARFIVE_INTC_SRC0_INT); + while (value) { + hwirq = ffs(value) - 1; + + generic_handle_domain_irq(irqc->domain, hwirq); + + starfive_intc_bit_set(irqc, STARFIVE_INTC_SRC0_CLEAR, BIT(hwirq)); + starfive_intc_bit_clear(irqc, STARFIVE_INTC_SRC0_CLEAR, BIT(hwirq)); + + 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; + struct clk *clk; + int parent_irq; + int ret; + + irqc = kzalloc(sizeof(*irqc), GFP_KERNEL); + if (!irqc) + return -ENOMEM; + + irqc->base = of_iomap(intc, 0); + if (!irqc->base) { + pr_err("Unable to map registers\n"); + ret = -ENXIO; + goto err_free; + } + + rst = of_reset_control_get_exclusive(intc, NULL); + if (IS_ERR(rst)) { + pr_err("Unable to get reset control %pe\n", rst); + ret = PTR_ERR(rst); + goto err_unmap; + } + + clk = of_clk_get(intc, 0); + if (IS_ERR(clk)) { + pr_err("Unable to get clock %pe\n", clk); + ret = PTR_ERR(clk); + goto err_reset_put; + } + + ret = reset_control_deassert(rst); + if (ret) + goto err_clk_put; + + ret = clk_prepare_enable(clk); + if (ret) + goto err_reset_assert; + + raw_spin_lock_init(&irqc->lock); + + irqc->domain = irq_domain_add_linear(intc, STARFIVE_INTC_SRC_IRQ_NUM, + &starfive_intc_domain_ops, irqc); + if (!irqc->domain) { + pr_err("Unable to create IRQ domain\n"); + ret = -EINVAL; + goto err_clk_disable; + } + + parent_irq = of_irq_get(intc, 0); + if (parent_irq < 0) { + pr_err("Failed to get main IRQ: %d\n", parent_irq); + ret = parent_irq; + goto err_remove_domain; + } + + irq_set_chained_handler_and_data(parent_irq, starfive_intc_irq_handler, + irqc); + + pr_info("Interrupt controller register, nr_irqs %d\n", + STARFIVE_INTC_SRC_IRQ_NUM); + + return 0; + +err_remove_domain: + irq_domain_remove(irqc->domain); +err_clk_disable: + clk_disable_unprepare(clk); +err_reset_assert: + reset_control_assert(rst); +err_clk_put: + clk_put(clk); +err_reset_put: + 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 ");