From patchwork Mon Nov 25 16:31:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Marian Costea X-Patchwork-Id: 13885143 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2070.outbound.protection.outlook.com [40.107.21.70]) (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 BD3AA1B4F0D for ; Mon, 25 Nov 2024 16:32:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732552335; cv=fail; b=rvg7bYZuHT6vevKkPy1q+TVKWBLfo6GJUwfml2tJy7VyJPCTjHSDjceZu4yS7lT9U7QgRSdPNHgi6N60J7nm5UtTXxbaShjhVPcyiMyeyIT3u/gsMmu3bmus7XE8WGKufY34SJE28hahwlv9vj3BztM8kSRFfLeiKslxZxBpLMc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732552335; c=relaxed/simple; bh=cT2SNZZceLc0I6oInJaPuMW0b4czwCX3CYXK77AJEck=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=gCCc2wqrI2oNmD610Md9fPYreQ3Z6bmh1PxRrfSWfwyygyUHbW+EA9x/k49nki2qF7gmuDmJmjIo3mQ8HuIDeX0G+Wy+Vk1ithlXjIxgG0j35LaZ8nh6kUw4n3NnewGvKFennTNv2QRulvfECANvZT8dNxRUC8NmAROsQN9HUnA= 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=QgCbI0bZ; arc=fail smtp.client-ip=40.107.21.70 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="QgCbI0bZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=A5zQZ6uGUuGJc1iHMinB3JSAUb4HNHGeYq+fLmdX5xqtPUUKqlWtvJ8XjnPddLXB5/5IwLH9Yz07J3XRg8FgKOhe23suSFCLydlsB/+TRcJGel8iba7ih5D8QQmFoKXcp+ivCbK/n5K/CqkhLRkwPUJ+ObxeejjkU8mhI4+s4l6+sMuaMNF1q89jMyjn4VlWS/lcHpIB9rAtJ+amPyHVHbOrnK8mN2fbTJJV8uqUKGsA35A8rthcXFnVKwBK1WMUXww2nG7JEzpgDvQ9hcqaKEMhJKbbXEW9e+zm1+rqBjd3ybTnupUlqFmucZvdqioxTwA5x/GzATgsSzta/SdPKQ== 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=uaQy5kDXIKDq/HEQbAR/hWTrTuj8zjoDD+WCajGG4og=; b=a4z/keg4Tk8XCRC0lpdy1TxW+ct+W29FVlVrLPRhWg59T6DorTeE3s7vY+nHWGMpwVNvzTMmhEqWjw10Qr9hwUhVprohoy3T7oUHBSqe7jB+lyDSe254QacJdwFDCKQb4biq2XpTNIavibA2e9j6AxECKKdZgoPknhtN022/Hb9AyIyrcq9rTzuU8ponJGSktgVr3coHcE9UFmStzxcLCEgmp7kPa4J5oOxqFuIhkjf3Xx9gqVlE2UfaP+iRBNokdUA+gKMg3Oo4+cUt3byDFs1r3IJQiZU86xF9aSGxmnD8R9NdNVn5q+IjSAIWcPbHK6AV3i9wPhIIH/1buy1SQg== 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=uaQy5kDXIKDq/HEQbAR/hWTrTuj8zjoDD+WCajGG4og=; b=QgCbI0bZFigodnjMRbrrGbe22c3e2hqr6PKUb6++xS4ZahvVDzqgV2pSgntc3aIHP9PrKVuGtgHJagpqHhmDMpOpOqF28QocTl3eW//r37/34cCGtjuKOQwf2vukTg7y10wfseRA/MdvmWlY9ZOZBX4rZn3tLfbi+XnqB8HAXlZBuc+zExeNCIOE2K95BXMZ3/OpFKcRG0hDzugoR0H4T4D6iGOc0A6yxSPCgI6DJYMivKK7A+VbRJ8Op7lcEEVtQp7DrwdFq0KurKsoi3mPxBwPXYGfzKgzEROn7MN4a6pMjiSrUUIsSlatTeLtsDwPMO2WxTFgs8afs+KkytZfrQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AS1PR04MB9261.eurprd04.prod.outlook.com (2603:10a6:20b:4c7::13) by DU0PR04MB9658.eurprd04.prod.outlook.com (2603:10a6:10:31f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.19; Mon, 25 Nov 2024 16:31:10 +0000 Received: from AS1PR04MB9261.eurprd04.prod.outlook.com ([fe80::7b16:7596:6bb4:c5fb]) by AS1PR04MB9261.eurprd04.prod.outlook.com ([fe80::7b16:7596:6bb4:c5fb%4]) with mapi id 15.20.8182.019; Mon, 25 Nov 2024 16:31:10 +0000 From: Ciprian Costea To: Marc Kleine-Budde , Vincent Mailhol , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-can@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, NXP S32 Linux , imx@lists.linux.dev, Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Ciprian Marian Costea , Frank Li Subject: [PATCH v2 1/3] dt-bindings: can: fsl,flexcan: add S32G2/S32G3 SoC support Date: Mon, 25 Nov 2024 18:31:00 +0200 Message-ID: <20241125163103.4166207-2-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241125163103.4166207-1-ciprianmarian.costea@oss.nxp.com> References: <20241125163103.4166207-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: BE1P281CA0041.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:22::19) To AS1PR04MB9261.eurprd04.prod.outlook.com (2603:10a6:20b:4c7::13) 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: AS1PR04MB9261:EE_|DU0PR04MB9658:EE_ X-MS-Office365-Filtering-Correlation-Id: 4cd2cd64-00ce-4590-fed8-08dd0d6e915b 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|7416014|376014|1800799024|366016|7053199007; X-Microsoft-Antispam-Message-Info: =?utf-8?q?1hRVhoDAuvn2tvh/emWXZvShl3kQN/P?= =?utf-8?q?g4UPafdHVqu20fCHD4sGMABZD2UBsHe687aT3RZqHNC3K0NHcv3A/OmiND2x5KDM9?= =?utf-8?q?VB1o7IS/rC43brCyDA1Ydk2YACe8AoyEB42q0NV1J80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=?utf-8?q?JPKuelLrRiHjwpof9NtTm7XNqNWrjAWEJA07t8joisO9DOC8/CeYEXZ3Hw7R2XgHr?= =?utf-8?q?1LObd3TUyFsO3s6oTWR6DE0RnIvUyacbBB2RF2LhZImkeZIrx6g0kYJQ6MXswgv74?= =?utf-8?q?2cqCSsDy2FakV2bua7P+meUUQ0XCFrVBiHDDZ4XLZOZUiBLWZ4h3GLQCPYV38ry22?= =?utf-8?q?pyNInCRhzXV5lgy1Jk9xGTkOTcJumH0yQrST6PoxG4zPHLzEnRO4HAm2TSmcKsHDr?= =?utf-8?q?lMqRRs+yTXcSVgPzp4blFuWM1bMZPY8vYqw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS1PR04MB9261.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(1800799024)(366016)(7053199007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?HCVr94DYaC7CO8PdBQNoudM8ByXZ?= =?utf-8?q?HJqwnD3zOY6wc6XumNEU2tKRd5O8kXGHVGnGKiwM9qa+ZT+1yC7mY9frHkny8Bq9B?= =?utf-8?q?HbnT3SZUvvxRdRbw2zxlbZf69YanZFDM/nPDiUPsE0Opv9CmaGSKKTlX2lxQ+0dhq?= =?utf-8?q?C4mYwrNigqUBeoKLnJJ4e46IuBwJlRf2d9QdSIES8QeqvD6U1+6C1FMyFNBUKPOjH?= =?utf-8?q?BwYIML3Pj4LB2rpkJpvBIZ5pAuHg3n8EWGp71mmYPcc4V9x0EuYrpzXQIWsKsLwLa?= =?utf-8?q?gSXcs9Elv5X2H8N9dC6NaMBxa7EtrWQJ9p5w2XPLa0K0tkK2tfdgKXDFJ2V+lmoSG?= =?utf-8?q?upd3NmwQ1KeCNn20qC6/Jbs09kZJ07dH5KxedBW0uXLf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xJhwxkTQ6q6C8fHKABN+?= =?utf-8?q?f6+IwHUgrwOMjhbsykyzqfIh1McQjx5ZhGPO25Qy4ZNnMWo5KDYAwU8AjS1IqnVk7?= =?utf-8?q?R3QM4bCPNZjX6mo2f3TWC49jRnoQ3pFciAMi4aUvNNKOyXRVbTXjvik3+nnr3gUaC?= =?utf-8?q?hXToZfX7py2nx1zdZtBcfiektInHQmclYVcuJLxF0Syqf9u4q0CFH2zWBdFwqd8M+?= =?utf-8?q?ZOglMgdepbOIVeTcJatmbq14xXrfBC0g724Y5lSKkeLTY1/s0UhiW47MgkjiTK4OP?= =?utf-8?q?kjyb3nUUxU6eRyQDn/2Rz/BNLseVGdUlAw=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4cd2cd64-00ce-4590-fed8-08dd0d6e915b X-MS-Exchange-CrossTenant-AuthSource: AS1PR04MB9261.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2024 16:31:09.4502 (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: 8BlaU5608z6xc+E4A8Vd/4DKDLy8oO/ChLL8QyRkX8L/c6N/3f2hE+HiIbN6E1DHsm+bxqkvFt6391vSm3cQV8RFK1N39V8tMsIWTwS1UAo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9658 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 | 46 +++++++++++++++++-- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml b/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml index 97dd1a7c5ed2..b2c16a7d864c 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,12 +41,21 @@ properties: - enum: - fsl,ls1028ar1-flexcan - const: fsl,lx2160ar1-flexcan + - items: + - enum: + - nxp,s32g3-flexcan + - const: nxp,s32g2-flexcan reg: maxItems: 1 interrupts: - maxItems: 1 + minItems: 1 + maxItems: 4 + + interrupt-names: + minItems: 1 + maxItems: 4 clocks: maxItems: 2 @@ -136,6 +143,37 @@ required: - reg - interrupts +allOf: + - $ref: can-controller.yaml# + - if: + properties: + compatible: + contains: + const: nxp,s32g2-flexcan + then: + properties: + interrupts: + items: + - description: + Message Buffer interrupt for mailboxes 0-7 + - description: + Interrupt indicating that the CAN bus went to Buss Off state + - description: + Interrupt indicating that errors were detected on the CAN bus + - description: + Message Buffer interrupt for mailboxes 8-127 (ored) + interrupt-names: + items: + - const: mb_0-7 + - const: state + - const: berr + - const: mb_8-127 + required: + - compatible + - reg + - interrupts + - interrupt-names + additionalProperties: false examples: From patchwork Mon Nov 25 16:31:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Marian Costea X-Patchwork-Id: 13885141 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2086.outbound.protection.outlook.com [40.107.21.86]) (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 41EF91B0F25 for ; Mon, 25 Nov 2024 16:31:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732552279; cv=fail; b=OcAt5eQqhxOGXeengJbiek3M8nsT6Lx9gppfhQnC6ioov5BWYpvfAqUJserWpsRm4A5kAkXypRNBpd959L0Tfw/8pkNzzwF7upe2VYKDvw2tUgOLz2Rtlk462eHUF8nSQZ7yuoFCmlK8LKswKAEMPA/Kz2gNQ9cdHTpktqIRFVw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732552279; c=relaxed/simple; bh=R4cigYs3WvxA18SHZWDLkmPrTPBp80c5KL4PHc/KKdk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=oQkydnJJyF8Az70yV42fLUE+TDv8DC7Q9ka1omNNoOFGXt8tNqJhT6QDGfMEU5Wwh+9jTDaNWi9aAPxZQBvr/DBTSzxvJei9auZgELK4tdI0d876SafvOESlDpNaKvrkRyYc8eprPp55T94RXvOSeVNxJsTzgKY4/YqnIcL8dAI= 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=Auqn4V5k; arc=fail smtp.client-ip=40.107.21.86 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="Auqn4V5k" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RdRrbehseQPpX3IMgXWFJNfBRKQ/3Zpxejth4zoWWHGw1K/1Y+P/M8wSzDPKMkFKm66jyF8bG+DBx1AiwUE8PupfSR5fVihn9JrSax8+4V+2JS384KO4dHRFCLrxFDZ1Efffh6+i49PQriGS1MrqEBHZv/dLjQKKsOjLikgwN7tlRlxEYG9+kiLaY/cqLp8EQZi2jBzVEwj1lFk0WLsVnT1I8NF9X5lc/DnZ/6GYrmGCmosdx9qo7fMBySrBK+Y3OoYYbVOewl2t9bsBVSjw4x1F3ltqfxOrdtfma2CiWfLsPs6kd7bexnaMrmY287sIJUYVWWxz/K6+r1QSa2yzNQ== 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=wXKfRfRos/K6nkIpe7cPHuVxoJKUztfgDSE7u8Mi6Xo=; b=uL+4ifmrr2uVCfh2RzLi3g9gxObst/Wu4ij48zm11NPuN1T2X8biHMG9m67F22Uf+XsaGWoZQyXwxZD0EdJDw7G56JRWuuJhW3yBvwcKucd9F3V7sXmrvk2J7577MPARbeL1YOuQMmugA1JSaNbqBSJetThQLfnBeJwp48iXeRAmQfx7VmXuH6UzLeGJtVlFkB0a4VSJ+LDs67gfZxhfPkQ6hrh7HxP6WWdX0d3YK0gbs35D/dJ+JgcSnourvIJ7RtLNqgNQjjoUb5g4kSG6m4htBSGKZoxsEioJyPWWRF+IcbbMrxcT/Kg/d11neyXStWraf8He6mCYG469AdG8cQ== 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=wXKfRfRos/K6nkIpe7cPHuVxoJKUztfgDSE7u8Mi6Xo=; b=Auqn4V5kNj3ICmql9UOewiwPJc8uOVZtFdQivljCDVCz3WQ/VqolLkgVLQmuzJU5raq6ktJJ45HV5CvmESAhFaH7kH5zOuaII+1ecTvgrlZybjWmOSeY4taH7nG4LW0vV4JPOX7dUzwDb8Hst28nvB5kMxNiNo/rEiDo23a9Om4cxePbvA89uH7MNF8fphX9eWdvhvikhbRMsyE8WO0NOlOo1bj3AoSKpzj/dvbbGf62uNjfWGrYmiQ+3xx5PFao2JRG52DRSZquNdwN8dzE9yKmuR+hX9tkg6AR0TGCcMHXjBi4aGlIvjL77DVHfsehlB+O65N+HtlCxuz7YZ4oXA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AS1PR04MB9261.eurprd04.prod.outlook.com (2603:10a6:20b:4c7::13) by DU0PR04MB9658.eurprd04.prod.outlook.com (2603:10a6:10:31f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.19; Mon, 25 Nov 2024 16:31:11 +0000 Received: from AS1PR04MB9261.eurprd04.prod.outlook.com ([fe80::7b16:7596:6bb4:c5fb]) by AS1PR04MB9261.eurprd04.prod.outlook.com ([fe80::7b16:7596:6bb4:c5fb%4]) with mapi id 15.20.8182.019; Mon, 25 Nov 2024 16:31:11 +0000 From: Ciprian Costea To: Marc Kleine-Budde , Vincent Mailhol , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-can@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, NXP S32 Linux , imx@lists.linux.dev, Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Ciprian Marian Costea Subject: [PATCH v2 2/3] can: flexcan: Add quirk to handle separate interrupt lines for mailboxes Date: Mon, 25 Nov 2024 18:31:01 +0200 Message-ID: <20241125163103.4166207-3-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241125163103.4166207-1-ciprianmarian.costea@oss.nxp.com> References: <20241125163103.4166207-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: BE1P281CA0039.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:22::10) To AS1PR04MB9261.eurprd04.prod.outlook.com (2603:10a6:20b:4c7::13) 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: AS1PR04MB9261:EE_|DU0PR04MB9658:EE_ X-MS-Office365-Filtering-Correlation-Id: ec47abe8-062c-4d91-8998-08dd0d6e928a 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|7416014|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Sw1+3jw+y2A6ndGpXTAc6hdgapwLbjr?= =?utf-8?q?kJqE9zpzWb3a4sSdkbH7TqW6OHEukvcEwkOlQRRmhRTer2q2wMAWpX21R+dyCNmOp?= =?utf-8?q?atlQLOD8bK9wKlZ5JY9D4unRuytl65Aq/IINKaBD5VrsVKovsR31RqQffP3kTbmOj?= =?utf-8?q?ekr3mStjYdJS8Km1O60fpN0w/SfOdCpDkzBU5MFKIsbsEcTkX3FSQkIJbiAxhvWwZ?= =?utf-8?q?eDJk422pEXaGhatFeQTBvh9qb++0tNcDZz2CoxBb+aBbQx0ozQV8Lx86tFW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Gx1D?= =?utf-8?q?POIPvM5H7nr3VhId/IYhE4bfx1/Y7ZMcMTTuqQCWBKJwLXtQQXW9BYDlyUNhOXzsg?= =?utf-8?q?4osqulUvYj19kxGAq+QiUcofXJbHil2mo9fA+aRk4u1OIGOgn8ToyLbesbvg9yKsC?= =?utf-8?q?j/NLxaDa6GrU3NxnGwveobtqTza59v2Qkaw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS1PR04MB9261.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?RKc+7UEpfg54jtjiQQS33cHOKHB4?= =?utf-8?q?SaEV8xqAqq1kLHykB9zYD7DozUjgHoJmCFjExVgDgaYYvyvnhezVdMa+O+0X2Kvc2?= =?utf-8?q?oUc//PnwgMKs/q7Li8wVWEMCjm9fUoob+MmgVB/lGQmoEGSD+k/27KseCcgDpJQm5?= =?utf-8?q?hEmKRbF0m14zd6ONJ05iKKuD/35/Y9swqYLUJDKlvOXIXkImO2qKYpq+wM4sSIjjK?= =?utf-8?q?1mjAaJQbVzFBcPe6jS/UoVoIyiM+GZbmNmPgYUh3tbaq+jqxqJZn45NHWOULZUj8N?= =?utf-8?q?b5g/YEs6VAiwLaa6cUucS+VqX4J/BrSYlWcDmrpYbC0qSwYofqkGBIOse6leTVdxI?= =?utf-8?q?1kADgPzWvic8nObuARwz3vfrDucKBiy+pYSPTYR0C0SF7sE1fKT+NQPten7BmqXCc?= =?utf-8?q?P7c62Harf8R2/u7ioZ9pAh2v2vEozmcnLAZrHI7jkFy3cwlNGeweId1JXZseuuoB9?= =?utf-8?q?UmVRkY1pst9C5+cLb2bYRvB+YSySgn3x4fuhN5zlogwN/s+vqYTMY0jHGYIb4qE1c?= =?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f-8?q?jTn1oAoq9rcFm+UD+b+o7toA+rmxuQrBHTChrezaXUEH2vIVFkHBXqwiPpe6LEfi9?= =?utf-8?q?KFUFfVgFA59x/Qp9GrK7YvYlRFDSWLMoChlSKTPerABnh9HshJ2tdLpPvyHLceb6b?= =?utf-8?q?v2FLJM0T4njbqJcMBDRwFVjuFchinpXRyw=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec47abe8-062c-4d91-8998-08dd0d6e928a X-MS-Exchange-CrossTenant-AuthSource: AS1PR04MB9261.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2024 16:31:11.3662 (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: hIR7VFoXvl8jR6/Dhm3JfXHJwpFdrBXI6y+DTlY5/junkz8U4ldqjvW6tO/IXWjrFLq9ol5bPH/vciK0q4VS4aojcUSZdTvfx2a6cVQOPQI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9658 From: Ciprian Marian Costea Introduce 'FLEXCAN_QUIRK_SECONDARY_MB_IRQ' quirk to handle a FlexCAN hardware module integration particularity where two ranges of mailboxes are controlled by separate hardware interrupt lines. The same 'flexcan_irq' handler is used for both separate mailbox interrupt lines, with no other changes. Signed-off-by: Ciprian Marian Costea Reviewed-by: Vincent Mailhol --- drivers/net/can/flexcan/flexcan-core.c | 24 +++++++++++++++++++++++- drivers/net/can/flexcan/flexcan.h | 5 +++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c index ac1a860986df..7d7f3fa1d67b 100644 --- a/drivers/net/can/flexcan/flexcan-core.c +++ b/drivers/net/can/flexcan/flexcan-core.c @@ -1762,14 +1762,25 @@ 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: + if (priv->devtype_data.quirks & FLEXCAN_QUIRK_NR_IRQ_3) + free_irq(priv->irq_err, dev); out_free_irq_boff: - free_irq(priv->irq_boff, dev); + if (priv->devtype_data.quirks & FLEXCAN_QUIRK_NR_IRQ_3) + free_irq(priv->irq_boff, dev); out_free_irq: free_irq(dev->irq, dev); out_can_rx_offload_disable: @@ -1799,6 +1810,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); @@ -2187,6 +2201,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..2cf886618c96 100644 --- a/drivers/net/can/flexcan/flexcan.h +++ b/drivers/net/can/flexcan/flexcan.h @@ -70,6 +70,10 @@ #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) +/* Device has two separate interrupt lines for two mailbox ranges, which + * both need to have an interrupt handler registered. + */ +#define FLEXCAN_QUIRK_SECONDARY_MB_IRQ BIT(18) struct flexcan_devtype_data { u32 quirks; /* quirks needed for different IP cores */ @@ -107,6 +111,7 @@ struct flexcan_priv { int irq_boff; int irq_err; + int irq_secondary_mb; /* IPC handle when setup stop mode by System Controller firmware(scfw) */ struct imx_sc_ipc *sc_ipc_handle; From patchwork Mon Nov 25 16:31:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Marian Costea X-Patchwork-Id: 13885142 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2086.outbound.protection.outlook.com [40.107.21.86]) (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 B69101B6CFB for ; Mon, 25 Nov 2024 16:31:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732552281; cv=fail; b=nvh/NK1/32hKWxu8djbX2JZoqenefrxILpME+XzngRB9lbb1iNQ3rhITchtvuoVkqxQHFYt6VVW0yNJ7u++Iff6RtYM4/6Q2mB4KENp4JMY1+1oNmXHfyBtk10VnVfiMBix7NfOZUvT8r0yXyRwo0UJAVVdd5XWkceueRC9p9rA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732552281; c=relaxed/simple; bh=MYMujGZAYq06JYtN7KHj1um7TxlB9N7/uwFx+yJiAxc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=CDaJGVokdwaDYBWzWeNtL1Y8BsDmTsE69UwLJh48bc9UwpXIAbMNVzm7ekdadNreETeUVOFmjVFeTxf7iK1YagsN7nQDtmOd8NhhI5dBCA2ZdNZfcpFN+H38B2D2vUV7fPjoR7wSl5Xtj6/heh+9Fjky8A+eayNk276aF3b/clE= 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=KHKsEm7z; arc=fail smtp.client-ip=40.107.21.86 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="KHKsEm7z" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FjO4W2XrO05r24ssVX4H0zY0KZE8cyj8x1no8LuPK3YIhEHXtqFXjukl3L2qkR3Bm4h7aFJMKdaXfg5kxokoBEP8wKidMIasM0ncs/5zhXv/8KrvehFOGmpda0oh+++Bi7TzRfTUvRmfL6ZPcT6obAQEwO9Sv/HuMv3658SpsPchb6koCCdxyHNTaYSFFzGJToFMfSvJTO6QRXm4XA46tRK2vgP+VMYgG6agk/vYVrwHtufBR+Fa88CIAAyYEbdO3q55LOJ6FYwEJqS8Dxr7J7cB1LAdNV0HEs5ejFJPJZsdjHb0HH/jYRvh4xEaL+RcwdMyEZjqcwS4xCZEKO+9dw== 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=M9zGiLxzpZ/vmJvSks/LGv0YsCMZl3nvZjTEgtwWwC8=; b=K3QXazmguy062YHgguSfosuX+ra+mj1cEp0zK+9GoTJn/3LQQRInq2oMwZRc3lGOThArCSULwjh1st2sTA7aVomGMEjE/8wCMM8s/wJ/cbEziE15/wuE4itNNq7zsuwrC9JWPHUdtRvLpV88uhHZMCqjEpfh0HWjLtsqwexMnI2Cvu4drnzJxnI8Rbusd4FxfIYEL5wzo9xnAqQNCupMOWYFDDlFbBpWqYTTC15AXdPy2Vr5LKKO4HrYE29AY6jfuMSYwkSjJ6JhmMP4EVhn7lmql69yp5Lfvwpl2EGrrOiip0+kjngZnHyp6w0PuJQkZs5g6YO5VOXeOPeNq6wD+w== 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=M9zGiLxzpZ/vmJvSks/LGv0YsCMZl3nvZjTEgtwWwC8=; b=KHKsEm7z5dCmIqUjNKqq8I+IV3Thn3d3P/B3Zf+CE4eUTUKVc2kJ595R/hjmRGYNZ+Q+4gMJTUdG/QZl+hE2lABmqqW6Lp6e0TbSATtFc/A7WR6HaN2SyExQ/+VI0Mo2RqOHgQyx3qnwiEDSFFymQg7UUmf/XEXtqaCIkqI5hS84ctCL3Au3QJG+IKwWKwsvBKrxvKH2XxKMjG2FDWDl+CzLK6//xpdbO6HBerPJBt3pT0I96uYKueW3eAiml+vVHoHRdxTGfCxRepESiRm0q78Ew8LPuVQ0QSiea5DQTCCbU8YrtdO1o0yeDw24pEXVGbCLMg9sDWS+QOaUKzS6zA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AS1PR04MB9261.eurprd04.prod.outlook.com (2603:10a6:20b:4c7::13) by DU0PR04MB9658.eurprd04.prod.outlook.com (2603:10a6:10:31f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.19; Mon, 25 Nov 2024 16:31:13 +0000 Received: from AS1PR04MB9261.eurprd04.prod.outlook.com ([fe80::7b16:7596:6bb4:c5fb]) by AS1PR04MB9261.eurprd04.prod.outlook.com ([fe80::7b16:7596:6bb4:c5fb%4]) with mapi id 15.20.8182.019; Mon, 25 Nov 2024 16:31:13 +0000 From: Ciprian Costea To: Marc Kleine-Budde , Vincent Mailhol , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-can@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, NXP S32 Linux , imx@lists.linux.dev, Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Ciprian Marian Costea , Frank Li Subject: [PATCH v2 3/3] can: flexcan: add NXP S32G2/S32G3 SoC support Date: Mon, 25 Nov 2024 18:31:02 +0200 Message-ID: <20241125163103.4166207-4-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241125163103.4166207-1-ciprianmarian.costea@oss.nxp.com> References: <20241125163103.4166207-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: BE1P281CA0039.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:22::10) To AS1PR04MB9261.eurprd04.prod.outlook.com (2603:10a6:20b:4c7::13) 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: AS1PR04MB9261:EE_|DU0PR04MB9658:EE_ X-MS-Office365-Filtering-Correlation-Id: f741b7f1-dd53-4079-860c-08dd0d6e93a7 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|7416014|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?q?tkncVyRQYiCFQLN49NCiYQoY9luIs3A?= =?utf-8?q?WBCWQ2d1iSet9WByzUed/IYCWcsmgp4Ok5FKCcC6eByAwjpqO50Wb2jBp9rgflPIC?= =?utf-8?q?XC2Li29pNEtPj2kXI+qFOGCoyMs3y2w8OBkWtLY/CW5aom2D7iUp9NnMdCnccS/Ur?= =?utf-8?q?xcAHBukh+GbMNqfnnNQMQVqtupTUMknUb6u8vgK98B0DJPIeq6mn1Jo+H0d7mZ6oG?= =?utf-8?q?9k7k2B9PAxGz1xVQcy1dgW9yZQIk/MzSY+3VhLIlzVCIfpOmRkthmNozff9+TSveT?= =?utf-8?q?nS2nHTbZ1HwHVOTM6anWIp0Y+WZZkNeAzBRyCPotCkVE4hvGECGwLnRc9JbHlezRZ?= =?utf-8?q?zllXumc5g+lWveQGb+GTzLDgQfMTOBl8cNjPebm6wy5zw2iwr4T9BFqBYCdLU002n?= =?utf-8?q?fjjtDuM0eSpEkxQ5pG6ILkxBeJZc30VD531ex6PhjBStkQDq9O3OmGJi6hmxHCagV?= =?utf-8?q?SW1dow0vbC7H50Dzp5gGygL9kxoF9sZlw5m9+KwxS+QLnQ3u4kmTU3quGSM8/V4gq?= =?utf-8?q?UIfq4z44zWMylRTAt1anqwgmkpM2YInfN2GtMrz8llGpa+y/g/wX22EFo3iH8faqy?= =?utf-8?q?B3p7XqwT1wdLrGbM5CEK1rkDja1SHlE9549BSwoFiB302SPi5Mz5LuuYgz7lyucY8?= =?utf-8?q?Z9RVKbvJymm6B1MPK4uzjq8ypOwkm7dXuYMSlVPS5EkGPc0DsMGhi2DmCau2QmTpd?= =?utf-8?q?2KWYlhjq9x6vyCy0cKyNzmO9smnkvEa4HPBBgh9AGzky7VoT4AlUHigSlAcY5rk9b?= =?utf-8?q?29F6xBw7a4k9STR7eFaah4r/tRjxb27X9fNVXP7mjVPyKzwlhvoT1aK6XvdZcXRZk?= =?utf-8?q?3XDl4V8TF+yQvjUWjQTesQjMmd9DpBTogu2GCIgpHpGEGibSEuyoKhvbPjHZGhcjx?= =?utf-8?q?fzbiHC8LdUjJJWXg0PNMghuym8JbfsQB0HC2Rq08UtctCcoweq602wxcdwrGpQZRv?= =?utf-8?q?Y77wKhfZ/Fzimy2HwpxqbnrMte89C7ERG6IivJGAWqwJmT3LL4fKwK6hbfRDNR4tx?= =?utf-8?q?Heo3/DAUqV0DN5oqtoT0PUx7mjc4uWDLGfliTsO4AAlLNy5DsV3k5HvWzeHTvn1aL?= =?utf-8?q?w+slWDe9jIq4oy4Bpy2VCF75DAwPp6haRPnHSsKzdy0W34VWZCyRa9yohFvOtj59a?= =?utf-8?q?istD2rnlTlTNFNxzTtu+8SWljTzXmmSU0DjvCE3jTHPMuqNOjUwtH+qsVylfzE7tu?= =?utf-8?q?H3kVuxVflERehT250GRJdnMgZ8PPRRth3t10avgkp5CgzU+QG4/Ailytt3e3DPcMY?= =?utf-8?q?dkgkw7GNl5tmCAJaAdlTGJEg0fu6x0MMd1Q=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS1PR04MB9261.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?9/Z3pAKG4Zo8K1FzPPmi9FLBIu2A?= =?utf-8?q?EYUS1OEC3F9LMgm6AmpCmhy7JWcpHtkYBuAkRJ2IXu9fKIHGRIRcZUB4DY4l7K8J2?= =?utf-8?q?ExgXU+B8XJChUiAwEpimTt3ZiL6jSExE6M+8z/rd25NLRvdYw+zJfxrKzm8T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=?utf-8?q?iEHXozwRzJbwTnqC7wUUSUCcjEdHd0sA7hJiXtJV2vEBWLt/GtO8qK5GG/qAH+sXA?= =?utf-8?q?CklE4dZ9cVVnbo2C/BiX4o7S4PoKWm1zOx0T23prEpzHlBJV0kZdB5HXryWRifxMK?= =?utf-8?q?1UFyC88vG46/n+hEUe756EAbSWCf3h5x9OUr7DRgyyMqvCUx2tXw0VQSzWRfikwID?= =?utf-8?q?Cx8MLQpfmqSog4c3n3PDcRHnnvFc6iUv9WYrX+HOPbhnrryPgKM6eEqyotBZ56et+?= =?utf-8?q?l+cnBdSK5UKyWoRh5UniQ/Rq/MRIyrVdZu18Bdot11dDwmLl9q1Q1hP4d238JK2Yq?= =?utf-8?q?1RgDygVUk2bcBzQTFIbtY8+QLxNMw+6Ga4/aHywEsC1M6f+lzz50uzybm0P3DzaYi?= =?utf-8?q?ezhOwBWuGgeomJiLemlaw2XdcTmKdS9xTbj9NUuRP3yHw8H6yMbZrIiDzL0LCVemw?= =?utf-8?q?4SVWl85/B0+BPkBXjbJJWFx/HRnNveArbbYU3DVREJSL9EzDQUmil0ql95KmvGHr2?= =?utf-8?q?15MAEi97IBBKAK9/JD6ifJBOhzDyyZSDYQ=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f741b7f1-dd53-4079-860c-08dd0d6e93a7 X-MS-Exchange-CrossTenant-AuthSource: AS1PR04MB9261.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2024 16:31:13.2575 (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: Wtz5gSLZyoGHJu3OBGDEQjAdeAgRktnk1hRskPTeCZS9OtG+pfHWhdjfSAkdBXyvcxRM+CYv5VfgZRWQMFkiOzqr4vgZ15u6KY8AOJmbdBo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9658 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. On S32G2/S32G3 SoC, there are separate interrupts for state change, bus errors, Mailboxes 0-7 and Mailboxes 8-127 respectively. In order to handle this FlexCAN hardware particularity, first reuse the 'FLEXCAN_QUIRK_NR_IRQ_3' quirk provided by mcf5441x's irq handling support. Secondly, use the newly introduced 'FLEXCAN_QUIRK_SECONDARY_MB_IRQ' quirk which handles the case where two separate mailbox ranges are controlled by independent hardware interrupt lines. Signed-off-by: Ciprian Marian Costea Reviewed-by: Frank Li --- drivers/net/can/flexcan/flexcan-core.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c index 7d7f3fa1d67b..bb24ae6195f9 100644 --- a/drivers/net/can/flexcan/flexcan-core.c +++ b/drivers/net/can/flexcan/flexcan-core.c @@ -386,6 +386,16 @@ 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_NR_IRQ_3 | + FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX | + FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR | + FLEXCAN_QUIRK_SECONDARY_MB_IRQ, +}; + static const struct can_bittiming_const flexcan_bittiming_const = { .name = DRV_NAME, .tseg1_min = 4, @@ -2055,6 +2065,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);