From patchwork Mon Jan 13 12:07:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Marian Costea X-Patchwork-Id: 13937245 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2047.outbound.protection.outlook.com [40.107.21.47]) (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 824C321ADB7 for ; Mon, 13 Jan 2025 12:07:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.47 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736770040; cv=fail; b=cycsOHwzzSHb6oFm6/fYqSeaJCB2f8T9EgWW05MoJ3m3Be6uiAzwvBOR+UnV2cO3bYlVnzFDkD0aUA2dKI6Rsqo7ScH244Pk2Zrr1VfXs4URxWZQkpqwE1NLlh29kPAI7g7bk9WCRYrA0zoe82lSTKZxBTlulMRBLdLzdEuJH8k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736770040; c=relaxed/simple; bh=z4OdTSCQ+86qVjVqzxGeoE2ZgC5pvMjXPFPwFo8/PDg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=TCiG+t+z+0komGz82mnFOak+MMCAloPR8CL4CsHkqHdujX9nkY4VDnnQ/W2bq9gu0NVRZn8//lSQg05xgNMvPw88pIP/t56aZopnL9VH/rwDhnR3SeKEs6YYe45mjY7MXZZJzwdUDpLs7+Ik2HNOLmajWGapWs1I5gpqlOj2mq0= 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=vJDBcYRy; arc=fail smtp.client-ip=40.107.21.47 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="vJDBcYRy" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vhfKc2IMxxLONUCWCYgbf3DCdTm7pI78nymN13007H0MolbxkBddboSjk/yM85JwT+/Ejoa24x3DOQZalUHxefVHMRlBn0F4QkHb2vxYF9xHwjuAVdle9vTyLnaKsUZrmnY1A+b+etar6IjC9nai2oiVVj5WdsGaIc43DX+3uxujRAjARYYaTeF8vBYiFYi8zikIF7sQHyMRAj0rJEQVUugXgHdUGvG830xSsm856gipvXlneogiJSmHE8efYHhNHK/CHA7XR805fgTk60zMl+o1ph3TYEvjrov0YmFx2xCVCOBUw6btGnkvIk+kS1n5XQfiiwU3c1iYqTINxqDXIA== 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=I4/SyxyURhBxCNCTRbSr5XgZMgwMBaBrjZu4kumk2Nk=; b=tvISqBbPYTZ63pKxq4MjzUAq49xoI/yhbDr88iOe4roZX2DqPUdnorn2HcppyOMJWaXIqAyosFidfCOLQV/qerBbcRbrLo1ApCvo/k2q8W4ZIwxMvTd33zmdxu89qMTzI7DXs+bVlfRuGOv4VOLJ9aYPFmB3SN1EXZk+8ZAUNiWHXbzQbJLFfLEqJYnApeYnv27v2Im8GdxvHv/5JtqBQd488nVhCGUia8wkP2VM+1R1eq+1WkPTvIvJIt5jHFot1D+m5dI5sZwN72JlqxPDjNpgbvgFI1ZHo5/tMKagyB48cm58wmZsxjp9I4sVneqmxYGf/TtPIZ3ROnTADZj0WA== 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=I4/SyxyURhBxCNCTRbSr5XgZMgwMBaBrjZu4kumk2Nk=; b=vJDBcYRyh4rEvx8f7mB2iYnsHVTECbvtL0SVgSnttoWMRb/3Q8VWGFjqhVXv7Q43uekdcTEFWN40+0moVp7g7DC1ZFTMMyntmtbAKsovBMWgC6sPj0fg1oTxwmp8RbYavCP4AyLvYIRNlkV97n8U6yCXNhLfmECdg/Brm7l43x9QEauNa3TjFLmhRtR6EPAAcbx/Z4V4eGetQsIFdb63+z9UVBcvAo7cv21aLY2bgusdPkVyyh40/xC3Bb/qNUpBAmrT2uoRoPNjMJpo04VsetHD52A4VF4kE5C8g7q3/LcHSa3gQNQO3PSqf1J+/JXj+J2kQdB375VBHkjxwQGpYA== 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 DU2PR04MB9066.eurprd04.prod.outlook.com (2603:10a6:10:2f1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.18; Mon, 13 Jan 2025 12:07:10 +0000 Received: from DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd]) by DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd%5]) with mapi id 15.20.8335.017; Mon, 13 Jan 2025 12:07: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 Subject: [PATCH v4 1/3 RESEND] dt-bindings: can: fsl,flexcan: add S32G2/S32G3 SoC support Date: Mon, 13 Jan 2025 14:07:02 +0200 Message-ID: <20250113120704.522307-2-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250113120704.522307-1-ciprianmarian.costea@oss.nxp.com> References: <20250113120704.522307-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: AM0P190CA0022.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::32) 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_|DU2PR04MB9066:EE_ X-MS-Office365-Filtering-Correlation-Id: a36c03c8-3633-401a-64b4-08dd33caced6 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?/GWrEnQRKWDt0JWR27rRDMY3FFIntal?= =?utf-8?q?NZkUVHuteAy4TVvsSAl89DYqmVroczX77YoeujrAjOcYM7q8d6lRW4dYR51XpisPq?= =?utf-8?q?pY+Hrw7nbVQ/FYVrXvmq6hCxXGuG/94rCsRWWg4de3GBPeYKqfaEkSdJZJajvKRjE?= =?utf-8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?HcbKwJnSBuvuav+MFK9W8fGpwUhtMkB4J4OeAim7oJKbbwnPD3dfjy8hHgVibZaBh?= =?utf-8?q?YAoPqoCOWfWI+0J2Se3xEd2ZAWx6wnT28pXRcr5xz+fcBdnmA+BdN1IiqEZSh7tCT?= =?utf-8?q?AUlOZhA/ZBYAWoZzPsGiv9A3G9w8F1EHovRZtfPw5DwTL8zZ+jjB0tlwE801EWcMZ?= =?utf-8?q?/QX2n0HTwhRinKVyHLbR4z+7BI+BCi/GjLANAAJMO+f3xsQzH2Huk9Sb9dKMK7Yhi?= =?utf-8?q?ZrwhGK6tHEjmd7FKzoeYAtsUoecLiw0G4xpD0hnUc94bHx0eveJ78F2EqE5IATty/?= =?utf-8?q?SoFO/xQbO5/h?= 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)(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?NHo1Yp495HOdDDPvDa07/EAXjflx?= =?utf-8?q?Xx2EBJ+fTlpb7ekkFkEVEW/OKD9I1+0V6eTGoeqE3MEXKyK1CEvw+vV4DkmHflXCk?= =?utf-8?q?CwQ9Ztsn4B6D6sZIPMV+3xT9NcjSW4YIy4OfvVAVOcrKwcYrTu+FAG/W4vvoBmiHX?= =?utf-8?q?SvPhAnpB/j7tHbNiC3Yd6G6J30VORoSIEBnyiaKARg3BRhNkxYeDgBGctwmVNRXmC?= =?utf-8?q?cMvWdZ/Id9UTEuaGttNovPY7CykHexFeKRbupzM2QkknQ2C2vaZJdCp/m8aHYn9mt?= =?utf-8?q?+hRtmUfrArOQHeqW3F9LILA5ageCR/ySvf9ANXAwoyyAcdQd7LU/gWE4XG+aYoi3q?= =?utf-8?q?csm8/3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utf-8?q?X8ps1eyB6SrKMzxjEf7IPHpN+DeIqEPbZ11nivgF7Es/o6XaLklqjptCP8xG1Ky5f?= =?utf-8?q?jOlI4jGl+nezwrTnET3QqnF4LV/PN8D952lJmQpORUhiSRw5UCBTEkoridHpWcfce?= =?utf-8?q?4odqYnv3lD3ihEaKITA3Q1YRKLS4qsHmmm0o1VluvJETOjQuaMzXmpiCxYl+Ltbi5?= =?utf-8?q?V/+f9FV3FR8id1VwK0/vCDGzfrBWlaCRZpC1VSZePMPSo8rzY6B5feWUO7G8C9y5G?= =?utf-8?q?Xa3DtuSO0+2890frQ18bejE+gxezXmCWgmlX+wHGCKcb217klGluoi66HXMHSTlYh?= =?utf-8?q?EavLl9dTwD88VZ9IYMIBdgFhjAlOeMmcXg=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a36c03c8-3633-401a-64b4-08dd33caced6 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2025 12:07:10.4379 (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: 6Zu739WVAjqPM2VzywLukwMfFk7GpCKkC/a9w+FtxHte7cX3Tp9f4751LQvpih5OnrvtfN6xNWGpwow6UVCQXiChZbQNTAjjSsyLTNU7lPg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9066 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 Acked-by: Conor Dooley --- .../bindings/net/can/fsl,flexcan.yaml | 44 +++++++++++++++++-- 1 file changed, 40 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..73252fe56fe6 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,35 @@ 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: Bus Error detection + - description: Message Buffer interrupt for mailboxes 8-127 + interrupt-names: + items: + - const: mb-0 + - const: state + - const: berr + - const: mb-1 + required: + - interrupt-names + else: + properties: + interrupts: + maxItems: 1 + interrupt-names: false + additionalProperties: false examples: From patchwork Mon Jan 13 12:07:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Marian Costea X-Patchwork-Id: 13937246 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2047.outbound.protection.outlook.com [40.107.21.47]) (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 0451C22A4CC for ; Mon, 13 Jan 2025 12:07:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.47 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736770043; cv=fail; b=QGGC3HfiFM61V4vw+0m69J/mCyu+C2uLp9aFtaSP2Mik/zvcvgdvVlYYdid1kKB4zYgoSxuLAKbzqrGQMM9z2y4hN3ZfV/xR7xbVoGe9aOU1kuGPz2B/qaMsL5ZF2fg2PQbsXgpX5JlQl3iybuxG3lICHrsXScGcg5H8RCTSv0A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736770043; 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=foZdTwRVfFEQx+9HqwW5MP5iTAim31XgPxOHdglPeWM2kVdH3OdD/Gm6XEBGG7IWP6Jb8iPJEpjSXbbsO6QAoJRCacMaZACM7B7S/UkM2zSlCHb146SwuD8JQT2Looui8njXOqlvGx1j6ofVoQlXsSEVlRTfXrc8dKUui7SB+zM= 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=n+JaAueo; arc=fail smtp.client-ip=40.107.21.47 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="n+JaAueo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=I/xzuroo4z8axkkK7rYxkPZm34kvQmv3SEvjDVh3XuQI8r7MUEQ1yw3hRauNvJna8OzzseIdwMDPnc+Tj7C6Ihad2XR1NsnpOofKVdEZ1XN9oDWPVrZBm2b6z64JNqujecJyqerQ0sereu4SvKGEz/ROY5ZfKPqUKCjj3tQUnPXMsVFErSQI8zGgc0kSrVMgh6Te1NH3tsqaRGW8jzXnzTKmSJdZryKc75db1OSH/9B5nD/gOaKSwI43yR93M275QxRhZaIWZBIteYy0jU3VzRtvGoKzXiSL98SYd/LwgqFESgSqk0iHollkltxkhkNz5kJaZRhGi0ND3h4wEMIvjQ== 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=O+IqajhN5rAjoqIPXNu42EQ6Cv8F/WaXJAQlvXJqTDGXT7kSZAylUjyq7gUoKbHseOyxnLpyemmTfsUISngnoU12gJJrAbGiBNLsepFz5z8nez/WwL0O5HD4sVZjTPcTQRwDLjMY+0z8OjNXCZNDcNdfw+wQy/VtH6h/uqcqNOI4F4SPW+mRUclcAWHZT2PVyqUjugnE7gYcwWKu5Gj6mgTGCu7XBXFYxDzGSTmjF7miik5SkP+YL1N9w7uFAWOMGGynFvDhp+NtOFkhbq0SROPKzRM2kcJiLJXicKn2RzrMzTWw0lbvV2IFOvokSIcS33fHYBZPSEk1PpNuTROuGA== 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=n+JaAueojXijmamIAsgUUIbR7QMrcq+NQCB/f5ITRt4rSg5Rqoe9tzbXKaxOCIV//DmIvf+r/o2Ie/o/P9gjF4GNlpVyMRFygMZ4vLnAGTD8KMAWJelyBSb9ik6iXHqNTuDRggCd6Z2ewcCAz8lFAMlXeGo9zSJatPSjwoYkmE+QBo2yf65BibR5mUaaL1jYqdgXdvR57mTKcRcF6Dt0qlZ7wR9GptPZjJb62mQUcXkQwm7PfpB2Tr21orUowhQgfam5E7zdDh3PyV1yM5oGNa2TGnnOu04fniTCQ8tyzXqCnZ3DT5RWEC9F0SAjHhZH7A5w0W6ZkysoCnJ4vOSBKA== 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 DU2PR04MB9066.eurprd04.prod.outlook.com (2603:10a6:10:2f1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.18; Mon, 13 Jan 2025 12:07:15 +0000 Received: from DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd]) by DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd%5]) with mapi id 15.20.8335.017; Mon, 13 Jan 2025 12:07:15 +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 v4 2/3 RESEND] can: flexcan: Add quirk to handle separate interrupt lines for mailboxes Date: Mon, 13 Jan 2025 14:07:03 +0200 Message-ID: <20250113120704.522307-3-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250113120704.522307-1-ciprianmarian.costea@oss.nxp.com> References: <20250113120704.522307-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: AM0P190CA0007.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::17) 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_|DU2PR04MB9066:EE_ X-MS-Office365-Filtering-Correlation-Id: 29995fdc-956c-40a4-f6ca-08dd33cad1db 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?YQtvWCKpCwkk2MQduqEYUESqQGPrco8?= =?utf-8?q?76XcvJijjNdy5zbH77hHVXptbJ02PPgRuzZL3L3wuFkYvtm2uaqmDu0H/EoDSDeb1?= =?utf-8?q?YgTvmHPz3g/V3+yqvaMfiYfwxxPZZNLa9h000fb+MycyKrq7S/wKeR8+uG0RxhQ/T?= =?utf-8?q?DnaS4j8nOxwCM+7XQx3U5IdU1UXPyXqLsD7EpA3QmwdLBttbD8wje77wim3LcPAMz?= =?utf-8?q?+KLKmbvh1fcwkZ/xJbDRJJpC283GcMcTEa3ORSwsUSeFskna43g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ja8Bq?= =?utf-8?q?tvTavENfYxRm3mQMAorUoLvwguzJnYDvb0Nh0Haom07zyB9/KhKU+bKbHQf1m/qlw?= =?utf-8?q?JZfewtfGpB6SRs+xbxWW0ptdcPa6RImthKKw2m/6uUR3SD9fzcxDgjP7gopSf1rri?= =?utf-8?q?XiwWNAg4UFl5Lyjdoo5fE6plXebK7YWRh7P0EPKW9xXbTpRsfWt6WWTBzNTcejVJS?= =?utf-8?q?qYkUVdbZeUlW?= 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)(7416014)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?DYZpbJOZjgwrg+201jadEN7dMUR+?= =?utf-8?q?JWpXBjnKyV4W0ZA2yaUSIfywPPCO3uY59xR4ORrHIq4C8e90lai5Zm7a1sIkRd0Da?= =?utf-8?q?zo8OHkEigXQBXHD2tlBU8XukQX1O/n0F/dPKGMbfeqLUagh0t6ZREReUscTFivMei?= =?utf-8?q?aWWfLcRm/u4qFfZzZc658fmNmMMko8VOXVt10usAOKbsZLEuMCz0zk6NIoQWXo4ko?= =?utf-8?q?SLvsgnUb9wzvXF1PY4W2knIVT+nHCRIqXavlc0iA9B/4pVdSgKY45CM+q0sYWR0Kk?= =?utf-8?q?ffJzDkANDgjWtL47dPgnZqHKeVXGSTSjrnvTIvKzs1SURJvu4JYs7LPlcP4eZ7y7i?= =?utf-8?q?Gab3KP3KfJWovX7ugoavhe63w5whcAzqxgDwm3lcatX4S4ZZkBRkr4jz8ZTZpUAcS?= =?utf-8?q?mG0h2XVpUd2+F2DsRN9QhubJwQrTJqey05siOqpMcqUNL5b+HEBaGomQ9cilSeCYF?= =?utf-8?q?F2yxh2T6nBbvOnyZa+GY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W0gxA7ldps9E0hdZHwkcxH?= =?utf-8?q?95y7E2ycUl3Tx/NQS9s+x8ZR0P/6MQQp5JByvCHcgIKK18atVasPdw8ze/d6yCkBf?= =?utf-8?q?EUSq6G2iMUqkebYLyahEJiS/1Ygb11mv9WIpKL0GsAy2O1KyQ+NP0gWoxfrDLVpwx?= =?utf-8?q?dQUZvXFKbiIWcTptbznC8GzAp2vI2vTBnA=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29995fdc-956c-40a4-f6ca-08dd33cad1db X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2025 12:07:15.5449 (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: 3yOHgprEwYQCq420lEMsJ5Va+4gLsNjqjmO9ER/aLvQy6AXEEEu5Q0knhsMyql+x2gA7q6X5qYWeIs7EX4fbLPsLGyK7lUkeHP3b8RrWzUE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9066 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 Mon Jan 13 12:07:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Marian Costea X-Patchwork-Id: 13937247 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2062.outbound.protection.outlook.com [40.107.22.62]) (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 7B7B022A4F8 for ; Mon, 13 Jan 2025 12:07:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736770044; cv=fail; b=l/f5Tfmmc6Ebxn5izp1NydeNCBwhY6aKEAtxvs37umVw5VRdc0BiBi/eXl53j7jacvcoMTRGdne/for6/adr4fxCcqzSJxv5oNQww3w3rPXXLxF9zmDQXWJ+e3jyucUPUIPjOWCRKf3tBBmfxEM2zdD+52OW78Kv8Yvp7WUVcAI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736770044; c=relaxed/simple; bh=z7sgzUHJzovVRjZcaYrA+17RJo1kqu7VsOOZWWx1Ykc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=MnxuaFfuJm9XyLJHcJ7IEJGjmVZ2bNEX0+GmIaVZs6xp5Cnzp+iYifYGqylQV/c1vqUE4MDlrVad+FE7QO+0Y5sNfxcAjyEKsH/HZjQ7PI0LJHOMRMxFTeNwX0e4vjNsV+XbqIrcdDzASW1RJZCUSSx+uzyOzw9SqJvDG6RSpnM= 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=Iyjn5sMF; arc=fail smtp.client-ip=40.107.22.62 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="Iyjn5sMF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HrVKK5uNcvM/m7RKNRh/w6FEHCLW5Ag1OrANc1zN0cl80p9mWJsRqgpp15ffFRVLwmk0m0/DdqG49ZeNM89SKnQUd8vM6frIf94LQ8enBRMsM+AsIcPFfx28Uf7HnmN0uQKZcxaKPzNnna+MzwzU+lpMyjhkuKbmyChT5mxpKn9k7VxL+NtdUGT0IaBM4PmQsHJqn4ZB9pB1qrYBbzT4PAhIW+LJsvd5OJ0BWR9zqKUZMGCAHtQDVKXaIuuMtHtF4G4biOKGy3YQ/2CvNZjw61i8sNzvNZvKOyf6RM41rGx5FkpbzCY/drFWaRrITW0cBvQUS9V4nRX/WdMjW1Xxdg== 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=ww7R7Yuavy3pyE7WfEL4eOORTIQNWqjKePkyfoVQzFXNPJOV7NlNspBw9KswU7kvQ+3AuFbXDlvvD3lxTakBVb89n4ZGT4Eu+SWdeNEX76dewZp937vDqD3vOR9v14NgvzyCaImK+LyEGx4q3gVL64Q0iYHB1e1FW+CuA/dQDRBpZVAbujJoqi5j4Ke+wI3wNHP2RgxS8YDN2kaVCmK6JKVukY30eOSSC+6SyAubSO5ATNmDBo7qzgeyUM7OrbVyd6JncilmtaCxam/4gA6EpANqVnMzCo5r8aNGOCof4FZU0jkcT+oIq2MrtXEyJd9NdObu8Gg8Ppo9qHCuVGpAsA== 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=Iyjn5sMFtNCiwmcyjPvnE91pJxcfIJ+RHXtxdJ9Trv+nttJM14QBn7nmBmAANpqx2hrkt/EZiXcN/kqspQRj6dc85W1Howv/93ox/dZ5oHdraGgR26PBDh6ch7iz+LHW9EgOYpu1krx8RAY3L/ZnPYmJxKzQjEV8z8BRKq87MHO5thWt+mS1wZRLBl5bp5u9GF4CFcXaqjmIp8+fFe98qrmK4MidKANkhrOi4QooJrYpG6ZpHQ8JtYq7YXTRS7NbXnZoBjGmtusHn6s1I+awUdvXHjqZ9llJor1DOtOX9Ofpjv7sOhcPyAYGLTIB8XDPvKsnEYHrzGyOC9TMA5zKuQ== 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 AS8PR04MB8056.eurprd04.prod.outlook.com (2603:10a6:20b:288::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.15; Mon, 13 Jan 2025 12:07:17 +0000 Received: from DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd]) by DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd%5]) with mapi id 15.20.8335.017; Mon, 13 Jan 2025 12:07:17 +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 v4 3/3 RESEND] can: flexcan: add NXP S32G2/S32G3 SoC support Date: Mon, 13 Jan 2025 14:07:04 +0200 Message-ID: <20250113120704.522307-4-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250113120704.522307-1-ciprianmarian.costea@oss.nxp.com> References: <20250113120704.522307-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: AM0P190CA0027.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::37) 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_|AS8PR04MB8056:EE_ X-MS-Office365-Filtering-Correlation-Id: d9ade785-d7c7-488b-98ff-08dd33cad30b 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|376014|7416014|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Rn9jg0Duv1CpZZqgX5HQVJ9GjszVcXe?= =?utf-8?q?IJKyUXOw7zKlQSo7x41eLOwRvsxVJpTGNS77hrTpGN367GVAe9a4bo2d5FYndSKwS?= =?utf-8?q?8VEAwyMehN1Waxsm9kiFVGbo2ifaSnwxxBLjjyqVBEooWi+IfROPG9AdCV1qjBnJ3?= =?utf-8?q?VOeLPYCz+QCBRYvomx+mrkYYicbvXAWxIpEYxk8NeuLd9IqStta2aHatj9+cr5GNq?= =?utf-8?q?J2PTMMIo9eYiHBbHxq1gUqrUMJY3dU/dZKrcK0Ni+q7OIaRdcyxSVqSGXUStGR7CY?= =?utf-8?q?0BaG807bnY4gDylHJGvOeOC0YXUWC1JX7is5BG2Ugo0GMw0RHfqm6HSn13vzXW/RD?= =?utf-8?q?7rjibGMdZLDBvU1xBrWgi6Syhy1dS+4vd0FEbhoV9bSEKJ4BvGUdMC3fEMLUfmLDz?= =?utf-8?q?RZZZuosDcS2lyBCqQ7VjxhOJiyFRxFo0LmZ6o5YQ/1lmzPrCBr4RBvSCh5P9li25r?= =?utf-8?q?Tr9jtWOfyu/f4Lg8zJksgVbkDBnANQW3PEE3eH5kWUFRWdpi8f+QRHcWUKKhBwOUm?= =?utf-8?q?wDz2aXA5w3BBjBYHWT6WqIAPki91goXYMtRyxLSixYMTl6RrdJ7SNbp/wGP/pmcCB?= =?utf-8?q?O9qLSNtvJhSZ7wE+STgX/2DGDDuJBKxHkK0FLqLSD4UwlZfm/PPjAKYr7HItwvh4i?= =?utf-8?q?YNmaUvnvk9ETR18lrEH7b0ITr1jKVsou+QRRkmGEnkDeq1hk184gX/t4CPLjQcY/K?= =?utf-8?q?mEu8DwVfJUYtDQlXShteBOtCdthXFyEHYjvD6ujLJo6rLNQUz3TVAx587lQLhAcCf?= =?utf-8?q?BRRktJTf79CY0S0Hha0CdeyyKUbAQp8VxcwB5BuoH6O9dK7WW0zuill15RT0AYAHN?= =?utf-8?q?JJfaAdeoArGVS/Ar6YT3CV1bmBaK+TYPp3lOXsL+Sh47qJmzk6JoM1JGvOQax+D0R?= =?utf-8?q?yeHMrhdN9Zwi2rG9wbVwqfmyOH/Hr3ieU9i+DrkyXvqYqXyErbPMh4811+MfRUAKA?= =?utf-8?q?HEJkBQyYkr8U1r5phrmq8WPzqqbwA3I4/9Rif0Tq036ORU5q9si2bIk4ESYkyG7P0?= =?utf-8?q?+af2qs8VXEEscaxGiYtyifb7IO/0k5hInH+hG7jjeE8jlgxa4UnQw2a6h7HZofh+j?= =?utf-8?q?KwNZvqjAQhNcqr7Gl6+FA6eiPioBVXSuoxx1gF4MnK0zm2znUy/P0G5+NYBljLx3/?= =?utf-8?q?v2OY8QV7hvIlCdqN/a16izF9kLiV/uFDgS4N8QFYe5/i+wsTA8pqcCY6UBt9c+EJb?= =?utf-8?q?2tj/KDDHnF6MV7uCXu/OWumgIBRFPXCe/Oiai/bs/OzN0R7h93yGrihscWMqK7i0V?= =?utf-8?q?TkS4kM8gjDFWurEXJLfldKO2IjUVAoIdirzkwXvwtftMDl/YqIOvqiq1az1BfQO1T?= =?utf-8?q?/INAZvQvag0n?= 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)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?z/07l24483dk7SMOGlzi3gd9hqrb?= =?utf-8?q?/yjSLsqUoCWCpYunTJMGGcJ9/fmEf3WwJLV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/UGlKPZmCcbJ9lgD/LqtAvZ9DnQwy45kz5PKJGI?= =?utf-8?q?VAtGNUVX0eOEuKPvMvpZWnQ3s1XRcW0QAjD9x07aUNY5/gVjLapk3CKfhDqALElrb?= =?utf-8?q?B4eFFK8EHvIcG8ijqS77UavvKRMX/hlSjUOCps0jUPQQKdhZ//DQVXTZiJqJKNWdz?= =?utf-8?q?FtfyGyalY41P4JBt+980fjp2c7QPjvpytYs3O5K3xqL6bADvgtQ0WPOC/1iW96mbq?= =?utf-8?q?tuGzOnnAarVEJIiP4vEejSNvFQVo2vEVYJi0Vse9fZ6I0GfXnz4eH6S58/RT9aBF+?= =?utf-8?q?QwwCMRdjOOHxJV3UdB2nPBrQcqsb+Vv6q3U4nBnrYbEuAfgoCLRuKySJmiuxqOyxX?= =?utf-8?q?nj6JZZTyM6vGbQEURZfxiGW75yuRqHSie+uwlrySlJwSD/nHnvhdXe9p+6o02Btie?= =?utf-8?q?X5mgaVkekRs3Ub9iNqpaSmxzyYkmOgj2AILOR0o1Ri7sc+VwoHIhuoB1mG+eE3eAo?= =?utf-8?q?IoHBQQHv0eSSoMZ12a+xSrrOpprAHCsTS/ryYR++r+RQOCI3eW1FFLXpTbu1yF+qh?= =?utf-8?q?urAJA5gd+pz4mIIl1eFcbK89fF8yb7nLmM1Fpsy9WQ63UacVIz55z0AjhdV46N/0u?= =?utf-8?q?GwgPjr3tJTlVr0ufJIiikgx/p/504q0Akg=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9ade785-d7c7-488b-98ff-08dd33cad30b X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2025 12:07:17.4823 (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: V15U4PvtqH0eLvpxHCeFdqe0+g7oj04qO4oON8qYCDsi3ElMJkT25NefaKgD9oiBfn60Xk5zXMfGGpHqsJXYrplgNRxNmuhQZ/uf73RDgAY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8056 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);