From nobody Fri Oct 3 19:11:41 2025 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2065.outbound.protection.outlook.com [40.107.236.65]) (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 EEBAB2FC01F; Tue, 26 Aug 2025 08:33:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756197195; cv=fail; b=FBEHTuEs0pBR5wkRcv2s03Pii0u0R2S2HR1hWhBkxt8AHTeIj8GFTC4H2DMEx/P5bgXZ0hWga+YYpy8O50vOf0JLzgJ6NqRlSXFDKoPESUZnQMyK3XtMuSQGM554Cj7Dna3gPs0zBJ4BNx1HGfzEytcAOH6NHyOaIWuFSFMHFM8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756197195; c=relaxed/simple; bh=AKHZUl9sirmivCeMeD42IsCP9VXkiPMBTSJhdolaETI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WSATQS93y8gbPysUl8Upam4RaQQkJ6S5BrLT8aPSBahHAIdyQ30wz7na4kUQnrKA5IsJWDLTBjGdDU4dYSNvdRkRHvp5EYs3LzZa1kd7cUKaHI8a0CDsHDH8FsSg3YcCPvBxcJFWKMuZd8mRi6AWltO+6uor6DCkLANnUy09u7g= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=rOHi/AiH; arc=fail smtp.client-ip=40.107.236.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="rOHi/AiH" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VoXUKq3nYX9L/EQj9FAF7eDF1NwbizsLulX2hBOcJe29DKikOqP+IpyogCCOqn2sJ2wzgC1Hhijln7YgMkyfAYU3y0QCXuN0JLNopLlmVIXS8XV6uowt08jxFdOQxUeRFXaJsyQstSbGsYf6Pxh2SQLdllM3awW4UKv0CLXoEIzDbUStZpoz71Gf599Zfzw/yYATp3CWrF0G5nmH+PJXOc0rYybktUDsq6gMETaLI3OetBGsSTSHYgezO8ooXCLVDc7JAq8mLBqFSYSJvMxTmSeUqsNNmZVueOu6YJ3z8oXCv5ExUWMom36rseMvhfl9b0C/BCsZq1TNgVbqaWDb0g== 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=wTZs20+4R+gm/l7JPhnmf43JXxQ28ckK+YHlpU2QDyI=; b=oj9qaLA/3546lMpEyNh5S5CtHh7oDpumIrF3YvrgOeNKMpzZZXPKj4V8+7MjcS8XvdIXreogTQdr2qJOxo/sIYdRToooX/PQuqQFcfXmR4pVVpjMKU8zi9mpwuvCED2suJuTwTh2uNJwI4NTb0n64GtM9ymSfkldnmahJd3ehYtJRCVSqABYL8db+lnYKEEwy1z3Q8GWE+NMSKbwZxyqs4ida4pVFRHyN/UCGkG5bfRvIyn6ACe4xbcFQBUhi8sIFXS2EAdV0bfkANXDeZo6fSQD3jGOaqiDytXlnCNDTZLU31wH9CTuTNZYny8/xLzMPY99gy+8xfIXGvU7ZZhuAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wTZs20+4R+gm/l7JPhnmf43JXxQ28ckK+YHlpU2QDyI=; b=rOHi/AiHaQolFnr3BdgxqIgpx4N2iaI05jqbiflna0S/BhGtGGa73pmNLCOEWMVWpik+0IbYsxqgViYPqCcOx4DRmoNu3IdxI/EE3FOyPswjxp8lzqCAWIdAMZ2FfG+OpdLTeF3S08SBAGmh0SK/soyZTgmQjQk33EPRKJ0G7KiqsgdM1CAolkMAH7I0puyzSeJ8rdN5/GOb8YU098y5wC7NHytlRUhJEylBMZG4XI+HMr6KWVAQ6v4cMEAMcd3u0w0jh1J9l/Vdb+HawSx7m5D+H6z4zrBD0Q0uh8bQpWGGZL50exaPQwlTRL7YKVc4cmq2zwJ56+J/3mfV0KL1xA== Received: from BYAPR11CA0076.namprd11.prod.outlook.com (2603:10b6:a03:f4::17) by LV2PR12MB5797.namprd12.prod.outlook.com (2603:10b6:408:17b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9052.20; Tue, 26 Aug 2025 08:33:10 +0000 Received: from BY1PEPF0001AE18.namprd04.prod.outlook.com (2603:10b6:a03:f4:cafe::c2) by BYAPR11CA0076.outlook.office365.com (2603:10b6:a03:f4::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9052.22 via Frontend Transport; Tue, 26 Aug 2025 08:33:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by BY1PEPF0001AE18.mail.protection.outlook.com (10.167.242.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9073.11 via Frontend Transport; Tue, 26 Aug 2025 08:33:10 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Tue, 26 Aug 2025 01:32:57 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Tue, 26 Aug 2025 01:32:56 -0700 Received: from kkartik-desktop.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Tue, 26 Aug 2025 01:32:52 -0700 From: Kartik Rajput To: , , , , , , , , , , , , CC: , Conor Dooley Subject: [PATCH v5 1/5] dt-bindings: i2c: nvidia,tegra20-i2c: Document Tegra264 I2C Date: Tue, 26 Aug 2025 14:02:40 +0530 Message-ID: <20250826083244.487610-2-kkartik@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250826083244.487610-1-kkartik@nvidia.com> References: <20250826083244.487610-1-kkartik@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY1PEPF0001AE18:EE_|LV2PR12MB5797:EE_ X-MS-Office365-Filtering-Correlation-Id: 7fc59e39-5f2c-41af-635b-08dde47b309b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|36860700013|82310400026|376014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?wtby2M7RzUAZVR+imnbn/Kv+fK6vU1KXTsf2U1850vCFHYIAF8VnOQcN2o/d?= =?us-ascii?Q?2pOtNMw/Q/IMZ2r+cZ4iSkkqNzbaeE7JhLOpk4da0hJXWvzL3347OTcUcyIz?= =?us-ascii?Q?LmwiXHyGeDj6rR+JUX64iMIXSZl5UgtpPYAvrogbM72rACWB9Tet7e5kU5ht?= =?us-ascii?Q?VuZNcqCuE1NzMXqvdSKwn5XYb2wWsF1XXrjfIAucIUvQ1JuQu9IX8A5LW73P?= =?us-ascii?Q?tNhkpe3GaXQOzwt8LKG7N4zIsc+OlQ/lAZdhq3G4YlaJ5R6IRiJhgJqStQcQ?= =?us-ascii?Q?pwomrYjW2PX684895raQgAKrhyiV3qmc8VBVE2pQnf1JHCCpj10T6EUHFQyQ?= =?us-ascii?Q?nUMIYauQS36rBhGDJUz5B63ZCLnxRDr1htJAPHaTEnnn4ldhACKVFTCdVIkj?= =?us-ascii?Q?H5AwIKjzIJZtd9KspK5tvi1VvOqbPjODZA4ZuxUbuxyBMFG+oqGWZlOtSRiE?= =?us-ascii?Q?SoEf3qlLA3JeUDZns/mGHyiKdeHVyKhjFb/79vF8e/XaCg2l5sHeXZbXAZp2?= =?us-ascii?Q?IteL/I5gTPLV7EaThcwW+fGeFiveICOW7BX85BuuxC8pedY6Z1j+uws8vBXL?= =?us-ascii?Q?g9hbpHKJh30tl7zPuqK0rArmrEH4WzA18fQaKLZubgbFv36e0RbkVL7YuXWV?= =?us-ascii?Q?qyMBALhSBNFwbkSkfxZpN+jEPmnAHrIwN8IqN3t1g3Kl9bDPAEzfA3dSRfG/?= =?us-ascii?Q?iibb3k7vwwrc27Oh4wSN3fsErAgVLN+1YQYo+sFrS5kDWiXNnMV9l4K+ESRE?= =?us-ascii?Q?XEIudhyn3xE9OwS3yMNzb5EjjoqGzDVCEnGpb+oU0LaAsmnHzCMZo3N6QpJF?= =?us-ascii?Q?FnQyUugsPWFaoRtmx7WbfBsVjNRjlHIa7jxuqNhxQBQ3JKAzb2DVZj+saxWK?= =?us-ascii?Q?PjKL5ANMKCjoRKGEjMs3btdSKMeyA5eHIdvT5Z0nHW/PhZXN/RTpAE3U8abO?= =?us-ascii?Q?717vfMpR1JMf5C5T26jJF06xZRqsA1BjkL3iTIhuprjE6i+6Hwwb2V8XXpZq?= =?us-ascii?Q?CXWu0gFmQZoTLMIAXpzAU2fKYGnSOrdj2pHfkue0OEk3mJZ/NhTtKg8NAT8a?= =?us-ascii?Q?8+s9G08aqyCz1noXD6lNZx3pG8pbjQlV04exWSNJYpXNg49JYa1UWxC4ZCZW?= =?us-ascii?Q?HOBJMOD//nKnJ25OlyuRIUecXZP9AeD50KEkypQuZhmYxNsxM+2hkt1sXmVl?= =?us-ascii?Q?/14mNhBl0Omlyfgjr8LlA2EQHVHv0rU51xtbHIaADVQEScnmh2iDKgNNRMFg?= =?us-ascii?Q?4PUzEi2mMrZM+0yjsNOoF2JnUMLeIZINKEEUEhzAbIfVDcXZPfRNO1cMrBNr?= =?us-ascii?Q?GHAMSG/EVwwh21wsE8XOCsy7jkC8Eyg1nlb9Ss1YybIuBBnvtLzGVWCVdlPp?= =?us-ascii?Q?sQnnJAe+PgrkrfKPQ8/ZOMojPJdo39aGgavV95lfW3AMEKR1jLzKcUcoj0do?= =?us-ascii?Q?TIgsA0Jt5TpKM7DY6HoZVpFKN0shji/dRpKGB66vE7Ohy00hEq6Bg/Q/TCdi?= =?us-ascii?Q?Ij7cDdo6LQaWKZGEpRolghoW4jPuTlTMgtOsBfqNdahDWpyIDVJ+fbcp2w?= =?us-ascii?Q?=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(36860700013)(82310400026)(376014)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2025 08:33:10.3715 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7fc59e39-5f2c-41af-635b-08dde47b309b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BY1PEPF0001AE18.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5797 Content-Type: text/plain; charset="utf-8" Tegra264 has 17 generic I2C controllers, two of which are in always-on partition of the SoC. In addition to the features supported by Tegra194 it also supports a SW mutex register to allow sharing the same I2C instance across multiple firmware. Document compatible string "nvidia,tegra264-i2c" for Tegra264 I2C. Signed-off-by: Kartik Rajput Acked-by: Conor Dooley --- v2 -> v3: * Add constraints for "nvidia,tegra264-i2c". v1 -> v2: * Fixed typos. --- .../devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml = b/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml index 6b6f6762d122..f0693b872cb6 100644 --- a/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml +++ b/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml @@ -80,6 +80,12 @@ properties: support for 64 KiB transactions whereas earlier chips supported = no more than 4 KiB per transactions. const: nvidia,tegra194-i2c + - description: + Tegra264 has 17 generic I2C controllers, two of which are in the= AON + (always-on) partition of the SoC. In addition to the features fr= om + Tegra194, a SW mutex register is added to support use of the sam= e I2C + instance across multiple firmwares. + const: nvidia,tegra264-i2c =20 reg: maxItems: 1 @@ -186,6 +192,7 @@ allOf: contains: enum: - nvidia,tegra194-i2c + - nvidia,tegra264-i2c then: required: - resets --=20 2.43.0 From nobody Fri Oct 3 19:11:41 2025 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2054.outbound.protection.outlook.com [40.107.100.54]) (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 0B1012FD7D2; Tue, 26 Aug 2025 08:33:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756197199; cv=fail; b=T+U1D3V3xN2N6IQB1yhcxq63skiSf/JlvP9vPmdNTQlsoeYEJSWWqHzPkWPnB/Z5cWIgc3I6nQW4JhmGUM8UH+nSSy4L1mZRPw+JVQTjS3UTqjEqe962gnJJc2bnkfGAOGrzYaocWYFgCxCHOMKmGqpnRYtXcF+IEzHineBC46c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756197199; c=relaxed/simple; bh=dFdpBy806e1fxNZfUxnACskBXaStls6gX1eNuojym2I=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=N2JJifJjL/qY98yDXv8rRW28l8zALrkPZXCFKWlJ4x1HnzA8uw4wbF84duevBbSnRQJDT8CVinB7bB9qzlvwVLga8E6yV9a6GzEFaX9JqzGdQUeBpu2oHPv0XnfmcGYSbya4B7voglo7ujd8P1J8QBX4nyAdKalbxtIsSn/Nd+E= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=mKDQZtTm; arc=fail smtp.client-ip=40.107.100.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="mKDQZtTm" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bNLTzlXq/6jytQXPsXZzE3URHVLCecHAX30U1vwArXcWuh+xsQ0Nw2yz6eerf4PnmguSVpty5hmZWmEWxiiP5Iwwfs+xWd0RBU7/Qe2voxj8A81TgA6egFr1PrwSwqCV8q91ul5IfoSTzRV+ZiBFI9+pD5k+arKUAmfDwFTp+Iir5L/eAIdkJd/5spQQ6jE6AZCXU579gh8nLcH8RGapUZkWWwvRo5JlUmoPFr+8sxuBeCv8Z2pDcDA5j5SN2TjpfyYRD5U9wJCIyQpVe7SxStjheC6B18DIfflzbL+bohSuxw7kxgJmxMfgwoIRr51Mzzpt153ilt0TJW18zGryZw== 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=zCYKPCmOmQZ9rtDoq3Ggw9KJvwWQ2OcmrBUpWS9O0VA=; b=lcPQJyab8OK97/zM0fr4zvgMYvoLTyHXIcEPfkg3BvVYvp9Gjk8gTloFrHnLc+v5zFJTEKg7HnVB+P2tk8p7HGYvyRdVNu0dhNqoBYamsEuvKXbEUyWRb8GsXAS+wHpxTy1As/969TBe/Hcj+rbTsLLzlrbbnaaX5emALMFVScm49+5/XJ/i+4hxoECEyFCw5EEmTmcF2kw0oAYNrn76VUPoRHGjOhLm9eCHvWtA6DkyhAX9Fa+UUcGDLAWYgKl3qIYFQ7Ci/PWd9TQahgA+VzyhnCIf9g3XM8xt/uHhCUlE9oytRRYSftGhHaNfcvgRPxes1Dcz59MMx6F6D7Sp9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zCYKPCmOmQZ9rtDoq3Ggw9KJvwWQ2OcmrBUpWS9O0VA=; b=mKDQZtTmPx4b2qTj+ag+2slwXSMQay14a2uQX4pDDkgmw/h92E7esfJXQxloQD6RMZN6iEEos4Vje8CwhKxZAz7spKfmFlio6+Hj1wTCKWIQDyX6WkHI+SLjNf35gSllu/v35ib/R2afgSFSdSjTGAV5TnWvXVbgy/QkzHGXkl1t9nczt1HB36lf9q6n0k5ONQhxyXF1MMwsik4GuEmaBLVLG5hYSTdZMLqdaQJqlqkEYuXMf4s9QHA3qhgyt9DdBCMth1dbIMXOA1p93SBnmmn5M8qvvf1CWuXTajRZeU40Otit8rgYcqi6L1xcwYeUOXD3Qw/zjLt0hFExhLkBZQ== Received: from BY5PR17CA0028.namprd17.prod.outlook.com (2603:10b6:a03:1b8::41) by DS7PR12MB9550.namprd12.prod.outlook.com (2603:10b6:8:24e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9052.14; Tue, 26 Aug 2025 08:33:13 +0000 Received: from BY1PEPF0001AE17.namprd04.prod.outlook.com (2603:10b6:a03:1b8:cafe::86) by BY5PR17CA0028.outlook.office365.com (2603:10b6:a03:1b8::41) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9052.21 via Frontend Transport; Tue, 26 Aug 2025 08:33:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by BY1PEPF0001AE17.mail.protection.outlook.com (10.167.242.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9073.11 via Frontend Transport; Tue, 26 Aug 2025 08:33:13 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Tue, 26 Aug 2025 01:33:01 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Tue, 26 Aug 2025 01:33:00 -0700 Received: from kkartik-desktop.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Tue, 26 Aug 2025 01:32:57 -0700 From: Kartik Rajput To: , , , , , , , , , , , , CC: Subject: [PATCH v5 2/5] i2c: tegra: Do not configure DMA if not supported Date: Tue, 26 Aug 2025 14:02:41 +0530 Message-ID: <20250826083244.487610-3-kkartik@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250826083244.487610-1-kkartik@nvidia.com> References: <20250826083244.487610-1-kkartik@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY1PEPF0001AE17:EE_|DS7PR12MB9550:EE_ X-MS-Office365-Filtering-Correlation-Id: 16785308-717c-4459-545c-08dde47b3246 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|1800799024|36860700013|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?H3L/Zdu5BEI6PDxfYg3Agl8MPVF+e7DWBePkalmsEMF4Uv349L45MEgPRXNM?= =?us-ascii?Q?JofG81nHdfrQ3+meGUVEquSexgCfc5MYnBex73yOacl52K3BufVA+LHvQ6lg?= =?us-ascii?Q?jd8S1G4y1YIxhEBklFJ3csZxSHauYrUNMpVOyqCa+BG8y5/Nvq8LsmxKoiEm?= =?us-ascii?Q?yA8FWK1Wz65YNRlpz7QuS54IXoFnY/hHHgDpZZCuR6Dc6dLtK0V3S/dNx0Sy?= =?us-ascii?Q?MGLTRKd3UEuXHlL8fYmNoMC7Rl+RLdlHTVcFTgvJXFT7zzmf7Tt2qPJu5+cI?= =?us-ascii?Q?tHK8rYzBFOBYpu2tR5+SDb0q7wT4bMm21UkFQpy/BEKpe5Msoj4UB0vAjFzN?= =?us-ascii?Q?0oKQYJv42U2ZqdwBBqIcn6bES0rHtEYUTyjmDpYr68/TWNhT+jqPrONJwfhI?= =?us-ascii?Q?vD8wBx4wXnhD1tsjgUFBgwtBHgJ/lYmBhXq59EcCQ0StXFLlUnvDTQ4hJOsw?= =?us-ascii?Q?aUoEjw4tsUqDvnXt43J53smemvlJPaC240lFC7QeYIdwLI7LjpueKwd9Btko?= =?us-ascii?Q?4Y/cIR4DrjaB6i/iXFCtAgDcitKqOk3HMo5YAfB47nWkqI6cDo4jggdbS2ni?= =?us-ascii?Q?yr8QVlo76o7DHwZJSD4GHrB84j20JN9zzeMCxHTPbg1n1YKIxT+8s0iO/71f?= =?us-ascii?Q?nAv3B5kABf/Os2vGr4WLiSmr2a3qDbr/odyk72StGE4B3jjRDbuMOARmpVMw?= =?us-ascii?Q?NGNRghG9hcfCFr3ZVY77PtMhCKL6B+A8hCsHEu0/gH2W/Ko2zdXPLUt85hBG?= =?us-ascii?Q?m5HcoAHJnNrCbF7rEG+X/g9pEBCq6eMGbxhmqmaUiY31wwCwZKZXD1ZvltHA?= =?us-ascii?Q?sescFlP5RyNmw3d0YjzBARt5YoJhVjvPG33/UnPLFjsG1R0GNLaZ8a1FC/et?= =?us-ascii?Q?PTw8+qz1yyFROayq9KZHONVo4O9aPXNBEa6r95I/Jx6iC95SonlAz8EVGdL0?= =?us-ascii?Q?1M8+0hsrhire2kkbZrEcq2+DP6Rl90FDq/i44tVv5P3Dtkt3NBKgSQrH2Jlm?= =?us-ascii?Q?K7N238hDXbquR4IF2ybUZktG3Y4kqnMzxrzGks3OEBULi2gQoki4IHmiPCvU?= =?us-ascii?Q?UP27TPQ6gJCdKwKGl6wsQuaE3ndZTY9jMS3s0Ke+rrc2ZdyW6YxKP5fQqWGF?= =?us-ascii?Q?5O04uHNg0KkrtbzXLCyqaqBUoqD2ojpZ4QcjJ81oFD6sqUYojAzjWSjDK0W7?= =?us-ascii?Q?h7ge3dx+fYKXzNv/aivV996+fwI0SrvzRY0pD0kqAWczvehIXqLZn/LpEcDb?= =?us-ascii?Q?sCOVNEAYpXYZJBBJ0dIjV9atB/piOl+6xertu2OtaO6FGM0XYpZyBRFl5hOB?= =?us-ascii?Q?M1L22+InkuF1mOYQoQPgThHrNdiUqUbv4wR3C62FJCCp0MtELLj7g6AC3sQp?= =?us-ascii?Q?3+dFRfQsT/N3bWlYEN6lJRF7ocyechHtbTlpeQjhlvs/fb53utMvHoDUPCwd?= =?us-ascii?Q?n0gTqrxnD60lkZgM2cUens8yKWbwyac3BuJQlVxoXZE/MT78UL/QX6+rFMlF?= =?us-ascii?Q?ivTdrbg3yBXea6Q7KuBWJet4d34XZNK87mb62Cxc2GtsaIcIWwzm+qHJKQ?= =?us-ascii?Q?=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230040)(7416014)(376014)(1800799024)(36860700013)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2025 08:33:13.1877 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 16785308-717c-4459-545c-08dde47b3246 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BY1PEPF0001AE17.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB9550 Content-Type: text/plain; charset="utf-8" On Tegra264, not all I2C controllers have the necessary interface to GPC DMA, this causes failures when function tegra_i2c_init_dma() is called. Ensure that "dmas" device-tree property is present before initializing DMA in function tegra_i2c_init_dma(). Signed-off-by: Kartik Rajput --- v2 -> v4: * Add debug print if DMA is not supported by the I2C controller. v1 -> v2: * Update commit message to clarify that some I2C controllers may not have the necessary interface to GPC DMA. --- drivers/i2c/busses/i2c-tegra.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 4eb31b913c1a..0c428cba4df3 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -446,6 +446,11 @@ static int tegra_i2c_init_dma(struct tegra_i2c_dev *i2= c_dev) u32 *dma_buf; int err; =20 + if (!of_property_present(i2c_dev->dev->of_node, "dmas")) { + dev_dbg(i2c_dev->dev, "DMA not available, falling back to PIO\n"); + return 0; + } + if (IS_VI(i2c_dev)) return 0; =20 --=20 2.43.0 From nobody Fri Oct 3 19:11:41 2025 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2088.outbound.protection.outlook.com [40.107.237.88]) (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 05FDD2FE065; Tue, 26 Aug 2025 08:33:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756197201; cv=fail; b=r4wLBWxA4S2Jzrza9JB3GatIHxxHHrsR1l8Ip2KOGze3K2AiRP2tqFyw1okkHxNDOi49KYtHBFbHyfrVEDZpGybihULv5SUc7krHpZY7BmneCDXL+hd9bh5S6nzF6B6RwyZMFIkiLEmqY0r9kT1sK2BbPf7cYIN0qbRlQa7pMaI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756197201; c=relaxed/simple; bh=2VMW242CtkOQ+PNfot0klWHe1n3VaxA1T1gab/rP16A=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OTHpfpUCwKIqFWB3nEq0Mlqig6nTeevo15HUdX95MVHzU8hS8dbxEMDSlfu9XH243jYy9c8CS099skYbs4pBTjiTBWtEV36XjHhA1TQWQjG7iWiU5Lj/sZ2h8YgLgdmyyHaicmETJ2ebcph04P6/bk+YCxsTOGl1Myk4pdOK+rM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=nUnIil5S; arc=fail smtp.client-ip=40.107.237.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="nUnIil5S" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pszcxueEQQZnNKGTBCBOou/YL0bGbJXgXBAjqBvlRMLpkhC0ZSc19J4vovtOZ4hsPCP01Zdn5tmy1LEL0JEAJ7NjWpXA6HShHWoZ037YmO6/MR0VBXe40Dt/B57n3ho5tsgWfyTQ0QX8vO6Nrchuccs59hPbTmxm2vMpC2Nwr+1YypLwy/R1mRkM7YTyet19o1rw+rOp1nvyghF5mL7Vx2KtzsiYc/lWDhsoorRjuJfo2ed9UC8indUW07RIl0/SYNJNmUMtysml9s/sF6ceEfM2D8fpoS0RRvLboX6ZVdtBO+ubeo33ZUvI69lqsc2KhucMsLOiKblXj1oUjVb5jA== 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=hRg0JU/yjvdLxd9Z7WD5qPZ5qDytPrEVsV6okmmrTew=; b=K7N3RWKswLLown9kKI5PE+Qwu7GV9CJYHsA2dkT42M9r72g+h9LFRcLW356VRbid95BIIA1FmvWLkzbdwx3rMKT02gIqINIp+7xzKJEF81hs/ZUc7oh4IQDZpbmGh/4cnYTsac7gHW1kDxWaokyl6slMTTfkdORaRcK/uIwp8Qh+dkd6KSSW+NY3PSzXxNDR3puc026B/tNL+tun1JVoboGyNM1rPeyX24/G7gXRfSHjYYy42+PgKZQrEwIEDY39LaQAOZsP+UYK1RQ4mlAbhUCl4d3R5z8MW8LfTTVA7QbgaxiVDTYbA3Kdd3Kb5SKNrzsBNiIuKjnBxit9Z4H0dg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hRg0JU/yjvdLxd9Z7WD5qPZ5qDytPrEVsV6okmmrTew=; b=nUnIil5SPv/4OC7M1+HS/Fpd8U6J2XoUreG3hQyQeuKifTkKo5BRTlYUQ4cc/GWccS8NSrEC5Wrg/mWNTVOIndYfJujs/F/WumHACsk0SkMXPPR9DQB+NynMgWgu7LA8uMaiz0HOuw34xP7g+j4LuK2OPIU87NYuXetDT5hAx7ESxaw2m/hyxC3dK9c2NkFlREMwRWXXGF20UgUM0aQEZHKGYRAIp67+UdyqxQ3Ew0gw8ZOt5g4htkle+qNgyXk29EeLLtiXyy68GZ7+Cdsp7d/e2GMdxQeT+oJc9Vqj2tCs92ABla7eiCrPGOkaGpFXQ65J0JgHtRUkTAnT/VQh7g== Received: from BYAPR02CA0030.namprd02.prod.outlook.com (2603:10b6:a02:ee::43) by IA0PR12MB8895.namprd12.prod.outlook.com (2603:10b6:208:491::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9052.17; Tue, 26 Aug 2025 08:33:16 +0000 Received: from SJ1PEPF000023CF.namprd02.prod.outlook.com (2603:10b6:a02:ee:cafe::e2) by BYAPR02CA0030.outlook.office365.com (2603:10b6:a02:ee::43) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9052.20 via Frontend Transport; Tue, 26 Aug 2025 08:33:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SJ1PEPF000023CF.mail.protection.outlook.com (10.167.244.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9052.8 via Frontend Transport; Tue, 26 Aug 2025 08:33:16 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Tue, 26 Aug 2025 01:33:05 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Tue, 26 Aug 2025 01:33:04 -0700 Received: from kkartik-desktop.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Tue, 26 Aug 2025 01:33:01 -0700 From: Kartik Rajput To: , , , , , , , , , , , , CC: Subject: [PATCH v5 3/5] i2c: tegra: Add HS mode support Date: Tue, 26 Aug 2025 14:02:42 +0530 Message-ID: <20250826083244.487610-4-kkartik@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250826083244.487610-1-kkartik@nvidia.com> References: <20250826083244.487610-1-kkartik@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF000023CF:EE_|IA0PR12MB8895:EE_ X-MS-Office365-Filtering-Correlation-Id: 46d6640a-d103-41ea-815f-08dde47b3422 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|82310400026|1800799024|36860700013|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?gzRKdf5EpPkW88rGB2mBN5Um3Ip6a5saDgeAGpqFQuLcOn4c+9G8JEVlxEQp?= =?us-ascii?Q?gcisnVxjswv0rR+P1BoJKsAW2SJZzVzKEmKWG8Z7jVkzwTfP++XlMlPPgaXg?= =?us-ascii?Q?G5PW40XFW04pxVjDxPWdjlp7q40negIPi94iKOmqrQkU69zAkiZ+F4oWalWi?= =?us-ascii?Q?9jn4zDL2xc5JDWwUx1LoakNHMq0a/SMvE+504qu8UinM80Egjeshqn1v80RO?= =?us-ascii?Q?8tHsfOKEOxBnGtpJ1a6qXqzV6MaB4x0DWijgPIfuP/BhLlszpLBXGwZtM/G8?= =?us-ascii?Q?k1xcZrOsD+SYc3OTm1meeS6dlST+oqMd9/3vKFlsAV5WVNXFCcxeVTsPqcQ6?= =?us-ascii?Q?b3pMqwEwVbpRJaJUbjuFZd1p9OqvN5ehIyBSwUxHx7e3SxTYj8n/+RiWIX9h?= =?us-ascii?Q?+QZXiuBHPZ7ot3hrAAzM2uKYbFXzKrPwM5XdIY43FvJYO5PVYouqMG6+vYOW?= =?us-ascii?Q?Ydl3jmK2BnCBa2/dO6jtsrzbf0+tXc+03JSvrTKo3Qj0psLpj1FrBUI3AYrT?= =?us-ascii?Q?A5zIGDezoLc4+AjvUcXWFmgjuaHSZqMeX7b1y6rQdmqoJr1Z3uxSifFnlnuO?= =?us-ascii?Q?IsBRG64FRLeflz0Dm2Oa2dIWqLkHY20Owr1eReaZb4dBoHNDJ9xksUf2uhFf?= =?us-ascii?Q?JkbfgEiok2rU4xRb9QVQNR+p2h6/haacvyAE16sreUutkYlsaR9T4u+RRnZS?= =?us-ascii?Q?0AOA8Ft0MvcFPqkntHEEtmnrEA71+GOgUG/2jia4BnCLXzvq4EWbDIvx6UyZ?= =?us-ascii?Q?ccaBX7Iodc2DnbTcrUhjQysUoavgTeq8lctmPQzl3t53GVpblKeYNzNrFpzI?= =?us-ascii?Q?VhG8fmkWiIvRxIbHxrJlHNcZZp+bNxnMPBitjMypS1w60iKJmWP0jwMg8V/d?= =?us-ascii?Q?OBpJJ+DcN/p6qMJMcCrO9qmouvR0VUx2r8RdNcI8jkA/JnnzSB+EGIYuALM4?= =?us-ascii?Q?bvGfH0qRFEpltattugM+xf+Vr5wpHoqpw3+qp9gJO2SM3vRLHOiVQqi7BNVx?= =?us-ascii?Q?E8BfQBBd7qct7Bpy6LmUvItBMP/ces5UMOL84LgC5LtmHJP9BdFcgMwRztcs?= =?us-ascii?Q?dEkjR8TDOgek9FREdYgxFgreflyyh68o4a6LQurrcwjLI91pJafAIAuLvvlR?= =?us-ascii?Q?XQJtCi5BkeCFMspjXMw+1hcopmUDqPm/9agA053Hg97+wcY9IFmfyvfa8FWt?= =?us-ascii?Q?KM3zu4+AcK05hiJI5lz44gJWSRtlRcYyGEXJvNP4J9nrlVzx+EeOAZ5QWS8A?= =?us-ascii?Q?Hb5YON6UoBuuv1CxLID751Led3FYXtLrch8YsFAdFPZLlo8olDbK1REkiwpr?= =?us-ascii?Q?OUFUESXrlWIgYcQg83x/9HmNtvFx3DpkYAe3cL2pZAJ0TSdx9sCb/bKdPva7?= =?us-ascii?Q?2jdJ2LNlXJj3Tm5Jl0/gXtQuD2u/gt+6LsnM6V1Y/CxiXOzh8HrGyE6tiEkF?= =?us-ascii?Q?mVISLS0nmxbk1XanmqmFqzkltlh3TeyYWviNk/BPl+kxOMGlnv6B2kH9KsLq?= =?us-ascii?Q?t4xcwsvpHKxFg1DRuKE8Ox59rpnH56reiHBWXpzlITcMrvgt779t0Yoh1w?= =?us-ascii?Q?=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(7416014)(82310400026)(1800799024)(36860700013)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2025 08:33:16.2952 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 46d6640a-d103-41ea-815f-08dde47b3422 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF000023CF.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8895 Content-Type: text/plain; charset="utf-8" From: Akhil R Add support for HS (High Speed) mode transfers, which is supported by Tegra194 onwards. Signed-off-by: Akhil R Signed-off-by: Kartik Rajput --- v3 -> v5: * Set has_hs_mode_support to false for unsupported SoCs. v2 -> v3: * Document tlow_hs_mode and thigh_hs_mode. v1 -> v2: * Document has_hs_mode_support. * Add a check to set the frequency to fastmode+ if the device does not support HS mode but the requested frequency is more than fastmode+. --- drivers/i2c/busses/i2c-tegra.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 0c428cba4df3..20d5c8a6925d 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -91,6 +91,7 @@ #define I2C_HEADER_IE_ENABLE BIT(17) #define I2C_HEADER_REPEAT_START BIT(16) #define I2C_HEADER_CONTINUE_XFER BIT(15) +#define I2C_HEADER_HS_MODE BIT(22) #define I2C_HEADER_SLAVE_ADDR_SHIFT 1 =20 #define I2C_BUS_CLEAR_CNFG 0x084 @@ -198,6 +199,8 @@ enum msg_end_type { * @thigh_std_mode: High period of the clock in standard mode. * @tlow_fast_fastplus_mode: Low period of the clock in fast/fast-plus mod= es. * @thigh_fast_fastplus_mode: High period of the clock in fast/fast-plus m= odes. + * @tlow_hs_mode: Low period of the clock in HS mode. + * @thigh_hs_mode: High period of the clock in HS mode. * @setup_hold_time_std_mode: Setup and hold time for start and stop condi= tions * in standard mode. * @setup_hold_time_fast_fast_plus_mode: Setup and hold time for start and= stop @@ -206,6 +209,7 @@ enum msg_end_type { * in HS mode. * @has_interface_timing_reg: Has interface timing register to program the= tuned * timing settings. + * @has_hs_mode_support: Has support for high speed (HS) mode transfers. */ struct tegra_i2c_hw_feature { bool has_continue_xfer_support; @@ -226,10 +230,13 @@ struct tegra_i2c_hw_feature { u32 thigh_std_mode; u32 tlow_fast_fastplus_mode; u32 thigh_fast_fastplus_mode; + u32 tlow_hs_mode; + u32 thigh_hs_mode; u32 setup_hold_time_std_mode; u32 setup_hold_time_fast_fast_plus_mode; u32 setup_hold_time_hs_mode; bool has_interface_timing_reg; + bool has_hs_mode_support; }; =20 /** @@ -717,6 +724,20 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_de= v) if (i2c_dev->hw->has_interface_timing_reg && tsu_thd) i2c_writel(i2c_dev, tsu_thd, I2C_INTERFACE_TIMING_1); =20 + /* Write HS mode registers. These will get used only for HS mode*/ + if (i2c_dev->hw->has_hs_mode_support) { + tlow =3D i2c_dev->hw->tlow_hs_mode; + thigh =3D i2c_dev->hw->thigh_hs_mode; + tsu_thd =3D i2c_dev->hw->setup_hold_time_hs_mode; + + val =3D FIELD_PREP(I2C_HS_INTERFACE_TIMING_THIGH, thigh) | + FIELD_PREP(I2C_HS_INTERFACE_TIMING_TLOW, tlow); + i2c_writel(i2c_dev, val, I2C_HS_INTERFACE_TIMING_0); + i2c_writel(i2c_dev, tsu_thd, I2C_HS_INTERFACE_TIMING_1); + } else if (t->bus_freq_hz > I2C_MAX_FAST_MODE_PLUS_FREQ) { + t->bus_freq_hz =3D I2C_MAX_FAST_MODE_PLUS_FREQ; + } + clk_multiplier =3D (tlow + thigh + 2) * (non_hs_mode + 1); =20 err =3D clk_set_rate(i2c_dev->div_clk, @@ -1214,6 +1235,9 @@ static void tegra_i2c_push_packet_header(struct tegra= _i2c_dev *i2c_dev, if (msg->flags & I2C_M_RD) packet_header |=3D I2C_HEADER_READ; =20 + if (i2c_dev->timings.bus_freq_hz > I2C_MAX_FAST_MODE_PLUS_FREQ) + packet_header |=3D I2C_HEADER_HS_MODE; + if (i2c_dev->dma_mode && !i2c_dev->msg_read) *dma_buf++ =3D packet_header; else @@ -1502,6 +1526,7 @@ static const struct tegra_i2c_hw_feature tegra20_i2c_= hw =3D { .setup_hold_time_fast_fast_plus_mode =3D 0x0, .setup_hold_time_hs_mode =3D 0x0, .has_interface_timing_reg =3D false, + .has_hs_mode_support =3D false, }; =20 static const struct tegra_i2c_hw_feature tegra30_i2c_hw =3D { @@ -1527,6 +1552,7 @@ static const struct tegra_i2c_hw_feature tegra30_i2c_= hw =3D { .setup_hold_time_fast_fast_plus_mode =3D 0x0, .setup_hold_time_hs_mode =3D 0x0, .has_interface_timing_reg =3D false, + .has_hs_mode_support =3D false, }; =20 static const struct tegra_i2c_hw_feature tegra114_i2c_hw =3D { @@ -1552,6 +1578,7 @@ static const struct tegra_i2c_hw_feature tegra114_i2c= _hw =3D { .setup_hold_time_fast_fast_plus_mode =3D 0x0, .setup_hold_time_hs_mode =3D 0x0, .has_interface_timing_reg =3D false, + .has_hs_mode_support =3D false, }; =20 static const struct tegra_i2c_hw_feature tegra124_i2c_hw =3D { @@ -1577,6 +1604,7 @@ static const struct tegra_i2c_hw_feature tegra124_i2c= _hw =3D { .setup_hold_time_fast_fast_plus_mode =3D 0x0, .setup_hold_time_hs_mode =3D 0x0, .has_interface_timing_reg =3D true, + .has_hs_mode_support =3D false, }; =20 static const struct tegra_i2c_hw_feature tegra210_i2c_hw =3D { @@ -1602,6 +1630,7 @@ static const struct tegra_i2c_hw_feature tegra210_i2c= _hw =3D { .setup_hold_time_fast_fast_plus_mode =3D 0, .setup_hold_time_hs_mode =3D 0, .has_interface_timing_reg =3D true, + .has_hs_mode_support =3D false, }; =20 static const struct tegra_i2c_hw_feature tegra186_i2c_hw =3D { @@ -1627,6 +1656,7 @@ static const struct tegra_i2c_hw_feature tegra186_i2c= _hw =3D { .setup_hold_time_fast_fast_plus_mode =3D 0, .setup_hold_time_hs_mode =3D 0, .has_interface_timing_reg =3D true, + .has_hs_mode_support =3D false, }; =20 static const struct tegra_i2c_hw_feature tegra194_i2c_hw =3D { @@ -1648,10 +1678,13 @@ static const struct tegra_i2c_hw_feature tegra194_i= 2c_hw =3D { .thigh_std_mode =3D 0x7, .tlow_fast_fastplus_mode =3D 0x2, .thigh_fast_fastplus_mode =3D 0x2, + .tlow_hs_mode =3D 0x8, + .thigh_hs_mode =3D 0x3, .setup_hold_time_std_mode =3D 0x08080808, .setup_hold_time_fast_fast_plus_mode =3D 0x02020202, .setup_hold_time_hs_mode =3D 0x090909, .has_interface_timing_reg =3D true, + .has_hs_mode_support =3D true, }; =20 static const struct of_device_id tegra_i2c_of_match[] =3D { --=20 2.43.0 From nobody Fri Oct 3 19:11:41 2025 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2075.outbound.protection.outlook.com [40.107.220.75]) (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 55E0F2FAC1F; Tue, 26 Aug 2025 08:33:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.75 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756197212; cv=fail; b=Yv2sm03PrRz7EoEVQah5loH2SJnd5HC3q8IHqQ8v+fQizmNRNBQsBxg7fkGsZkDiWdj1WNJV4s51pcOBYuBpFUl2fQrG3MwKYVY1AcwDdrl77YRSEvb9KHnu3AETRXicfPeaIDugmxLHTAg8trlEwJpQ5NaWg6pZ4jxExK0kPQs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756197212; c=relaxed/simple; bh=JW1mgETgSFmYyqZhQH4uV/24RZBAO6rS3OMVvpKLRxc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iFKm5toT29BdnKyO9IVWnMfrqHT+5HQw02VP+y8kHerpn3MsSV+nUa0nCgmPI3yERMD6/Y+C4OLged8nx0PCd4t8thUh0NPhbmwFI5qTFfBndQm0YpCqUBSaV7unt6wBMD3R/in1kZGEkYpAud/xrgUID1XqYuq8tXU7k3dZyCc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=pyCmIizb; arc=fail smtp.client-ip=40.107.220.75 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="pyCmIizb" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=t/vm6NDdbTwOQEkmrLJJ0lugTYwX43rQuGckKfblRatKOxiwG/Q8UOubBxUAJjP697ppOYh3ITUrwTibEBPa8kEO+zKkxcOt17ysDhaCG7AZP+nCVMUZtvpo/rTrDDqsIUQAnMUGTDwADrUmDOgBP1d/sIcWkLjpN3i4CweSHH6VtqjOFEjezN9aeDo85G2RqjCmT3oliNTLRjXiZbmem8Nh5gQZ0s68dPNXHejTpOzxlsQa/5vlCQTT5ktItS8/FlEUAauWLaCVrucAxSJzi6iSiUQUyW6Jjku4ryoK6wUG9d6XeM+4oRL2i4S7rKph/PjNRsWbk+Z+5n7HNXhZUw== 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=zjg0C956GIp0dXz3R2XRKTbAadMqS+n/2ZmeoKqqCU4=; b=K2f1CG9UVgXWruLFH6eFKtSNIgXicqBwHyONuF68glsnR03rCUq6KYsywt1ZZMCFc0fm2Whcp1IxvBJeWKPHcsDerGmuhM3642bZ/4mwACQpSaU8zJXBPiXRgmZtnDM2LdJrEj0BHh11JXRqRo2eUypjsjyLQg25KbnVpdF3fqlsZWWZM1N69DXGIt9g1SmhUDF3J7TiQ9DPH/lz7/Vfzfhx2VO1uK/yxf3gw4kdv+cYgslNTkv9CuyF+5Ptqhkdo9ym1L11gJqO8xSMEcIkgtX7W+ats1dvKeG8g76FJC7f6nTQr46NBGTN1HEb79hotvSPTHaUz4I68NgD4ip6NQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zjg0C956GIp0dXz3R2XRKTbAadMqS+n/2ZmeoKqqCU4=; b=pyCmIizb1fT9pXF0DKT0lkZBrhUt9zjx6TMwS4ldSaBIuhfJtmTl2ecyD71VHHQx9Wiy6fJJC3w6IAJT5gLA3aGCG7D1nhvCuoiUOfR3X2zVW/3B/EsrpJkU3R1OWCJNzBIzdJ2VS8AuvlZuwEkjmx5X+OiKEPIGQSjHlokW/o2ZxylpmXxOQA8QZHN5PugWv1ZUK6Dm7gpz96GtoescefaqyxKovTcyY1tjNcSUSXOMzgDSoviZLh0fRr/o+W4GYu53zd+OCTvN+paU+zVh+w7SjpTvPUnyEUcCHZz6cc4KcxRKAp/ECV4BeBaMR6ir/xDf3paBz+XxTMoa0+XLxg== Received: from DM6PR05CA0045.namprd05.prod.outlook.com (2603:10b6:5:335::14) by SJ1PR12MB6363.namprd12.prod.outlook.com (2603:10b6:a03:453::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9052.15; Tue, 26 Aug 2025 08:33:26 +0000 Received: from SN1PEPF000397B1.namprd05.prod.outlook.com (2603:10b6:5:335:cafe::22) by DM6PR05CA0045.outlook.office365.com (2603:10b6:5:335::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9073.12 via Frontend Transport; Tue, 26 Aug 2025 08:33:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF000397B1.mail.protection.outlook.com (10.167.248.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9073.11 via Frontend Transport; Tue, 26 Aug 2025 08:33:25 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Tue, 26 Aug 2025 01:33:09 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Tue, 26 Aug 2025 01:33:08 -0700 Received: from kkartik-desktop.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Tue, 26 Aug 2025 01:33:05 -0700 From: Kartik Rajput To: , , , , , , , , , , , , CC: Subject: [PATCH v5 4/5] i2c: tegra: Add support for SW mutex register Date: Tue, 26 Aug 2025 14:02:43 +0530 Message-ID: <20250826083244.487610-5-kkartik@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250826083244.487610-1-kkartik@nvidia.com> References: <20250826083244.487610-1-kkartik@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000397B1:EE_|SJ1PR12MB6363:EE_ X-MS-Office365-Filtering-Correlation-Id: e5b082c7-d69a-47d4-8c53-08dde47b3999 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014|7416014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?tXKjf69rvUASWL6RV14YWP7/BCfW/qLCWGqQjSHNDZtxqbRq9vu+LS7RbM0S?= =?us-ascii?Q?HhG2P1NAESxlzUKkLN+W/3kgOwZmV9w8NW0aG2VwAOVKArXVL1ju/E5yTpr6?= =?us-ascii?Q?4MUN3oqob4mB3MDa+L+PNv7c2qR1zWetPZjrDuqrAxc0GpwXaiCANtitjWi+?= =?us-ascii?Q?p1Sty7YptugHf0FfsSj+jLcCZReJhXN51SSG0WvqO2d7GqgichqQD8WV9cS6?= =?us-ascii?Q?+fbsNR75TYmg2ktnGhlpEy4xrfHWUxmVlYEufJb6W46gnTJUbwvG31pFcOne?= =?us-ascii?Q?l0dNSH8ZxMCxK5d4emufwH6mzE5wqygvTMqh/orbYZcB8vOIieMYeiIrwRfz?= =?us-ascii?Q?xfGgANPi1UHlqzl15BOozoj1KEqYGccBsmVk2oE+T95z5RC8CWBzZRounpmt?= =?us-ascii?Q?0mOjPgGBRsMaV6r9lLPazloN5fnlQUXs6h5pGZUCBq7t4yStHfaCtcMZrkcS?= =?us-ascii?Q?KyYh3UM1sBqTfyp8D9BC9wTBKdPH4DoQtt9kARy76bIgGIyzE45lF1YbQUTD?= =?us-ascii?Q?pIQ9tvHGsmzUcRDuwJyg+RWbDpHxw1qgpz3v/7TEtN4SDOV8P0k0Sr2fBEX+?= =?us-ascii?Q?39GXorG9/a8+2IYRVCnoQeHI8zXeYW4/6IItydTWvkmXHGXlXhiVSdTcZg8P?= =?us-ascii?Q?5mA3MWa/GWL0+RvOTLXvsbjkcnQmpkZfW+8nPcZDeTGQszEJHu4nx3pZM53F?= =?us-ascii?Q?pRt4K/GPAcg8aqScipZTKeQPae2vvG/LcjBfTMpQrNzvyer5G+1EomGXm33n?= =?us-ascii?Q?DL1ERLNh+vS9vfFN0zznk7rDqaXhKbWnWbPSY25BLhxEpUJ2cGvH+gz1g0b3?= =?us-ascii?Q?77HJusLPQpfgeU6JpDZYBDLMgtVW2uErjJMNfMlOGr0lCei+/FaOtAhqcezd?= =?us-ascii?Q?CSxV/DqVU7vFfJfqvoqEfDqJbDNKCic9pH998ZNEJX1cHdYh/7vPOnUueLAX?= =?us-ascii?Q?z/3VGSiPt02tyJx3gM7zE5N4dgEunHDGk77uvitee+0ajeG6+3fNd3C5erMX?= =?us-ascii?Q?HQ+/Bii/0p3/xgdtJaszMZksy3jB9XzxYWmKogfBF7RfapeEb6RPbwqVZHUx?= =?us-ascii?Q?jorDnGck9MO+qvm4ezduvcQ6cY2HsjodA2alOLQLRhBTsd+atqq+rIDpsEis?= =?us-ascii?Q?8BMNyumAYUkvOwB6FRuxJ7K1D3nqS+mYl+Ai6jy+/0sG0d7NiSMlUOCT6CnI?= =?us-ascii?Q?4ghUU26XJYOadUcGqOjgLMloGL0XSzhY85epEcFtNOrAEzK7EatsWJgQc1yB?= =?us-ascii?Q?hFk+r+gbjrYC/ASWuA3kHh7nBXlpRMNIyAphKqD/rmvs7fILwYE/aqzmo2lv?= =?us-ascii?Q?Gl04/NsvA9A/Xe0BPzhnlrLtTSdfIFZFE0D5hi/ZJRRWc7FFzeDQNKuXZUkU?= =?us-ascii?Q?dSr2ZAh7QPn1RvEBvT66oQuprf2DSjb9VtPzv4bhbNr7kmlxH51wQGL1+bSe?= =?us-ascii?Q?maacS6dsARCUbe3mYDTXXf0dD6EohCpdDR4wK7Zylt8Qt6bGLiwISkKs7oVD?= =?us-ascii?Q?qEISGvyLEFTeSuqI0KmVLR4AoJaxkUytkRlfHT9j2XOvVBVYYB8EMowxeQ?= =?us-ascii?Q?=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014)(7416014)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2025 08:33:25.3680 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5b082c7-d69a-47d4-8c53-08dde47b3999 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000397B1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6363 Content-Type: text/plain; charset="utf-8" Add support for SW mutex register introduced in Tegra264 to provide an option to share the interface between multiple firmwares and/or VMs. However, the hardware does not ensure any protection based on the values. The driver/firmware should honor the peer who already holds the mutex. Signed-off-by: Kartik Rajput Signed-off-by: Akhil R --- v3 -> v4: * Update timeout logic of tegra_i2c_mutex_lock() to use read_poll_timeout APIs for improving timeout logic. * Add tegra_i2c_mutex_acquired() to check if mutex is acquired or not. * Rename I2C_SW_MUTEX_ID as I2C_SW_MUTEX_ID_CCPLEX. * Function tegra_i2c_poll_register() was moved unnecessarily, it has now been moved to its original location. * Use tegra_i2c_mutex_lock/unlock APIs in the tegra_i2c_xfer() function. This ensures proper propagation of error in case mutex lock fails. Please note that as the function tegra_i2c_xfer() is already guarded by the bus lock operation there is no need of additional lock for the tegra_i2c_mutex_lock/unlock APIs. v2 -> v3: * Update tegra_i2c_mutex_trylock and tegra_i2c_mutex_unlock to use readl and writel APIs instead of i2c_readl and i2c_writel which use relaxed APIs. * Use dev_warn instead of WARN_ON if mutex lock/unlock fails. v1 -> v2: * Fixed typos. * Fix tegra_i2c_mutex_lock() logic. * Add a timeout in tegra_i2c_mutex_lock() instead of polling for mutex indefinitely. --- drivers/i2c/busses/i2c-tegra.c | 92 ++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 20d5c8a6925d..aae1645dfd92 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -137,6 +137,14 @@ =20 #define I2C_MASTER_RESET_CNTRL 0x0a8 =20 +#define I2C_SW_MUTEX 0x0ec +#define I2C_SW_MUTEX_REQUEST GENMASK(3, 0) +#define I2C_SW_MUTEX_GRANT GENMASK(7, 4) +#define I2C_SW_MUTEX_ID_CCPLEX 9 + +/* SW mutex acquire timeout value in microseconds. */ +#define I2C_SW_MUTEX_TIMEOUT_US (25 * USEC_PER_MSEC) + /* configuration load timeout in microseconds */ #define I2C_CONFIG_LOAD_TIMEOUT 1000000 =20 @@ -210,6 +218,7 @@ enum msg_end_type { * @has_interface_timing_reg: Has interface timing register to program the= tuned * timing settings. * @has_hs_mode_support: Has support for high speed (HS) mode transfers. + * @has_mutex: Has mutex register for mutual exclusion with other firmware= s or VMs. */ struct tegra_i2c_hw_feature { bool has_continue_xfer_support; @@ -237,6 +246,7 @@ struct tegra_i2c_hw_feature { u32 setup_hold_time_hs_mode; bool has_interface_timing_reg; bool has_hs_mode_support; + bool has_mutex; }; =20 /** @@ -381,6 +391,73 @@ static void i2c_readsl(struct tegra_i2c_dev *i2c_dev, = void *data, readsl(i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg), data, len); } =20 +static int tegra_i2c_mutex_acquired(struct tegra_i2c_dev *i2c_dev) +{ + unsigned int reg =3D tegra_i2c_reg_addr(i2c_dev, I2C_SW_MUTEX); + u32 val, id; + + val =3D readl(i2c_dev->base + reg); + id =3D FIELD_GET(I2C_SW_MUTEX_GRANT, val); + + if (id !=3D I2C_SW_MUTEX_ID_CCPLEX) + return 0; + + return 1; +} + +static int tegra_i2c_mutex_trylock(struct tegra_i2c_dev *i2c_dev) +{ + unsigned int reg =3D tegra_i2c_reg_addr(i2c_dev, I2C_SW_MUTEX); + u32 val, id; + + val =3D readl(i2c_dev->base + reg); + id =3D FIELD_GET(I2C_SW_MUTEX_GRANT, val); + if (id !=3D 0 && id !=3D I2C_SW_MUTEX_ID_CCPLEX) + return 0; + + val =3D FIELD_PREP(I2C_SW_MUTEX_REQUEST, I2C_SW_MUTEX_ID_CCPLEX); + writel(val, i2c_dev->base + reg); + + return tegra_i2c_mutex_acquired(i2c_dev); +} + +static int tegra_i2c_mutex_lock(struct tegra_i2c_dev *i2c_dev) +{ + int locked; + int ret; + + if (i2c_dev->atomic_mode) + ret =3D read_poll_timeout_atomic(tegra_i2c_mutex_trylock, locked, locked, + USEC_PER_MSEC, I2C_SW_MUTEX_TIMEOUT_US, + false, i2c_dev); + else + ret =3D read_poll_timeout(tegra_i2c_mutex_trylock, locked, locked, USEC_= PER_MSEC, + I2C_SW_MUTEX_TIMEOUT_US, false, i2c_dev); + + if (!tegra_i2c_mutex_acquired(i2c_dev)) + dev_warn(i2c_dev->dev, "failed to acquire mutex\n"); + + return ret; +} + +static int tegra_i2c_mutex_unlock(struct tegra_i2c_dev *i2c_dev) +{ + unsigned int reg =3D tegra_i2c_reg_addr(i2c_dev, I2C_SW_MUTEX); + u32 val, id; + + val =3D readl(i2c_dev->base + reg); + + id =3D FIELD_GET(I2C_SW_MUTEX_GRANT, val); + if (id && id !=3D I2C_SW_MUTEX_ID_CCPLEX) { + dev_warn(i2c_dev->dev, "unable to unlock mutex, mutex is owned by: %u\n"= , id); + return -EPERM; + } + + writel(0, i2c_dev->base + reg); + + return 0; +} + static void tegra_i2c_mask_irq(struct tegra_i2c_dev *i2c_dev, u32 mask) { u32 int_mask; @@ -1422,6 +1499,10 @@ static int tegra_i2c_xfer(struct i2c_adapter *adap, = struct i2c_msg msgs[], return ret; } =20 + ret =3D tegra_i2c_mutex_lock(i2c_dev); + if (ret) + return ret; + for (i =3D 0; i < num; i++) { enum msg_end_type end_type =3D MSG_END_STOP; =20 @@ -1451,6 +1532,10 @@ static int tegra_i2c_xfer(struct i2c_adapter *adap, = struct i2c_msg msgs[], break; } =20 + ret =3D tegra_i2c_mutex_unlock(i2c_dev); + if (ret) + return ret; + pm_runtime_put(i2c_dev->dev); =20 return ret ?: i; @@ -1527,6 +1612,7 @@ static const struct tegra_i2c_hw_feature tegra20_i2c_= hw =3D { .setup_hold_time_hs_mode =3D 0x0, .has_interface_timing_reg =3D false, .has_hs_mode_support =3D false, + .has_mutex =3D false, }; =20 static const struct tegra_i2c_hw_feature tegra30_i2c_hw =3D { @@ -1553,6 +1639,7 @@ static const struct tegra_i2c_hw_feature tegra30_i2c_= hw =3D { .setup_hold_time_hs_mode =3D 0x0, .has_interface_timing_reg =3D false, .has_hs_mode_support =3D false, + .has_mutex =3D false, }; =20 static const struct tegra_i2c_hw_feature tegra114_i2c_hw =3D { @@ -1579,6 +1666,7 @@ static const struct tegra_i2c_hw_feature tegra114_i2c= _hw =3D { .setup_hold_time_hs_mode =3D 0x0, .has_interface_timing_reg =3D false, .has_hs_mode_support =3D false, + .has_mutex =3D false, }; =20 static const struct tegra_i2c_hw_feature tegra124_i2c_hw =3D { @@ -1605,6 +1693,7 @@ static const struct tegra_i2c_hw_feature tegra124_i2c= _hw =3D { .setup_hold_time_hs_mode =3D 0x0, .has_interface_timing_reg =3D true, .has_hs_mode_support =3D false, + .has_mutex =3D false, }; =20 static const struct tegra_i2c_hw_feature tegra210_i2c_hw =3D { @@ -1631,6 +1720,7 @@ static const struct tegra_i2c_hw_feature tegra210_i2c= _hw =3D { .setup_hold_time_hs_mode =3D 0, .has_interface_timing_reg =3D true, .has_hs_mode_support =3D false, + .has_mutex =3D false, }; =20 static const struct tegra_i2c_hw_feature tegra186_i2c_hw =3D { @@ -1657,6 +1747,7 @@ static const struct tegra_i2c_hw_feature tegra186_i2c= _hw =3D { .setup_hold_time_hs_mode =3D 0, .has_interface_timing_reg =3D true, .has_hs_mode_support =3D false, + .has_mutex =3D false, }; =20 static const struct tegra_i2c_hw_feature tegra194_i2c_hw =3D { @@ -1685,6 +1776,7 @@ static const struct tegra_i2c_hw_feature tegra194_i2c= _hw =3D { .setup_hold_time_hs_mode =3D 0x090909, .has_interface_timing_reg =3D true, .has_hs_mode_support =3D true, + .has_mutex =3D false, }; =20 static const struct of_device_id tegra_i2c_of_match[] =3D { --=20 2.43.0 From nobody Fri Oct 3 19:11:41 2025 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2057.outbound.protection.outlook.com [40.107.220.57]) (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 BF3432FE584; Tue, 26 Aug 2025 08:33:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756197214; cv=fail; b=cAHOR8zc08+lugGikh0Q4FGmwVdWUefiGU1ZmUX+8MffhUYRdAkVY5pmxgRJMsjtqc7dWdfnQcT7MXQSr1lFn/sTNGdCPE11V7gAxiHsxJyTVFbe5CLqrASFxvvtGKkDmd0W1EOqtp548GrSzi4BlqD0BGuI2ibAx/EEAoLA6jo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756197214; c=relaxed/simple; bh=cxPRbsNQEs4GfTdJkhRIoUcV8/L2HHXg1Vd8BalR4Og=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gAqh8Jl2JvFExdRcLKpd3Ae/YOGjRoAc8azA7PBJbWRWTgulRPxRyq8/0DWNOQw6AdmnfU5fjP6lEkNHboHrSjKCqrK4M0jDVE0Dkm0xbj7vDPZzHA9od9CR6E8SWdBMfpdWw8F1iW3cDwi7azaj0dE9G4T/TBDTKWqi808vj9E= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=cffZzPMQ; arc=fail smtp.client-ip=40.107.220.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="cffZzPMQ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZPBDIdAYQcNN755qJPtA8hr7sqQhGG/dnTJlGS8gM2CSAAchgkGdeaPA2zXeji39G56VuN91dIYFAQCf8e3eAVC04yChJlnlTkhsRRg3V58kp7VPdpWT0DQWx7Cs+Xg004SPhFDkUCj+P5tcl6OUvJXF9IqZHbxLv2q6SHlVHkkmCztLjmzOYh8h9hYdyB51GaRPkP3exJVbeRd6/V6JVYFnrjUtqASZQFZnW26YNi9wFcrWDFvRsYL0X3ZVseUc8ya+OUbtiHvCYmweqOmxwj3YYzq47pn6BJiQ0lw73apu4pAM5esTtbDOfteNN4PD62a6NV4gEY08WYsVmhdXnQ== 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=nceHASv1qeWUUXXE9UblyzLtvrTcYzI6/clJ6b6GuTw=; b=N/zCyAz210fIu1Tj05sdWr74OVwzwQ52tkX+u7lOov2nED5rkaYCZE0FLvddK8yGMSxyBrkkHAORPoDJi6TRHlfA1VlJ1sJT8oa7nL5kCz8Uo8+dfQYcujqkzr0fk/HUmU3ASHOdmQDIjS0bv/1YaaZv7UvQdokia94W6wHG9fIcPvXFe7vqHoC5Vq9uT1fUsAOufGuyYaMAI33t3vp4wr6FsOu84maIZ1XBFQqiGARAHB2tiicQnrrmLcQO71ILPB8lbdve1NOrHqcT0FmbKDRyx2YvUUtsN3G/TddHkDmn3ZZvGTez3sEBWRJIlEt4GHN34EHiCaG1/Y5sMW4NdA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nceHASv1qeWUUXXE9UblyzLtvrTcYzI6/clJ6b6GuTw=; b=cffZzPMQX7TB/zgsbRemMbAwEqy9YUxx28tpIw8sp90z8jT2Q1t7FuKDB6Nx4UcyNhxxSjDA2QcE+hUYY/G8HeaNz6jpaqGSNBQtUKAUFHcJct6OoAENEVYHw1yOhqnUxSQWQ0zTTlfjTujQWh4dPAKXu2MQmRTkaPq1H8irr9/LHQmtpB8LqpStay5dWOZcVYow8WjxlcQuKVykyUmWn0BJK2O0VUSCnK4O75kdD8IoCymAJK5BeRHVV41ckZZyjrk6RRJT9Uz5V7ppcXxkmvmgdadyRHHcl5v9UjUx+f4Oq6oN6ugesat8otUPJngM57IJazoLRwx52+EzWhFbpw== Received: from SN6PR04CA0078.namprd04.prod.outlook.com (2603:10b6:805:f2::19) by MN0PR12MB5836.namprd12.prod.outlook.com (2603:10b6:208:37b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9052.21; Tue, 26 Aug 2025 08:33:29 +0000 Received: from SN1PEPF000397B5.namprd05.prod.outlook.com (2603:10b6:805:f2:cafe::e3) by SN6PR04CA0078.outlook.office365.com (2603:10b6:805:f2::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9052.21 via Frontend Transport; Tue, 26 Aug 2025 08:33:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF000397B5.mail.protection.outlook.com (10.167.248.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9073.11 via Frontend Transport; Tue, 26 Aug 2025 08:33:28 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Tue, 26 Aug 2025 01:33:13 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Tue, 26 Aug 2025 01:33:13 -0700 Received: from kkartik-desktop.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Tue, 26 Aug 2025 01:33:09 -0700 From: Kartik Rajput To: , , , , , , , , , , , , CC: Subject: [PATCH v5 5/5] i2c: tegra: Add Tegra264 support Date: Tue, 26 Aug 2025 14:02:44 +0530 Message-ID: <20250826083244.487610-6-kkartik@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250826083244.487610-1-kkartik@nvidia.com> References: <20250826083244.487610-1-kkartik@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000397B5:EE_|MN0PR12MB5836:EE_ X-MS-Office365-Filtering-Correlation-Id: 3584e989-53f2-4f41-e0e6-08dde47b3b2e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|376014|7416014|36860700013|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?8s4TVLfvzRrXxcUTr+93SZ92RfAcWsjZHVv4Wp158pLEVhFY8wZxcChP7ASU?= =?us-ascii?Q?LJTzeDC1bK0lqb2A/ogybjN1seDjzFX5JFm2S83MQjgatKxJOiyYd1s2cmWO?= =?us-ascii?Q?nhRLHqPWbcC6isLIhrwBGnGfSY2INMnKaZ9dtZz2jA32kKfzk1vVe274LGfi?= =?us-ascii?Q?lRj+COagt1DlXYobmD4T+0sHPoHg1SWHmPb+rcVFX8I+Dd1k1Kc6iqFTwNEW?= =?us-ascii?Q?OxdBiVYtiWOD2Prev8BLxL8mo+nS94u9BAKi2XIq+bGnhVnF4ZdXaR5ffBuG?= =?us-ascii?Q?STC59xSveN384VxfttSltFFgpMrkdts7YtZmMevUahhZhMc32kJ5k4cvXEtP?= =?us-ascii?Q?EPl/O31J2SoAc++tjN4srM6TaVET9sYy/XUNwHEOYGQgz3hqae5qCF5cDvye?= =?us-ascii?Q?mwN7WzsDdcfbDD/Tt0zfOfENuR7DdopHwcn210lvecT2GSk/yGK5vLkVhdWS?= =?us-ascii?Q?ZBcFxg6ez1dqW1UONrvdkqOIvDiS/4W+nwMRjjxKrzjnWw8uF9oaic/N6F3h?= =?us-ascii?Q?wiroDmI3pBjBuGOGarhupU/hLMjg5QvwmnNyBlwT6I0yvy8ziRMRY+X9ikmD?= =?us-ascii?Q?fWJM9N5zH8XydCMW6qzMTuExXOrsBLev8LuoQ4X/ZvfVw3+eq16NMi2azbTH?= =?us-ascii?Q?v/pYAMrwGeA2PIsqSbvu0FQy9taTU/fFJiT5V6sZmLn+Qtw46DrC7OjDv+mJ?= =?us-ascii?Q?N5xRfxo0Aco+1lU3GnBMZADvl3HPSNtwSKON3LgTb/EDIQ7zHnD49X12TQHt?= =?us-ascii?Q?5uWur5x6iKzLijAtQ6Let3XMXSsicjEwOoUQ4KweYmTQZWg7d3nHkqXLdrJ3?= =?us-ascii?Q?mmLG42m32kfLdF91x+F2YNXkchnp7LvKMkfkHlDI4XXIlc0MB/l7+mtSkljH?= =?us-ascii?Q?n64tiFXO6c2y1deqHJkngDxi6jAFrrOEygowdM7zqquUq+cZ/pWSptWYw2r0?= =?us-ascii?Q?LApIbMkSvIUswZ4hQNSgphFpqWeHUvYZM/PRccara7mf0r5pwsQPaCRYMIn/?= =?us-ascii?Q?VSSoIZJWrzxHJrjhhzBuLxFvR1LABcJ9k+HXbJWyZ4G0QPv2N0DguZH66WRR?= =?us-ascii?Q?CE07NXOCika8jUMnnQpb0PwxWeWxkGowQ1AHBFgK4C/dGkbaiKDgXJwss75r?= =?us-ascii?Q?RP9pCiS0XFJiUAfqnTFyqaVkefaFj/cJeBeAbtnRyAZ+kyt8vHoUmO2V+fr2?= =?us-ascii?Q?fPuhSRncrPI5KKl8RKjF+N+MB1ISta6iq4r1nUbl20U9SUfmSAI+Oog5WYIU?= =?us-ascii?Q?OM3iCcoTEY+Sjr1fWrSCy38zVBDaB1M0tAEfSJ3Yb/2npIk9k/S29WFKaEBY?= =?us-ascii?Q?+72rfNCn+Hg0uIw1y6G44AiYGhamHz3WocOQ0QB2KvuKjGNL4i2OaYg6aCsN?= =?us-ascii?Q?ppErmvis0oAP1Z+T267/MEx8ZYpUQffs2btUh9QCOGZY1t4qHzCcz3KUAph3?= =?us-ascii?Q?+XSuhU1a1MPqPZF+40U+slp9tBajuE2vSamxI4gUQiRC+RyTrh1ZDqexlchW?= =?us-ascii?Q?Ol0Q6jduWjZQR7XI4HwqvclNOMQpFyAYjUofZtZLuYCI5nt/DAdpPv7Iog?= =?us-ascii?Q?=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(376014)(7416014)(36860700013)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2025 08:33:28.0037 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3584e989-53f2-4f41-e0e6-08dde47b3b2e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000397B5.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5836 Content-Type: text/plain; charset="utf-8" From: Akhil R Add support for Tegra264 SoC which supports 17 generic I2C controllers, two of which are in the AON (always-on) partition of the SoC. In addition to the features supported by Tegra194 it also supports a SW mutex register to allow sharing the same I2C instance across multiple firmware. Signed-off-by: Akhil R Signed-off-by: Kartik Rajput --- v1 -> v4: * Update commit message to mention the SW mutex feature available on Tegra264. --- drivers/i2c/busses/i2c-tegra.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index aae1645dfd92..2acfc497126f 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -1779,7 +1779,36 @@ static const struct tegra_i2c_hw_feature tegra194_i2= c_hw =3D { .has_mutex =3D false, }; =20 +static const struct tegra_i2c_hw_feature tegra264_i2c_hw =3D { + .has_continue_xfer_support =3D true, + .has_per_pkt_xfer_complete_irq =3D true, + .clk_divisor_hs_mode =3D 1, + .clk_divisor_std_mode =3D 0x1d, + .clk_divisor_fast_mode =3D 0x15, + .clk_divisor_fast_plus_mode =3D 0x8, + .has_config_load_reg =3D true, + .has_multi_master_mode =3D true, + .has_slcg_override_reg =3D true, + .has_mst_fifo =3D true, + .quirks =3D &tegra194_i2c_quirks, + .supports_bus_clear =3D true, + .has_apb_dma =3D false, + .tlow_std_mode =3D 0x8, + .thigh_std_mode =3D 0x7, + .tlow_fast_fastplus_mode =3D 0x2, + .thigh_fast_fastplus_mode =3D 0x2, + .tlow_hs_mode =3D 0x4, + .thigh_hs_mode =3D 0x2, + .setup_hold_time_std_mode =3D 0x08080808, + .setup_hold_time_fast_fast_plus_mode =3D 0x02020202, + .setup_hold_time_hs_mode =3D 0x090909, + .has_interface_timing_reg =3D true, + .has_hs_mode_support =3D true, + .has_mutex =3D true, +}; + static const struct of_device_id tegra_i2c_of_match[] =3D { + { .compatible =3D "nvidia,tegra264-i2c", .data =3D &tegra264_i2c_hw, }, { .compatible =3D "nvidia,tegra194-i2c", .data =3D &tegra194_i2c_hw, }, { .compatible =3D "nvidia,tegra186-i2c", .data =3D &tegra186_i2c_hw, }, #if IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC) --=20 2.43.0