From patchwork Tue Nov 19 08:10:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Costea X-Patchwork-Id: 13879480 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2077.outbound.protection.outlook.com [40.107.20.77]) (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 35CF415530B for ; Tue, 19 Nov 2024 08:11:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732003865; cv=fail; b=tTZUfIOoF+eNBlVuNihGkztE9lDuHuL/RlpVSyRix4NBFq6kXGDal5amEgHcXZma04NGrLid+WweilPu6Iwd29Pf1FTOdNhpKaHnDxnhr9lZ9LlJn0o7+BHrpZXTHrvNuC5CnKRKWDFEdym5/faw3N1ktUe/RTr6ey601bMM1io= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732003865; c=relaxed/simple; bh=2lC5tG3oSaMMhEya7MsoBHOSGN2fF94UtT4f2Wd32sQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=MR/G92rLctUJykKxqCccg9HbbzUxPE+IZz7ivUDyWL+lZtB9++Diu7MB+duIBsSYb18q4JRY8WY2OJbsGt7FJPmE/zlE/ETKuQMzqezmjSC6okJm3H0iEa8nxy0B0Mfax8NiS/4nrpyEFcgJo/mwFHXxmSNiz0decsvefNznubo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=IMNwiZni; arc=fail smtp.client-ip=40.107.20.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="IMNwiZni" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=W7Cd1Fu2l2nGa4On9FUzqoLmbwyoA5hvp/8wKMdnc0+9xsYAFTMt1AZyNKaIH+NpqLd9HlsnX0KzcZkZ75F6FjU8SRl22Lx7fp1LSpvChFEmaPf51UO0KutHIQucNP1sUFhGKL8zrH8YWouuWzdrYCExvhCTgydOkekn90yKgq6qr/uPex+ilJeixpNN6JHInwcBOi9beIGHWU9sTDfMcccoVlvwkISxXv01h0Wuqz9hrylanWSf9hnhR3PMj5U/KtJEtWRETyj6my80HInSdyrxTEXqii6PcaRCRrjc8CpdUfJIIeOdJxt+TMXHQwTd90aJXexi2egHn/orB5b93Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Zm+Ou+Qc6KomIYnh+sPgqRr7u/wWjPGAlWW15rwFxcE=; b=ZoWMns50cQmBcOuAmmnzoC5WlcVqTjVKqSfZNXhlGf5TZykt0yngjjl/k9YYh+BN1jku2kPLUYavOcsndJmAcLVNuid4Tst2ruQubfTHwmX8KVzsm8w9pbFl5QC9XsSqC7WHNjteAJWEDlqAf0kWD1NbhNe70p5UfTa1Vnr8pYb6OO5vwnxj+so3DSB4BUAmVXMESKZjr18Anh79WOvoobHFgVGuS87hoztrP0ATUWNH4whN6BoEwzEeL0O3moqqiLKu/zwZ7aMVJikxYKuS7IoSkiDmNDtL/Y5sr4AfSHDK7OoI2Kid42alD3vwKFWKqKcyVmmPKhC7CrPD7q/VHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zm+Ou+Qc6KomIYnh+sPgqRr7u/wWjPGAlWW15rwFxcE=; b=IMNwiZnigfRknjgOacOKw2CpbSwthOtIPHnp2WPUpG4Y2MfCF+ozsLFJ6TT/6z0b63bDF1mb4D4JkmLy8OjgWWjku+ksvS6K3zklfpwoHrFtlJ1r42ENBxirb9u/pxYyh1l4UwP0XAbdONTbaixXQ7pdqt8/zBBhLMCEoR5WQwKw2oRDhiBLabynOvplQyjXtoxAnbtPgGjqTGHSQYiyhkMQiWfUQYVgWMkLz7zSjjv1/DS6WHb5OB1DWjX2mjFyzX4TOOxhD4Ye60JRS0QrIJgMdYtl+hdQ/sgRt4l2oEijQtZO3TS8fTGeATujq1dY7g6sjzaP0faCorO9q/PyvA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) by AM8PR04MB7876.eurprd04.prod.outlook.com (2603:10a6:20b:240::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23; Tue, 19 Nov 2024 08:10:59 +0000 Received: from DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd]) by DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd%6]) with mapi id 15.20.8158.021; Tue, 19 Nov 2024 08:10:59 +0000 From: Ciprian Costea To: Marc Kleine-Budde , Vincent Mailhol , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, NXP Linux Team , Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Ciprian Marian Costea Subject: [PATCH 1/3] dt-bindings: can: fsl,flexcan: add S32G2/S32G3 SoC support Date: Tue, 19 Nov 2024 10:10:51 +0200 Message-ID: <20241119081053.4175940-2-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241119081053.4175940-1-ciprianmarian.costea@oss.nxp.com> References: <20241119081053.4175940-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: AM4PR05CA0036.eurprd05.prod.outlook.com (2603:10a6:205::49) To DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9251:EE_|AM8PR04MB7876:EE_ X-MS-Office365-Filtering-Correlation-Id: a832a998-e519-4e2c-2096-08dd0871b39b X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?8QvbSWYURUjLzJwcwyqNVgH/IkWbuLn?= =?utf-8?q?sOQ69z1Z+dpDhPrbKyD6jmyZg3MWSQ9sfy9SfNwI7UZpBY1ckmzA54zhe6Xn2hHh8?= =?utf-8?q?npdV/D0EsIESGyeXkwrKVni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Z8m7kqF++xwtXCummXiQAWBuxutt036UcbpV8mR?= =?utf-8?q?UImZwBNBd1tmxziNgtwPDFYPDueLa1qld1eU3LaoAt1kPDgGKQi1FB14EGiSr4OKq?= =?utf-8?q?u9LfgaNvGTBex5Bg2UoRBz+qGn09QvVVnwLd30a/H3KEv1Oa7CMa+BQNbE0Dpue+A?= =?utf-8?q?Rwmh1g7zhVl5Te+hN7vZjdCdx2dlw68UUodYldBDfELDwlk94mmO8R3gYABksN+JX?= =?utf-8?q?BHpWBI34xAUPro5UkRC+tkuFIB/W76DERTgOIidB5DJBapK8gwAk4r/y2aWHE/tW7?= =?utf-8?q?vc4445vBnOA6x1CfyobhdxKmkdD1Snl3TX5ZMldrjx4NgUwgzd8HwXgA=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9251.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?c7+vYrvn5eR0gyVvzwFwyrgUGdhZ?= =?utf-8?q?GMoshJLSK7qOyoVWM1xaMWnj8X7FVzFpRTJ5ZqcJ5pjyIQk067mcMzTlJ8vexTeX9?= =?utf-8?q?KyFkgMKnKxlIENuXe5m3ReVI3VY1sTszNAklS2ICX1uFuakRmbmSIGDHDUS0ojHzz?= =?utf-8?q?m/ywdqzYYNcX+bomNMHShmfzMXxkVbX0DL0N2uxT35GWwg6FUu+hOSLFtsEcn6TFf?= =?utf-8?q?AnTYjw9WcUMywrjyzlsXKoOQKKgnoA25dLX+3MlgSxij7N67R+HTxnTkST8eK62BF?= =?utf-8?q?xLi4N1IVZ5FG2alupTf7V2jbsNFN0Gs99i4bWRTQFbqWXDYHJRNlj2GpHPWLk3gh6?= =?utf-8?q?+ofI2yird4Y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kQBkVDi7+E5tw/5/5CmYdfvObACAB3GsNSiPzTSJUTG3qwpQtBjgQlxwqH6a/3?= =?utf-8?q?LL5+jeOBFXuvqgCpElF8+F7DUzn4GnFfSUQFW9rmvqchdfinlFeevL4+2U4do0j6S?= =?utf-8?q?qrs4VXWlud4RzVUmg4INuVTndei6TOmS1x259mXdJYMPRmAOnh70DdsY1nIN56rMk?= =?utf-8?q?I8+1p8RDL7pktiTebp4pf5vXXoH2pzRXULKzsPLjfdQBy+pGj03CkEEVbwaL1IE5I?= =?utf-8?q?JYll9YwMltF5Trd/GxNDmF8t7ubm7loEKENvZ78FW2GlE3rQ5SxB+/BsZpPojgKFA?= =?utf-8?q?UpR7eJUOJkFWHwt6zO2kw4LK6B/1MNENEA=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a832a998-e519-4e2c-2096-08dd0871b39b X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 08:10:59.5571 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Z5gJ6pEXb7VJNS+xpKoSJ2BXRmTDEvCLKpylu2AZkwQoO2+uQBIgGhuBkwlQX+UavejYKp8by48rLZl5oB5we3czkuXyOT6NU6tDalR19y4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7876 From: Ciprian Marian Costea Add S32G2/S32G3 SoCs compatible strings. A particularity for these SoCs is the presence of separate interrupts for state change, bus errors, MBs 0-7 and MBs 8-127 respectively. Increase maxItems of 'interrupts' to 4 for S32G based SoCs and keep the same restriction for other SoCs. Also, as part of this commit, move the 'allOf' after the required properties to make the documentation easier to read. Signed-off-by: Ciprian Marian Costea Reviewed-by: Frank Li --- .../bindings/net/can/fsl,flexcan.yaml | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml b/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml index 97dd1a7c5ed2..cb7204c06acf 100644 --- a/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml +++ b/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml @@ -10,9 +10,6 @@ title: maintainers: - Marc Kleine-Budde -allOf: - - $ref: can-controller.yaml# - properties: compatible: oneOf: @@ -28,6 +25,7 @@ properties: - fsl,vf610-flexcan - fsl,ls1021ar2-flexcan - fsl,lx2160ar1-flexcan + - nxp,s32g2-flexcan - items: - enum: - fsl,imx53-flexcan @@ -43,6 +41,10 @@ properties: - enum: - fsl,ls1028ar1-flexcan - const: fsl,lx2160ar1-flexcan + - items: + - enum: + - nxp,s32g3-flexcan + - const: nxp,s32g2-flexcan reg: maxItems: 1 @@ -136,6 +138,23 @@ required: - reg - interrupts +allOf: + - $ref: can-controller.yaml# + - if: + properties: + compatible: + contains: + const: nxp,s32g2-flexcan + then: + properties: + interrupts: + minItems: 4 + maxItems: 4 + else: + properties: + interrupts: + maxItems: 1 + additionalProperties: false examples: From patchwork Tue Nov 19 08:10:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Costea X-Patchwork-Id: 13879481 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2077.outbound.protection.outlook.com [40.107.20.77]) (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 5DC5115530B for ; Tue, 19 Nov 2024 08:11:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732003867; cv=fail; b=acrw6Ct7IU1+UjjydbJ838n4tUECwNLa6LeSF1c5xFTtSeEYZpCdVmLRysHg8ErWqUSOx6/6ipOE071wglmGyyp4qG3MthmcxIJ0VnwdngDx79v2DUIsOR64haNuYaPUlwxxB6WVHZ5B7ETd+AoU1Mtlgrutb6BSzpEv3ssptbc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732003867; c=relaxed/simple; bh=s5GyuIVsTRuB+40aK1xPdi/4m/eU1k0HoIdFk2wTwjw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=lom/3BHWid5veMVrs3+XeI7JNZhZHv7Wr+jCA36dtfB2/UCYAWcEmB4L9RQa8BRQqfWMHDGvjpBP5I+Y3EWcrRwW/gDDSJ2NFWIGvh/D3xSBUsHZAxrZ7E3W7DVZnVlkovx397RmAMseX62P/VC5CzrUCnlS6S7TXUqYnegw4DI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=kPKTAa+K; arc=fail smtp.client-ip=40.107.20.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="kPKTAa+K" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vh0t5IynW+TGrZF3FzA80y5xXy8JGi2H7L24bSv5Yuju4eeSc+2PC6dm4wnIHuqQOQOBFjM+cNpGIiMJNEvWYjku6nSUiaRZ7vxgTIuFV+q2wStr8PZhf17m6aRtPoWAM67B4Sm3pI1NRSVciqySA+lnDXPqrS+T+ORk58NxOSN8koksTtFMvGqn04cZpgKnn597F4oed0OEVWwth+WIBOVOtcWr6HZ08EbjC+q9AM5plQH0gH1D4qDWL3k1SEWqQdT8FW8KHuoe7PWbpWXKRlTnuT/nAPvVo1jXig3zMk6ZPl4r5rVwJlife04ERyTY11Usu12jVx6iYuRCIbL/iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=tQz1hpJ7w6n4hw+ZQnp6Vi37ibD95Iux605dlxQo19I=; b=dBSei8sb+V8AsX4deYpQB/GhbFm7EtTHUOUEPXYfExBYD069gspxx5bDqf4nboKnjdzV/bZnobcv/mVCSNvo4pZCp76UXFF4hWEccc+eP7G11betz+vGAkL6zP+nmwKaOxS01xUpazvbwn/kNvaGA0k0VM5biFL0cirvfcsjlbLEriWdYQ50XaQ7D8Bske834JyD8ChZkH5zsY17gYDTAmhxSAPMfVWoxEnldxibx5bRk7sDFFSP39C2jS6q2Ka868KYC7CubLx7lxFFTAP4E9xdcCe8WEexjYdG3JSmrqeGlyaY+9l3A+gNd4aAx4T85m90p84bP/f5/UKm3Fv0Cw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tQz1hpJ7w6n4hw+ZQnp6Vi37ibD95Iux605dlxQo19I=; b=kPKTAa+K/7RzPy/JQDgk1rfP7QjiNZ8z9A1fBQU163qk9djPbj1x1LJxaod8bxUmcskhgdrMvjIYytVbUJ/snigMjyWb/6ztNWZ7EhGpKO/Dmps6gOOUxlooWTWYsHdZt90OMsTZiXHwWBtFpau+18GKNiCrjjWR0upPVESZpwW9eeuFexPNLDROuNfXc3Nb300Xw0aqfCFT2Grb51ybcN7aOyilcQKxsHRS79tGSohM+TtHACaX8CIWoE1D74cTrbACwL4gcu4Q7mXcx5HYDWwC1tlfa2okZMdph77cR/0G53+HO5/Uba8KjtDFSMHMckHVLsTuxLXAub2ymURtFg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) by AM8PR04MB7876.eurprd04.prod.outlook.com (2603:10a6:20b:240::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23; Tue, 19 Nov 2024 08:11:01 +0000 Received: from DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd]) by DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd%6]) with mapi id 15.20.8158.021; Tue, 19 Nov 2024 08:11:01 +0000 From: Ciprian Costea To: Marc Kleine-Budde , Vincent Mailhol , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, NXP Linux Team , Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Ciprian Marian Costea Subject: [PATCH 2/3] can: flexcan: add NXP S32G2/S32G3 SoC support Date: Tue, 19 Nov 2024 10:10:52 +0200 Message-ID: <20241119081053.4175940-3-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241119081053.4175940-1-ciprianmarian.costea@oss.nxp.com> References: <20241119081053.4175940-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: AM4PR05CA0003.eurprd05.prod.outlook.com (2603:10a6:205::16) To DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9251:EE_|AM8PR04MB7876:EE_ X-MS-Office365-Filtering-Correlation-Id: fa80d4aa-0d7c-47dd-29fc-08dd0871b4d7 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?xIYJ6Beo6rBjDp+dPPYBgR3s+LuGpP6?= =?utf-8?q?5nmmKeSzoakqPJsWiq1G5t23b+kxOhEKDJzMBlLytGzQIJ0l3aiGAhgP+eAg6WDO6?= =?utf-8?q?6nUJfFCBQHgjEDEXnbh1iEhmv/TMre3o2EjdvW1BlKAt+hzsxAmAUPsVRI5AdjGXc?= =?utf-8?q?0LAlHribev69m/kVffWm1p+WEaZhU37hDfLZqoFlQWWMyMwavc2V5gSR3MS/m2B8G?= =?utf-8?q?W3sMIXBdMD8CBeBoTykKb6/mtdHMp+jrQtC3MTgRLDhqnVxwHkpCgJmBZ2gPFmSQc?= =?utf-8?q?vQfzfjw5Fg8KQqDhupa9J/aHprU/ooDPIzkCDkcVgqc5Ws/SogghBijKzQ3l9xU6M?= =?utf-8?q?0VInml9jO0a/8ivs6m8z6kpgPthDZixOMYVa7HvosI0bySHFck01Pr75MYwal+/lU?= =?utf-8?q?rBB5lobNUZh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MWG9hZIrHLVANkdOvplzoeUspXNktxp3PeUO+O8bDbO7cPw=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9251.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?SVLM2Uj5y5LjPnih8sqBZeg58Z2F?= =?utf-8?q?uJzvcIdSWRaaeGHYaGVbR6qiJW0WCsSDq/rQAaqh1HUAEcRq/obZTQyHX91fRfHOR?= =?utf-8?q?iRLNdb+sQHqxJiQM+l6ODg4smg7oLVjezqSIWBrtLM8RD9p4Ecd0zAwkGLmKc+UKA?= =?utf-8?q?S0vRv5+/VNc669o34/0FxKWFFVEgUyZGfza5/r7jZ/ukr4+aL20HU/UgQ2OmaVCSs?= =?utf-8?q?Tpnj+wcz6G59A0+4Oq1vn9zSH73vL47Ey4vv/xGT2vjx5wJQuLWlVvsOuN4uN8Z+z?= =?utf-8?q?pDTap4mpT9pAFJnA2xPqthqxqsTDLek8uTPYjApbGScqSrjAxwUeQvGSmDAy1q39R?= =?utf-8?q?NgRCQQZ9GUVSIESpdrvaaEuWdDoqmqcEyQz5vBTfZCQaaSHGgJORzhTtsMEs/Ynz2?= =?utf-8?q?uMzdgChz2xqm4vMHNrTb1nUft2H1swl124Bi/cInbeRosQwZ1BBm0YOW1ilpzoAA4?= =?utf-8?q?eNqkwz9oiALhoWV6BqCgCzqxFw5A9J0xc62FT1vajHfU3cXINwf3PRiMwevx9xU2s?= =?utf-8?q?Sbaotmh/Di2Ame/JZHKmeKJwyza/dgWe8q0oty3JdQY7DH3IQele/KRh1At5ZCGxT?= =?utf-8?q?1JyUHpRdt8uaLS8CknPHk1j7PBdsHxU7Tb4aNAovjD1owUQa2yrf7pF4y+Md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Ffjhjl1P+DC+xZ0PMv81/nAiXkg=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa80d4aa-0d7c-47dd-29fc-08dd0871b4d7 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 08:11:01.6342 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gmmb6bWUFWQsvfEk1v0uqFqPHwB4aqLG6RhrNL1V+WtPmAmncVRhkIMr2igZMz703SVDd8g2eTW+eymPmZalQ6qimpscRf7O6B2nzkKkHMA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7876 From: Ciprian Marian Costea Add device type data for S32G2/S32G3 SoC. FlexCAN module from S32G2/S32G3 is similar with i.MX SoCs, but interrupt management is different. This initial S32G2/S32G3 SoC FlexCAN support paves the road to address such differences. Signed-off-by: Ciprian Marian Costea Reviewed-by: Frank Li --- drivers/net/can/flexcan/flexcan-core.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c index ac1a860986df..f0dee04800d3 100644 --- a/drivers/net/can/flexcan/flexcan-core.c +++ b/drivers/net/can/flexcan/flexcan-core.c @@ -386,6 +386,15 @@ static const struct flexcan_devtype_data fsl_lx2160a_r1_devtype_data = { FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR, }; +static const struct flexcan_devtype_data nxp_s32g2_devtype_data = { + .quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS | + FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_BROKEN_PERR_STATE | + FLEXCAN_QUIRK_USE_RX_MAILBOX | FLEXCAN_QUIRK_SUPPORT_FD | + FLEXCAN_QUIRK_SUPPORT_ECC | + FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX | + FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR, +}; + static const struct can_bittiming_const flexcan_bittiming_const = { .name = DRV_NAME, .tseg1_min = 4, @@ -2041,6 +2050,7 @@ static const struct of_device_id flexcan_of_match[] = { { .compatible = "fsl,vf610-flexcan", .data = &fsl_vf610_devtype_data, }, { .compatible = "fsl,ls1021ar2-flexcan", .data = &fsl_ls1021a_r2_devtype_data, }, { .compatible = "fsl,lx2160ar1-flexcan", .data = &fsl_lx2160a_r1_devtype_data, }, + { .compatible = "nxp,s32g2-flexcan", .data = &nxp_s32g2_devtype_data, }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, flexcan_of_match); From patchwork Tue Nov 19 08:10:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Costea X-Patchwork-Id: 13879482 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2077.outbound.protection.outlook.com [40.107.20.77]) (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 7CED919D06E for ; Tue, 19 Nov 2024 08:11:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732003869; cv=fail; b=TxJK6CIyipy7yIvCzFnzxBw4YnNIdpGZSHrah89ZmDwNManonbVH0X2xLn/t60A/NzzVNM6kkkA10p1YNoq7TyNY88GAUpLj4UmWLzaGWAeVKRytltfac2NaOV2AMysWm+TYv2Pqeg5RPOT6Ljrhh1yna/Gd9aPrs0gjLB/kskc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732003869; c=relaxed/simple; bh=G0WXPIXmMq0Zlpzu9iMfPQeI0xxXc0kD7I0Hsy8XA30=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=rpI4s0YWcDA+edJXivZ9DCz1lPMUOxrUKSrKKT3dpR8i8ONcx6lpOvCEzWeqhd1ilXdWxx2qILZPHM1yev8W/kRKcnAkxrG1Wmu/cR9WA2cJBdJnLi/T3X2rQy0YcenWJ4aYvtDFKmDUG8k2dkZbUoQqSaxU/YhwjOk+m0vj5v4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=djEO/WED; arc=fail smtp.client-ip=40.107.20.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="djEO/WED" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=erPxxAu5A/5CQq2wJpp2OlE5rTgujdX/BckliJSEHS+h3YWo0osU8ASQ5BxTZ+NcEi8Iup6NMUIZOKl4rjGhEtaFk6+ScGWicdOEktK9/Q4bu1jLkDa3eU4q5OwDU45zgnX5DWW0MicQmr3uq/VMQl7Zn8PXPzTfJEm5xELvog5AOz1bXcpgMX4xtbE42SUTpL1PLxOucPBIrgH2iX/J+Ck+VokGHIDnhqs7f2dkmylgRAqfloCubeegHmPPjiLIDF7t/TNJizW1xaoSkHcwnEKSqz6FtcAZZRfFEsWA4KS/bC0Rd+xMVnaKC+NJvHLRS8m56tIUc7BaGBNjgsocfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=d+MvJjMJ3N0pA8nHxioLNChTuV+Hmdtz2LxJKzYJbxY=; b=LZQU4HQvUYFa+ArSxX8oSEzccrJKmfNo+23N7fRjaTBdF0LUQT4EDWGqE28Y6OidmGrmjEw77Xjr79BVsIgqELrOmbRnBHWYpvy25UzuPywhVlwOywi+fFLJJW6b5FVUosnwfYgswrYyrE/ZGX42Yntu0dkrZTC0J4zjynwGGiLZwYQSBW9UiiCpos8PJJVC4Duccvb/E7B5TPJy+Bl081SNStjSy8S9A64TFrd0TAnFcuQt9r/uxqzG/WxSG+5UjEvW+fwHqP8Bgp0+gMnkRPKVD5/wypzu84f6YfG/9H3WOZzDjTAqw5T/IrrRZpB2QvON+u3nuIM4nnFo7hBwSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=d+MvJjMJ3N0pA8nHxioLNChTuV+Hmdtz2LxJKzYJbxY=; b=djEO/WEDxg/M+oRBHEBMMuPvZYEqG5NWgDjGhpNDYen5IvNcqvExPcuMCo5T1a6P8wnPldgABIdzmToO2gUtjdtqs1h5Aa4u1Z6GF1H3VsMvx9+dqe95HBKWH/vaw29D24EWi+VT3c4HqykqQPpuDSsXDjLtOYrIOMHGsZFm9ePTCSvTLsgkVi1GyfQfx0vsPHBnd2WD3FYm1vp/a7hhROZ0Yd7YLeZ5uMnCXyKRjuZowecS3KcDjlE2zUjncMdfTYTJGCiFsHvSM00LHEK/rY/PthI88VfhABhT+DEeNan7VfOcJU3upUyRvIIhjqrffaoo0PPZwo8680b2pXLhxg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) by AM8PR04MB7876.eurprd04.prod.outlook.com (2603:10a6:20b:240::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23; Tue, 19 Nov 2024 08:11:03 +0000 Received: from DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd]) by DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd%6]) with mapi id 15.20.8158.021; Tue, 19 Nov 2024 08:11:03 +0000 From: Ciprian Costea To: Marc Kleine-Budde , Vincent Mailhol , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, NXP Linux Team , Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Ciprian Marian Costea Subject: [PATCH 3/3] can: flexcan: handle S32G2/S32G3 separate interrupt lines Date: Tue, 19 Nov 2024 10:10:53 +0200 Message-ID: <20241119081053.4175940-4-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241119081053.4175940-1-ciprianmarian.costea@oss.nxp.com> References: <20241119081053.4175940-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: AM4PR05CA0021.eurprd05.prod.outlook.com (2603:10a6:205::34) To DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9251:EE_|AM8PR04MB7876:EE_ X-MS-Office365-Filtering-Correlation-Id: bc93aa2f-5cb8-4877-cfef-08dd0871b617 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?sFwlcKdPeOXHAz/Jww+0zHOBmxPkJjp?= =?utf-8?q?NCFNIWktkNmMBva6/A9iTByjCn2JApJb3D5x3fHodDq/M5yGXQuPtbGu6lpjPK24I?= =?utf-8?q?hSa6ieVFnQLfvs4Xh1wXx/4xZ4Rg/nlIB5+FT8yYkEaRr2zp/nEvXkbYXoUhB4aLg?= =?utf-8?q?Gw3cdrrmkizTh7ETIISpJIWKUkkQCCqWpEs0Hig75X0DqN6bTAwjs+HJhjqfRy371?= =?utf-8?q?lpRdqk7khIUxgwQ1UvHlKN2KDt0L3malvKNQnrSTcg/i74hB3pMUOflqhJ/smRQaV?= =?utf-8?q?y/bXqqn+t6XdYWRTn0iGR7JA2X7kkT/cvRV1yfvplly/mCZHX+yMqq12Oy+b4+UPf?= =?utf-8?q?NFDI2LKrvUvTBFT897eb7hS9st8aCBOZAp1JmswJQ2ZsNJnI5B3NHhuvl8jk/BeSF?= =?utf-8?q?3ZOjW4U3EJiqCarHPtC7ca+BJAweIhWNPmPPvBwZeqLIUkgk3c8GwKMkjLE1RN4my?= =?utf-8?q?cdhOjjEdfdLlKcrwEUfP5Iu2UESFb43vb2+kaOg3JFEAga4ahUcO8mBqxMnKeZAg6?= =?utf-8?q?BOWUGJik75Xt8SFP4M9CO/aGsgBHfE5x4wQtPYmXtIpd9qK4oJvxTXnc6U3nWrWgR?= =?utf-8?q?Iyv3GYfvmNyaEeP417vEYpruyhfKlTyGkRLhw9NFMROexVZSB2iS8Iw1QCijymhA2?= =?utf-8?q?L9Nv1mZQepLArp6zDZFaBfhrNC8C/FH4gsjnkRYKA6dvdDqtofvHQoa3O2G6fRY2V?= =?utf-8?q?IomVHyJVpH4tvseJsZkZnSCV5HNMg8vNJbRdZRtgDyFI6mB3Y7cmakQjvoAYmcgMa?= =?utf-8?q?pA9q82BaJ3/YQfcyBQG44kl2Daqy1lig+nGpmtfF0VLH1J0coN0EJc+aaA6DEd47V?= =?utf-8?q?xnOXLfpo9Tacxa+/8rYmCAbQq0nLgSntT4lPCJOw/h8hQe4RQ/GiyPJUyAvjD5V0d?= =?utf-8?q?+j95Fgwlv73F7WD0vWijG1Y+jx6RwXv10jAIwCFWGSUmQJvadHejZOLCAdTTZo0xC?= =?utf-8?q?ZStlGu0zASDMSW7hEL46WYG982ZDww6ZG/oH+yTzYOHFZTlQIIvpPuChecaG6wgGF?= =?utf-8?q?P8W4KOZ5FHITVIyjts/6yq1zk40EKrLPDT9l3Iwwz4fsk4zlt0rXaQBYZFna7Q4tN?= =?utf-8?q?nX/KY9z666Qz3ZXc3sJxN4wn7K8nKdbekplNvsxy49fgXTcD8l1/7gIqqtznMBdHq?= =?utf-8?q?OjVkXMPHZTFH6UJozaRZzFTkgUUFP1hhe5WMfa/y+2TQDugzstJjiNhkq4kfvZlap?= =?utf-8?q?UKr4psj+guOQ9NB9eG1LfmLt3fFXl68lDLJIBxepS399hgdBdTbbxEUYcYRzan51j?= =?utf-8?q?0qX0ijcAAT0yRzhes6retgRKlWdU4BzfE1Fo0MzU0tawqVJqrqOx2zAQ=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9251.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?eBQvtVUN0ox1steodJ247xbmivlq?= =?utf-8?q?E5QuKXgevni9CYEKGqnMltqmPYOx4r8KcXZb2R4rjG2i9x/VPXbEbVlscTPKHLy5t?= =?utf-8?q?PbgghMlxb9yssTfwaQELyO5SdPvHavnC5w5g5aquIM4q12xZoL7YmFkVPq0nSqTun?= =?utf-8?q?46BQ8qXhqbBokic14uyRMMF02TJbbkRDGpCNF24kpqvtJUanjAYnRqjESqLDVGVnZ?= =?utf-8?q?atxNDBwokz2bDi1jzbPLGQ0OiVYW+B0JBqaxU0MvtMjtHYhf0mEF6Gted9iUJclZi?= =?utf-8?q?YbcZWaedMWoGJmPP/uE5jye/bAMmEQMvW66n4F1+frQCt5i4ZKK3xCn9VTtYbkE8b?= =?utf-8?q?8pk5aQwRgLEygHBYrPQDmydoUyUDPq/o3BCtFdoN1eqKZ0HKj+VPim8nNcpjWiPG1?= =?utf-8?q?tLw1IVsEXZ3BjeZjsmAyN1Pr33YjjQNjx1q3zr+rwVgTfb4eJ5O33f/nMflf+0MtD?= =?utf-8?q?lXnn7h+H0UwLfI5giOrFwuzA/aKAmKscWV6eCa3kmPr5AmN8EuYVbZooiVysvHOBv?= =?utf-8?q?TnMIkSPK3djXkqVIk2XWc7eU3x9Ewe+ooJ+StmO35XduyAq0IZX92Jq+awMa70TC1?= =?utf-8?q?XgKTz2vqYeEa/bDO1iIfrTEjX/yYs63a0eKdQ9DCp0vAGD0Oh90yhBFt72KKX3oyr?= =?utf-8?q?Cam/HuXxLWnt1NY+GumWMUsOyNaTLzZirS68xpSE63taQxxjiGvVhyItniLfxuSav?= =?utf-8?q?2vVdLDz4WSb9dgsv8ZlcQtkOm3wrFqv8xH2elVZDx+ZFQsisLs5E7bRL3XFGwZHyL?= =?utf-8?q?kZPyBYYeOY/aw33yeDe/6MvqGe6MjYkU91MMUDRMjBWFBRXlI5NJYpySFqUYgPKP/?= =?utf-8?q?DHDu+U7C+VBVGeAJH4ipySOLSnpGnKnf0fA2Dtd+JwKV2s48tC8nyJ2eB/nJkCrAi?= =?utf-8?q?pU1XO+hkvFFDa75PPehxO+HYVWIpHBBCncrn8ARCIYyMOlGcKKw7QAQZRLfF+YRco?= =?utf-8?q?thaxlp1H7G2Ugig5mVCa51lW+gMQxTGvxO0Od2x8YydRV/GkYWpxe2xAXij+pzG75?= =?utf-8?q?F/LJ358rMzPflkVLObliRsXsXs2xs7BrIip/FYSguGcYOTIQ8Bstp7tDB7ZPtBP2r?= =?utf-8?q?yzA59rxJ1eMf+h8A19x7IEPikUmn7CxOL5OyBRSLD19eR9dIevLPnK8nJkjhB1lW2?= =?utf-8?q?ucRYh8sbwnYQDdwu9Rf8+RBoS8w+e7Styu78XjRoyVorb39Qx6esslAtfoA2fG1nY?= =?utf-8?q?CU6yhl12ipC9O+CvHDS5Plg/QMdRphtzfOBPSmGbwhylRk8C5gwl7Xft6GQlzUcEb?= =?utf-8?q?ARV8JeB5wF35W9Jzt1asdtoqcNhdzxJp3/Zwr/OhLrKbviFR+4f7+KfhRk6dmC3ro?= =?utf-8?q?IRGpdq8GWxBGrhTb7T7RfNCwZnTQ2sCsp98uFJZ8S0JVc+GlFBWQ+jGR9XAn2xEVP?= =?utf-8?q?P+uWytG26dU6HZk16aQwkiX70IcM9RLFFb1gHxeq+vzvWNxLaST4kudOWvb+z3R5Q?= =?utf-8?q?xT9zqJu86HdOPnKegPhqJ60Rn6EtgKEQEP42LQTuaUk4y20FEjFXDd9y2w1Dd46PM?= =?utf-8?q?RWQVZeQhhQSfRIv11CBRFO01mu0MxNFwpA=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc93aa2f-5cb8-4877-cfef-08dd0871b617 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 08:11:03.7235 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: H3X6bGugneoxgBVbFvkW2TPf3yTkSebfD4BFRZctynlcyrDmhdHx8/S+/F6wKGuWPqFEn/9Ns3wO+9bVp83MOJOyNkKG1beAeIr0+5WC+ZI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7876 From: Ciprian Marian Costea On S32G2/S32G3 SoC, there are separate interrupts for state change, bus errors, MBs 0-7 and MBs 8-127 respectively. In order to handle this FlexCAN hardware particularity, reuse the 'FLEXCAN_QUIRK_NR_IRQ_3' quirk provided by mcf5441x's irq handling support. Additionally, introduce 'FLEXCAN_QUIRK_SECONDARY_MB_IRQ' quirk, which can be used in case there are two separate mailbox ranges controlled by independent hardware interrupt lines, as it is the case on S32G2/S32G3 SoC. Signed-off-by: Ciprian Marian Costea --- drivers/net/can/flexcan/flexcan-core.c | 25 +++++++++++++++++++++++-- drivers/net/can/flexcan/flexcan.h | 3 +++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c index f0dee04800d3..dc56d4a7d30b 100644 --- a/drivers/net/can/flexcan/flexcan-core.c +++ b/drivers/net/can/flexcan/flexcan-core.c @@ -390,9 +390,10 @@ static const struct flexcan_devtype_data nxp_s32g2_devtype_data = { .quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS | FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_USE_RX_MAILBOX | FLEXCAN_QUIRK_SUPPORT_FD | - FLEXCAN_QUIRK_SUPPORT_ECC | + FLEXCAN_QUIRK_SUPPORT_ECC | FLEXCAN_QUIRK_NR_IRQ_3 | FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX | - FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR, + FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR | + FLEXCAN_QUIRK_SECONDARY_MB_IRQ, }; static const struct can_bittiming_const flexcan_bittiming_const = { @@ -1771,12 +1772,21 @@ static int flexcan_open(struct net_device *dev) goto out_free_irq_boff; } + if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SECONDARY_MB_IRQ) { + err = request_irq(priv->irq_secondary_mb, + flexcan_irq, IRQF_SHARED, dev->name, dev); + if (err) + goto out_free_irq_err; + } + flexcan_chip_interrupts_enable(dev); netif_start_queue(dev); return 0; + out_free_irq_err: + free_irq(priv->irq_err, dev); out_free_irq_boff: free_irq(priv->irq_boff, dev); out_free_irq: @@ -1808,6 +1818,9 @@ static int flexcan_close(struct net_device *dev) free_irq(priv->irq_boff, dev); } + if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SECONDARY_MB_IRQ) + free_irq(priv->irq_secondary_mb, dev); + free_irq(dev->irq, dev); can_rx_offload_disable(&priv->offload); flexcan_chip_stop_disable_on_error(dev); @@ -2197,6 +2210,14 @@ static int flexcan_probe(struct platform_device *pdev) } } + if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SECONDARY_MB_IRQ) { + priv->irq_secondary_mb = platform_get_irq(pdev, 3); + if (priv->irq_secondary_mb < 0) { + err = priv->irq_secondary_mb; + goto failed_platform_get_irq; + } + } + if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SUPPORT_FD) { priv->can.ctrlmode_supported |= CAN_CTRLMODE_FD | CAN_CTRLMODE_FD_NON_ISO; diff --git a/drivers/net/can/flexcan/flexcan.h b/drivers/net/can/flexcan/flexcan.h index 4933d8c7439e..d4b1a954c538 100644 --- a/drivers/net/can/flexcan/flexcan.h +++ b/drivers/net/can/flexcan/flexcan.h @@ -70,6 +70,8 @@ #define FLEXCAN_QUIRK_SUPPORT_RX_FIFO BIT(16) /* Setup stop mode with ATF SCMI protocol to support wakeup */ #define FLEXCAN_QUIRK_SETUP_STOP_MODE_SCMI BIT(17) +/* Setup secondary mailbox interrupt */ +#define FLEXCAN_QUIRK_SECONDARY_MB_IRQ BIT(18) struct flexcan_devtype_data { u32 quirks; /* quirks needed for different IP cores */ @@ -105,6 +107,7 @@ struct flexcan_priv { struct regulator *reg_xceiver; struct flexcan_stop_mode stm; + int irq_secondary_mb; int irq_boff; int irq_err;