From nobody Fri Nov 29 10:47:19 2024 Received: from CHN02-BJS-obe.outbound.protection.partner.outlook.cn (mail-bjschn02on2098.outbound.protection.partner.outlook.cn [139.219.17.98]) (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 E784D624; Mon, 23 Sep 2024 01:25:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=139.219.17.98 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727054753; cv=fail; b=iIyewdJ7/z2OILsDMdI+lm/0LBLi2/PQa0WSkLn4qchatCyXNfHaC5gEOKctOcmeYktECyuBEjXXDyuRX0V4lZeDH2fnvFi6Mbe9CW7SRBV6kzJv9tDGCp4AMv093sCKpT1b1Tk6G7cZWG1NdUSa+t/huKF9rZsuY8G3CnsDU/s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727054753; c=relaxed/simple; bh=JisoKtMP5jErIyadQb/MAq4m6AaG7NjWnVFRwFqJuV4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=SDkzw2BdinUziHwEKp5ftVNX5vNP9GRla4+v+1yDKNpZU5zY72ccnsYMnfWRH74RdgAyC6/faMC/u742s2R33PfKuO6u2pwxJupM+gPdDqO3eypCcF90kBehl4T2VLkkr1/KTfPmnZ/5e1Xfzgc+jmK5kJftU4b+VYDuVC482bA= 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.17.98 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=YQBMmz//yHKlxlQVuDg0IVB5pod/w86lhiRpy72T587UkILabLWk55h+eiZIPKftm4pAi6l5dSX2S1IondGr3CNvF45UKjGaU8gm0aSmwaoChyGY9e5OU8cFT48UmUzHVSy9hlr/Cn3YMm6k5x8nkeU7M98rspiqo53csODmWcN/3b+05kGmLVFpgfIicQonSe8+iayPLGAkOchVufDHzrs5rPzR4WTdxOqT3aSpaNwvYCduJUKAgG+sHuULV7ZeRffik8t4OKvF7tePcjcgi/eIcSoKyvV0BU3EDS7O/+9gsOsVmEfs0miVOHu/2wIoTEUY3nLtzCqielpl59NH4A== 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=2ACs4imNmP+48Q+YvftxnYh+ZhqiqBENJ65iamqQZVo=; b=mmBrMYVYhdGihA4iWT4AyQvOdB1ygfF0EaMrmStJeGCIH9U1FpjmBv/JKY0Ww0uXruj74rWlgInT4gi7xamcs8eCEJU7aTYigwkqmz1jbI9FnA5vLS14NMlKIW3Rap+ESPVP6JbbMct0vua24qZM4ldjmdn/ou8jUGpxK2pmPkKc6LP74rG0tl6sYupqPXkHXILrL9L3PXlxT71KNGNt7QvUzJg9fh0qfdqNY3pf7tiC9huiPaMRDyTA3x69w+CufhrB5ckDEMayM9UEOIaGStGQdBsTMTQ9N9Zl/J54jsidE1hKEt9NPLomarfLIXJ/pQhshvxuuK4aJwbY+abH3g== 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 ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:7::14) by ZQ2PR01MB1145.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.30; Sun, 22 Sep 2024 14:52:00 +0000 Received: from ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn ([fe80::2595:ef4d:fae:37d7]) by ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn ([fe80::2595:ef4d:fae:37d7%4]) with mapi id 15.20.7962.029; Sun, 22 Sep 2024 14:52:00 +0000 From: Hal Feng To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marc Kleine-Budde , Vincent Mailhol , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Philipp Zabel , Palmer Dabbelt , Paul Walmsley , Albert Ou Cc: Emil Renner Berthing , William Qiu , Hal Feng , devicetree@vger.kernel.org, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/4] dt-bindings: vendor-prefixes: Add cast vendor prefix Date: Sun, 22 Sep 2024 22:51:47 +0800 Message-ID: <20240922145151.130999-2-hal.feng@starfivetech.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240922145151.130999-1-hal.feng@starfivetech.com> References: <20240922145151.130999-1-hal.feng@starfivetech.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SHXPR01CA0027.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:1b::36) To ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:7::14) 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: ZQ2PR01MB1307:EE_|ZQ2PR01MB1145:EE_ X-MS-Office365-Filtering-Correlation-Id: 7442d9bb-711f-439c-8363-08dcdb161d0d X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0;ARA:13230040|41320700013|7416014|366016|52116014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: XtVbNfD8s3hyLk7Cnze0YekiR1Yf9Yj7MWyLjiXRQVa8j8ndZj7maPFgsvhSXsq+RlmAidAM2XtfHqvpDt8vUEPnuWKKhW75q1V/Lat0xjHuCTtqCgbyNzjfNX0Zcw2krMwwOXOiRiZDndf+U9kDEXuAIjoIZjKslu90NbfbWBk7kngKR8FMNiwGTKdHwKLsMgOlD5Khg7lEqT8MTMHVt6d/htohM8hJBXAiWat6Oq80PGX/OX4A6zmi3sTP6Q+vTxIZjMwrJMMW9brwZIWpghO/++27Ci6zDz1kTnTzo2b1QZ59z2aPqw439UoOWh3XKj1YaD3Jr6DsFpEctaD6yjIo2e58IObjD10Nz4OYTJ8Z/CRy2FVi5j64941gKRFvjtR0pX+iWUIgU2eSMTWbBF/TuueXapnhMVqSiCwAzPKy8+P9zbnmxdtFkOu0ohO/z3cvjXYFzbQWC8HPbfTFZWKLTJLhVX5km4yeRTDZ5ggDyeU8Up21iiVjeA0X93x9xZM7sh5rtwXwhgzhiT0JTBF79g/HMi+WdzKGFhRDbuSB8cQszodR47ZXzpMIUVS+1grzj5aNDvEnG31GC6NBwLxOmWUrdyq7bOy8MWuuJPXf2KrateAotxbhK3uS0kanF5u74Sd45vRGyE1Ob49s4w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230040)(41320700013)(7416014)(366016)(52116014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?nPNao4tjlbTqZ+ystFvQ0KLJcfZb8IQOqp3/I+i7HpHOo1ZZjk28NacWpK6w?= =?us-ascii?Q?cr7sTQUFDi4IIRLCqlWDFIoYOt0OZV3j0EtHop91SJs5VfpxgAZjutdemcn2?= =?us-ascii?Q?1+bIn75aZTDa+mGZpHkHIuItAXuETCoLReZkCrHyLCA7A9KrfyDe6Tgb3JEb?= =?us-ascii?Q?9PpNXotRI0obE70RhQ1nrwV3sAAhGsyawJa+yAneijf7ZhueU+3GVmUS3EWQ?= =?us-ascii?Q?umeouktAqFobFJ9t5n4xoA5Rz8ww6AZ1G9y2bqpKAXTMEKsyHk3dXtWfhRyj?= =?us-ascii?Q?QRsvd/XiaLafBF9+KHEvfzOeBl1retf6J7kqkzp/c6ky+BxNLOrF4WP/390N?= =?us-ascii?Q?1QRpP2PTR/bFt/a63yEM7GiJH7fDWlB2VZNPtP+sT11kjgyEqJxr+BrbWztW?= =?us-ascii?Q?ZQMbZInG4dhrc6GzpIuob75ZIKdrB4zSZuxUhlNr6BWbv5N5RpFVuPGqWMWi?= =?us-ascii?Q?h6XaSFgTe1PIBYUDLmkKup8Y+F2cUmmAX0mRTi5fDP4G9sGxm4pdqrRchVVK?= =?us-ascii?Q?WM//t1RCSdMZ+tnZ3qFELR7jGbGazFMiQoCR0NyoPS5z64/fc4gWmeHsXns2?= =?us-ascii?Q?LT4tsOyaYVp6d/g+5vUboaCWYZ+XX/6aPvHGH02NvInR7tOI6TRPMXAsfsTw?= =?us-ascii?Q?lj7wAlDiBzF15lVW6rCdc2GcoZtlIZfkoRzupCAc357/wfBAoE64TlqK6mxs?= =?us-ascii?Q?rkDmHCSBFkuCKS84SJfD740n/UYth/WCL7cXNeokAG+LQdo7yLGgubWmTweL?= =?us-ascii?Q?k5WjNqkOKSY1o8Cz8HILhGfJphlHNr2RAxD5FG22NQWky5oi7razw6Dsj78N?= =?us-ascii?Q?agw/s75lh5nJI6HkRuC8U9e0edeA+QKiQQhOF4MJ2LFlTY57wV6KXqd9n+ry?= =?us-ascii?Q?VU3tSAZVIFvFW7Hw3WOzsPRB+7GoGkzBzkTMKUwtvMPOsVkguIxVOcfz87fa?= =?us-ascii?Q?jvqBM/UXWrkBaVHR4fTZ9VYXpeMithU/807p/kS36RRMB06/zN7i0nro2SNM?= =?us-ascii?Q?5uW3wa3XEs4yAD+ch21ExT/ybtu7J58qFFLnOts6jYXvosEAWUd5Zl1TJisR?= =?us-ascii?Q?SHd0Dng1Kx0rPJa/+OWdOO/pdEUxm/nKp4bWe1b/nV6bxPTpvyoedDckRlN+?= =?us-ascii?Q?+ikbWhYT1fD/dV55PTg2YR74XfdZjh8K+jHmDeAWBEFPxlPXOTE3fVsRwZfW?= =?us-ascii?Q?/kh+yMAxr8i98m2syKXigbwF2git3IfUCWaFIyukJb03A5QLsfLx12saqqIS?= =?us-ascii?Q?sBSvaqWmMlBY/uIUPhVg+7gZxAK2zNrfOLU/DVWGmMCze8zhtIxTp4aXmSNz?= =?us-ascii?Q?lpihTGo31gw+8LiWCpSAZK1O3EQiO92HhQBsgOCglxmJOX2/WHidJ83yBFMF?= =?us-ascii?Q?iYb60ww5pZPelKe+yCqCnt5VmwjTuvVrrQi6dDYRqr2mmIJkIlCcOCEMrS3R?= =?us-ascii?Q?yJ6kPeenHggAs5oolwB7E36Stgz5CDT8fWZ0yJYXLmtdDIav5vxiNvEI5K9B?= =?us-ascii?Q?7bHuKHsa3bEy45z0u6S+vq3b5+1w34FSx/HuURpNCWIS6Jw93TSB4KCYCuj1?= =?us-ascii?Q?7QRdbOpuRC24E65H86fBkxV9utIuPsofF9SyB+J4EqGy6OFsbY6zOHRVTy6U?= =?us-ascii?Q?ow=3D=3D?= X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7442d9bb-711f-439c-8363-08dcdb161d0d X-MS-Exchange-CrossTenant-AuthSource: ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2024 14:52:00.4571 (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: 0OYA5/0ThzkZhJMZzOAgRKB3zhRYl7MABGdjBityihhnlPTLk5Fg2A2T8I+R6uLpXpMp9qAJcc5945Nxwr7FwcIx/Ry9U+wLjYb955lCprk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZQ2PR01MB1145 Content-Type: text/plain; charset="utf-8" From: William Qiu CAST (Computer-Aided Software Technologies, Inc.) is a company developing, selling, and supporting digital Silicon IP Cores for ASICs or FPGAs. https://www.cast-inc.com/ Acked-by: Conor Dooley Signed-off-by: William Qiu Signed-off-by: Hal Feng --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Docum= entation/devicetree/bindings/vendor-prefixes.yaml index a70ce43b3dc0..9bfb0156bc8e 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -256,6 +256,8 @@ patternProperties: description: Capella Microsystems, Inc "^cascoda,.*": description: Cascoda, Ltd. + "^cast,.*": + description: Computer-Aided Software Technologies, Inc. "^catalyst,.*": description: Catalyst Semiconductor, Inc. "^cavium,.*": --=20 2.43.2 From nobody Fri Nov 29 10:47:19 2024 Received: from CHN02-BJS-obe.outbound.protection.partner.outlook.cn (mail-bjschn02on2104.outbound.protection.partner.outlook.cn [139.219.17.104]) (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 C97112CCC2; Sun, 22 Sep 2024 19:25:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=139.219.17.104 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727033154; cv=fail; b=XrwY1J/LI7WRiNfsSa53CjIebS3OBB5M2kDoj3FqgxEm0iNoRywCGonLHNgKhRtJ2WX2slHbs37N7xyRaBcBVpZIvhfbKMN1oYLvjjGFvDTzLIoj11UAiUGopiOx52yKr7nXMyQAbvYavdaBnsoQnpK1l2Qdk9of741XKG0XnQ8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727033154; c=relaxed/simple; bh=t9bLzqApRzCMyuQxF5Wn6L3PAzWKXW86DEQUXk3N9JA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=sa2hBZEELj8O9/rDW+KcH+mFXFsl0mJ8RXyGJ7NT+JxO5NeIa1jvpNmNBUmwM0Jmd9V3iNGXTmDljiVPswH0mjEiKXWmG5Id1roOjUCCOwY+sszLKZc6kP65djMdWyHaBSGXoekTdx8d2/HbM4cLnhPdSzwFm+2fUldf2e6Facs= 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.17.104 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=WLy5//gxz1EEqENPkIWjCjwz1HhPNHwrYrDtgK44KjAjYHA7ss9gwfar5B4fcYqlZ9l7TafSsNv35LkRuonXb/WdLsBXdi+JP05udicI9H/G86CUHK3PU4UMnIL3zy523YvG80q6FYv6z+YICCtm0wDnAe6p4IH+EmAEKl8g5s9kVm7Y7zylxtvzRjTRdHU/EOt8rJYJKGhrq8JKrA1hMVY23AeyhRBmWpaVvxh9lcim/OO1GalGKQdETDlNoFOH9zMAUzMd/kEC4kCpW2hWrRo7uP19dSw58edbOzVHdc+ctQ5JVOndZUjpi3lyHBpIvyuHqlisx9zjA+iczg28mQ== 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=xGog7RH8gMlxqZjwmj0fjNLvCAAwCP9dhYNgE08yFVo=; b=UyYrEDpQBofN7sWfbw82EMXFzDcHM9EcXNPvN1LOopJtjKJe1sVp+zvjTU51f8qhVGh5eDR8QtdP+1Ln4tdHulc3H9P0mLnmlInKIXuQUSB7JDwRROMNc51K7CYBShxATWAQWmiPLPOtInP4qQNl4t066AnvbWKgC7PeFX4M1tj2IhdNfxoNzcdVFGC2Wjc4ig1w9MYn7iY9AEycztg8VkmJWGTU57Y9VU0uqrKQMyZIwN0ObsuWkxxetbBpmQy8lDq99RnpxpDamJaUi+BlG7vl1qgCHIW8/4Si7xVCfl8UKJL9UCKVsZeld2HtYu5zePCjNdaTYivh56Gw7JSe6A== 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 ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:7::14) by ZQ2PR01MB1145.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.30; Sun, 22 Sep 2024 14:52:02 +0000 Received: from ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn ([fe80::2595:ef4d:fae:37d7]) by ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn ([fe80::2595:ef4d:fae:37d7%4]) with mapi id 15.20.7962.029; Sun, 22 Sep 2024 14:52:02 +0000 From: Hal Feng To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marc Kleine-Budde , Vincent Mailhol , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Philipp Zabel , Palmer Dabbelt , Paul Walmsley , Albert Ou Cc: Emil Renner Berthing , William Qiu , Hal Feng , devicetree@vger.kernel.org, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/4] dt-bindings: can: Add CAST CAN Bus Controller Date: Sun, 22 Sep 2024 22:51:48 +0800 Message-ID: <20240922145151.130999-3-hal.feng@starfivetech.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240922145151.130999-1-hal.feng@starfivetech.com> References: <20240922145151.130999-1-hal.feng@starfivetech.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SHXPR01CA0027.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:1b::36) To ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:7::14) 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: ZQ2PR01MB1307:EE_|ZQ2PR01MB1145:EE_ X-MS-Office365-Filtering-Correlation-Id: 425b14e6-5b30-4f5b-7654-08dcdb161df3 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0;ARA:13230040|41320700013|7416014|366016|52116014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: Kl8kFGbidh6eORm1N8kZPPBvOftKpQR4EwAz1SRtGMCdVoJyHz8iLl4PUQpmpbghuVqzuyW1w/cUJqGq4cRKm4Vy12x5r4EMIHA1zr7UM6pJxwNOb2NmPeM+uNNXCdyw3TYcdEq8gIjmsi09+UV5+rwPZRDJjYs7GEde5J+/I/0qOB3Cp7B6KblTnTv239XoHTznj7t/74DbGtbODmf0ydOkWpLYinTexRW4MRzieotFB5BdPz4S7FV9jK2S+XitajvJ/i93zlSCW12pY2q5rnAK1Qv+KMWRyvQ5DHUA5t4mjx5sKrDNKBKnsO+g7wHhLQKzKkRVeIaWcxFTOAurqoJfHEKc8GoikR92d+NW9pv3cvhIr5jWVLWwXy/3sBPoco8WQd4ni2eSDEjRHiqGroRPs1y3t98gHDVYzLxLokVRWBSHvPMUmcgy7ZfkUO79MMx/OI2NpTTxhn61BxX4kTd0iHQ6MabuoE01KN6qFPiwDKQxutuOJgLtq7a8Ku7x7GxaxDsv6SWbxFOxawquE7NTKVzahUbgr1gEKv9sqrK0Jdq3LW18Uz4DiFCnY6xX3BTtUxlaXfzjwvPyxqIr/7W3R0SjyhrfDdn3LUzBZqocB3lrEUFmSMzp2UTMLDOQ3ET3ez/zI9AwgeY/E8SS9Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230040)(41320700013)(7416014)(366016)(52116014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?q5bg4uScxmppeOhhlvCGkNav7o6SgZf5N4ue70zuuxH91IwKWAtvYhNf5UQq?= =?us-ascii?Q?5LE+OWWSCfBNtgkv7sFKqzwFZFE4O+DWcuIxpVkLy2Bjqc3OQq3f2q7mIyE/?= =?us-ascii?Q?ylvDb8lIzVTCWaKhN6UZ0XUfixMmJMjXWWnbcF5NO3EtidyoAR1NmEBYBHQu?= =?us-ascii?Q?DoC3sMi5IqXWa4+1QejoxIGa3A6ic8fSriwksBM2/2xIlKYKB97lp7e0Qztp?= =?us-ascii?Q?t4623606kRnI2e0wkHRx5J9COr+Jl6qp074P4//FCyeIm5BOdY2fP5pm18RE?= =?us-ascii?Q?jq3za7NzId/4VEpNx5Ar05v93EKid3/C5M0ONQwjBu+lFzsrqdTja7fp0Oaw?= =?us-ascii?Q?QfuhIpxhgorC0KkGxP8jpwSZTj4hXee2sMtsRv3B+eHXw2LtHNaMe9fx8QLR?= =?us-ascii?Q?QuEVBq6pApG4wqk45Dbfcea8tBJby08Fo69E/6Ly5mYBitaMVFRSW1SitRS+?= =?us-ascii?Q?NkRizo7bqakc2fwOrR1i7KQGBrkLVl6f8qKeEiDW3t8XOsjMsq8Z9bWdRgQE?= =?us-ascii?Q?M34TI3+eEpPIIAH1vtqOnfCWw5hqXjU46PNJBv4qcglw5pv4oRjUPFbMOHjw?= =?us-ascii?Q?xjlXx5oENXcIGiUBi8sg7+WbKXzwlPgPVFetXyMsLwkk6M6QZ0ZCy4O4NXdm?= =?us-ascii?Q?OzD6kuhKIraXN3XBIYDe1GMS5yHoRd1FbmCiozMo0EXLEvU19ln4Tn1XY7j+?= =?us-ascii?Q?Jm019I9yaZe7rnwt10bBQ7Il0b5nz7AuD7E66E1+9J5tkPOrgkRERQZB8lEZ?= =?us-ascii?Q?7MZyPfK7xCx2USTLiNA+AEsvtU628HzblaAT5LqusbrMtzvXOIe0MSiHyhez?= =?us-ascii?Q?30boPYrm9AeAjcMNZgLxIYduM+aaXLPNgoVb9tgI0uIPjlJuhayB/Q4nwEyJ?= =?us-ascii?Q?e2W3JVoBsdo7L8bjqwzYd6XJQ0FwnuZfxVIjsFht9ANTXDfYiRmMnD6Y1RnG?= =?us-ascii?Q?BXKQWaCXkvP6bs2iLznfp3KbtGoxEUGga0lkpfxYr8cR/hkBCLGX3Yqx++7a?= =?us-ascii?Q?LTMi+kG+AcN8dAPeLkTHVrd/jRbIQouqyGbOGUnQMFIqkv1/S5RjP/Oq/iAj?= =?us-ascii?Q?YkHQ3fMsa5eyv0rwjbfAiMG+DNHjrJoQKipakBcHT45E5pCUjHUsK+nvc3s2?= =?us-ascii?Q?g+nYVG1HxOwmfBkE74vWh9dsPFi4WlZpKS92K34Xt0D9HfHXgdQUULG87ySW?= =?us-ascii?Q?cnqCiTydAkwt5XOORRVt5Xt5Or8k5B2/n4uIxY/Hov+hr25HNZA7/3x2mQ8a?= =?us-ascii?Q?vVLwwP+PQ1d8oZkAKSycOUBvoq5WFyvM4ReuHz36p4QRiOwt46zKhi3mVoB5?= =?us-ascii?Q?8WlKBLNCKQgpcDVxCSgHAnQd9Y0J/2KbM5Sfd2/75W+ziOTBZyuklDnj87kW?= =?us-ascii?Q?/6JdfpR0Gt/EKBb9bmgBLDnJTQ+wZ6RbqBPDx0kuxHqFHkcgXOuu4h/7u3nm?= =?us-ascii?Q?97BniAzkUWnBlo50lk6P4ZKfrw0Iq3zqtdSe28rT9KUFedNL5g7UJuoPzOS7?= =?us-ascii?Q?Vbw5Xx/Adh05KfZaI09voDDgQs4q5wONjKfY1sxyN3zyPuoOx+zBDDvWzoW6?= =?us-ascii?Q?scFYl6K9vPI0HJVKDGT0wBxGOHt13IffobQk/pFPcqoy3vJI0I/YJVveaqpO?= =?us-ascii?Q?XQ=3D=3D?= X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 425b14e6-5b30-4f5b-7654-08dcdb161df3 X-MS-Exchange-CrossTenant-AuthSource: ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2024 14:52:01.9311 (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: thJ5eDq9rH0wOq2fgwK6HTDxx4q836ZaFf3Tw69bm4kSDPKqFJQyDZm2M+uDPMlUgKnxTnB3c+6k76N1w3ZwvFItyY50oQ6HeyrtLUf85y0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZQ2PR01MB1145 Content-Type: text/plain; charset="utf-8" From: William Qiu Add bindings for CAST CAN Bus Controller. Signed-off-by: William Qiu Signed-off-by: Hal Feng --- .../bindings/net/can/cast,can-ctrl.yaml | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/can/cast,can-ctrl= .yaml diff --git a/Documentation/devicetree/bindings/net/can/cast,can-ctrl.yaml b= /Documentation/devicetree/bindings/net/can/cast,can-ctrl.yaml new file mode 100644 index 000000000000..2870cff80164 --- /dev/null +++ b/Documentation/devicetree/bindings/net/can/cast,can-ctrl.yaml @@ -0,0 +1,106 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/can/cast,can-ctrl.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: CAST CAN Bus Controller + +description: + This CAN Bus Controller, also called CAN-CTRL, implements a highly + featured and reliable CAN bus controller that performs serial + communication according to the CAN protocol. + + The CAN-CTRL comes in three variants, they are CC, FD, and XL. + The CC variant supports only Classical CAN, the FD variant adds support + for CAN FD, and the XL variant supports the Classical CAN, CAN FD, and + CAN XL standards. + +maintainers: + - William Qiu + - Hal Feng + +properties: + compatible: + items: + - enum: + - starfive,jh7110-can + - const: cast,can-ctrl-fd-7x10N00S00 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + minItems: 3 + + clock-names: + items: + - const: apb + - const: timer + - const: core + + resets: + minItems: 3 + + reset-names: + items: + - const: apb + - const: timer + - const: core + + starfive,syscon: + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to System Register Controller syscon node + - description: offset of SYS_SYSCONSAIF__SYSCFG register for CAN= controller + - description: shift of SYS_SYSCONSAIF__SYSCFG register for CAN = controller + - description: mask of SYS_SYSCONSAIF__SYSCFG register for CAN c= ontroller + description: + Should be four parameters, the phandle to System Register Controller + syscon node and the offset/shift/mask of SYS_SYSCONSAIF__SYSCFG regi= ster + for CAN controller. + +allOf: + - $ref: can-controller.yaml# + - if: + properties: + compatible: + contains: + const: starfive,jh7110-can + then: + required: + - starfive,syscon + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + - resets + - reset-names + +additionalProperties: false + +examples: + - | + can@130d0000{ + compatible =3D "starfive,jh7110-can", "cast,can-ctrl-fd-7x10N00S00= "; + reg =3D <0x130d0000 0x1000>; + interrupts =3D <112>; + clocks =3D <&syscrg 115>, + <&syscrg 116>, + <&syscrg 117>; + clock-names =3D "apb", "timer", "core"; + resets =3D <&syscrg 111>, + <&syscrg 113>, + <&syscrg 112>; + reset-names =3D "apb", "timer", "core"; + starfive,syscon =3D <&sys_syscon 0x10 0x3 0x8>; + }; + +... --=20 2.43.2 From nobody Fri Nov 29 10:47:19 2024 Received: from CHN02-BJS-obe.outbound.protection.partner.outlook.cn (mail-bjschn02on2104.outbound.protection.partner.outlook.cn [139.219.17.104]) (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 69DFA1A28D; Sun, 22 Sep 2024 15:09:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=139.219.17.104 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727017769; cv=fail; b=K48a3UinGGw7Gdd/gDclOlUZAm75KXySsj+Ae2aotJBSFWD4R8Lvg7+RrAMoZtqdwS6fyu/c7bxOaT6zWmJTZ5dZ+Unls+pdc1ieg1VSDXcLUGcuvCYqNkH259owUGh2ocphb5340/C6FNc+CZfzHYC/mSHo0SBKj98AtrLjL5Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727017769; c=relaxed/simple; bh=y5jUpbl/2LHI7OoNqyjcKBgfX5O3xeIcTgRiTe6bFK4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=pQsLRveb9HbO197T+Z6F7GL3kduL3uTZu6+9H9+npxchIW0FNqnzqQAUi+5yBNOmKbtoYfC0KbupkqmjsjzrgBUeDoYXNG0TqDSThVDutQ3SLQE8PPyrIvhlp/BI3526TIuV18d/VzVqYwLulvWzzAu8DMP+65hXf93n9Fu+Y8Q= 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.17.104 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=i6diYjJUK196MOceAT4pu8uAmydoQJ9JBGPEPl1ITQonUSJzX1Eda+ClVSNrzX3jcteBrXH4PCUU1Hzh9zJ/aKJ4PzkT/Ix/6l+47RdU61iNq3kQh3WqOP1mUm4dbY3QGsF93LC0cbTk154cXqEO7RdvPFGDbxeoEZ7v7nRven7B+GIlBEcDGC5hvb9ZSTrVZ+jTSDsYw+h956FFMDXamEZ8jeut/hkd2rQhj9l034VkjUfqDQm82X6dsb0pr8ZV23XsLRXUOdDYBRh9v561MxX+F/sSsYwNcEZfmOuV6Gx1Kx3ukiSXgdSyQQ8EmVSi8PI/ckxaXQYoAZ88ExwvDg== 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=4zCt/1j2HejWMh2kW7rfUYMyT4Q28BaR3H9/uMiTjng=; b=JmGoS1qVxn1kDrIIl4oO7clXEreuPfs/Zl51xb9oXhYECnXZnRGNuUMjy9YyUU/Dm5Ch1OY5fW5dcUKI8dAPHDaisG5HA1i/ra/g7VSZVgRXQAK24/QKY2P+3c/uFpi72T5DBStAguEK9jTRMHNFSRqg+MP1mYCuJpK495609ifZAooKYxojIU0jYnGGnh9/810TQarghWjrd/7AIC0N1pPbIGTVrLn6VxXBwXacHI7qJAwxUKLBuDw4Y57M/Venj83ZQsnpFZlK0DtpN4TXNxAI/asHQqLZUbAsnI1KUmYKV7pf3PD45fZS0ilzkw47L/dvApyJQrTZCtexsb8gxg== 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 ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:7::14) by ZQ2PR01MB1145.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.30; Sun, 22 Sep 2024 14:52:03 +0000 Received: from ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn ([fe80::2595:ef4d:fae:37d7]) by ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn ([fe80::2595:ef4d:fae:37d7%4]) with mapi id 15.20.7962.029; Sun, 22 Sep 2024 14:52:03 +0000 From: Hal Feng To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marc Kleine-Budde , Vincent Mailhol , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Philipp Zabel , Palmer Dabbelt , Paul Walmsley , Albert Ou Cc: Emil Renner Berthing , William Qiu , Hal Feng , devicetree@vger.kernel.org, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/4] can: Add driver for CAST CAN Bus Controller Date: Sun, 22 Sep 2024 22:51:49 +0800 Message-ID: <20240922145151.130999-4-hal.feng@starfivetech.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240922145151.130999-1-hal.feng@starfivetech.com> References: <20240922145151.130999-1-hal.feng@starfivetech.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SHXPR01CA0027.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:1b::36) To ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:7::14) 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: ZQ2PR01MB1307:EE_|ZQ2PR01MB1145:EE_ X-MS-Office365-Filtering-Correlation-Id: fc3d005d-f8d6-4878-9dcf-08dcdb161ed6 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0;ARA:13230040|41320700013|7416014|366016|52116014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: y+ciQzfwVmVXed7sp4KH3QDdIhPgA8puZ6PXKwMImKr+n+q+Zlwp3BCUYvrBfWMGg5ab5uC4Q3wXgIJO6KaXpFpjvUs/1WjhE2aoeQTkogEJ6a13CTvvZmNhj+3yy/612HZf80cn6Euc7JnkaG3rec09qHAkXGZlTO7iQVPZExumYohHTEIDCQ6ukMwJ4eNgWs89Pe2AlsDsq2YfIYj/7gVcWARglgOnPyPY63mKQlhN57ZBOl+VY6Bi69KIuy0pKPzjmhFYUf84R59fcch+jPWmPPp9UpMQ0QXBeIR+rj3Hhx835bW+Mw9un6zto0kH65lktymGi2tXvY6KhuOq8+FAmGx8sqjeJBh8sU7NbvrSS3gzWIvahvXlu2g65SXg65MZX+YuBSrGK0uhYFifNQfPuqqDv/Lxfmc0BRW/oW6asQQuucZVfvucjjnCV5hzUBlBFiBMox41fKXWCt9eBBaSem62xmjlGCICDJJgMkZI3tU/XWcWVH+oMsCQJ8veJMDAYgG2yAHbOPDrAcXofenizd3LWsbKwTYl6nyWg3Avyfikdvwit5pWCPptTK2ndqtxuY8m2G+Z5A+jrA+o8eA0n2h0wt6KH+2ADtsBxEIEmHvf8LdS3F10Muqh78Jb2AJRqu5Ru5pZiX/9uPz7HA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230040)(41320700013)(7416014)(366016)(52116014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?iEseLpymkF67ouza/oaxnfEd6Gt3LYPiwOR+uS3yX/rTF42Rb3UUlmHg0vhI?= =?us-ascii?Q?VlmTb6TacxIMITC1N58L8+1m60bSZ1/mWIlSXhY3Tc+/ZidCLPd/EtHd/xOF?= =?us-ascii?Q?S51njkuA4BCsUpYU/yxrSciB/912tKQ37mGJMtalzP4WApkI64iEXrG6tESb?= =?us-ascii?Q?zm1XOM4QI3vnuNY7amX8rcShGl4KZaN5h6z8+fsG/LV0RiVy0I3BqLQGZ34N?= =?us-ascii?Q?BkzRb54NWxeQlByQ/z6QpKdF+aaywB1MPgcspcu5KsqjPT4hGVq7oPfvMla+?= =?us-ascii?Q?kLR7CWyyNK0ERK8pHBdEQH1OzP480hEC2gqyjwWIZDLTcT0lihWFPAGjTTVi?= =?us-ascii?Q?QJOWZVQlfd44jh1meUJLN4Uwu4i1F6TJ0QqckAduL/8E6VNGeo3Aczf9fXI1?= =?us-ascii?Q?duqij9tdm4FFRMOFsbxFz4Hk2wR02RDdxm6l3X82vfsPM1ZjLYjnLaPnD6cs?= =?us-ascii?Q?vD4buIy7ONyjYcxtg8mwPy0oGmqENQdWJ/z8IT671ScfFMJVd5ui9Kz0PtuA?= =?us-ascii?Q?iHAQSEcWn/tNqXsOyNcFcl2Pm4pi6grTxhIpf/+0IZbq1h+Zxb5WNbA5PWxK?= =?us-ascii?Q?bo4XWkKClKP+CQhV5OFLkrzERKV+w9tN7ZUcE1cN7u3ygPtfgoFKydUTcmDh?= =?us-ascii?Q?eHF9UP97ikPyyzGFbLjHru1sEh5h9LbKMnCJKQY6xV//TFINlu66613tXCYk?= =?us-ascii?Q?I6ZzZJuenRJtxEUPxIMqfVudrmEmsne9ksQLwIBPSa+it+wh0yOn8xIvRqfT?= =?us-ascii?Q?q9oF3rxFZ1sfD56xVIS6wWGBTqTe1pE80BuDV4vHsddoFVPz7YxooNRurMnI?= =?us-ascii?Q?THkFQgxBU+oFuemE3EGOAWZzi2pGdm7D0BV8NfER4PXcaEDZxCFql8saJxdi?= =?us-ascii?Q?3ZDPVuBBdCEZSBw0leA+7UvDMpPNVk+JkLiX17/KaJloH4ueidccc38ZkBmJ?= =?us-ascii?Q?pC0BBqFfmF5E82OZ3Y4ph4+P06PTiJWRbCOuuQXLw7zx2iBpZbBi85YsWKey?= =?us-ascii?Q?ozCk3vqjUMXtkmCFfe0dq6Pu6ZejUrVRQ94rCEiNPNoh26QDoBSyNc/ufQlI?= =?us-ascii?Q?XGtATuBlHK3GNky5eOjNQUi36tlWTyLH5QbD5kf1O7jKO90Xyh8JU9giZLBV?= =?us-ascii?Q?xevWQlcxZQxht4uqYyBEhvLov5Vj+fj6GyEa1dOrP2XZk0ZhXOZaTAniVXXB?= =?us-ascii?Q?S1Tvu6diokSNDF9hsDzJaH3MXj2PHarJVtjnR4nHzLkSLSFlbcc1zIO/+LYp?= =?us-ascii?Q?pk66ujyrQ0+MjwQCQ1pTnNhae4wt0KVzMFXlas0Tw4s+lxO0gerXsJFP68Tm?= =?us-ascii?Q?uSCAXtwgQHL/+d5vtALDQJimJT/e+WruOk/rA5WNRb4RKyEe1tp3Jl8v1WJb?= =?us-ascii?Q?fv04W1bi1jejIirGZERfEbDrMhxF3oyK3cUMZXJilehP6eTlD/eosnpP9e46?= =?us-ascii?Q?b+/X7mAZX/HQPSoMFnUq9ogwGYZEeUqEr8rpSoQ4TNksxhMb3ZEa9Bu3ugNF?= =?us-ascii?Q?sBoQGsjkI1r+M8awmUILT9bT5Nl4kWoxv8lQZ8UGhlUt8t7Y9/O5CkPgQ3D2?= =?us-ascii?Q?f23eVZ4jhkppIVriKIySzDXAjTe4oiWloeL0LW9pbYUS2ivr9y2HtIFoQHG/?= =?us-ascii?Q?JA=3D=3D?= X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc3d005d-f8d6-4878-9dcf-08dcdb161ed6 X-MS-Exchange-CrossTenant-AuthSource: ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2024 14:52:03.4474 (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: 5U2o42a3qeJjPrNi0ELa8MFI6Zf5j43bk3T+mI1cI5aHBmcoOwVFeX9CmFvsWR6TEtUuP/Jzc/F52UhxR3+cAoE5C3Ac+t0DXqblZsvjq54= X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZQ2PR01MB1145 Content-Type: text/plain; charset="utf-8" From: William Qiu Add driver for CAST CAN Bus Controller used on StarFive JH7110 SoC. Signed-off-by: William Qiu Co-developed-by: Hal Feng Signed-off-by: Hal Feng --- MAINTAINERS | 8 + drivers/net/can/Kconfig | 7 + drivers/net/can/Makefile | 1 + drivers/net/can/cast_can.c | 936 +++++++++++++++++++++++++++++++++++++ 4 files changed, 952 insertions(+) create mode 100644 drivers/net/can/cast_can.c diff --git a/MAINTAINERS b/MAINTAINERS index cc40a9d9b8cd..9313b1a69e48 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5010,6 +5010,14 @@ S: Maintained W: https://wireless.wiki.kernel.org/en/users/Drivers/carl9170 F: drivers/net/wireless/ath/carl9170/ =20 +CAST CAN DRIVER +M: William Qiu +M: Hal Feng +L: linux-can@vger.kernel.org +S: Supported +F: Documentation/devicetree/bindings/net/can/cast,can-ctrl.yaml +F: drivers/net/can/cast_can.c + CAVIUM I2C DRIVER M: Robert Richter S: Odd Fixes diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig index 7f9b60a42d29..a7ae8be5876f 100644 --- a/drivers/net/can/Kconfig +++ b/drivers/net/can/Kconfig @@ -124,6 +124,13 @@ config CAN_CAN327 =20 If this driver is built as a module, it will be called can327. =20 +config CAN_CASTCAN + tristate "CAST CAN" + depends on ARCH_STARFIVE || COMPILE_TEST + depends on COMMON_CLK && HAS_IOMEM + help + CAST CAN driver. This driver supports both CAN and CANFD IP. + config CAN_FLEXCAN tristate "Support for Freescale FLEXCAN based chips" depends on OF || COLDFIRE || COMPILE_TEST diff --git a/drivers/net/can/Makefile b/drivers/net/can/Makefile index 4669cd51e7bf..2f1ebd7c0efe 100644 --- a/drivers/net/can/Makefile +++ b/drivers/net/can/Makefile @@ -17,6 +17,7 @@ obj-y +=3D softing/ obj-$(CONFIG_CAN_AT91) +=3D at91_can.o obj-$(CONFIG_CAN_BXCAN) +=3D bxcan.o obj-$(CONFIG_CAN_CAN327) +=3D can327.o +obj-$(CONFIG_CAN_CASTCAN) +=3D cast_can.o obj-$(CONFIG_CAN_CC770) +=3D cc770/ obj-$(CONFIG_CAN_C_CAN) +=3D c_can/ obj-$(CONFIG_CAN_CTUCANFD) +=3D ctucanfd/ diff --git a/drivers/net/can/cast_can.c b/drivers/net/can/cast_can.c new file mode 100644 index 000000000000..020a2eaa236b --- /dev/null +++ b/drivers/net/can/cast_can.c @@ -0,0 +1,936 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * CAST Controller Area Network Bus Controller Driver + * + * Copyright (c) 2022-2024 StarFive Technology Co., Ltd. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DRIVER_NAME "cast_can" + +enum ccan_reg { + CCAN_RUBF =3D 0x00, /* Receive Buffer Registers 0x00-0x4f */ + CCAN_RUBF_ID =3D 0x00, + CCAN_RBUF_CTL =3D 0x04, + CCAN_RBUF_DATA =3D 0x08, + CCAN_TBUF =3D 0x50, /* Transmit Buffer Registers 0x50-0x97 */ + CCAN_TBUF_ID =3D 0x50, + CCAN_TBUF_CTL =3D 0x54, + CCAN_TBUF_DATA =3D 0x58, + CCAN_TTS =3D 0x98, /* Transmission Time Stamp 0x98-0x9f */ + CCAN_CFG_STAT =3D 0xa0, + CCAN_TCMD =3D 0xa1, + CCAN_TCTRL =3D 0xa2, + CCAN_RCTRL =3D 0xa3, + CCAN_RTIE =3D 0xa4, + CCAN_RTIF =3D 0xa5, + CCAN_ERRINT =3D 0xa6, + CCAN_LIMIT =3D 0xa7, + CCAN_S_SEG_1 =3D 0xa8, + CCAN_S_SEG_2 =3D 0xa9, + CCAN_S_SJW =3D 0xaa, + CCAN_S_PRESC =3D 0xab, + CCAN_F_SEG_1 =3D 0xac, + CCAN_F_SEG_2 =3D 0xad, + CCAN_F_SJW =3D 0xae, + CCAN_F_PRESC =3D 0xaf, + CCAN_EALCAP =3D 0xb0, + CCAN_RECNT =3D 0xb2, + CCAN_TECNT =3D 0xb3, +}; + +enum ccan_reg_bit_mask { + CCAN_RST_MASK =3D BIT(7), /* Set Reset Bit */ + CCAN_FULLCAN_MASK =3D BIT(4), + CCAN_FIFO_MASK =3D BIT(5), + CCAN_TSONE_MASK =3D BIT(2), + CCAN_TSALL_MASK =3D BIT(1), + CCAN_LBMEMOD_MASK =3D BIT(6), /* Set loopback external mode */ + CCAN_LBMIMOD_MASK =3D BIT(5), /* Set loopback internal mode */ + CCAN_BUSOFF_MASK =3D BIT(0), + CCAN_TTSEN_MASK =3D BIT(7), + CCAN_BRS_MASK =3D BIT(4), /* CAN-FD Bit Rate Switch mask */ + CCAN_EDL_MASK =3D BIT(5), /* Extended Data Length */ + CCAN_DLC_MASK =3D GENMASK(3, 0), + CCAN_TENEXT_MASK =3D BIT(6), + CCAN_IDE_MASK =3D BIT(7), + CCAN_RTR_MASK =3D BIT(6), + CCAN_INTR_ALL_MASK =3D GENMASK(7, 0), /* All interrupts enable mask */ + CCAN_RIE_MASK =3D BIT(7), + CCAN_RFIE_MASK =3D BIT(5), + CCAN_RAFIE_MASK =3D BIT(4), + CCAN_EIE_MASK =3D BIT(1), + CCAN_TASCTIVE_MASK =3D BIT(1), + CCAN_RASCTIVE_MASK =3D BIT(2), + CCAN_TBSEL_MASK =3D BIT(7), /* Message writen in STB */ + CCAN_STBY_MASK =3D BIT(5), + CCAN_TPE_MASK =3D BIT(4), /* Transmit primary enable */ + CCAN_TPA_MASK =3D BIT(3), + CCAN_SACK_MASK =3D BIT(7), + CCAN_RREL_MASK =3D BIT(4), + CCAN_RSTAT_NOT_EMPTY_MASK =3D GENMASK(1, 0), + CCAN_RIF_MASK =3D BIT(7), + CCAN_RAFIF_MASK =3D BIT(4), + CCAN_RFIF_MASK =3D BIT(5), + CCAN_TPIF_MASK =3D BIT(3), /* Transmission Primary Interrupt Flag */ + CCAN_TSIF_MASK =3D BIT(2), + CCAN_EIF_MASK =3D BIT(1), + CCAN_AIF_MASK =3D BIT(0), + CCAN_EWARN_MASK =3D BIT(7), + CCAN_EPASS_MASK =3D BIT(6), + CCAN_EPIE_MASK =3D BIT(5), + CCAN_EPIF_MASK =3D BIT(4), + CCAN_ALIE_MASK =3D BIT(3), + CCAN_ALIF_MASK =3D BIT(2), + CCAN_BEIE_MASK =3D BIT(1), + CCAN_BEIF_MASK =3D BIT(0), + CCAN_AFWL_MASK =3D BIT(6), + CCAN_EWL_MASK =3D (BIT(3) | GENMASK(1, 0)), + CCAN_KOER_MASK =3D GENMASK(7, 5), + CCAN_BIT_ERROR_MASK =3D BIT(5), + CCAN_FORM_ERROR_MASK =3D BIT(6), + CCAN_STUFF_ERROR_MASK =3D GENMASK(6, 5), + CCAN_ACK_ERROR_MASK =3D BIT(7), + CCAN_CRC_ERROR_MASK =3D (BIT(7) | BIT(5)), + CCAN_OTH_ERROR_MASK =3D GENMASK(7, 6), +}; + +/* CCAN_S/F_SEG_1 bitfield shift */ +#define SEG_1_SHIFT 0 +#define SEG_2_SHIFT 8 +#define SJW_SHIFT 16 +#define PRESC_SHIFT 24 + +enum cast_can_type { + CAST_CAN_TYPE_CAN =3D 0, + CAST_CAN_TYPE_CANFD, +}; + +struct ccan_priv { + struct can_priv can; + struct napi_struct napi; + struct device *dev; + void __iomem *reg_base; + struct clk_bulk_data clks[3]; + struct reset_control *resets; + u32 cantype; +}; + +struct cast_can_data { + enum cast_can_type cantype; + const struct can_bittiming_const *bittime_const; + int (*syscon_update)(struct ccan_priv *priv); +}; + +static struct can_bittiming_const ccan_bittiming_const =3D { + .name =3D DRIVER_NAME, + .tseg1_min =3D 2, + .tseg1_max =3D 16, + .tseg2_min =3D 2, + .tseg2_max =3D 8, + .sjw_max =3D 4, + .brp_min =3D 1, + .brp_max =3D 256, + .brp_inc =3D 1, +}; + +static struct can_bittiming_const ccan_bittiming_const_canfd =3D { + .name =3D DRIVER_NAME, + .tseg1_min =3D 2, + .tseg1_max =3D 64, + .tseg2_min =3D 2, + .tseg2_max =3D 16, + .sjw_max =3D 16, + .brp_min =3D 1, + .brp_max =3D 256, + .brp_inc =3D 1, +}; + +static struct can_bittiming_const ccan_data_bittiming_const_canfd =3D { + .name =3D DRIVER_NAME, + .tseg1_min =3D 1, + .tseg1_max =3D 16, + .tseg2_min =3D 2, + .tseg2_max =3D 8, + .sjw_max =3D 8, + .brp_min =3D 1, + .brp_max =3D 256, + .brp_inc =3D 1, +}; + +static inline u32 ccan_read_reg(const struct ccan_priv *priv, u8 reg) +{ + return ioread32(priv->reg_base + reg); +} + +static inline void ccan_write_reg(const struct ccan_priv *priv, u8 reg, u3= 2 value) +{ + iowrite32(value, priv->reg_base + reg); +} + +static inline u8 ccan_read_reg_8bit(const struct ccan_priv *priv, + enum ccan_reg reg) +{ + u8 reg_down; + union val { + u8 val_8[4]; + u32 val_32; + } val; + + reg_down =3D ALIGN_DOWN(reg, 4); + val.val_32 =3D ccan_read_reg(priv, reg_down); + return val.val_8[reg - reg_down]; +} + +static inline void ccan_write_reg_8bit(const struct ccan_priv *priv, + enum ccan_reg reg, u8 value) +{ + u8 reg_down; + union val { + u8 val_8[4]; + u32 val_32; + } val; + + reg_down =3D ALIGN_DOWN(reg, 4); + val.val_32 =3D ccan_read_reg(priv, reg_down); + val.val_8[reg - reg_down] =3D value; + ccan_write_reg(priv, reg_down, val.val_32); +} + +static void ccan_reg_set_bits(const struct ccan_priv *priv, + enum ccan_reg reg, + enum ccan_reg_bit_mask bits) +{ + u8 val; + + val =3D ccan_read_reg_8bit(priv, reg); + val |=3D bits; + ccan_write_reg_8bit(priv, reg, val); +} + +static void ccan_reg_clear_bits(const struct ccan_priv *priv, + enum ccan_reg reg, + enum ccan_reg_bit_mask bits) +{ + u8 val; + + val =3D ccan_read_reg_8bit(priv, reg); + val &=3D ~bits; + ccan_write_reg_8bit(priv, reg, val); +} + +static void ccan_set_reset_mode(struct net_device *ndev) +{ + struct ccan_priv *priv =3D netdev_priv(ndev); + + ccan_reg_set_bits(priv, CCAN_CFG_STAT, CCAN_RST_MASK); +} + +static int ccan_bittime_configuration(struct net_device *ndev) +{ + struct ccan_priv *priv =3D netdev_priv(ndev); + struct can_bittiming *bt =3D &priv->can.bittiming; + struct can_bittiming *dbt =3D &priv->can.data_bittiming; + u32 bittiming, data_bittiming; + u8 reset_test; + + reset_test =3D ccan_read_reg_8bit(priv, CCAN_CFG_STAT); + + if (!(reset_test & CCAN_RST_MASK)) { + netdev_alert(ndev, "Not in reset mode, cannot set bit timing\n"); + return -EPERM; + } + + /* Check the bittime parameter */ + if ((((int)(bt->phase_seg1 + bt->prop_seg + 1) - 2) < 0) || + (((int)(bt->phase_seg2) - 1) < 0) || + (((int)(bt->sjw) - 1) < 0) || + (((int)(bt->brp) - 1) < 0)) + return -EINVAL; + + bittiming =3D ((bt->phase_seg1 + bt->prop_seg + 1 - 2) << SEG_1_SHIFT) | + ((bt->phase_seg2 - 1) << SEG_2_SHIFT) | + ((bt->sjw - 1) << SJW_SHIFT) | + ((bt->brp - 1) << PRESC_SHIFT); + + ccan_write_reg(priv, CCAN_S_SEG_1, bittiming); + + if (priv->cantype =3D=3D CAST_CAN_TYPE_CANFD) { + if ((((int)(dbt->phase_seg1 + dbt->prop_seg + 1) - 2) < 0) || + (((int)(dbt->phase_seg2) - 1) < 0) || + (((int)(dbt->sjw) - 1) < 0) || + (((int)(dbt->brp) - 1) < 0)) + return -EINVAL; + + data_bittiming =3D ((dbt->phase_seg1 + dbt->prop_seg + 1 - 2) << SEG_1_S= HIFT) | + ((dbt->phase_seg2 - 1) << SEG_2_SHIFT) | + ((dbt->sjw - 1) << SJW_SHIFT) | + ((dbt->brp - 1) << PRESC_SHIFT); + + ccan_write_reg(priv, CCAN_F_SEG_1, data_bittiming); + } + + ccan_reg_clear_bits(priv, CCAN_CFG_STAT, CCAN_RST_MASK); + + netdev_dbg(ndev, "Slow bit rate: %08x\n", ccan_read_reg(priv, CCAN_S_SEG_= 1)); + netdev_dbg(ndev, "Fast bit rate: %08x\n", ccan_read_reg(priv, CCAN_F_SEG_= 1)); + + return 0; +} + +static int ccan_chip_start(struct net_device *ndev) +{ + struct ccan_priv *priv =3D netdev_priv(ndev); + int err; + + ccan_set_reset_mode(ndev); + + err =3D ccan_bittime_configuration(ndev); + if (err) { + netdev_err(ndev, "Bittime setting failed!\n"); + return err; + } + + /* Set Almost Full Warning Limit */ + ccan_reg_set_bits(priv, CCAN_LIMIT, CCAN_AFWL_MASK); + + /* Programmable Error Warning Limit =3D (EWL+1)*8. Set EWL=3D11->Error Wa= rning=3D96 */ + ccan_reg_set_bits(priv, CCAN_LIMIT, CCAN_EWL_MASK); + + /* Interrupts enable */ + ccan_write_reg_8bit(priv, CCAN_RTIE, CCAN_INTR_ALL_MASK); + + /* Error Interrupts enable(Error Passive and Bus Error) */ + ccan_reg_set_bits(priv, CCAN_ERRINT, CCAN_EPIE_MASK); + + /* Check whether it is loopback mode or normal mode */ + if (priv->can.ctrlmode & CAN_CTRLMODE_LOOPBACK) + ccan_reg_set_bits(priv, CCAN_CFG_STAT, CCAN_LBMIMOD_MASK); + else + ccan_reg_clear_bits(priv, CCAN_CFG_STAT, CCAN_LBMEMOD_MASK | CCAN_LBMIMO= D_MASK); + + priv->can.state =3D CAN_STATE_ERROR_ACTIVE; + + return 0; +} + +static int ccan_do_set_mode(struct net_device *ndev, enum can_mode mode) +{ + int ret; + + switch (mode) { + case CAN_MODE_START: + ret =3D ccan_chip_start(ndev); + if (ret) { + netdev_err(ndev, "Could not start CAN device !\n"); + return ret; + } + netif_wake_queue(ndev); + break; + default: + ret =3D -EOPNOTSUPP; + break; + } + + return ret; +} + +static void ccan_tx_interrupt(struct net_device *ndev, u8 isr) +{ + struct ccan_priv *priv =3D netdev_priv(ndev); + + /* wait till transmission of the PTB or STB finished */ + while (isr & (CCAN_TPIF_MASK | CCAN_TSIF_MASK)) { + if (isr & CCAN_TPIF_MASK) + ccan_reg_set_bits(priv, CCAN_RTIF, CCAN_TPIF_MASK); + + if (isr & CCAN_TSIF_MASK) + ccan_reg_set_bits(priv, CCAN_RTIF, CCAN_TSIF_MASK); + + isr =3D ccan_read_reg_8bit(priv, CCAN_RTIF); + } + + ndev->stats.tx_bytes +=3D can_get_echo_skb(ndev, 0, NULL); + ndev->stats.tx_packets++; + netif_wake_queue(ndev); +} + +static void ccan_rxfull_interrupt(struct net_device *ndev, u8 isr) +{ + struct ccan_priv *priv =3D netdev_priv(ndev); + + if (isr & CCAN_RAFIF_MASK) + ccan_reg_set_bits(priv, CCAN_RTIF, CCAN_RAFIF_MASK); + + if (isr & (CCAN_RAFIF_MASK | CCAN_RFIF_MASK)) + ccan_reg_set_bits(priv, CCAN_RTIF, CCAN_RAFIF_MASK | CCAN_RFIF_MASK); +} + +static enum can_state ccan_get_chip_status(struct net_device *ndev) +{ + struct ccan_priv *priv =3D netdev_priv(ndev); + u8 can_stat, eir; + + can_stat =3D ccan_read_reg_8bit(priv, CCAN_CFG_STAT); + eir =3D ccan_read_reg_8bit(priv, CCAN_ERRINT); + + if (can_stat & CCAN_BUSOFF_MASK) + return CAN_STATE_BUS_OFF; + + if (eir & CCAN_EPASS_MASK) + return CAN_STATE_ERROR_PASSIVE; + + if (eir & CCAN_EWARN_MASK) + return CAN_STATE_ERROR_WARNING; + + return CAN_STATE_ERROR_ACTIVE; +} + +static void ccan_error_interrupt(struct net_device *ndev, u8 isr, u8 eir) +{ + struct ccan_priv *priv =3D netdev_priv(ndev); + struct net_device_stats *stats =3D &ndev->stats; + struct can_frame *cf; + struct sk_buff *skb; + u8 koer, recnt =3D 0, tecnt =3D 0, can_stat =3D 0; + + skb =3D alloc_can_err_skb(ndev, &cf); + + koer =3D ccan_read_reg_8bit(priv, CCAN_EALCAP) & CCAN_KOER_MASK; + recnt =3D ccan_read_reg_8bit(priv, CCAN_RECNT); + tecnt =3D ccan_read_reg_8bit(priv, CCAN_TECNT); + + /* Read CAN status */ + can_stat =3D ccan_read_reg_8bit(priv, CCAN_CFG_STAT); + + /* Bus off ---> active error mode */ + if ((isr & CCAN_EIF_MASK) && priv->can.state =3D=3D CAN_STATE_BUS_OFF) + priv->can.state =3D ccan_get_chip_status(ndev); + + /* State selection */ + if (can_stat & CCAN_BUSOFF_MASK) { + priv->can.state =3D ccan_get_chip_status(ndev); + priv->can.can_stats.bus_off++; + ccan_reg_set_bits(priv, CCAN_CFG_STAT, CCAN_BUSOFF_MASK); + can_bus_off(ndev); + if (skb) + cf->can_id |=3D CAN_ERR_BUSOFF; + } else if (eir & CCAN_EPASS_MASK) { + priv->can.state =3D ccan_get_chip_status(ndev); + priv->can.can_stats.error_passive++; + if (skb) { + cf->can_id |=3D CAN_ERR_CRTL; + cf->data[1] |=3D (recnt > 127) ? CAN_ERR_CRTL_RX_PASSIVE : 0; + cf->data[1] |=3D (tecnt > 127) ? CAN_ERR_CRTL_TX_PASSIVE : 0; + cf->data[6] =3D tecnt; + cf->data[7] =3D recnt; + } + } else if (eir & CCAN_EWARN_MASK) { + priv->can.state =3D ccan_get_chip_status(ndev); + priv->can.can_stats.error_warning++; + if (skb) { + cf->can_id |=3D CAN_ERR_CRTL; + cf->data[1] |=3D (recnt > 95) ? CAN_ERR_CRTL_RX_WARNING : 0; + cf->data[1] |=3D (tecnt > 95) ? CAN_ERR_CRTL_TX_WARNING : 0; + cf->data[6] =3D tecnt; + cf->data[7] =3D recnt; + } + } + + /* Check for in protocol defined error interrupt */ + if (eir & CCAN_BEIF_MASK) { + if (skb) + cf->can_id |=3D CAN_ERR_BUSERROR | CAN_ERR_PROT; + + if (koer =3D=3D CCAN_BIT_ERROR_MASK) { + stats->tx_errors++; + if (skb) + cf->data[2] =3D CAN_ERR_PROT_BIT; + } else if (koer =3D=3D CCAN_FORM_ERROR_MASK) { + stats->rx_errors++; + if (skb) + cf->data[2] =3D CAN_ERR_PROT_FORM; + } else if (koer =3D=3D CCAN_STUFF_ERROR_MASK) { + stats->rx_errors++; + if (skb) + cf->data[3] =3D CAN_ERR_PROT_STUFF; + } else if (koer =3D=3D CCAN_ACK_ERROR_MASK) { + stats->tx_errors++; + if (skb) + cf->data[2] =3D CAN_ERR_PROT_LOC_ACK; + } else if (koer =3D=3D CCAN_CRC_ERROR_MASK) { + stats->rx_errors++; + if (skb) + cf->data[2] =3D CAN_ERR_PROT_LOC_CRC_SEQ; + } + priv->can.can_stats.bus_error++; + } + + if (skb) { + stats->rx_packets++; + stats->rx_bytes +=3D cf->can_dlc; + netif_rx(skb); + } + + netdev_dbg(ndev, "Recnt is 0x%02x", ccan_read_reg_8bit(priv, CCAN_RECNT)); + netdev_dbg(ndev, "Tecnt is 0x%02x", ccan_read_reg_8bit(priv, CCAN_TECNT)); +} + +static irqreturn_t ccan_interrupt(int irq, void *dev_id) +{ + struct net_device *ndev =3D (struct net_device *)dev_id; + struct ccan_priv *priv =3D netdev_priv(ndev); + u8 isr, eir; + u8 isr_handled =3D 0, eir_handled =3D 0; + + /* Read the value of interrupt status register */ + isr =3D ccan_read_reg_8bit(priv, CCAN_RTIF); + + /* Read the value of error interrupt register */ + eir =3D ccan_read_reg_8bit(priv, CCAN_ERRINT); + + /* Check for Tx interrupt and processing it */ + if (isr & (CCAN_TPIF_MASK | CCAN_TSIF_MASK)) { + ccan_tx_interrupt(ndev, isr); + isr_handled |=3D (CCAN_TPIF_MASK | CCAN_TSIF_MASK); + } + + if (isr & (CCAN_RAFIF_MASK | CCAN_RFIF_MASK)) { + ccan_rxfull_interrupt(ndev, isr); + isr_handled |=3D (CCAN_RAFIF_MASK | CCAN_RFIF_MASK); + } + + /* Check Rx interrupt and processing the receive interrupt routine */ + if (isr & CCAN_RIF_MASK) { + ccan_reg_clear_bits(priv, CCAN_RTIE, CCAN_RIE_MASK); + ccan_reg_set_bits(priv, CCAN_RTIF, CCAN_RIF_MASK); + + napi_schedule(&priv->napi); + isr_handled |=3D CCAN_RIF_MASK; + } + + if ((isr & CCAN_EIF_MASK) | (eir & (CCAN_EPIF_MASK | CCAN_BEIF_MASK))) { + /* Reset EPIF and BEIF. Reset EIF */ + ccan_reg_set_bits(priv, CCAN_ERRINT, eir & (CCAN_EPIF_MASK | CCAN_BEIF_M= ASK)); + ccan_reg_set_bits(priv, CCAN_RTIF, isr & CCAN_EIF_MASK); + + ccan_error_interrupt(ndev, isr, eir); + + isr_handled |=3D CCAN_EIF_MASK; + eir_handled |=3D (CCAN_EPIF_MASK | CCAN_BEIF_MASK); + } + + if (isr_handled =3D=3D 0 && eir_handled =3D=3D 0) { + netdev_err(ndev, "Unhandled interrupt!\n"); + return IRQ_NONE; + } + + return IRQ_HANDLED; +} + +static int ccan_open(struct net_device *ndev) +{ + struct ccan_priv *priv =3D netdev_priv(ndev); + int ret; + + ret =3D clk_bulk_prepare_enable(ARRAY_SIZE(priv->clks), priv->clks); + if (ret) { + netdev_err(ndev, "Failed to enable CAN clocks\n"); + return ret; + } + + /* Set chip into reset mode */ + ccan_set_reset_mode(ndev); + + /* Common open */ + ret =3D open_candev(ndev); + if (ret) + goto clk_exit; + + /* Register interrupt handler */ + ret =3D devm_request_irq(priv->dev, ndev->irq, ccan_interrupt, IRQF_SHARE= D, + ndev->name, ndev); + if (ret) { + netdev_err(ndev, "Request_irq err: %d\n", ret); + goto candev_exit; + } + + ret =3D ccan_chip_start(ndev); + if (ret) { + netdev_err(ndev, "Could not start CAN device !\n"); + goto candev_exit; + } + + napi_enable(&priv->napi); + netif_start_queue(ndev); + + return 0; + +candev_exit: + close_candev(ndev); +clk_exit: + clk_bulk_disable_unprepare(ARRAY_SIZE(priv->clks), priv->clks); + return ret; +} + +static int ccan_close(struct net_device *ndev) +{ + struct ccan_priv *priv =3D netdev_priv(ndev); + + netif_stop_queue(ndev); + napi_disable(&priv->napi); + + ccan_set_reset_mode(ndev); + priv->can.state =3D CAN_STATE_STOPPED; + + close_candev(ndev); + clk_bulk_disable_unprepare(ARRAY_SIZE(priv->clks), priv->clks); + + return 0; +} + +static netdev_tx_t ccan_start_xmit(struct sk_buff *skb, struct net_device = *ndev) +{ + struct ccan_priv *priv =3D netdev_priv(ndev); + struct canfd_frame *cf =3D (struct canfd_frame *)skb->data; + u32 id, ctl, addr_off =3D CCAN_TBUF_DATA; + int i; + + if (can_dropped_invalid_skb(ndev, skb)) + return NETDEV_TX_OK; + + netif_stop_queue(ndev); + + /* Work in XMIT_PTB mode */ + ccan_reg_clear_bits(priv, CCAN_TCMD, CCAN_TBSEL_MASK); + + ccan_reg_clear_bits(priv, CCAN_TCMD, CCAN_STBY_MASK); + + id =3D cf->can_id & ((cf->can_id & CAN_EFF_FLAG) ? CAN_EFF_MASK : CAN_SFF= _MASK); + + ctl =3D can_fd_len2dlc(cf->len); + ctl =3D (cf->can_id & CAN_EFF_FLAG) ? (ctl | CCAN_IDE_MASK) : (ctl & ~CCA= N_IDE_MASK); + + if (priv->cantype =3D=3D CAST_CAN_TYPE_CANFD && can_is_canfd_skb(skb)) { + ctl |=3D (cf->flags & CANFD_BRS) ? (CCAN_BRS_MASK | CCAN_EDL_MASK) : CCA= N_EDL_MASK; + + for (i =3D 0; i < cf->len; i +=3D 4) { + ccan_write_reg(priv, addr_off, *((u32 *)(cf->data + i))); + addr_off +=3D 4; + } + } else { + ctl &=3D ~(CCAN_EDL_MASK | CCAN_BRS_MASK); + + if (cf->can_id & CAN_RTR_FLAG) { + ctl |=3D CCAN_RTR_MASK; + } else { + ctl &=3D ~CCAN_RTR_MASK; + ccan_write_reg(priv, addr_off, *((u32 *)(cf->data + 0))); + ccan_write_reg(priv, addr_off + 4, *((u32 *)(cf->data + 4))); + } + } + + ccan_write_reg(priv, CCAN_TBUF_ID, id); + ccan_write_reg(priv, CCAN_TBUF_CTL, ctl); + ccan_reg_set_bits(priv, CCAN_TCMD, CCAN_TPE_MASK); + + can_put_echo_skb(skb, ndev, 0, 0); + + return NETDEV_TX_OK; +} + +static const struct net_device_ops ccan_netdev_ops =3D { + .ndo_open =3D ccan_open, + .ndo_stop =3D ccan_close, + .ndo_start_xmit =3D ccan_start_xmit, + .ndo_change_mtu =3D can_change_mtu, +}; + +static int ccan_rx(struct net_device *ndev) +{ + struct ccan_priv *priv =3D netdev_priv(ndev); + struct net_device_stats *stats =3D &ndev->stats; + struct canfd_frame *cf_fd; + struct can_frame *cf; + struct sk_buff *skb; + u32 can_id; + u8 dlc, control; + int i; + + control =3D ccan_read_reg_8bit(priv, CCAN_RBUF_CTL); + can_id =3D ccan_read_reg(priv, CCAN_RUBF_ID); + dlc =3D ccan_read_reg_8bit(priv, CCAN_RBUF_CTL) & CCAN_DLC_MASK; + + if (control & CCAN_EDL_MASK) + /* allocate sk_buffer for canfd frame */ + skb =3D alloc_canfd_skb(ndev, &cf_fd); + else + /* allocate sk_buffer for can frame */ + skb =3D alloc_can_skb(ndev, &cf); + + if (!skb) { + stats->rx_dropped++; + return 0; + } + + /* Change the CANFD or CAN2.0 data into socketcan data format */ + if (control & CCAN_EDL_MASK) + cf_fd->len =3D can_fd_dlc2len(dlc); + else + cf->can_dlc =3D can_cc_dlc2len(dlc); + + /* Change the CANFD or CAN2.0 id into socketcan id format */ + if (control & CCAN_EDL_MASK) { + cf_fd->can_id =3D can_id; + cf_fd->can_id =3D (control & CCAN_IDE_MASK) ? (cf_fd->can_id | CAN_EFF_F= LAG) : + (cf_fd->can_id & ~CAN_EFF_FLAG); + } else { + cf->can_id =3D can_id; + cf->can_id =3D (control & CCAN_IDE_MASK) ? (cf->can_id | CAN_EFF_FLAG) : + (cf->can_id & ~CAN_EFF_FLAG); + } + + if (!(control & CCAN_EDL_MASK)) + if (control & CCAN_RTR_MASK) + cf->can_id |=3D CAN_RTR_FLAG; + + if (control & CCAN_EDL_MASK) { + for (i =3D 0; i < cf_fd->len; i +=3D 4) + *((u32 *)(cf_fd->data + i)) =3D ccan_read_reg(priv, CCAN_RBUF_DATA + i); + } else { + /* skb reads the received datas, if the RTR bit not set */ + if (!(control & CCAN_RTR_MASK)) { + *((u32 *)(cf->data + 0)) =3D ccan_read_reg(priv, CCAN_RBUF_DATA); + *((u32 *)(cf->data + 4)) =3D ccan_read_reg(priv, CCAN_RBUF_DATA + 4); + } + } + + ccan_reg_set_bits(priv, CCAN_RCTRL, CCAN_RREL_MASK); + + stats->rx_bytes +=3D (control & CCAN_EDL_MASK) ? cf_fd->len : cf->can_dlc; + stats->rx_packets++; + netif_receive_skb(skb); + + return 1; +} + +static int ccan_rx_poll(struct napi_struct *napi, int quota) +{ + struct net_device *ndev =3D napi->dev; + struct ccan_priv *priv =3D netdev_priv(ndev); + int work_done =3D 0; + u8 rx_status =3D 0; + + rx_status =3D ccan_read_reg_8bit(priv, CCAN_RCTRL); + + /* Clear receive interrupt and deal with all the received frames */ + while ((rx_status & CCAN_RSTAT_NOT_EMPTY_MASK) && (work_done < quota)) { + work_done +=3D ccan_rx(ndev); + + rx_status =3D ccan_read_reg_8bit(priv, CCAN_RCTRL); + } + + napi_complete(napi); + ccan_reg_set_bits(priv, CCAN_RTIE, CCAN_RIE_MASK); + + return work_done; +} + +static int ccan_driver_probe(struct platform_device *pdev) +{ + struct net_device *ndev; + struct ccan_priv *priv; + const struct cast_can_data *ddata; + void __iomem *addr; + int ret; + + addr =3D devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(addr)) { + ret =3D PTR_ERR(addr); + goto exit; + } + + ddata =3D of_device_get_match_data(&pdev->dev); + if (!ddata) + return -ENODEV; + + ndev =3D alloc_candev(sizeof(struct ccan_priv), 1); + if (!ndev) { + ret =3D -ENOMEM; + goto exit; + } + + priv =3D netdev_priv(ndev); + priv->dev =3D &pdev->dev; + priv->cantype =3D ddata->cantype; + priv->can.bittiming_const =3D ddata->bittime_const; + + if (ddata->syscon_update) { + ret =3D ddata->syscon_update(priv); + if (ret) + goto free_exit; + } + + priv->clks[0].id =3D "apb"; + priv->clks[1].id =3D "timer"; + priv->clks[2].id =3D "core"; + + ret =3D devm_clk_bulk_get(&pdev->dev, ARRAY_SIZE(priv->clks), priv->clks); + if (ret) { + ret =3D dev_err_probe(&pdev->dev, ret, "Failed to get CAN clocks\n"); + goto free_exit; + } + + ret =3D clk_bulk_prepare_enable(ARRAY_SIZE(priv->clks), priv->clks); + if (ret) { + ret =3D dev_err_probe(&pdev->dev, ret, "Failed to enable CAN clocks\n"); + goto free_exit; + } + + priv->resets =3D devm_reset_control_array_get_exclusive(&pdev->dev); + if (IS_ERR(priv->resets)) { + ret =3D dev_err_probe(&pdev->dev, PTR_ERR(priv->resets), + "Failed to get CAN resets"); + goto clk_exit; + } + + ret =3D reset_control_deassert(priv->resets); + if (ret) + goto clk_exit; + + if (priv->cantype =3D=3D CAST_CAN_TYPE_CANFD) { + priv->can.ctrlmode_supported =3D CAN_CTRLMODE_LOOPBACK | CAN_CTRLMODE_FD; + priv->can.data_bittiming_const =3D &ccan_data_bittiming_const_canfd; + } else { + priv->can.ctrlmode_supported =3D CAN_CTRLMODE_LOOPBACK; + } + + priv->reg_base =3D addr; + priv->can.clock.freq =3D clk_get_rate(priv->clks[2].clk); + priv->can.do_set_mode =3D ccan_do_set_mode; + ndev->irq =3D platform_get_irq(pdev, 0); + + /* We support local echo */ + ndev->flags |=3D IFF_ECHO; + ndev->netdev_ops =3D &ccan_netdev_ops; + + platform_set_drvdata(pdev, ndev); + SET_NETDEV_DEV(ndev, &pdev->dev); + + netif_napi_add_tx_weight(ndev, &priv->napi, ccan_rx_poll, 16); + ret =3D register_candev(ndev); + if (ret) { + dev_err(&pdev->dev, "Failed to register (err=3D%d)\n", ret); + goto reset_exit; + } + + dev_dbg(&pdev->dev, "Driver registered: regs=3D%p, irp=3D%d, clock=3D%d\n= ", + priv->reg_base, ndev->irq, priv->can.clock.freq); + + return 0; + +reset_exit: + reset_control_assert(priv->resets); +clk_exit: + clk_bulk_disable_unprepare(ARRAY_SIZE(priv->clks), priv->clks); +free_exit: + free_candev(ndev); +exit: + return ret; +} + +static void ccan_driver_remove(struct platform_device *pdev) +{ + struct net_device *ndev =3D platform_get_drvdata(pdev); + struct ccan_priv *priv =3D netdev_priv(ndev); + + reset_control_assert(priv->resets); + clk_bulk_disable_unprepare(ARRAY_SIZE(priv->clks), priv->clks); + + unregister_candev(ndev); + netif_napi_del(&priv->napi); + free_candev(ndev); +} + +static const struct cast_can_data ccan_canfd_data =3D { + .cantype =3D CAST_CAN_TYPE_CANFD, + .bittime_const =3D &ccan_bittiming_const_canfd, +}; + +static int sf_jh7110_syscon_update(struct ccan_priv *priv) +{ + struct of_phandle_args args; + struct regmap *syscon; + u32 syscon_offset, syscon_shift, syscon_mask, regval; + int ret; + + ret =3D of_parse_phandle_with_fixed_args(priv->dev->of_node, + "starfive,syscon", 3, 0, &args); + if (ret) { + dev_err(priv->dev, "Failed to parse starfive,syscon\n"); + return -EINVAL; + } + + syscon =3D syscon_node_to_regmap(args.np); + of_node_put(args.np); + if (IS_ERR(syscon)) + return PTR_ERR(syscon); + + syscon_offset =3D args.args[0]; + syscon_shift =3D args.args[1]; + syscon_mask =3D args.args[2]; + + /* Enable can2.0/canfd function */ + regval =3D priv->cantype << syscon_shift; + ret =3D regmap_update_bits(syscon, syscon_offset, syscon_mask, regval); + + return ret; +} + +static const struct cast_can_data sf_jh7110_can_data =3D { + .cantype =3D CAST_CAN_TYPE_CAN, + .bittime_const =3D &ccan_bittiming_const, + .syscon_update =3D sf_jh7110_syscon_update, +}; + +static const struct of_device_id ccan_of_match[] =3D { + { .compatible =3D "cast,can-ctrl-fd-7x10N00S00", .data =3D &ccan_canfd_da= ta }, + { .compatible =3D "starfive,jh7110-can", .data =3D &sf_jh7110_can_data }, + { /* end of list */ }, +}; +MODULE_DEVICE_TABLE(of, ccan_of_match); + +static struct platform_driver ccan_driver =3D { + .probe =3D ccan_driver_probe, + .remove =3D ccan_driver_remove, + .driver =3D { + .name =3D DRIVER_NAME, + .of_match_table =3D ccan_of_match, + }, +}; +module_platform_driver(ccan_driver); + +MODULE_DESCRIPTION("CAST CAN Bus Controller Driver"); +MODULE_AUTHOR("Fraunhofer IPMS"); +MODULE_AUTHOR("William Qiu "); +MODULE_AUTHOR("Hal Feng "); +MODULE_LICENSE("GPL"); --=20 2.43.2 From nobody Fri Nov 29 10:47:19 2024 Received: from CHN02-BJS-obe.outbound.protection.partner.outlook.cn (mail-bjschn02on2104.outbound.protection.partner.outlook.cn [139.219.17.104]) (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 02E5E2581; Sun, 22 Sep 2024 15:09:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=139.219.17.104 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727017765; cv=fail; b=MHeklQ5RUpjr6sCz4nSJZMbDxYvujwGdQgE7rtIai6HocJO6EqZtxM5UzAG84Kw2MrEJw+pk9rZqMsI20LRm4DbSfF70isJjVeYj2N2c6g91FniS9pEuTTar3ltvtq3SUGi3FAyJWIGZVvpsQdzBPYMGMqYv9AdZjcDd8sG82G0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727017765; c=relaxed/simple; bh=yIv5AywgoYUiexghGCHAegZn/GjkhYyKIlhJZ3Gd1gU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=kE6Sz2DJnbpixCaxLvDaxExwU5YkOa77KBWxNLfMhCaf1ldJmRuJOwUG312uVC1C0uJ1pwygfuQpTRn1/H96iodf8s/Gxugz5ddYC0qkXkwDP2wG/Xj8v7VWEQrjarUg9d7I+fxVoFsetJhLjbTf7dL1eINniO7Rp2xQ3piJBGE= 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.17.104 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=YWvscdSOZFMCoh2pB09MxQ36ZOG1GHwPMeeE1/xCsqWCDKbLzVMDxBxwpv/6Dg2i4sI+UYS3RO42EErVkw393+VlnUivdxwnGN8yqVL4AWyY47sA1xkBVWzOwQ2RYLbpdnD7j2go2KIYUBR6ohFoXdZ7/Zg3fP7s6l+TNRj2+RC1fhUqDouoEkm4alO3GYFuU1NtuAeX4x1GYTjnBdkjA68lThR30t84h3na/UXK3jvil/Ng8UyoX1s6aQUGvACwpQ+twAkwydFxZjbLuAaodR7fowsjatoyOkuc0SIX9IMUsbcB1jsitb1cNRrw7e9PBmg9hAhMO4/6eyxzjjS0bg== 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=boQOFNz2EK8l2+Om/smGByT0hie5kB/d7HNghFz/its=; b=S7JlchTkOStbUQrC60aDwmF5s91e2evWQg46UaLTp0uzzYodD9sX4lKUTDtGYXuYyHM0owe4ZjXYSSPT1RhV4ncd7o9v415yoMGZunhniy93a04aZNqjY6EBAlwyZoXA1qr0EsNBygb5btCYX6rekB2bWMrI1xtNcnMogPO5mp3OJzdEpXJIUGhsoBZKnZ7rCmgHv6mlpfArMKLnIDoPCm08FzCsdR2MPpn8terFMlt8U22ByspdEKEmijhLk0LoAul6gE5J8KXYYpdWm9G5mwiWv38zwmZHOOtvGEC0+20j+37F9FWAdn9sPzySwADJU4427cDNeyfNhxDUYt2e9g== 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 ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:7::14) by ZQ2PR01MB1145.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.30; Sun, 22 Sep 2024 14:52:05 +0000 Received: from ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn ([fe80::2595:ef4d:fae:37d7]) by ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn ([fe80::2595:ef4d:fae:37d7%4]) with mapi id 15.20.7962.029; Sun, 22 Sep 2024 14:52:05 +0000 From: Hal Feng To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marc Kleine-Budde , Vincent Mailhol , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Philipp Zabel , Palmer Dabbelt , Paul Walmsley , Albert Ou Cc: Emil Renner Berthing , William Qiu , Hal Feng , devicetree@vger.kernel.org, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/4] riscv: dts: starfive: jh7110: Add CAN nodes Date: Sun, 22 Sep 2024 22:51:50 +0800 Message-ID: <20240922145151.130999-5-hal.feng@starfivetech.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240922145151.130999-1-hal.feng@starfivetech.com> References: <20240922145151.130999-1-hal.feng@starfivetech.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SHXPR01CA0027.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:1b::36) To ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:7::14) 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: ZQ2PR01MB1307:EE_|ZQ2PR01MB1145:EE_ X-MS-Office365-Filtering-Correlation-Id: cfea74a7-0952-42b0-1b07-08dcdb161fbe X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0;ARA:13230040|41320700013|7416014|366016|52116014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: 5P4p6SelbiLdbau+aFsXuIQ3zucWTYeq2q6ZVytPDdBqwJPlxGMLL4MlQQVJ6/p37axjKKq4Ip/6Rz3HwDt5x6N79Io+Xcyy2OImpRbKzrHmJw+CGcUEg0j/EsrX6BB8n+68vryGDSDEsrwxR90STdmrINpFp/rDZMN1r6+XU+S1RICcLLg3NT6YJSqlzPDnK83oxi8/GTJ9adwoAV1fWgq4G5rryhAIbHnSmes6xJBEMyJPR8KVMvb3nXALSl2sRCrCaauUlz86vBKMjx+GfhOP3CzfEUNH7emUNm1/trJXR+Pm/keGuKLgUCf7CsqQnoomqcdZAne3PQO9a+LdykIekEhRzVkCrz4giyzvaolLWh9KXM/KSNb7Df3cHcE0REN1vfj7/pVBUMXjxzhlwdOP20WCdpA97AJ5JThb3iICTJ1LmWZ2P38X/uNWntcwFZjt9WfE1v+24kgxLItA2H89/uNUPyVlAePZGACbNgC53NMSzIaX1AdH/ogpGGbG9sMqmghuW8GdCqhlVIwN198G3WB9kwlrtm6Dfnz7XpzqVZETEtdlp4zvClX25Zew+qt/TN66/Smq5Rnh4p4jBhlJyjHs7Lu9g9/61bSJXdYFFm/MIBwRTV4n9rlkFUfFVUx5q3aFAIM8Q5uiwWWbgQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230040)(41320700013)(7416014)(366016)(52116014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?viW24WfvDb1tv6OLIE9BdZltT2YPPbsxNRq/0FZHEY2/JDwhoLZY/WEWGn5J?= =?us-ascii?Q?CssKL3yYfSYLnS98qEbp4dNQSxi3fZM7dBfl+JgUOTUQsYVWZgeW+XSyrTPI?= =?us-ascii?Q?XDtc6pXu2G4+XNCSEQ7TEvyQxMEmjZBU484dNMYMpxWXBY6a6w/GaePotNU5?= =?us-ascii?Q?gvuXn4cPxuEf+A8iyDAzyJSgdZy20SPKRtELoskdUY+6p8d/pUMKivrq0JBp?= =?us-ascii?Q?pofjvXA4VlJlfntF6si4+i+h5P/NAzSrfOgvXv6iIr1hudJXY7IN5WQ+WbB/?= =?us-ascii?Q?/mMb8x3YCxZrONyMT+pVtWmnCv3f3GENG46qu6qlAxnxBZnzkVBJr+ILyCSG?= =?us-ascii?Q?Z4FjD9+6LzdtElqdtawH0ZniQPJ/CvXMCJ8nZxI7vHPn2QqRTvm2F9HEuZCt?= =?us-ascii?Q?j/Zf098BNYdkIhEXtQmPPyD8uiJqEllzrixP1GfRRQ9QUn2tkAz6AcxDe221?= =?us-ascii?Q?45b/O8+Wo+byt1BFvND3F/t69oxZflOuLS3KctROdMHXySEPCYQINrhMGvUv?= =?us-ascii?Q?Lr7SeR5W4qy+BqxiBSWSyZIjERJoGZN/kVm3d2svurr3QEJWMftBWWGnm+dJ?= =?us-ascii?Q?TS2pByrPA62k7/ApH/TN38kmv08kW7vZzqZSsKRKeHPLkC4af+vRfeiaknnj?= =?us-ascii?Q?8RfMfNCpV9y9ZxaNVLjTAi4jHxslYVj7U6XmOpohsmjf8dJpH7f+rwNfpmr5?= =?us-ascii?Q?SoSWXiDkr7893ZmEZDRNV+rpGNiUxhsu+Q4WBpWCLCnEvLCNbWczbO4pLkkA?= =?us-ascii?Q?XgOA1zc45uq6rwib/iTTmGqPIGHzT/ie/WAXFh1bYSQ1Vc+iW1AhhQy0b0E8?= =?us-ascii?Q?TfTYPFH7SZ/AUPKc7MSAfvshAh7KtMbpgYCt0bPiMl/vH+4tz6NZ6DyfCfUz?= =?us-ascii?Q?VIx9h0g0CLxR2VX//F+sjpCWY0IBCyniFAWmcueXXodPTxNEZZJ8MRPf4FEO?= =?us-ascii?Q?WeOPJ+j1AmwBfHoije4Y2egsmJXGSv68/zCKnKqZjJXpf9P9vHnXURBbE5uw?= =?us-ascii?Q?o74yP8p8XFGjmI+Z4ipbae996o5RhRu1FacUyF3Q6hhjwkK3blZwuW3H7vvu?= =?us-ascii?Q?r2Xq/mMu/Bqk67SNcnU3/3Mcxl+s31dg9YR9BtWrKa5jTVeVRSZbn9b6ChVt?= =?us-ascii?Q?sDDLeIEaBi6Sy73C3J1zZDYJ8hnWs4GfQBaEXiTyGtMv7DRsaPi3RShrQ8Sq?= =?us-ascii?Q?gY/KOeAfZWSxrLA9hm7NL0OhQVJc2JSQc2a2bsVDNKip2T+VEPN0CwcSr5/v?= =?us-ascii?Q?m5X1WKH6H64dePamk+9csPKrPhayYkL/rrjY6rjSePyMETo9TqbieGHrAcu8?= =?us-ascii?Q?EBtXytNLfRaenCF39UHhFZdC4mkQ8au0Q7XgWHBTYlo/sQK7ooiPT0IcpRP5?= =?us-ascii?Q?Wsf7FZuNJG4k5seUknmNQLMtlNjDXM4yE7vVbvIs9rCeyBn6P3dMN38bq9P4?= =?us-ascii?Q?RPFDKjpby+QFYgGAHQUS0q81PLlreU0SUbSGEWL+is/y8M62T1Hi8KXIcong?= =?us-ascii?Q?OArfR66FJFDMmAvuefbK3n9+48To5iz+Lwkkueh7oHMAp6c4W8hB0F2O+7rC?= =?us-ascii?Q?B2ISm3TRwH8pLKwlOIQ5sIJE6qeXBM79Bvv7GQVvPMW+YnRfe7OZPlpflcUj?= =?us-ascii?Q?RA=3D=3D?= X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: cfea74a7-0952-42b0-1b07-08dcdb161fbe X-MS-Exchange-CrossTenant-AuthSource: ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2024 14:52:04.9079 (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: E4/D3q9LKbwZzsVogxJXMM6vijOUDiIqay45GMD7eLn4/j8BSLTb0PJ2t0OKIY//Q8PeV0bQsPgSPr23RaaAhXAz2z9YeiNk9WxoNM3L000= X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZQ2PR01MB1145 Content-Type: text/plain; charset="utf-8" From: William Qiu Add can0/1 support for StarFive JH7110 SoC. Signed-off-by: William Qiu Signed-off-by: Hal Feng --- arch/riscv/boot/dts/starfive/jh7110.dtsi | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts= /starfive/jh7110.dtsi index 0d8339357bad..368cc40829f9 100644 --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi @@ -929,6 +929,38 @@ watchdog@13070000 { <&syscrg JH7110_SYSRST_WDT_CORE>; }; =20 + can0: can@130d0000 { + compatible =3D "starfive,jh7110-can", "cast,can-ctrl-fd-7x10N00S00"; + reg =3D <0x0 0x130d0000 0x0 0x1000>; + interrupts =3D <112>; + clocks =3D <&syscrg JH7110_SYSCLK_CAN0_APB>, + <&syscrg JH7110_SYSCLK_CAN0_TIMER>, + <&syscrg JH7110_SYSCLK_CAN0_CAN>; + clock-names =3D "apb", "timer", "core"; + resets =3D <&syscrg JH7110_SYSRST_CAN0_APB>, + <&syscrg JH7110_SYSRST_CAN0_TIMER>, + <&syscrg JH7110_SYSRST_CAN0_CORE>; + reset-names =3D "apb", "timer", "core"; + starfive,syscon =3D <&sys_syscon 0x10 0x3 0x8>; + status =3D "disabled"; + }; + + can1: can@130e0000 { + compatible =3D "starfive,jh7110-can", "cast,can-ctrl-fd-7x10N00S00"; + reg =3D <0x0 0x130e0000 0x0 0x1000>; + interrupts =3D <113>; + clocks =3D <&syscrg JH7110_SYSCLK_CAN1_APB>, + <&syscrg JH7110_SYSCLK_CAN1_TIMER>, + <&syscrg JH7110_SYSCLK_CAN1_CAN>; + clock-names =3D "apb", "timer", "core"; + resets =3D <&syscrg JH7110_SYSRST_CAN1_APB>, + <&syscrg JH7110_SYSRST_CAN1_TIMER>, + <&syscrg JH7110_SYSRST_CAN1_CORE>; + reset-names =3D "apb", "timer", "core"; + starfive,syscon =3D <&sys_syscon 0x88 0x12 0x40000>; + status =3D "disabled"; + }; + crypto: crypto@16000000 { compatible =3D "starfive,jh7110-crypto"; reg =3D <0x0 0x16000000 0x0 0x4000>; --=20 2.43.2