From patchwork Fri Nov 29 14:25:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Costea X-Patchwork-Id: 13888728 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2079.outbound.protection.outlook.com [40.107.21.79]) (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 E0757381BA for ; Fri, 29 Nov 2024 14:25:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732890357; cv=fail; b=cbRfCcylDsA5rW/0TUWY1SyRfQSkWJgoOqu/BOjCkzOhO5McWqmWWioixGLuT8wgVEy13Ne9h8wutfaDHOnh6M/kAR6L29mGHQKDFGfcCSEb17jWpp3fAVWBtIsIV1pAA1AA9d0k/1kO/nIe2G9f/1mwHn9VcRTNOs3h6AjJCHs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732890357; c=relaxed/simple; bh=B9//oYLecncFM9JB+D6PwaNQnd8OJ1qKAqW+qPmds+c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=j0eSgk7nF72PiX3sjb1DcBNm+KV9aL+J/hCUBqyaHOfkWJEXQrLbZsBq7sbPX28EFsM2Q1FNHwhn4wgFnadY4q7PmLytPw64KnXpObxFDyIlhAZYKMg2y+MlVBx37TONTCc9x9qNuaLFdRFrVQoNgsaJz8Pq+s7tfAdOosuhxaw= 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=pCJs/g+u; arc=fail smtp.client-ip=40.107.21.79 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="pCJs/g+u" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YtKVEizSq9Ric4LH27Dut0NncHlBis9eaUYIf5naqX2VyUYeJPsUnbnkBoURuJlYNi1GiXee+hrUC5WHeu+oQ8EiSjwmfzVsPBmoN/LtcNWrs2/493BTR+ziFcdqIzB/BoE67/l+dejnGlSEA5lFn9pf8EeBaaofnwgDeKywktdcz/01P9OSAA51DrwFtlglbTEKIwNBxxrVGpZbxJ2m9+vp/1q57JuT2Rj7yJ8RAm8dPIk2YlAUgXotMUbH6jC34GVB9fnOT+l81LFwJ6NHotUeeg3YTMFj63XoIb2s8FrfZe3JXE4vH3XWZDA39AEOaTRwNaRN4as2Q+zQ1JZOAg== 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=x5loT4JFE+/+1p4Njux9vpoFNLWjwdIiY3CI20LHZTo=; b=cEYSffaikN4sXudjiwYfz2Sl+XdKd3Qz8wDLyXeK+dAMX15F1BXe60rSFZpPW7GLjTb/MpJ/POPRKqAjMHertO4x+ceNo0uvkZgmFcnlmUAk2D2WQ2HaJUG4dj6mCME2T8KIabJDyzIf5ZDSNYy2XJE7xgy/bx5EiGkFTjTcVUxuI0sy2DUVc4knMg4jatayTxCmGhl9wcFZafh3neARHO8RBx7X4isNZofnAKjOyPV7jmA8IW+0nA0zocYX2kSTyojMs03yca9LZbrhfdxPHtXXBEJJ0pVG8/XzOENMqF2+bNOMaExzDydn5Mvhr6zdyrR7F4C76kNN9pkpI0OEaA== 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=x5loT4JFE+/+1p4Njux9vpoFNLWjwdIiY3CI20LHZTo=; b=pCJs/g+ubBeHo07u/QQiUTE/vrA65kv4T/3vWS9Y1XtQdVS4VrFlQVsy3nW6HFFMTtfClzFqAQ1QS9ciHN0gX73+wkWc2cDcPaHsxlj5PB2MwuyYlVWbFqhUSbkRGNsS+h/vKb9wZecociF4SQ9wYdKIw7BLul6OQ5rS/0+/hddKgEWo/KuPS3sQeEfYhTFcDnd5iB88aCGl9EZDiMeN1E2ALG86YxdNar3iwElzpK0f+HEssmEDjt7TGaOtztoAkwiOZKNux6tO48Lqqk1vXeOgJNNZYsAItI5eeeUd0a4zuwlLmxpkdUmbhu/tGGPrtTRnGphqkORrHm4AxC33Uw== 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 AM9PR04MB8810.eurprd04.prod.outlook.com (2603:10a6:20b:409::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.13; Fri, 29 Nov 2024 14:25:50 +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.8207.010; Fri, 29 Nov 2024 14:25:50 +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 v3 1/3] dt-bindings: can: fsl,flexcan: add S32G2/S32G3 SoC support Date: Fri, 29 Nov 2024 16:25:33 +0200 Message-ID: <20241129142535.1171249-2-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241129142535.1171249-1-ciprianmarian.costea@oss.nxp.com> References: <20241129142535.1171249-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: AS4P189CA0024.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5db::14) 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_|AM9PR04MB8810:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d82681f-a064-447e-ff7c-08dd1081b95e 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|366016|7416014|376014|1800799024|7053199007; X-Microsoft-Antispam-Message-Info: =?utf-8?q?jRhbKhgvsLZU8rezwfaUfnH+P4TMTPv?= =?utf-8?q?PPITkM4sYd2WH9ZfRiDbef2kQ++DuudZ3ekw6FNu26dY9LAcY9+NqF9qPGBrq7rao?= =?utf-8?q?e7kLTbagYwPL9OxChqZHQBYHA7bz+IKP+nJXZRQ8D5tMLInV9Pj4TB2+Gm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?MXH9SL4Cc0U+glZeuHeZVV8onLGoJJJuhaJngOgQKzwNwkiGgpkRlzbDuQpalWLYt?= =?utf-8?q?T+G2PYa1zSDlusLq079W0haQXF8S2AE5LdA/f/wkSWfrVsMsndbxb3/Fop0D1G7pM?= =?utf-8?q?wu8+aOzN/Fk7xreQE9LXK8Pc05j0zA/byUUqLZubD26VbiS7sXg/dvuf6iZ/QxoFz?= =?utf-8?q?Keqj58Ty1Nbp34GxY6Q0OClGPq39B8XpCW5NDwtC0Rhh+1MyR33VC76h4aTX9cUNv?= =?utf-8?q?9UiZd18wJW9MDB2lD1XZ/f58oSetBblf7HA=3D=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)(366016)(7416014)(376014)(1800799024)(7053199007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?gtXsEIz416gjfUMNBIbSEbIliJ7D?= =?utf-8?q?u/GMpznZ3U4C1VuWrjA4bCoKWahbNjVH2mRF9k+A13JVYyR6/GHQEhJVB83J64PK0?= =?utf-8?q?rUGeoQVur7BxEd4GoLaLlJk/3mCUSZhHCzT5i1RPBwOe3diOV2JYlN7e4SFfxCwI5?= =?utf-8?q?RUOcLrHnzJaCrpUNtiZxaJRuoJ7yDrloa466uPxsV78Y3fpYcYz8LiKnS7/u4roBj?= =?utf-8?q?x912NyTstVpmweW0Y4VUd8SpCAlF5cAimD6UvStAg/JQRGKZ/B8krD7A64fKx7WRJ?= =?utf-8?q?Z5rn8TxGhC9RHw2OFQa23seRH/p5aGDRhSO1h/oXPlvAwUW5ARp9hF/S+I0Najrd7?= =?utf-8?q?wesIsP5to7e5J3pO3E7YVHPlCtAM8EckqZzoASYS8LiAuNR3lbTUw+LNUlNTwYNIG?= =?utf-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7XJkBSxK4HbtgAlg4YJ8zVJ50YnLnK7jkAwyzQ/UIXD1luG+M1kY6akBUONF3R?= =?utf-8?q?dAw/dfSgtNSNynfRBpZh+GW/PdRcxulT3wfJYTDPmTNDSsUm2f0uf/TMgmMs5eaIH?= =?utf-8?q?LtOFNOtIMU8ErEo+2xxtlQnx3Aq7NjC7Q59xbEd/dj8XX1C6MLzA1/poyeNbTyLcP?= =?utf-8?q?Zj8Mx3E3tN5aG0erbH8NLkBkAuC0rH/NrNxP02Ydl/4fe8F865l6ZcNhcMx7rlT4l?= =?utf-8?q?EvlY1hAhobQbAUEYYhGXxKfvClF8Ao8nCw=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d82681f-a064-447e-ff7c-08dd1081b95e X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2024 14:25:50.4728 (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: EQU9VkB+2ttfYLzaEikoylktfXhdTHPk9HVRjZkPIgZpzcXaUb5FqF059EcXDj6ctOmuAW54EoEMTFiuAXmAOOxAeEWFf6C/V0adk+YzWVM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8810 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 --- .../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..10b658e85ef2 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 and Enhanced RX FIFO + - description: Device state change + - description: Error detection + - description: Message Buffer interrupt for mailboxes 8-127 + interrupt-names: + items: + - const: mb-0 + - const: state + - const: berr + - const: mb-1 + required: + - compatible + - reg + - interrupts + - interrupt-names + else: + properties: + interrupts: + maxItems: 1 + additionalProperties: false examples: From patchwork Fri Nov 29 14:25:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Costea X-Patchwork-Id: 13888729 Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2079.outbound.protection.outlook.com [40.107.103.79]) (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 EEF1E3A8F7 for ; Fri, 29 Nov 2024 14:25:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732890358; cv=fail; b=F5+j8osgIbJDzfgxln07piF/6peE7iKk//op7ZZBvPii/OzV/55rXSG7MQRZ6/RXJ2QkwLgyM61T4a2GB5tyNjYqHX7GpVguJr1WBbyiCWLzXgBPsYYDEdOnCkLzsjPMUeacIb/UrAxn+xW+rt/mhip4TfQctD7kcSsxOLrKUvw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732890358; c=relaxed/simple; bh=D/27Msja/lJBWRfcJFy3VjNENyNFL2o0U4+oVCpi7ps=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=f1e0c2Z2kM/rFTLAwvxrTdqa9VUQchvi6FlyuTdUFWq5NvS70zkdUZMFejiM9Nh/RugF6Dj/pl6SQDl31VzpEao/0sv+fArflQ6BLyS3RINXokYszpAyWJoh3m/cKTX/mYBHkul54T6F8Kse1rdCG0np+dEW6W1XH/eRouXTKMU= 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=PcYg8Owx; arc=fail smtp.client-ip=40.107.103.79 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="PcYg8Owx" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NXdWa2wzZboAwkkU9P3kFbScYcKFS8UOWIKKGZafhfMWoBVNS9pWRF7O6n9mXx4iBxI3+z05qK2xrU0W2BOSOPJ6H32euLD+NdFjM/ZmljZllyAKm+sgXkFEnpLfoWnQyPDjsRVBjGxCDDeCDcaX+AIhKN06h6+H6cruthxZAV3o17aOtUjZAGCFpnIco8W4z5sns0itpBRX/zEKIsFHoiZIvqJZx6o1WD+eMD/I9XnQzZAN4JfwF1f6e8D6Up0Q+SJJK2IySln81PlpnzbQ03esF0yK8DCyjnOHbDDYDWL5M8WAyHWBBu6R8hViWSgFQmlYawMK5wJ/GGGRj05QnQ== 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=tpZ3L6RcAnRf0eDx7wa22XwJ34ledo9Aicworoq88jQ=; b=BqH9ad+b5PC1EAyBzNG6NLnzNalQpowIC1jm+J4oe0daPG/d7Hsu7lprK2MiIvUY8qLKAT4mxNAFg7oschzlGTnm6aWLbbfizcCxDdlRI9NNosRA7yVS/meGh84R184pVEI1nu0E+VvnRAUvgF3nfRwPNsMQUdwwb6n0M46EsXphYIC6CgAKE9R5SwBPrRQn0WmpnWc+W/XTEdlw7X7Gi1k5NywBsiA4sjqGCpYLlQNiZ2mobJrDtq0axxvWJC0P0e/O6kiRCOh78T8rJ0EOuAEK0xzemdGm7XzueYiPTTTV1bQ0ivyKaU9HcQYuXeXuTeFN1IrD5uYQoGYk15c2Ow== 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=tpZ3L6RcAnRf0eDx7wa22XwJ34ledo9Aicworoq88jQ=; b=PcYg8OwxOnCnvB9Hg8ObxLToawfOR5GW31Y4/jPsL2TH4His3qIn2bdzxvhxc0rVD4Grx3BHgAOktoxpW4hbLcnfPVVra6epFs8J8RLC5w4kUIVtEe3o2Fh4Y/ooocWxLLJZ/cmhL9SAVv2/Poyr6TEeWdKU20KUHb71fNF+9iw7RGkzqdm+ZZIFGwcsDwr6beOivC3KqNwqHURT/YilwILSPgTCWJ34K1sc7mo0XTqhH0SbUkrKPUD8gxSHqZBMeok9O2nx21tqH3iB0uoCt/l9v6z7WQ7v2+c4cwI/zo/6TP02pWUaPgxWUwrdapHoffFgHG8YxUZNg2jBu+SFuA== 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 AM7PR04MB6869.eurprd04.prod.outlook.com (2603:10a6:20b:dc::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.14; Fri, 29 Nov 2024 14:25:52 +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.8207.010; Fri, 29 Nov 2024 14:25:52 +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 v3 2/3] can: flexcan: Add quirk to handle separate interrupt lines for mailboxes Date: Fri, 29 Nov 2024 16:25:34 +0200 Message-ID: <20241129142535.1171249-3-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241129142535.1171249-1-ciprianmarian.costea@oss.nxp.com> References: <20241129142535.1171249-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: AS4P189CA0016.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5db::8) 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_|AM7PR04MB6869:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ee97418-e821-4ecb-1794-08dd1081ba4b 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|376014|7416014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?q?9AxeVSB4sD+M5C0oNF/e8YItVWdrc7+?= =?utf-8?q?idU9rJF5+CNWe25fLfFa5lcfw/aYFsZmFnDPiVuJ4Ha+p0RGTPalPDpxct2TuOI98?= =?utf-8?q?U1omPFZfYg1mCTgqXXOWhmKbnvOslZXI4lxxJuukyxlvJjlm3fd7/6aobUCiafw/D?= =?utf-8?q?bZaWIYjl4jHD2+5luIe3k/So8FgCTk+6qc6zLDvJk9pL4q/3N0HaZv2d/wrX/ZCR4?= =?utf-8?q?t58XyqAniV2QPHm9yWnSw/JJI1QkUo0oEvRUFXJ0p4ygVouigQitaxMJMBbn1h0Y9?= =?utf-8?q?fuXJTebXAWtzF3OFFBckkdSptOlwdYU4mz1iMXRfBBXrLGKD9VU39S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i9/RaHEPVJpK6?= =?utf-8?q?IRSTzk6BM2UUy+bwtMOtFbS1QH7tpR0ugTXpbDLAj0dVwEvmj73ykz6hJIcqQVpIz?= =?utf-8?q?6mDcqE8BTNSVDO+trKH5cXfYnxuSeJaBy3A=3D=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)(376014)(7416014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?sZV3S1+pbBEqetAChsWjplMVH7dW?= =?utf-8?q?dHRL4MVPEd6ETF5sZQ9RVnMtRHqtNJy6cxlclN2TCvnThT3Ln/MgaN+R3LcYjure7?= =?utf-8?q?/23BgKKNND2Uxxpqldu4WktpO4pBmCH4sgKMzPwqoF5EW9KS3YmAArMRT22SvrCul?= =?utf-8?q?5h1ttJ7Joiq301ekAFrmxfbKf7eNvXQnX/zM9nTS7eG98v3G7TiIFAsQ53V0xLi0/?= =?utf-8?q?ONYw0xo+B/IrEbMcpeLaqp5YikVqqkndBXYhvTNsgSwZQOg7gg8J//XKX2SVHn9vA?= =?utf-8?q?nie+yZHmvGT49NnPIds2Hnsr4j3sDFNIiT+tN1WRXRC+BK14stD+vI2hQPz9MBoBn?= =?utf-8?q?0DkQvQNf+tWhjYyltL6AUszmAWDc0jHVlqYctdhz9sixe9I3HL+tES2hhAIZ3Le21?= =?utf-8?q?QPCFW9A+t+7K8GKg/B2NH3mUTlrSTsN8Htj2alyku7tdTy3cpZI3uzQu8d+oQIu4g?= =?utf-8?q?pDkBwNQyPcqFpSuYmXVbV+i3jgYrZpIyGqH0aAjbdzBsG1vdTN7L8gm85/g2+Br9i?= =?utf-8?q?SZAIdp7S1uOwioc95/pNCDggXSxBUEYgJcFrDUkZ3ilfUzL7oC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uzzmFHQ395fe4gYMVp4pAFnUw2SN?= =?utf-8?q?YluJaXxHi9aoQs1w2QZM6Vap2PnnJsa6Wy/iaBagwHYWjfFEersaMeMnvO1OJPiTY?= =?utf-8?q?U9r7C7Jm82b/B52xihspMSP6RVHsGnp1zQ=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ee97418-e821-4ecb-1794-08dd1081ba4b X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2024 14:25:52.0153 (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: P11SOTmgBl8zTrH/C7P0VqrNyPiobrLZXUDkZUziBntwY9lxmpdYE1j4ei8ES0bUjqE13aXEzibgU/crXI+A0j6Me7M0gJegDe15AEZ62+Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6869 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..3ae54305bf33 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_byname(pdev, "mb-1"); + 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 Fri Nov 29 14:25:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Costea X-Patchwork-Id: 13888730 Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2079.outbound.protection.outlook.com [40.107.103.79]) (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 81F6B7C6E6 for ; Fri, 29 Nov 2024 14:25:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732890360; cv=fail; b=T1e21SgJD7mQ5Enei7xsFmKthLSUsG8g5SlBzFqnGUw5sCvPwJKpsziDQ4RwgQUDOfPluvanL+EzZW28EW9XVjD1qv/so/UdXpt8WKeD6w6IF6JcuNrMGf27AZW2BfyK4rRv/6c4H1LYtGJzdHx8hWAWSTynkuFI69c/zBH+cFM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732890360; c=relaxed/simple; bh=z7sgzUHJzovVRjZcaYrA+17RJo1kqu7VsOOZWWx1Ykc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=mjN9US5JxTKJzv67zjJSXfLxKTjl2Xl4Ry4tRF3BS4ALXIW0k3eB162hSeNDwg7DqRByuyOl/B8dGMtIS+UJHIWr/bM7aUnP9BTVMJc2zC6Vwkb58VG5IqxnIT/2UA92UFCnome/3A6l33mtPkUUjIqqZWNuUCU/4yMrGbdMVyU= 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=VamjHE9R; arc=fail smtp.client-ip=40.107.103.79 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="VamjHE9R" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hnuE0LtkWgB6udSqm8BtLTEo7KBxoc4i/eoftL2kNMdvrYB7l9yKSG8FMv8H/pgbRiDoHRiMEyJtsJ14ETZpw6PuLLgF3PokZx62aL+jRU7h9iDxXv3PyCNs65oE0A/kl34m8hPDqhT0mhQ5YD7Njuuo2EFVwGGiBvz19HW0piTazHDvkKP4s4A8DzUch9HTsSLWN5ZDmekooetkvCJzjNIFmtWXLgfFs6Kb3nI8LPjc27lnPyANd3034zIznaOgv+sRQ3XKEYGLxupmXt+Gq9Qvt/cq/07JyZ/LYl295sx9+DE+Mc3t8u4i6JRAzaBa1LDOhjzBixUvLiB5rQ/XFg== 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=ifRbbYsxVD/S/XeUi1nthARbnHnUTln9zsV7Ng5LIrM=; b=dMuPKxFkY0VUHU8LRzXAvTdhMG5F2ROAMQQJGIcQlMIYf8EzJxJeS9iaoe62QOGJZ/CUMYUoKTMsz++CC3mkgyNfKnRN5wkcY8dNw1efUCnl7sxx8ZsPGQtfiaDV9krYklKPJcnAGpye6aDSbwtzCeeo3FxPAwuB0//oXs2T/1Ugn9/yVQ22onBIq7EuY3aXXcX6ym/gJnoXD2jdHAyRMNPh5EAxiWlscFBQeHiQcwhQa9Uy3bOK7OTYDZXMxaBfnosXypSnOwONqoeNpT/fBampgN067gEA5otdsoMhkaX9CciKskDsacjCqARtahVqNm07xRv80+0ECoilnEb1/A== 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=ifRbbYsxVD/S/XeUi1nthARbnHnUTln9zsV7Ng5LIrM=; b=VamjHE9RWZT7H+nRAyOv5iJ8JiCnXTlhI92vipoENJGUaqQgonBT/rF7SXbttNZvnMkvHZCw9NyeeBn6uNjI3i2I+68oPeLs7nDf8nrmd5zwAvOpCsMRlRWkVNhvP+kx4YV3OHS2xHx253ol59zEjCqDnIKNhOW4ixM4+gaWeS1+jGe5rcutaQj4SFQz6XoYQQ5oaDBeze+qtrOSuKSnD7T05d5HGQ+X8LOFGG4VzqN743by3OWsuHDsfieRD5S+z7Ao9tlMLMcam3YGRwRdDkiRAnOLozTLK+aoOkzAcpG2f9ePsIfAudCCZxpKKVT3Q6XNTp2sZoyJy5Xt8aunEw== 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 AM7PR04MB6869.eurprd04.prod.outlook.com (2603:10a6:20b:dc::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.14; Fri, 29 Nov 2024 14:25:53 +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.8207.010; Fri, 29 Nov 2024 14:25:53 +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 v3 3/3] can: flexcan: add NXP S32G2/S32G3 SoC support Date: Fri, 29 Nov 2024 16:25:35 +0200 Message-ID: <20241129142535.1171249-4-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241129142535.1171249-1-ciprianmarian.costea@oss.nxp.com> References: <20241129142535.1171249-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: AS4P189CA0023.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5db::11) 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_|AM7PR04MB6869:EE_ X-MS-Office365-Filtering-Correlation-Id: ff70218e-b6d8-4c2b-0a4b-08dd1081bb4a 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|376014|7416014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?q?NiBvL6dtJc4jh8INZYNOonasheRE0mM?= =?utf-8?q?Y3oAj0SZdFt0bIrvogKkfhB6PK1pkjh8Oka0LjWydXNucDJOMaHt63c9uDCV2wyVm?= =?utf-8?q?CrmgjHRnZbcvQEc4Lmc4U3QMhBOGQIPKvR6+8taI7d0Pf8wHsvkzA0uY7U+53Sbc2?= =?utf-8?q?HwsIH3q7FxElNVAWTSaa0uUSmIketcMrFRVvMi9GQpTQ9IaZH97ZNUDF12l+8JOBM?= =?utf-8?q?2mg+9+XrQlRpsYF1UGb3TIXYitzhVrQX+4Z6NZOQDm6y3CdpTH80fpv2lNt8RpGRB?= =?utf-8?q?BQY0eH3mZZOBcEdzr+BExzf7ILybQ1ADcigpx8NI2aODOKbrUIXKTm4p86th7D3Fs?= =?utf-8?q?65bBk3tPKkKkPMI+uk0uAEHD6YSCttfuJTB8M5rnrg4CdYCMqaD4Bln27GP2Q+oZ8?= =?utf-8?q?/VvCftfOr4ze8qlytdDCztSCE2GYXG1f54oORBOTff95GA7wAiSh1t4evRj3npE1+?= =?utf-8?q?cEaBu0cx2i0dzf4EdJcMxU9JISNCCwR2vq0MghH3yUo1mwwWeXPCrVqCQsQlvq5VU?= =?utf-8?q?h+DcnC0Rv+LYgN6skTe2E/QEi6CHYWBqPejTbWROk2XFJGSTqcmSKQlpJrntXTv9O?= =?utf-8?q?hORLkHu30KztFoZYjKwuDl2WaylHwAISYTzS0zMMlHYuhyShoBlaYjxoY2JEwmFli?= =?utf-8?q?+PXb3MHNNXp6CAV/J6t6jD+8sxvitstiQOK4TPfKPsLPVVvfnwn8HsPSSZ3mnfTQu?= =?utf-8?q?jBOY0yrUfh0oe+te5QELU42smGEUqQpMN4BzkSlZNYEePdo+nbcqgskRMH0vojAeI?= =?utf-8?q?0VFhjjlIQpDKbJBXeTLjZRW5bnPKJDrMGInAZXPK2yOUcD9kzkBi2YNDJa15AOXgK?= =?utf-8?q?9MUVXbIUfbiPOptETa4E3hBY9IJEiHkCMqPGZBJwYea+wlnqcth2jnhKzdHu/rBCz?= =?utf-8?q?TvkIQHejD4ZPy20b2FSn7QoYlhB4L6+v9U82XgdTgJDO4GXpvJJCxCpuBnwHDWPHl?= =?utf-8?q?Q/csqRkrvm407PXLWs0Fr8PcShNr8hdCQhTO4pCDYUevTrF7zoQ/+Lzc9KQvGgzbG?= =?utf-8?q?WpkNAxzL1P5clQYqik5kcHGwkuwq2Uy4mQ/TEc/xKNKP6U3M3Jqt7Ka+GL+w70V23?= =?utf-8?q?v+y40HjGWIPuONGgnMClCko50xHZQPe2FOrWex6+RL0/G99nQot4EZBnsSScEu240?= =?utf-8?q?AZW8ue2M0/5L7IuQrAKSlywCw/6ySLbuhrsJAxXDPKWfgk3M+pJX9WHMCBQlQw7u5?= =?utf-8?q?jWYciEf/DH05bcfA8ndxYgG6iGI+fbXIcgPsohYcwpUtZ2Iz3/92GVOZDPgUeNBvi?= =?utf-8?q?xG75KHgMzrEfs+I+qCft2NHq1WB/YoEkJsQ=3D=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)(376014)(7416014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?ZDW8goUyDyeDbjgo/cKQAyj3cq32?= =?utf-8?q?BT/slb0k+FqHtqZepnjQg5BVOm4PIDti+KU+INfuS6w9U2fHpjaOOatA+UelTEeBG?= =?utf-8?q?jdeicB9Z/swjTBNObSix7YuHAuIaF8rdscDqVfZiQK/J64Y54BYA/NzXfhyipr9mc?= =?utf-8?q?htkndx7ZjRyzEeexjDM3Px95CLElWG77SYoxu5V/kYaXkf4hTfimVB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?utf-8?q?3a1kEJ8C/5mvV2YO09bDAIkJaCKkoBI0OoMgNQIiIuWuLI82wQRryUNjjxvB0wMLx?= =?utf-8?q?T+lrzaRKP3fPfB/kwSgY+DHQLYOuf0K7kHW/OOqt69yOzwII+beGSJ1HIMMRrf1iC?= =?utf-8?q?2CXPtO40Sis/9jEKn24tETCWz/cpCpYir1X/dcfRQn32QXbJRJTQoOiTOjzgKNkKk?= =?utf-8?q?pna7mc6o+7acy2GXeSeP8slYeJjHLohAJy49Cu3ioLmLkNf0QbyOwaeA3GF183N3s?= =?utf-8?q?6kPDU0dzJ8fEnJU3+aMN44mSEW4KwMo11zg6W9r1VJhxLTp1y3Zco4TnL4IaDC/u0?= =?utf-8?q?hjPxfJx79fcL/HmKAUI0uV6KprGz8BE4kDaq3rhEEV/hb8wx2aze37sBEyej73jD8?= =?utf-8?q?uu+21c8Oj0Vp2VCQ7qoWK3/knurGJXdoip/WBqwP6DmzFn2cnyN0uSMRn+b35Z/FJ?= =?utf-8?q?TNJU4cZK8s+Trfv3CXM9d9dtDhcXgyeR/Q=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff70218e-b6d8-4c2b-0a4b-08dd1081bb4a X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2024 14:25:53.7495 (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: P0oKiq7f0JW7ON1yEKqGexpCZv1XZ3o26iI5DWTEtblZvtIq9UjiYX28hiONWCT4+IpkkxBRakbHFVTjOi6b0jO9YeqPGTY7HG36W2yWqmY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6869 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 --- 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 3ae54305bf33..282297c55502 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);