From patchwork Mon Jul 1 15:12:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 808910 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2041.outbound.protection.outlook.com [40.107.212.41]) (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 733BA16CD29; Mon, 1 Jul 2024 15:13:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.212.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846794; cv=fail; b=o8a/mhoUNsiq8Iz73DeTGbDHfm1r/QAPSM+8ctWNWUBxxnVftOMJUSTyQkxtOPuIazlxXJkpAcDknybnR7z25NxBTA0QT1jqqNEITFOze883CCrQp4zYhHdCJDUexrUljplfgvXap/2Iug+8n6krvlX4/JvEncGSacGrqszNdjo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846794; c=relaxed/simple; bh=yW4Y8MQuU8jlecl4te6Y//7A+d+g5MBxvtL9eq3yqgc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oKSZHTCp53Zf3hbta+pRQqsyixrmlLYSzeJo/wypn0wzNVfPoAWgpZTFypDPY9gUN24Aiq8e4VnFYucjHWmNK/ndKTpJQs8WoiHdnmZAPsrtMMnbEmMtOy3ZvK9DWRYt5ZaVzcEZt+if3nHOO+FMdGoLftAE3NaYEB86boacSDM= 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=o6vV0GdC; arc=fail smtp.client-ip=40.107.212.41 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="o6vV0GdC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JVR9gqUNVKjgB8ujmczNzWMaOZYKEEHYxnb1uROlTZWaHpJAvvJHm2YhVAIwFl+gyCk54/REdPTyomD5x2LrmCBBTahSN4g8VjZZHILv2+jtK0NXIjpFQx++rKujAtDi0+KBIFbCPe9GtixxD0AHPdRTM7VFK4jsrUmxAsz2jmRIyiR+0qojpJLNRxgGJ1xlnIM2yt3z2/graw8cmCQFfdP7ShdYlvZj6/YGkWVzXT+Maruw+lGPdnQD5C5vSwmAIr7Jnl7dt5XeR/q9EhOMht16tGaURYbk1S4lPF3MHhJS/NlmOz9f4jDwIVbAq77Yy2oBM34xq0BP8xr0wFYU9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=n/xbNFYFAuh2pEJcNGT3DSCsAfI8UXgHM0H+sRgfRIY=; b=JYQlPxwJNNf7S3TeVWZyfmq5BgDOlfORQulD51Ej9Qqnx9wV8K0AJP3ybhy8Jz5X8gK6nHjsDmoE6yMbM13yZOtJ5G4BrtlT55J6wT15fI5GTPXbKEG0X45/dxXXMsraETkVFEqAYckQlqnHOjBn16xrRS3olLmFsxCdCSv0llT3VfhPsi397mzxtk5ooTUxhEfTbVsARujv+pumPkV7+zvkyABQMniw6hi3Xn02+RYOH3rSuFbEP/avOZKZY8x5qs97UNAkYx9Y8PMRr4qa5xh4/y7dqcVyuAhrbgh7keCpRdlGawnzVILtSUWs+sHzNSG4EvLtyYLWWbYzymzBqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=vger.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=n/xbNFYFAuh2pEJcNGT3DSCsAfI8UXgHM0H+sRgfRIY=; b=o6vV0GdCJ0JNBJT2UAtwUfIVTcRpsT6xhLQ0BB64DLJ9BzdZ9fbYsvDAGbWkEygS1XyhtA8TOvX8opv30s7Bf7okuokWEt1/EuxeFa2Ym2d526D5SOVPAJgD3ZX6zEFTyBoRkTwwhmhjI24VP+1uezxpG+1FHFB+ZLaeeXCVxrN9PV089F0ocLMNoO8fRONYRsp4ogl3t8mCYLPDsr+Sf2uSV+TrQIyd9unxwC+9m6HrcJUfWpsauEm4otxoxGw2HdMxQweG9bWht2XIOLSeMnQ+Pxlys6WdhCBxSc1hYbHgdTGre3wVCKeZHW7oazQ4mWbizDoHst5TVLcaU9cBmg== Received: from BL1PR13CA0382.namprd13.prod.outlook.com (2603:10b6:208:2c0::27) by MN0PR12MB6246.namprd12.prod.outlook.com (2603:10b6:208:3c2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.29; Mon, 1 Jul 2024 15:13:05 +0000 Received: from BL6PEPF0001AB74.namprd02.prod.outlook.com (2603:10b6:208:2c0:cafe::14) by BL1PR13CA0382.outlook.office365.com (2603:10b6:208:2c0::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Mon, 1 Jul 2024 15:13:05 +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 BL6PEPF0001AB74.mail.protection.outlook.com (10.167.242.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Mon, 1 Jul 2024 15:13:05 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) 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.4; Mon, 1 Jul 2024 08:12:49 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 1 Jul 2024 08:12:49 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 1 Jul 2024 08:12:44 -0700 From: Krishna Yarlagadda To: , , , , , CC: , , , , , , , , , , , , , Subject: [RFC PATCH V2 01/12] Documentation: Introduce config settings framework Date: Mon, 1 Jul 2024 20:42:19 +0530 Message-ID: <20240701151231.29425-2-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240701151231.29425-1-kyarlagadda@nvidia.com> References: <20240701151231.29425-1-kyarlagadda@nvidia.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB74:EE_|MN0PR12MB6246:EE_ X-MS-Office365-Filtering-Correlation-Id: 933f3d12-1d11-4072-a015-08dc99e04f1b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014|7416014; X-Microsoft-Antispam-Message-Info: g5l05dI8t0R00fOHXSh4eetPCwiYIcAxpNlfLWX8NJewrrl+U2B+uaF/Kqe/pqZsTIwXtmQo5q2v7OSX+65pVbxohRHJHbvwvba4OxEILsqw4NUYC3WBkM14gWR73++a6SiaipsnSz30Et1Khbuy63BIRbQMhIWWF2RDV/4ov2n/rQzbRaTOyf+j0SIyyme4rHgkeYk0JQA56Z+2WLY/EP0P3gWPhZ6kRFnU3PLeZGcx+SXXV4XVpXNYvtpNcbi4JT0kKC0pQ8XXoFM3PN1rE7ewtGKsstJZ6fVGGJQCWwn6ZwTmTUKpuSCd9cwp6mGtISPDr4x6XkPeRhnb9BU4A94+nZ837pNr0GhMgPHKElQJLeHNgki2hIDgVHPPTaxmVuQvHbN1cDeWGplNBwm+q2auIn7UZwlKJ8CLJou88CuasZYaHTDK/DdISWmMCsRy7ezTMkq8/Myu/PYG1PsAoVulRhxpTMydpP5fYJ1FuUYyV6H2rrmG60tapqCy2Y816nhHlttzxlfWWGX3wLLku4lYziFCp8Qac6rA5mwz/YumSqpk6G7WLjNGq/cngWxu/uEygkByc3qtf1mjvVW3fr3NHX684CPWdbhxYbh9nuvIhNn5hClRPh8upvjFO6vNeBEws5NZHvMPIftGeafy5AOV78EDTCnHgI3cR0sZ02IjptkGd42K0XHplf8o19I2Y8HJSLUdahYVQUEUY9pzfCDArHoZOIKEkB04Xm3EmxDzKpJZJMi7aM9L3KAU9HyAqDUd+r3lRHIfEFes3cQ8PHWm05UI6pYpxkcz5BkzGl8ChwdcSiUjyAvtpj9xS8VezNdM8K73XXED+w7L/lOR3IeRRWq16NUFggdPgz3/5LPJCGRtysMdUCk2J23EVAAUY8196E78FHe9G7pLgSDTiIORoGZLLSGOwWNnyWtnKpmnitMziIWK26D9ZTFW2XfzC/LddpxsC+EenDmnKZ3B1fD1ThsqJfH0CaGnwAWgzWk8UZN6brA+/xBwpqdVnAy34FSVL+IDmtfE5vp1osc7yNCVOcRO2WZ7/IH3VDaWrLOnNITOn/U73zCZZLc6tSS5zOoZmxMBdWulbb/ueU8KefTzcA7ioYgYj0WiFQ/zcHSQ0i8Wt+WK6RltxZCBSSMLV/1bsM1IyXaFuHBegQg5BYXtpsJFNEGIDW/wUxjUIQPrbbIuV/FdUQuUkFeU2VQ2khT5yj1aTcGoVyaZff9bIOMCla4AehdZSga2pBGACZzzmlsqfbEm69GSKggZ0bL8bxjFPoBk/NhgDogDGeLL1PiZD7OF5ntutuDaqI9KKfmWhhnrRu7N8mhxoFPCHom25JPDVjtMwWr1Fqf75KxYvauRnvmJCAckIyhUYG6WpHfCBOx017y2V8L+IBwWTL7fo3S3/e8x2TJ5KsTSYFalfNZ2+0q9djfIbtC+jG2GP8nZRYM2RNuhbfavt7RXFjuu 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)(36860700013)(82310400026)(1800799024)(376014)(7416014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2024 15:13:05.6827 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 933f3d12-1d11-4072-a015-08dc99e04f1b 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: BL6PEPF0001AB74.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6246 Add documentation for config settings framework utilized by Tegra SOCs. This framework is used to configure various device registers (I2C, SPI, etc) with the optimal/recommended settings for a given operating mode. For each operating mode there may be various register fields that need to be configured and so these settings are broken down by register field. This framework uses device-tree for specifying various register settings for each operating mode for a given device. Signed-off-by: Krishna Yarlagadda --- Documentation/misc-devices/tegra-cfg.rst | 133 +++++++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 140 insertions(+) create mode 100644 Documentation/misc-devices/tegra-cfg.rst diff --git a/Documentation/misc-devices/tegra-cfg.rst b/Documentation/misc-devices/tegra-cfg.rst new file mode 100644 index 000000000000..407e3b3449dc --- /dev/null +++ b/Documentation/misc-devices/tegra-cfg.rst @@ -0,0 +1,133 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=================================== +NVIDIA Tegra Configuration Settings +=================================== + +Introduction +------------ +NVIDIA Tegra SoCs have various I/O controllers and these controllers require +specific register configurations. + +They could be due to changes in: + - Functional mode (eg. speed) + - Interface properties (eg. signal timings) + - Manufacturing characteristics (eg. process/package) + - Thermal characteristics + - Board characteristics + +Some of the configurations can be provided by device specific standard DT +properties like speed of interface in I2C, rising/falling timing etc. However, +there are more device specific configurations required to tune the interface +based on execution mode or other runtime parameters. All such configurations are +defined as 'config' settings of the device. This configures a device to operate +with the optimal settings for a particular mode to improve performance, +stability or reduce power. + +These configurations are either static or dynamic: + - Static configuration which is set once during device boot and controller + reset + - Dynamic configuration is applied based on a particular condition like bus + speed, controller mode, peripheral connected to controller, SoC and platform + characterization + +Static configurations are provided as common config setting and dynamic +configurations are provided as mode/condition specific. + +Background +---------- +Slew rates, tap delay and other calibration parameters for an interface +controller, are measured through characterization. These values are dynamic +and requires different values for same property / field. + +Use case +-------- +Tegra device drivers that use these config settings include: + - I2C uses config settings to configure setup & hold times, clock divider + values. + - SDMMC tuning iterations per speed and CQE values can be set with this method. + +Device tree +----------- +Config settings of a controller are added under a configsettings and +referenced via phandle in the controller's device tree node. +Further subnodes are created under config for each conditional setting. +:: + + configsettings { + config-ctrlxyz { + ctrl-common-cfg { + reg-field-a = ; + reg-field-b = ; + reg-field-c = ; + }; + ctrl-condition1-cfg { + reg-field-a = ; + reg-field-b = ; + reg-field-c = ; + }; + ctrl-condition2-cfg { + reg-field-a = ; + reg-field-b = ; + reg-field-c = ; + }; + }; + }; + +: + - "config-": subnode in device node to hold configuration settings. + - "-common-cfg": static configuration that needs to be applied during + controller reset. Register fields under this node are applied during + initialization irrespective of any condition. + - "-condition1-cfg": conditional configuration to be applied when + controller is set in specific functional mode. Conditional configs may + override existing settings in 'common' or contain settings unique to the + config. + - Properties defined under config must correspond to a register field of + device controller. + - Properties are device specific and added to device node. + +Example +------- +Ex:: + + configsettings { + configi2c1: config-i2c3160000 { + i2c-common-cfg { + nvidia,i2c-hs-sclk-high-period = <0x03>; + nvidia,i2c-hs-sclk-low-period = <0x08>; + }; + i2c-fast-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x3c>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + i2c-fastplus-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + i2c-standard-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x4f>; + nvidia,i2c-sclk-high-period = <0x07>; + nvidia,i2c-sclk-low-period = <0x08>; + nvidia,i2c-bus-free-time = <0x08>; + nvidia,i2c-stop-setup-time = <0x08>; + nvidia,i2c-start-hold-time = <0x08>; + nvidia,i2c-start-setup-time = <0x08>; + }; + }; + }; + + i2c@3160000 { + config-settings = <&configi2c1> + }; + diff --git a/MAINTAINERS b/MAINTAINERS index e58374b99e5e..8a60c98ac755 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22255,6 +22255,13 @@ S: Maintained F: Documentation/devicetree/bindings/mtd/nvidia-tegra20-nand.txt F: drivers/mtd/nand/raw/tegra_nand.c +TEGRA CONFIG SETTINGS DRIVER +M: Thierry Reding +R: Laxman Dewangan +R: Krishna Yarlagadda +S: Supported +F: Documentation/misc-devices/tegra-cfg.rst + TEGRA PWM DRIVER M: Thierry Reding S: Supported From patchwork Mon Jul 1 15:12:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 809575 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2045.outbound.protection.outlook.com [40.107.212.45]) (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 6CED816CD3A; Mon, 1 Jul 2024 15:13:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.212.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846796; cv=fail; b=WNXyWq4DUHgx5ScQ3+/1CRcpJfriCpLyBnqibNbP3SsBkhU4v24v5MFUG1xWdjmxD198AWqHmGNFtctCNKthogYlE675KY2V8yjRcqq5ZaqecD7QIiqx1ix89DVrlIiMILgK9co/atreo2wnyKDrFLHISpN17vKjNAUrlsHKdvo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846796; c=relaxed/simple; bh=6gQT/P/VSwOBeFGio+biaVSavkSkEqKVWVxiDBna1JM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=eI8xq3NhgCEeH7tadO5WAUqrDBqvrjIsOUJJ2Ay+WNCbmmp2pSSt2SgVHC7bAedwh12Crt4btgDsvL8s/FQYsHPV06B9oyOorrA++kyJs9pD5tsBLIBU0SaBEL3204o+wEydeuUIz4zbC7MMDgQMZS+w3o2bJ1Nz85+wSA6DR0A= 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=ZRLsPF4D; arc=fail smtp.client-ip=40.107.212.45 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="ZRLsPF4D" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mAIQj31if5BoRopmVxvciwCmhnDUqMV1CPUgIYLC3plk8DXsjsbJsdChD/SU2Mu0MRLvMcqnVLmeL4mWEwPmXIJQqat5tjVb/UiPULSMOiYa6ERVuIcVfp1uBtvm9xGLO7pwJIEkkgAEVzdaX3nYEUEG9pVYK76ErSzR6uRMVwtUciT89Om7Y17bMmIaH2yS5l6XgNSVXkBAeVLSyWALllVhj8mQYEQb9lzeZ0sFMdjYow3ElxUV2ncbJ/YgkDp2M7TlVhlZtoGeVldvK6j/8eqEstjvGp9A1fllCwXXt3nmBxQYqqYhFMspZRUpWtPHRi9derWD+VPlafzYUk2mJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=0ARZn80MDI8ALmMhWYO2ZasUD2KxXXSpRnp2BFL5dRI=; b=dCHqC8rf/oR/H9+wZoXXIBoZAQmuHZ6Tj2Pd/6gfY1ytoVODoyBpAq7jVta1Ybx0fdbc2i+B4CAx8cUZlpoEg+EKeAU+axlrBl68SYyjlwoHilP8mKO/rfdjsYQcmA7ANRQksRYkGCe8z1eaxBei6fh9l/wSjJl4xswHm5JzqcUgN5VD83XBspij2I75Xty0R2teXM5hJ94eozBe/YNBXLvPbZ9pPW8LVs/V0ZaZP+GP4nA3nscIiTNUzzpS5oOZgzWhbfBtb/lGswu2J6EJDWNVLqZqXoRvSBICxuKE1ph6wrd3uPQdo2umKAvxI+1CYDNK+VlbTnFs2ZiB5ai3vw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=vger.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=0ARZn80MDI8ALmMhWYO2ZasUD2KxXXSpRnp2BFL5dRI=; b=ZRLsPF4DXtjZTEriJeiVOH7DHpzpXZPDQUsj4AwbFHQpLyKPEPFZuZK5zqP2IDK6n9hesSAx2f7pP5RfTjcl46mJTGMlg4shstFPfzI+6hE6uMKNMa1iVvRm/G5EtJqwubDeBeld4z2S+0W1pZPBiaDFwqbO1W27HRyTHDkhy2FQBiptm/cylDFEZ7IVcHke3nu26OEfUTBm9+4FnsdecQdanBuA3muIYPPMRfoLdrvlhK6Nj4wAjlEwyzLkRcRE6NzNbVT6JCYdMaHB74EkciZhSntKYGMaGmgsWxU47c4FbCeX3R/sCCiiTXRLhrGUGlOPQvZ1cz71WOCQz0f5Tg== Received: from BL1PR13CA0138.namprd13.prod.outlook.com (2603:10b6:208:2bb::23) by DS0PR12MB6462.namprd12.prod.outlook.com (2603:10b6:8:c6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.26; Mon, 1 Jul 2024 15:13:10 +0000 Received: from BL6PEPF0001AB76.namprd02.prod.outlook.com (2603:10b6:208:2bb:cafe::e4) by BL1PR13CA0138.outlook.office365.com (2603:10b6:208:2bb::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Mon, 1 Jul 2024 15:13:10 +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 BL6PEPF0001AB76.mail.protection.outlook.com (10.167.242.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Mon, 1 Jul 2024 15:13:10 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) 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.4; Mon, 1 Jul 2024 08:12:55 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 1 Jul 2024 08:12:54 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 1 Jul 2024 08:12:49 -0700 From: Krishna Yarlagadda To: , , , , , CC: , , , , , , , , , , , , , Subject: [RFC PATCH V2 02/12] dt-bindings: misc: Tegra configuration settings Date: Mon, 1 Jul 2024 20:42:20 +0530 Message-ID: <20240701151231.29425-3-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240701151231.29425-1-kyarlagadda@nvidia.com> References: <20240701151231.29425-1-kyarlagadda@nvidia.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB76:EE_|DS0PR12MB6462:EE_ X-MS-Office365-Filtering-Correlation-Id: b38aea5d-7e51-4211-d57a-08dc99e051bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|36860700013|7416014|1800799024; X-Microsoft-Antispam-Message-Info: Pl92aCLP6gpeN7XnPKAmwafwkGjYOOqoUvAfN6+eV1h1j5iB/kdGAscTHi+WGPh3LZkq/5aHQscKz8R/hj+0gzlqxhECQcshi/VlN/XZBq6ZM3Cb2HHy6CzmyvxECiXdQ8cykndF4n2QlAgy7z/jX6vfHuG7fjjVnhp6zUkHP92yWrW6Hr8nChcrSm6SROFJO9GD44FDegDk4QuFyAHDXBNlCQjwFPiwZPZzeo2BZFkEcQZj4Sjc27LNzaCuEFFe0e8iBDicls1wkBOZxQK/xrZOi4Ow7Q3R+anB0FKI9MMJg8vp+tY/EcQ9Epjjmbb3z3NMwTowoMya+pKReGAlA18n5QAFbolFgJVwZnbjWnjsZoMcimPtqeqHhm84xfC1TjCf53xpUiwLrdBu1ONY2AQrFGu4zH+Eosu28tJ0OhBVLZvXn24xa2zUebY76JpaMNTwFiz7rJtqSc4YNpX6lfO0GTHGBIRFAdE7KHg9jV3y6083s6Bx76V2tv3xuSvGz/BYasZOLUYqYoXmTcG8DqD5T77/t/hVvjMnQZ1NyMv6ePY1ceqCfyWUGx5V1UeRcYyx6fZWBU4De+LBXZN2D7xj1XN1Wj1c6ZrpkLr7K99He3TbpMhIrmNR1QgA8uzHMrPTfHbXN5CpV8tt+V4MHolO/DYwTE76dMc3Yb3FWES0jwNEKND+ssq1TNtUznifg3alJTLfJx18x7NucjhN9EE9T8RJylMVDXH9LN8Tanuu3Xbrkll1SX/epaZqL9BtyQvoIMjmfLExAsIjf6rkPuokC5hP/phcJsgVQ4/7sUK5rca3T69jfZSU8lUEIB0k7ECgIHYswUzfZ3Cvz5/IO5cPFrQplO4E9QPRD9Q1u/sQSg05mStGp28DUAYqJLbEtYjkRTt1SQ1H2IvKpAxz0MSDJnsfK3aBD7YtexFnpijV4x/f2mX2w5w/nefm2hk0s0ZC19TClhX45EL03PZPmQ2RGy7Y/TxPMdS/d608oXgFo083Q71cVaa7XwPxnsCpdJ/R9R/rLjlD87mmCilEDDDg6jqIbTabXp0D7kYvW0QNimvS5DrWMbk13qYGkyktWmEHp4tNQUWbMzVtNNTFNHcrt/sL+2qbbAP4F53SzJTufSaPAVGyz+eSqu+gx+pZNGI8OUJrWl+tZdjd67T+OjqdakVtjbfj5DAdyfSSlBY/Ki/hMkG/8ai6vYtDcKGyNhIzykGyZZ3rh0F9F3P8ZFkgI9Rirc7esFv68DgZkU+/ZgJK3envIwDjvAb1QmqqnOafHTNOhnsDM0Tf9cnNCz+LChOw4jRkPbMu1GySqN40TkwFyVVTlWOkx9CdZOqmR6j7o/+r7lrNHSa5RosPE/E0ztxquWx00IdBHycotNVbnGLYkq85JHSeI76rDClvqzfQ9ZcUMfaK/k7dRdlDmsDT5aOq0OKQ3sA/6/H3YMaZS4nHl6b038JVNQ6qMAMv 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)(82310400026)(36860700013)(7416014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2024 15:13:10.1103 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b38aea5d-7e51-4211-d57a-08dc99e051bc 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: BL6PEPF0001AB76.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6462 Config framework parses device tree and provides a list of register settings with mask per mode to be applied by the controller. Add binding document for config settings framework. Config settings are defined as a property per field and have different modes per device. Signed-off-by: Krishna Yarlagadda --- .../misc/nvidia,tegra-config-settings.yaml | 62 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 63 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml diff --git a/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml b/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml new file mode 100644 index 000000000000..4e5d52504c01 --- /dev/null +++ b/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml @@ -0,0 +1,62 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/misc/nvidia,tegra-config-settings.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Config properties for a device + +description: + Config setting is the configuration based on chip/board/system + characterization on interface/controller settings. This is needed for + - making the controller internal configuration to better perform + - making the interface to work proper by setting drive strength, slew + rates etc + - making the low power leakage. + There are two types of recommended configuration settings + - Controller register specific for internal operation of controller. + - Pad control/Pinmux/pincontrol registers for interfacing. + These configurations can further be categorized as static and dynamic. + - Static config does not change until a controller is reset. + - Dynamic config changes based on mode or condition, controller is + operating in. + +maintainers: + - Thierry Reding + +properties: + $nodename: + const: configsettings + +patternProperties: + "config-[a-z0-9_]+$": + description: + Config node representing properties of a device. Properties of + each device are listed under a unique subnode and referenced from + device node. + type: object + additionalProperties: false + + patternProperties: + "^[a-z0-9_]+-cfg$": + description: + Config profiles applied conditionally. + type: object + patternProperties: + "nvidia,[a-z0-9_]+$": + description: + Register field configuration. + $ref: /schemas/types.yaml#/definitions/uint32 + +additionalProperties: true + +examples: + - | + configsettings { + configi2c1: config-i2c3160000 { + i2c-common-cfg { + nvidia,i2c-hs-sclk-high-period = <0x03>; + nvidia,i2c-hs-sclk-low-period = <0x08>; + }; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 8a60c98ac755..ac8410ed421f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22260,6 +22260,7 @@ M: Thierry Reding R: Laxman Dewangan R: Krishna Yarlagadda S: Supported +F: Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml F: Documentation/misc-devices/tegra-cfg.rst TEGRA PWM DRIVER From patchwork Mon Jul 1 15:12:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 808909 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2062.outbound.protection.outlook.com [40.107.220.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 2D19D16D4C2; Mon, 1 Jul 2024 15:13:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846801; cv=fail; b=f8U3AvLokLYGYdSwrAnc0jZMAtr65NtW1FxEDUtGS8yP5Q9HhTUcInGAFm3iiahl+ZgB3A9LCDL43qKhzozOuUPDhk8lbrjGiqatN2HUocUrJgRjLbb6Qs3Lkm038eeU4v+ug0k+G+Qw5s3VYEwWAB6YOMNR3xletV86tIeBcHg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846801; c=relaxed/simple; bh=+IYrRw+YqBg5BgG5vZRAshq95I6CoCvsbHCqDJLGqYw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PPiYIRLFhlZc005drz+PDgmluNg0W73Wchq45p69kh/lTTpHSXHfBBPgD7YFLz7sl8E7f9dJQSI44/jxqwZBzNeUTW3qFrfPT0eDTHOwtN0nQHJj5WqPHYPgT0I3KzbvQ/QXVG6sekXlGPn8alYLmkc2v+nQv25Q60E378apDm0= 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=pB+io2HS; arc=fail smtp.client-ip=40.107.220.62 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="pB+io2HS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Db+6ZyMkZJhBNMUFjFeOAT/rI5kEufzSUV0XfGgErYiQQgjNQ3e9fSBQKPSoLk8suO9+kWnIPJ5OhQo+UXtQpGk4V0Xc+GqTZaQX3RD+ivDcCuh0u0uA+JKrInJ/5lqlkTn8+CyFLmAo8UqK8YkvrwLNDRV4agIm2W84M9/LqudG/FI7+ci4MaBO9vD/jYFa0vNmg6fNWucXYe+KXuCSOgViS2MRsbUc9ntlk+o8z5ZDVdsBmqAbjOVIFYxJ4dRWYCSyC7DiXxvrTslfbvoeUxv/SUjilYpOmXEtyOm4/PDZlmb833xoGm1XXQQTFFfFJGgXdCDo5V5hAqQNRpe0Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=iUNhyDvPk43qI+RxLDVQ57An7jA1i7r3m2m9708bROU=; b=a4nt4KV44sJyxxCicoVj/0JDHu8eXHF8nKH+bLULir46zpfPSEc7WeWOW1hduyt9ZetKHBco4XZKYrM09hJ8UZlWct69luDAVsZKQ67AW2pu+oJRlYGQRVDm63l0a9/EGSYhaffCBmPfgqN1/e6JKBPIDdATgFXaA2HjblEZfs82yiwKhrhjG4h1QH4YzlZ02w134VWO05nNLUtdiH7FjVGnFmIE06T4f+VskLsLRzMrSz/k5UrFg7MMPE5s0oanLvFxujIuFTs2jYsqCC6caeZnw0DQ0ZF0UQ0175gz3fthafAP0Pw2JttdvcLiZBbyIg5h1f4GKsJQ7tcnKG9JLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=vger.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=iUNhyDvPk43qI+RxLDVQ57An7jA1i7r3m2m9708bROU=; b=pB+io2HSubik+JmbH9+Z2em/g7BlRlDw+l7t7uWf8IsUKkg7IyqsjFlOJm90FDiQrZCGtRh5UVckIHEuEeSimFX4PHINCQQTBib973kaWFdmUrXBxsUyy22N3H48RRvpNqzh/o5wsWywM1+E/qgTK68y94aSuFfMXovqvXIDWYNiaOY+U0nmzLjX/uZGp1imaXxZjV9DAdN51a8BTEKtP/fyAbhvEaAH1LF3e8myYCssaJaLgTGTszMqPq5mTW5/vWeQxe3UvuAUIG2tlJrCJflVUsxD62p8u/Y6dZGnqtzs5ROixOmWneQd8Wc7+1Mrs5eZNl3YMc6uxZM63f1O9Q== Received: from DM5PR07CA0106.namprd07.prod.outlook.com (2603:10b6:4:ae::35) by DS0PR12MB9323.namprd12.prod.outlook.com (2603:10b6:8:1b3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32; Mon, 1 Jul 2024 15:13:12 +0000 Received: from CY4PEPF0000EE3A.namprd03.prod.outlook.com (2603:10b6:4:ae:cafe::44) by DM5PR07CA0106.outlook.office365.com (2603:10b6:4:ae::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.33 via Frontend Transport; Mon, 1 Jul 2024 15:13:12 +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 CY4PEPF0000EE3A.mail.protection.outlook.com (10.167.242.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Mon, 1 Jul 2024 15:13:12 +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.4; Mon, 1 Jul 2024 08:13:00 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) 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.4; Mon, 1 Jul 2024 08:13:00 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 1 Jul 2024 08:12:55 -0700 From: Krishna Yarlagadda To: , , , , , CC: , , , , , , , , , , , , , Subject: [RFC PATCH V2 03/12] soc: tegra: Add config setting framework Date: Mon, 1 Jul 2024 20:42:21 +0530 Message-ID: <20240701151231.29425-4-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240701151231.29425-1-kyarlagadda@nvidia.com> References: <20240701151231.29425-1-kyarlagadda@nvidia.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3A:EE_|DS0PR12MB9323:EE_ X-MS-Office365-Filtering-Correlation-Id: b0055b53-059a-4a5c-2513-08dc99e05320 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|376014|7416014|36860700013; X-Microsoft-Antispam-Message-Info: ek/9y06E/oLh31+2Kye68yqr1yJoVojNUEYu2U5f7TKto8pIc6sYO1KAroqOLZkzFhEr2ZIsKc+sf59ZrMNMxroQjL0vDV/Olf0plveBYhizWzAJ1+40+KohFDWRsjIVi6oTSSkt7f/oFHPaFO0blWUoguHsqEtikJxkLt1P9F05okMKwyfe49CFJgVroE4xsUnUUMWJITZKnLvCixD1Jz1EuzpSsUWCmDQ89JafWfJbHqYUpd6gmF/mDooigaWPiuXEVhPXLtY+29rZYOqblrCUnTX53Tn2tZs6P4SrUl6D4IaV46I29VrMvw/kAz65rKjkEu+OYHrxKRLOtD3IvncPhbGKhIQMBhZwZk3KnetORCRPYETD5dNF/XZ3J3SdibITchdeiCT+DJ00FdwNYqDXSE54Qm/wLRPUxvWD9oQIz1J/h+73O0SlJQqdXMYyYWiLedbWH0Ei02pNNYA/tH18unCK8uc8+nb5GZ98jUI3BeLi4bvDNSKwwNg4aP5k7+b61Oj4+caXGgfMRCDRVeughV2Mlq2KDmykoKvkm1BfA/iab8ExDpLERhc4CjuWPFxlCMSle9mn+wVtC0A0BlFhf4bxeL8mYPIVSzZngm6zDSdoU7tKN0sXLZ/Kgz16rdkqqAOzIQtocDoUvsfaqUjNs/WS8vxfkaqU0BgTrGWRIF3ahsZ9Ou2b92EU7qVeYWrETQSxn9QVY+gJ3kFVpDP9WxzuDfws7W+OLqEsDDZevfIWnqBcJ/p7taeAVluld1PpoWoLOCkOXNFW/Fbk0ft/nOe8d8Y4PnR5Fu+TIkOJ52g1eU8g36GQosiTAwouJhnssA3O/RhGycl1wVXJ1fBAbRNoMv3EA9x5Jj3sRu1SfWp32Pwe69rDAuevfWHX69ICc6EQouVlJVC8x/8Ik/CeofR0kZ3HYb5BMAtZhk/7Vv9FPlDnxRQ63McG6BA4d8w4IiTY/ytKA8sUTdeZdu7xTmf8dYdbUQN2C+FWIICwbA8SFzcyV0SrJgr3/mon0mLbnZXnwbs2RXa7Fs5s37qpbEAwH4J6A6oG5SPwWfq3b6aKpfvZkfnnv2DSIjHUkf4tQ9OOdp+MlcjS6swEf0214glGbhjcJ5iILTfFGedVBmxrivf8pUX1XpLzXl0BbyjWo52z/OsMsddRD1yrojj4KqnhiPQnqmS4BMDEuTsHWIiCcYbsxBTUddLF3tHlVAnLggbu5+YBM5Rn82a2HZ36M2Td9NWou7dp7fRuhYFGIiyt6T+n41ATG1rsJO1iFgdCTLLOl+nfmTN22saQ+5Kedh4W5NbeqflpRPq5ctAMWC/7jHRPozoh9DSg7zyEx79Q8nWoG2eKhfMddHacpqdlw+XkhqnYeJ6Km3xRongl6mZs4DrI4DDI6+jZK42zoqik3DoNG42Jaap8C4TOTCdsQc2I4fwuAm2sjzOrQEdJUuSaKrH/EsGYn+4K27i4 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); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2024 15:13:12.5013 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b0055b53-059a-4a5c-2513-08dc99e05320 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: CY4PEPF0000EE3A.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9323 Config settings are defined as a property per field and have different modes per device. Each mode contains multiple properties and a device can have multiple modes. Config framework parses device tree and provides a list of register settings with mask per mode to be applied by the controller. Add APIs to parse list of register config settings and to get config from the list by name to be applied. Signed-off-by: Laxman Dewangan Signed-off-by: Krishna Yarlagadda --- MAINTAINERS | 1 + drivers/soc/tegra/Makefile | 1 + drivers/soc/tegra/tegra-cfg.c | 147 ++++++++++++++++++++++++++++++++++ include/soc/tegra/tegra-cfg.h | 87 ++++++++++++++++++++ 4 files changed, 236 insertions(+) create mode 100644 drivers/soc/tegra/tegra-cfg.c create mode 100644 include/soc/tegra/tegra-cfg.h diff --git a/MAINTAINERS b/MAINTAINERS index ac8410ed421f..23e79a878f2a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22262,6 +22262,7 @@ R: Krishna Yarlagadda S: Supported F: Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml F: Documentation/misc-devices/tegra-cfg.rst +F: drivers/soc/tegra/tegra-cfg.c TEGRA PWM DRIVER M: Thierry Reding diff --git a/drivers/soc/tegra/Makefile b/drivers/soc/tegra/Makefile index 01059619e764..8d0c8dc62c8c 100644 --- a/drivers/soc/tegra/Makefile +++ b/drivers/soc/tegra/Makefile @@ -8,3 +8,4 @@ obj-$(CONFIG_SOC_TEGRA_PMC) += pmc.o obj-$(CONFIG_SOC_TEGRA20_VOLTAGE_COUPLER) += regulators-tegra20.o obj-$(CONFIG_SOC_TEGRA30_VOLTAGE_COUPLER) += regulators-tegra30.o obj-$(CONFIG_ARCH_TEGRA_186_SOC) += ari-tegra186.o +obj-y += tegra-cfg.o diff --git a/drivers/soc/tegra/tegra-cfg.c b/drivers/soc/tegra/tegra-cfg.c new file mode 100644 index 000000000000..50a15651aaa1 --- /dev/null +++ b/drivers/soc/tegra/tegra-cfg.c @@ -0,0 +1,147 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2024 NVIDIA CORPORATION. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +static int tegra_cfg_update_reg_info(struct device_node *cfg_node, + const struct tegra_cfg_field_desc *field, + struct tegra_cfg_reg *regs, + struct tegra_cfg *cfg) +{ + int ret; + unsigned int k, value = 0; + + ret = of_property_read_u32(cfg_node, field->name, &value); + if (ret) + return ret; + + /* + * Find matching register for this field in register info. Field info + * has details of register offset. + */ + for (k = 0; k < cfg->num_regs; ++k) { + if (regs[k].offset == field->offset) + break; + } + + /* If register not found, add new at end of list */ + if (k == cfg->num_regs) { + cfg->num_regs++; + regs[k].offset = field->offset; + } + + /* add field value to register */ + value = value << __ffs(field->mask); + regs[k].value |= value & field->mask; + regs[k].mask |= field->mask; + + return 0; +} + +/* + * Initialize config list. Parse config node for properties (register fields). + * Get list of configs and value of fields populated in tegra_cfg_desc. + * Consolidate field data in reg offset, mask & value format in tegra_cfg. + * Repeat for each config and store in tegra_cfg_list. + */ +static struct tegra_cfg_list *tegra_cfg_init(struct device *dev, + const struct device_node *np, + const struct tegra_cfg_desc *cfg_desc) +{ + struct device_node *np_cfg = NULL, *child; + struct tegra_cfg_reg *regs; + struct tegra_cfg_list *list; + struct tegra_cfg *cfg; + const struct tegra_cfg_field_desc *fields; + unsigned int count, i; + int ret; + + if (np) + np_cfg = of_parse_phandle(np, "config-settings", 0); + if (!np_cfg) + return ERR_PTR(-ENODEV); + + count = of_get_child_count(np_cfg); + if (count <= 0) { + dev_dbg(dev, "Node %s: No config settings\n", + np->name); + return ERR_PTR(-ENODEV); + } + + list = devm_kzalloc(dev, sizeof(*list), GFP_KERNEL); + if (!list) + return ERR_PTR(-ENOMEM); + list->num_cfg = 0; + list->cfg = NULL; + + /* allocate mem for all configurations */ + list->cfg = devm_kcalloc(dev, count, sizeof(*list->cfg), + GFP_KERNEL); + if (!list->cfg) + return ERR_PTR(-ENOMEM); + + fields = cfg_desc->fields; + count = 0; + /* + * Iterate through all configurations. + */ + for_each_available_child_of_node(np_cfg, child) { + cfg = &list->cfg[count]; + + regs = devm_kcalloc(dev, cfg_desc->num_regs, + sizeof(*regs), GFP_KERNEL); + if (!regs) + return ERR_PTR(-ENOMEM); + + cfg->name = child->name; + cfg->regs = regs; + cfg->num_regs = 0; + + /* Look for all fields in 'child' config */ + for (i = 0; i < cfg_desc->num_fields; i++) { + ret = tegra_cfg_update_reg_info(child, &fields[i], + regs, cfg); + if (ret < 0) + continue; + } + count++; + } + + list->num_cfg = count; + + return list; +} + +struct tegra_cfg * +tegra_cfg_get_by_name(struct device *dev, + const struct tegra_cfg_list *list, + const char *name) +{ + unsigned int i; + + for (i = 0; i < list->num_cfg; ++i) { + if (!strcmp(list->cfg[i].name, name)) + return &list->cfg[i]; + } + + return NULL; +} +EXPORT_SYMBOL(tegra_cfg_get_by_name); + +struct tegra_cfg_list *tegra_cfg_get(struct device *dev, + const struct device_node *np, + const struct tegra_cfg_desc *cfg_desc) +{ + return tegra_cfg_init(dev, np, cfg_desc); +} +EXPORT_SYMBOL(tegra_cfg_get); diff --git a/include/soc/tegra/tegra-cfg.h b/include/soc/tegra/tegra-cfg.h new file mode 100644 index 000000000000..ece6f63a83c1 --- /dev/null +++ b/include/soc/tegra/tegra-cfg.h @@ -0,0 +1,87 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. + */ + +#ifndef __SOC_TEGRA_CFG_H__ +#define __SOC_TEGRA_CFG_H__ + +#include + +/** + * Config settings are a list of DT properties holding each field's recommended + * value. Field info is held in tegra_cfg_field and tegra_cfg_desc. + * Data of all fields in a single register are parsed and stored in + * tegra_cfg_reg. Struct tegra_cfg_list contains list of configurations + * and each config tegra_cfg contains register list. + * Client drivers provide field and register data through tegra_cfg_desc. + */ + +/** + * Register field and DT property mapping. + * @name: device property name of the field. + * @offset: offset of register from base. + * @mask: mask of field within register. + */ +struct tegra_cfg_field_desc { + const char *name; + u32 offset; + u32 mask; +}; + +#define TEGRA_CFG_FIELD(fname, roffset, fmask) \ +{ \ + .name = fname, \ + .offset = roffset, \ + .mask = fmask, \ +} + +/** + * Configuration setting from controller where it passes the total number of + * registers having config, and their register field names. + */ +struct tegra_cfg_desc { + unsigned int num_regs; + unsigned int num_fields; + const struct tegra_cfg_field_desc *fields; +}; + +/** + * Configuration register info generated by combining all field config settings + * in device tree of a register. + * @offset: offset of register from base. + * @mask: generated mask from aggregate of all field settings read from dt. + * @value: generated value by combining all field properties read from dt. + */ +struct tegra_cfg_reg { + u32 offset; + u32 mask; + u32 value; +}; + +/** + * Per config info of all registers. + */ +struct tegra_cfg { + const char *name; + unsigned int num_regs; + struct tegra_cfg_reg *regs; +}; + +/** + * Config settings list. + */ +struct tegra_cfg_list { + unsigned int num_cfg; + struct tegra_cfg *cfg; +}; + +struct tegra_cfg * +tegra_cfg_get_by_name(struct device *dev, + const struct tegra_cfg_list *list, + const char *cfg_name); + +struct tegra_cfg_list *tegra_cfg_get(struct device *dev, + const struct device_node *np, + const struct tegra_cfg_desc *cfg_dev); +#endif /* __SOC_TEGRA_CFG_H__ */ From patchwork Mon Jul 1 15:12:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 809574 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2069.outbound.protection.outlook.com [40.107.236.69]) (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 DBC5C16D9B2; Mon, 1 Jul 2024 15:13:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.69 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846808; cv=fail; b=SHqmI4m+sAxTbmExUQ9zZ2R6n8fspK4aIY83qR9YxQ2MDGdO+ELctvRSBBD+a5/BwyVJMr8ECEQdrLgMIWiOj3qt2+ZIAA+DVeWs0AUsREoZDVTN590+njsKiSuMDQlrEk5OVAFsswu/nFz4UazDmChkoeLT2FzS4N0S70HpFVI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846808; c=relaxed/simple; bh=wnMFOqXtNuFqkDZpClG5MpN/ckKDRfertwJ3F0IY1l4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GlAoBSPi8jN/npbs/upuVqo9W6wqUl0g6DysSaHSR7EKRWxoqwXJ8B/ifykmKGRrpZX2PIKpc22sSNaf7P6BBoUky9rAITyYQ5+bLEi+UpcWc/QXXDGs6vwasIjhh+2N60NBxH2TZWRg8Fffj9Nx6w6jqYq9OsoKn8ZrxLOaW+w= 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=X6VmPBZ6; arc=fail smtp.client-ip=40.107.236.69 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="X6VmPBZ6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L604O5ItwoAdfxkZK3x1i5+bWwm+xEfUkb2sFY7i+E49MJ7tHSn13sEX/fOmk523vlkhit+Tg72v0ZZ49Dly2dXjRyGRfQxGvV7AhojqnPqwG6PoRxISDUQ1Gzun9xADiT+M4LXBAZTTdnBwRPDCraKkIBd329s0kzFda0y939qE4pPttvlKZogsPulbdYVvjq4U5h+4B8mEDi2/UEH8ib8gF5cAfgPKrAxSUvdqfM3Puagj7+0jI4zSPPck05NjoCKXbDxDfLmgC9QPb/4mnhZvzxLTe0FxmOSvilKUdtGJ7hPmKHRPOPhUxrQkWGBuDJe/a42S8qK0ZjfpF2GZjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Of4Aqm9lqHrzVFJZ1YNHf1b3uJXRTKcawqwHrZYIqmk=; b=iMBw2QxXved5kF5piPD+oBU3Ws58YiKQw2FVuvoSF7yCHJCmN8EmWLeMj+pp9KChzW/2156ek43LZGy05Hv/njM8VpLhRXjzBGjIO44nffiesZqZnl0Edb5hBoXJ3wsB9kQrcYIKZGIUW8F+1NSgSVCpEf7WwH3fYr7jDzP9cRAwnI7ZMPM0SlWxDyMhtyZ1KXz/qR30o8vBRspNF81IGY9HhHF9Ml+dUo9WzML2hJAVvfBqeMx6bCJfT4SdBRN54PR8sFbk/V1jbFZnKT8GKlfeAmiJR1yVU0norlfqOYsmylMz8ZYpgibrtxUHO2cHGopl8tAYGYBonGZknxtYzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=vger.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=Of4Aqm9lqHrzVFJZ1YNHf1b3uJXRTKcawqwHrZYIqmk=; b=X6VmPBZ6m/9TncDyC2UYguF0C40o/EvLCTU4k9QF5PPW0aqig8nabs74p9IqSWbWHGJKj4qWx4hjW3bT3zwJdrSS2hl2o8uemFahi0RMIN9V/Zra//XOOYgyfetgcuyj+QvL+2l8IURbmsxdarHG/Kb1BoOhg0TloCt6/Mr6YbJMP39Fd8BSK2KMWX9PsZRpnKefBeC0c2c4WhTJbpU5QA4DWe1IpN3++aOCEYqEI6hED4kjvIpHbA0cvBputmiFRZ3rjguYDW9ZA5V4N3hhOWAVEGqXMHftdlAZuNZNReWD6fPaq2eVbkxKXLZVSdQRGnsNoB/rXlejvXUShl8qaA== Received: from BL1PR13CA0366.namprd13.prod.outlook.com (2603:10b6:208:2c0::11) by DM4PR12MB5795.namprd12.prod.outlook.com (2603:10b6:8:62::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32; Mon, 1 Jul 2024 15:13:23 +0000 Received: from BL6PEPF0001AB74.namprd02.prod.outlook.com (2603:10b6:208:2c0:cafe::c1) by BL1PR13CA0366.outlook.office365.com (2603:10b6:208:2c0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.22 via Frontend Transport; Mon, 1 Jul 2024 15:13:23 +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 BL6PEPF0001AB74.mail.protection.outlook.com (10.167.242.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Mon, 1 Jul 2024 15:13:22 +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.4; Mon, 1 Jul 2024 08:13:05 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) 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.4; Mon, 1 Jul 2024 08:13:05 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 1 Jul 2024 08:13:00 -0700 From: Krishna Yarlagadda To: , , , , , CC: , , , , , , , , , , , , , Subject: [RFC PATCH V2 04/12] dt-bindings: misc: tegra-i2c: config settings Date: Mon, 1 Jul 2024 20:42:22 +0530 Message-ID: <20240701151231.29425-5-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240701151231.29425-1-kyarlagadda@nvidia.com> References: <20240701151231.29425-1-kyarlagadda@nvidia.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB74:EE_|DM4PR12MB5795:EE_ X-MS-Office365-Filtering-Correlation-Id: b02740cb-f360-46a7-0c5a-08dc99e0595f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|36860700013|376014|7416014; X-Microsoft-Antispam-Message-Info: 3S8l4Jz6lSlREr3p9le9hnDip10TRpljxDuD7NiK7mgiuzt6N6P2c0lyazSStZs3z3aetJOjK5GOmkj8ypijNFU0hqe/HJhFkeJ51UvjoWNhExIAHI4U9+np3qVtuFdAvmQduGZUyjuPpZXZ1O6a3RF/VlzQ6uQY/k2kw9SuJ/P+GWqTLUiCM85NYkTl911cQfE3V0Txdo1ABE6DNZz9NAxb1tVEcvb0ijAqhiCBn+k011UkDCfUB10g3CO7XU3Y4VK5E9m4fPuXpq2DEWTNW2RqbBV2EnkfM2jtMFnpSsDr2Tlujg0kw3zCq7IlvOyqZUjqwmD+lG921s1u/0JEgyPublC6mlYftPzgA3ZjVq3gFfD1t2J4lCotSfRtFbOZP2ZmsqTl0vc6Lq3gVaUjzLWFVhxdSVEeArQwxuii5qgAGqr8Q0wvMw6J1nVPpPj+bIKmvg1vMqDkA116qDNkiTSUL5AVYUbMqbUK96g0VAHFHyhEzoQCamkT2CGlnvLDiSOaRLWBBXoE09PttDZMyKB//OaStU26TgffiPXUAHTlsbodJq7diV3SAQKue6iupZKMzV51MBxaxfRA18r2Ar0Vt6ssVvz0Xj0+q0CDgSx5UGraVvenb9Cv0u3PIRAyyFza6RC+YJwuTq8eHKoBXYX9FRMqvIcZTkWkj+p5nZfpyKYmYDvZAk/UhCQvBenH1jxU95J0nv/6hXghLEzfkKz2Spxrr6mG6J81anBzTgOvPVHDf6gvt8AUfyXZJ3m4u6MD4xzPwJSJCw01UFYHtH/bOAV515jLaSuHBTkG+veU6bEsDfXtWcPdDqDldWGnINf1ZgNIeNN9f6csy5bI2pLGZX3g9cA/JD/OLKGUbvSijTocD/kaPWgY7DAiXAavXwXLZd76j3xriU02rwKUbDERVXoVbuXvD2e8c1cXfNGGwolcT3xOafPsbtDQnvH+AhGa7c5dVvwvd94jAl4Z55E/4s2JwHWyYk3FMfNBZqc3FoYLSAYT+7fA/x3BuRPkS23qXkEEAi83XTh+2KGCUgBxeJGaHqhT9WLxwE1naGkKBfRVE5Ss5wHSFHS5PfD1mqQMJ1QA0FRBkgqdH/KW9zYKuWy1SuWaRGBDpJk25IPtz/uZTrJBfee5oN+U3Tjdp0xGZEaUwmRKZk86pgMnwwZh/D8aY9MFLYpCx1gG8owkyx1lLz8cqrxzM3+Bcpk8YzXAdRZpeXuvcGXBVHSgJzOo5r+S20uRxpJ9C4T/GY2EmOBUAFyCXHA2mFkbJc5GkTXlv3zuXg0tK7AxkdyinYkU5j+9ZmrK5DDPB2ul0mSUu9qhu8djo8oyp5PfGmUKqw5DKV8QcZRz6qRBVgrNlP1zihh0KRWR131qCahdHPTwbwhIHljwkzIuiWA8TIkyr4kGwEklOMoFLEKtIkdaiLSTcqwgxsS8ybPusFJKUGo+gYiah9d/WE1DJt21bc72 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)(82310400026)(1800799024)(36860700013)(376014)(7416014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2024 15:13:22.9174 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b02740cb-f360-46a7-0c5a-08dc99e0595f 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: BL6PEPF0001AB74.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5795 I2C interface timing registers are configured using config setting framework. List available field properties for Tegra I2C controllers. Signed-off-by: Krishna Yarlagadda --- .../misc/nvidia,tegra-config-settings.yaml | 83 +++++++++++++++++-- 1 file changed, 74 insertions(+), 9 deletions(-) diff --git a/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml b/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml index 4e5d52504c01..5f4da633e69b 100644 --- a/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml +++ b/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml @@ -38,17 +38,74 @@ patternProperties: additionalProperties: false patternProperties: - "^[a-z0-9_]+-cfg$": - description: - Config profiles applied conditionally. + "^i2c-[a-z0-9_]+-cfg$": + description: Config settings for I2C devices. type: object - patternProperties: - "nvidia,[a-z0-9_]+$": - description: - Register field configuration. - $ref: /schemas/types.yaml#/definitions/uint32 + additionalProperties: false -additionalProperties: true + properties: + nvidia,i2c-clk-divisor-hs-mode: + description: I2C clock divisor for HS mode. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 0xffff + nvidia,i2c-clk-divisor-fs-mode: + description: I2C clock divisor for FS mode. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 0xffff + nvidia,i2c-hs-sclk-high-period: + description: I2C high speed sclk high period. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 0xffff + nvidia,i2c-hs-sclk-low-period: + description: I2C high speed sclk low period. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 0xffff + nvidia,i2c-hs-stop-setup-time: + description: I2C high speed stop setup time. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 0xffff + nvidia,i2c-hs-start-hold-time: + description: I2C high speed start hold time. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 0xffff + nvidia,i2c-hs-start-setup-time: + description: I2C high speed start setup time. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 0xffff + nvidia,i2c-sclk-high-period: + description: I2C sclk high period. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 0xffff + nvidia,i2c-sclk-low-period: + description: I2C sclk low period. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 0xffff + nvidia,i2c-bus-free-time: + description: I2C bus free time. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 0xffff + nvidia,i2c-stop-setup-time: + description: I2C stop setup time. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 0xffff + nvidia,i2c-start-hold-time: + description: I2C start hold time. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 0xffff + +additionalProperties: false examples: - | @@ -58,5 +115,13 @@ examples: nvidia,i2c-hs-sclk-high-period = <0x03>; nvidia,i2c-hs-sclk-low-period = <0x08>; }; + i2c-fast-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x3c>; + nvidia,i2c-sclk-high-period = <0x02>; + }; + i2c-fastplus-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x4f>; + nvidia,i2c-sclk-high-period = <0x07>; + }; }; }; From patchwork Mon Jul 1 15:12:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 808908 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2050.outbound.protection.outlook.com [40.107.100.50]) (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 A614B16DC0B; Mon, 1 Jul 2024 15:13:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846817; cv=fail; b=ROVg9vHW05Jt85dziBHvBYHof7ZfLU0bVoE626cpnXjNe38ASvHyQFnq2jZXnT89lvDiPSlwi7A4j6/vWRublv6mSfgYIbFcmxmr/8a3JGK1/plcJdVZvHyVNwErk9lR6S8o2Dyq78twJ4zba/cO3Ml+br5noa1vWcWBe//hxo8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846817; c=relaxed/simple; bh=XW8mdH21wzlU6H2Xg0pzxbzlnFyEK38ok+9uPeTTYXs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PbCsdjeUu+jAkg2td0nxxsNz04RTDZjFoSuzadC/cA8A0RRkEWKMoqw23uJfgxtaPITI+nNBCd0iRsv1COIe2duIlWiV1SpcNjkKSVY81dtOagP1WImDQ9Zv+GGAVF2U/9x3nH3+KTxIJL86c9rpmzTMOu4ywTuN0vtz2MPaV9U= 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=dimA/Oa+; arc=fail smtp.client-ip=40.107.100.50 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="dimA/Oa+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SbweC/IatyCQk2xuS8daLAcVEss5ugmq9xXOD/Az2Dl8Zs9ZlJxbjH/JDxni2fuVfXuMsnI3LIlF1OXSfbT3GcO2RTK/SVshhiLaybI0qp3oGUX95iYX/ml17rPFSiBcSb2fZdNDnaXkWS+L6ZD1CmmqPHrDTcQT4eN/Gxafb7hvOILDeclstgESwUYZYTNKn2JacYhlSaqxOE/Hh0H1fflkDIj8sBmbU7jQV8FeSmKoYYFlVm9s3VhvScVzkq8aKmiVFoQoi5/7u1/7G07xeKwkMDwjiJqMcsY7U5NRXtTKNemXEm+wwV3j7MyrrfL8KXS1VKQwMynxvE08n6IytA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=e3vge8b88HXiAUwzvg8+z/EYxU3BCZe+8cSXzzbmD9s=; b=CEImA1gvPqYg4jx3w47CKF9ZSiq34IE7ajQ74GfRPvuGynkvckVpYJFn4Srq75gomap0rxuS40Fp7TjTxdbZudz+n1WRjyGJOXlPDXBj4kSiH4bCDJJYa3O/oNQPDwkT7ZlsHeUEMEVkNfQALxq/mOiP8PwfmsyyD/ZnbcSnFOOocAXA68GCS8qli9G1ad1sHTAxlS/ui+cl7OevI/DGsA/61iUGImGTJKaJgoL6rvFEAuZGqL40wcGPMgEPtMk+YvkvKFw8EN/DNiWBh17k2STaSx6KPqOpfwbpdmIt3zmDvPfo7PPZJdchR/VHPHEwFVWk2EcltB/UZSmcQTxyfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=vger.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=e3vge8b88HXiAUwzvg8+z/EYxU3BCZe+8cSXzzbmD9s=; b=dimA/Oa+iZjyOaPHfHE0T3DGXrBim7fRikTUQ4E9B/7xc8CSAEqA1EC/DinE+qrU94DiJ41Qfxeo7JjNBDkgsEzP3eVa7fl3sfPvKXHdpeszaAvBhp0+1IkHWxW55mtWJa+nVT03qb7G4md9h6I8Qr/07nFf6/+h6ETTnbKSU9MCfIzMfxYyVyMKHdykEBLKInI+gM7zTmVl0gFmzk1FTMw3CyqZiv+0IWfz8FPNXdhYoFXQ3oHMO0XYQsM8kKkWp8BbigmNba+7OyzDA7JWgkyQY/sFZBgVurDwMwnbjkqGqDoSr4SGaKG6/L9jyUxO85kQHI4BEyk5paiADWRBCw== Received: from MN2PR12CA0001.namprd12.prod.outlook.com (2603:10b6:208:a8::14) by CY8PR12MB7098.namprd12.prod.outlook.com (2603:10b6:930:62::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.29; Mon, 1 Jul 2024 15:13:30 +0000 Received: from BL6PEPF0001AB78.namprd02.prod.outlook.com (2603:10b6:208:a8:cafe::f0) by MN2PR12CA0001.outlook.office365.com (2603:10b6:208:a8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.33 via Frontend Transport; Mon, 1 Jul 2024 15:13:30 +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 BL6PEPF0001AB78.mail.protection.outlook.com (10.167.242.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Mon, 1 Jul 2024 15:13:29 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) 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.4; Mon, 1 Jul 2024 08:13:11 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) 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.4; Mon, 1 Jul 2024 08:13:10 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 1 Jul 2024 08:13:06 -0700 From: Krishna Yarlagadda To: , , , , , CC: , , , , , , , , , , , , , Subject: [RFC PATCH V2 05/12] dt-bindings: i2c: tegra-i2c: reference to config Date: Mon, 1 Jul 2024 20:42:23 +0530 Message-ID: <20240701151231.29425-6-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240701151231.29425-1-kyarlagadda@nvidia.com> References: <20240701151231.29425-1-kyarlagadda@nvidia.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB78:EE_|CY8PR12MB7098:EE_ X-MS-Office365-Filtering-Correlation-Id: 653e2289-c98d-4d0e-b0f4-08dc99e05d7c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|376014|7416014|1800799024; X-Microsoft-Antispam-Message-Info: HseA7DJQMAPDVcvr47G3Nu+3QJB97jvweeyYWwLl7NHuzulbhLYTQnc2SrmRJHB1ZZOIJkoRjD+jKXV1+2HuOIYRhlC4X06RuFCxZ730p9XwRXGGRedqNO4hd43+B/NsdPbYQRz1dAkNqPgA+8m3itN9+FwieeWv800X/CihTKX7PwnqgKr0IfDQPUNJRchrzQNLa3dWiqPxYDJDCegCcTAOtmHX8w97dkzpSTlOqaCP+KZ5A4Wkg0VoJv6lrSRU4xQsfuUqlgBTED5SEjef098RL3usAQsjfWsLfHFqFfbfXYgO8Yr7qIoQOFejrHG5DVXcaggGt15R7EsmHh2a0VMH9/lQiKFnN6fMBEr1mJgSZpSrjiMF9bSqGL9y/wdbzNle6+lEZsoNxMOL6n03bH/h+O/Wcez8Bx43vHMUiYBBaJ+n6M5xm79J1ue/xEjCo2+mzCEu92C1PhdyLF+iO6/qnx6VwSuS5OdjKYkZHuEuqSELN6uYfjE0G0HyOR0umBryefdc2UV/POrZ353PhUySFVXE1xSrqhJE3Kwn3lIy3HOopupa8A9zTI6IruUDOJ+e7F7On/ce5pzOR7+rs6VF2pdV523OdHOgEqB2o+4b0emwrXJSF+pksg/L1qAel/x2wA6cXOqm1kFG+2okZBNHwPbJK+Cl5CWbxwlb+UiLAc+N0bxjEMQEtmKSNggTyucMJdHaia0FyswfcaYCatOaTfWL5NM4B4BQlvJiDO9tfc0f2RXOUWgbGOPt+0oCqBpXMh4mU0S2/2dhHU/UrnVmJtFb9qb2oxrgF2C04eDkDlDd/LYHVpxiYfgzbVX9zCdOVG5/ZxaedrbvI4upnKN5lfDgMqxaqRoCWgIg056QXP21peZaW5UM8evU9aUhvBt89+iJbWWRVE/HockMseB/2pbdfxW+7rS74fA+pJ/zev0tegfUURBDa7xTJNJacsNoEPfDb+huCLhKy1dJ6n/eyhbQNdEablATSibd35myeGpWMdyB/9Ed9ZfAszBNcMZ8ARsVP7CtQIdbrINjQsOqGAcxasgtoexhFReqgK/naTAqDP4UBPzmIfvfQSzJTH3UdnCLvn8FnDdfbIpoZgLNSWNX4nmZbQNqxUAkHW4Gmwb1mm8X3HiR//OC2KV7fBHJyQmlNfqLN70U8Nq1zY+l9HXSsb/YsKt8BS3vYZbjdF06+kjGj7l+0wshHwgSmx4jPNj3WCL66GCmni7Xd6IId1S3pv8ez164a+5iahsjafnK4qXsR+bR6bp3rvITycieV6kaFp+2g5kJWvWdHqug/yaJRJh2TXb6VnVPvLoSeakmnDpLhZrPEdUD8u6xC1fQJ3R43Hx11/e3ALxg6gAODRgFuZnlDs4ZeIyd78mbeucC2K9dqBT0lHXq5DVh437qBp+ef6ASJd5ONn0J+KtelZR/yguzlm3wJuhANKc1y5XYFB7+nOgAoInqH6Ru 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)(82310400026)(36860700013)(376014)(7416014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2024 15:13:29.7287 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 653e2289-c98d-4d0e-b0f4-08dc99e05d7c 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: BL6PEPF0001AB78.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7098 I2C interface timing registers are configured using config setting framework. Add reference to I2C config settings. Signed-off-by: Krishna Yarlagadda --- .../devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml b/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml index 424a4fc218b6..2f6f12149876 100644 --- a/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml +++ b/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml @@ -119,6 +119,11 @@ properties: - const: rx - const: tx + config-settings: + items: + - description: phandle to the i2c configuration settings + - $ref: /schemas/types.yaml#/definitions/phandle + allOf: - $ref: /schemas/i2c/i2c-controller.yaml - if: From patchwork Mon Jul 1 15:12:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 809573 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2083.outbound.protection.outlook.com [40.107.94.83]) (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 CD30316CD23; Mon, 1 Jul 2024 15:13:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846821; cv=fail; b=VCxqzkV456wMghQazaucQYK9hRfC1SePdjue6HD9n77VmXuzpWLYGgiQgjXuWj6I0vPt/vsj8W49EwOVjclnqR/qloi9nxIPHUz3SgaxAQ95ZeYVQVBsiOmRrH0l9kGOWR5i78ydLcYhOuUpTFHcydB4yJq9nK4oboU9q5mn1xo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846821; c=relaxed/simple; bh=iBX/Ign0ibZ2cJo5H4xOwNyhcHnttHXJDUWTRrucGnk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YloDj6jj+LLG3gMJyMtTSyDV0w2XnenFyJCKHxILAIOVUz1DTMSZbsAXBx8QVDKulPnIGuk4Eu/KqSXopvhTvqtGfWRIflSIlxkyDH5arfl6vaGPIAjqanLT6NKPrQZqli7ARI7mxKjHY9/dXPyn7LxQnVMkPnJ2bIWbRruexs4= 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=UAjgHxTp; arc=fail smtp.client-ip=40.107.94.83 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="UAjgHxTp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HVeY1ysOjz0f30Lke1JY5YsIJiVIHj/WEnxHyoNQJ5gL/QMypNwNV1RJm0K2t/tBQzUQvv5Zb6bmNrfY3DI0eR3nfJzHDZiJ4ATEKe41WDJTMgMTQX9LQ6lrwsiOzC6nFuBDFPGh0falHFloebiDQhxpF2QdXvbrj/lhOHd1ltavsn7SRRMQlCHvN1BeUZMceOMmy6yBb4QSlOVcR3kBJbJdrQbAPodL0ENL96FaPtpKgoHSphxqx/Adlqdr6eqA3pArCajiYihb/o1X0u74ICRJxFDJCKLnARDUAeRGI0uzY2j7EmPafCMcQfTA4cb1JEH8QQ8AUeunmt5VICBX2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=WFZD/oaACHTDbMFEGbqUivhtJCQ+tYY8GI/iakxP/jg=; b=EevawNE8evsz6E28jMp22mkZRHS6AmTcHiqyU6+ptqZIUrDhbbobwLCDes9aisrJWooZs6c60zvahH3O3UA+6E7yg6WOCMnVEhrhRC5G/LrXdBpOQx4HWka68QYgPtVyWPN8DWx9ikST5qCQzcri/4W3fcq/d1hMr7i5ugPwtlrmDwLx3cMgRh8SfdIpRAwQyU6Is3ukjSFYa+pyfptPaEVQ7MIW7LJb/u7gQnu/Z/3jldQ0ASkpl2IQNCyAwqVN6iB+36YXgsEpmkPU3NLtDjfZ53kORaMLSfOanl6sNDX/mpHcLwMsPxk3dM/v+IbFmfOHxzyiZ0Vve5zcK89M8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=vger.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=WFZD/oaACHTDbMFEGbqUivhtJCQ+tYY8GI/iakxP/jg=; b=UAjgHxTpL4uODQzNIgzo4nWghNHoavp5hWvzPdlhhVAvRcPMYcjpHEfO5RxD0NLrLyztF3vuWGAuC2Ud9fduRKYMWMKJTa90ZDvzAE/e+oyLfZToTXNztdcxzC7y0hd95qHQlXR07yibRCkkx+F0vtQfpY9/C8rnVq83PB+Tep1dp51D4cem/NeAnzsMVfsRJuDElr/vK9xYfq9nopMGrWShlluffD6gv7Uhp73R8u0+2HM6nWxWFxI3kzdG7ZlLIP/JzV2dDGB340CM4eq+3zmgTBlWFY+AjYTVXeWDw/boLgbQSXHkVnKDiWxqKEgpRxphVfebl1Y17QU+O2U3Cg== Received: from PH8PR20CA0006.namprd20.prod.outlook.com (2603:10b6:510:23c::11) by DM4PR12MB7525.namprd12.prod.outlook.com (2603:10b6:8:113::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.29; Mon, 1 Jul 2024 15:13:31 +0000 Received: from CY4PEPF0000EE3D.namprd03.prod.outlook.com (2603:10b6:510:23c:cafe::c7) by PH8PR20CA0006.outlook.office365.com (2603:10b6:510:23c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.33 via Frontend Transport; Mon, 1 Jul 2024 15:13:30 +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 CY4PEPF0000EE3D.mail.protection.outlook.com (10.167.242.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Mon, 1 Jul 2024 15:13:30 +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.4; Mon, 1 Jul 2024 08:13:16 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) 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.4; Mon, 1 Jul 2024 08:13:16 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 1 Jul 2024 08:13:11 -0700 From: Krishna Yarlagadda To: , , , , , CC: , , , , , , , , , , , , , Subject: [RFC PATCH V2 06/12] i2c: tegra: split clock initialization code Date: Mon, 1 Jul 2024 20:42:24 +0530 Message-ID: <20240701151231.29425-7-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240701151231.29425-1-kyarlagadda@nvidia.com> References: <20240701151231.29425-1-kyarlagadda@nvidia.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3D:EE_|DM4PR12MB7525:EE_ X-MS-Office365-Filtering-Correlation-Id: 9bad22a1-d8d9-4bfa-a7c5-08dc99e05ded X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|36860700013|82310400026|376014|1800799024; X-Microsoft-Antispam-Message-Info: pSQQOqOs2t/nvwRVj94Al1+idUNNZxt+1uvlmo19XukNve3IC+NJ5Z9dzlnVSJv/OGpuVDXLOMWDCQgWDs1M/7vrtn16hLeWtKP9k9n7yNecDFKc+MyNN5H1HBYxnRorvJAXlmhdehe6H76ZA/AjUqjQ2V7vhDsJyZf/7J5T7URSCHb5kYMh+LBFW2qhomzYaOoRScNaWM0Grce5p2vCn6kabE6Ted0GOZeYaOVfOSaWe4emb3o2s9YpfznZp4KEiFwaMZ9rQ9yI/6RXPe3eM5ZK0Gvf0zbEBi0bV/ETl5HZvD3KGBAJTiS9ip1+Pfs0U3aaEPgwd3NUTzdFSqIvUT/Xd3JYMp7N1+29yOksvbxOSASuyuVhfrcgffqMUolkWbxFMfcMQ3fXL0RsXQ+8AXljWc7wPKbCL3aWlSnqm7b5biT5T2Pos7B0vJOmFEynxUfJXWTFsScstVzZOrzktECXDALa12aD4CVhRK4DwOMDWnj95LwWUnRZqKjKib9F/3Q6Nb7KdR2Shw7d2KrVnpyIKxSQts26EiDxADXyhYEzFII8jPYp0iXaqlG/HawnviIY8yQIYuiDCb73OgreEYbUVO8BHESVPUTA245E8NMkeKGyXb0Cjysn8BjIOaqqCG0+rcfSN3GxwEswmNoVnHb85LiJa2kwtvqgnrYVn2tkSbmGCy+rIbZkDUUUZEu0PZrxLJewsavGFkA73sCFTmYcqg9urZ+PbYygYW20KXp6liu5xqpaTgmVTDlEQcvrOHFQQPj1lpcax3UWJ9oYAVqxEoRo7+EBMCFfkfk7kOhSI6zpR8q1L6t6Fq3ZcvPowlvdzvB1iTBqrAChOvYQwdHP5iawiQVLtAOzuV7SmZ13yrkihJOkbnaBgJW5SCDNsyViJ7sud01oYAsgbS2/lhugZ9fKMmLjr5IOGsLff1OwIUp3xSZWs2UnG2wfvIlv2Bq1yF820rIRIElmH3PvTM15urz9qq0TXr/0wIZlhbTnkZJHm1ov3+33mkScryLMg+AsXNo/9dYOLMYHfeqcWq/oBpN0fkBdEUda47HefQbjVQDlYY6gFchBBy5HsW4+71YDU5ANuOkqJNFTHuejk/t6g/tfxZbS06imBcxLcnP19et1S7kbFXU+FpHXcOyPsRwi2f4w9fLlaFLyUzp/aDTKBJhaQLuCf8QN1bJxf8/km+0EuB7ElRA0n/rBTGDzldAKHRv9+nZVsXDWCHaRBJPCmp0braHMXr5sdizXRqnHxO8ZUuYI/9lODvhkJNvZ9FUF8Bs4IEnKfzUvh8L+wjqARsxPksMHiY4FdHmg0skuATxCvUq0JE+ZhvEQJ+GtX2xPXfAf5ABBTpIIhhdLrwLzUp0r4iUTa3P/U5fqfO8BTjOf5RVUvaQ6jZgHvadIC3SluzbbXLlM9+EqJHfoBAiGWQn+n2EQAzuoSXy2qVGx8D/c5YwtFx9kc+gNCPwY 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)(36860700013)(82310400026)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2024 15:13:30.5472 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9bad22a1-d8d9-4bfa-a7c5-08dc99e05ded 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: CY4PEPF0000EE3D.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7525 Add new methods for setting clock parameters and setting clock divisor. Signed-off-by: Krishna Yarlagadda --- drivers/i2c/busses/i2c-tegra.c | 127 ++++++++++++++++++++------------- 1 file changed, 77 insertions(+), 50 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 85b31edc558d..b3dc2603db35 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -604,12 +604,83 @@ static int tegra_i2c_wait_for_config_load(struct tegra_i2c_dev *i2c_dev) return 0; } +static void tegra_i2c_set_clk_params(struct tegra_i2c_dev *i2c_dev) +{ + u32 val, clk_divisor, tsu_thd, tlow, thigh, non_hs_mode; + + switch (i2c_dev->timings.bus_freq_hz) { + case I2C_MAX_STANDARD_MODE_FREQ + 1 ... I2C_MAX_FAST_MODE_PLUS_FREQ: + default: + tlow = i2c_dev->hw->tlow_fast_fastplus_mode; + thigh = i2c_dev->hw->thigh_fast_fastplus_mode; + tsu_thd = i2c_dev->hw->setup_hold_time_fast_fast_plus_mode; + + if (i2c_dev->timings.bus_freq_hz > I2C_MAX_FAST_MODE_FREQ) + non_hs_mode = i2c_dev->hw->clk_divisor_fast_plus_mode; + else + non_hs_mode = i2c_dev->hw->clk_divisor_fast_mode; + break; + + case 0 ... I2C_MAX_STANDARD_MODE_FREQ: + tlow = i2c_dev->hw->tlow_std_mode; + thigh = i2c_dev->hw->thigh_std_mode; + tsu_thd = i2c_dev->hw->setup_hold_time_std_mode; + non_hs_mode = i2c_dev->hw->clk_divisor_std_mode; + break; + } + + /* make sure clock divisor programmed correctly */ + clk_divisor = FIELD_PREP(I2C_CLK_DIVISOR_HSMODE, + i2c_dev->hw->clk_divisor_hs_mode) | + FIELD_PREP(I2C_CLK_DIVISOR_STD_FAST_MODE, non_hs_mode); + i2c_writel(i2c_dev, clk_divisor, I2C_CLK_DIVISOR); + + if (i2c_dev->hw->has_interface_timing_reg) { + val = FIELD_PREP(I2C_INTERFACE_TIMING_THIGH, thigh) | + FIELD_PREP(I2C_INTERFACE_TIMING_TLOW, tlow); + i2c_writel(i2c_dev, val, I2C_INTERFACE_TIMING_0); + } + + /* + * Configure setup and hold times only when tsu_thd is non-zero. + * Otherwise, preserve the chip default values. + */ + if (i2c_dev->hw->has_interface_timing_reg && tsu_thd) + i2c_writel(i2c_dev, tsu_thd, I2C_INTERFACE_TIMING_1); +} + +static int tegra_i2c_set_div_clk(struct tegra_i2c_dev *i2c_dev) +{ + u32 clk_multiplier, tlow, thigh, non_hs_mode; + u32 timing, clk_divisor; + int err; + + timing = i2c_readl(i2c_dev, I2C_INTERFACE_TIMING_0); + + tlow = FIELD_GET(I2C_INTERFACE_TIMING_TLOW, timing); + thigh = FIELD_GET(I2C_INTERFACE_TIMING_THIGH, timing); + + clk_divisor = i2c_readl(i2c_dev, I2C_CLK_DIVISOR); + + non_hs_mode = FIELD_GET(I2C_CLK_DIVISOR_STD_FAST_MODE, clk_divisor); + + clk_multiplier = (thigh + tlow + 2) * (non_hs_mode + 1); + + err = clk_set_rate(i2c_dev->div_clk, + i2c_dev->timings.bus_freq_hz * clk_multiplier); + if (err) { + dev_err(i2c_dev->dev, "failed to set div_clk rate: %d\n", err); + return err; + } + + return 0; +} + static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev) { - u32 val, clk_divisor, clk_multiplier, tsu_thd, tlow, thigh, non_hs_mode; + u32 val; + int err; acpi_handle handle = ACPI_HANDLE(i2c_dev->dev); - struct i2c_timings *t = &i2c_dev->timings; - int err; /* * The reset shouldn't ever fail in practice. The failure will be a @@ -641,54 +712,10 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev) if (IS_VI(i2c_dev)) tegra_i2c_vi_init(i2c_dev); - switch (t->bus_freq_hz) { - case I2C_MAX_STANDARD_MODE_FREQ + 1 ... I2C_MAX_FAST_MODE_PLUS_FREQ: - default: - tlow = i2c_dev->hw->tlow_fast_fastplus_mode; - thigh = i2c_dev->hw->thigh_fast_fastplus_mode; - tsu_thd = i2c_dev->hw->setup_hold_time_fast_fast_plus_mode; - - if (t->bus_freq_hz > I2C_MAX_FAST_MODE_FREQ) - non_hs_mode = i2c_dev->hw->clk_divisor_fast_plus_mode; - else - non_hs_mode = i2c_dev->hw->clk_divisor_fast_mode; - break; - - case 0 ... I2C_MAX_STANDARD_MODE_FREQ: - tlow = i2c_dev->hw->tlow_std_mode; - thigh = i2c_dev->hw->thigh_std_mode; - tsu_thd = i2c_dev->hw->setup_hold_time_std_mode; - non_hs_mode = i2c_dev->hw->clk_divisor_std_mode; - break; - } - - /* make sure clock divisor programmed correctly */ - clk_divisor = FIELD_PREP(I2C_CLK_DIVISOR_HSMODE, - i2c_dev->hw->clk_divisor_hs_mode) | - FIELD_PREP(I2C_CLK_DIVISOR_STD_FAST_MODE, non_hs_mode); - i2c_writel(i2c_dev, clk_divisor, I2C_CLK_DIVISOR); - - if (i2c_dev->hw->has_interface_timing_reg) { - val = FIELD_PREP(I2C_INTERFACE_TIMING_THIGH, thigh) | - FIELD_PREP(I2C_INTERFACE_TIMING_TLOW, tlow); - i2c_writel(i2c_dev, val, I2C_INTERFACE_TIMING_0); - } - - /* - * Configure setup and hold times only when tsu_thd is non-zero. - * Otherwise, preserve the chip default values. - */ - if (i2c_dev->hw->has_interface_timing_reg && tsu_thd) - i2c_writel(i2c_dev, tsu_thd, I2C_INTERFACE_TIMING_1); - - clk_multiplier = (tlow + thigh + 2) * (non_hs_mode + 1); - - err = clk_set_rate(i2c_dev->div_clk, - t->bus_freq_hz * clk_multiplier); - if (err) { - dev_err(i2c_dev->dev, "failed to set div-clk rate: %d\n", err); + tegra_i2c_set_clk_params(i2c_dev); + err = tegra_i2c_set_div_clk(i2c_dev); + if (err) return err; - } if (!IS_DVC(i2c_dev) && !IS_VI(i2c_dev)) { u32 sl_cfg = i2c_readl(i2c_dev, I2C_SL_CNFG); From patchwork Mon Jul 1 15:12:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 808907 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2058.outbound.protection.outlook.com [40.107.92.58]) (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 8A67916DC29; Mon, 1 Jul 2024 15:13:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846823; cv=fail; b=TaRnq8TuDFCVmiEGV8+2aOyp9FA9DADTm+Co29xgstWnmvsa2KsoWSgROQl1b6aleE+iuJ2H5efxn2FZVzVA3pFhrfYMjx3Ywd1ismdyfu68vj9soSyzdH0pl3qp6KXVOZFFUlTsF5LDZPxa5qjb4J+zX9FX9BhWUG+JBUOU1nI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846823; c=relaxed/simple; bh=E117bRPM0/tqqPpnK5FdqynKoa64sKvJOX8lCbgr/30=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=C7xdHqwMf5evO/gs302hzzbydnIXyxtDdqmffTpNQCA6+uHHlUb46iRMBk8TRqTnizkK3G15N59RVKj26o1b5wL4J5/S/GTqZa04DlfdpoMY/ekY+mbzUq3KfJZxemKFxxX6a27QXKgi+pLclwjlVyS4+Uo8U1hRgqDz728c0Go= 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=dCV2wnZX; arc=fail smtp.client-ip=40.107.92.58 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="dCV2wnZX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NcC7+5zTxA1rKxDt7E0D4ix28lRO21PM4YplXplzD17MG5vkg7Cjv9QSRMn/svy8XKiCrWFE1IBj7gSSBdkL3enKEdU9yRAUZYuPDVFDQq3dVAZ+PZcBRAC2pjb1fR7ddQYkk6tC/k1cK0VLXTQpKWkBnTNrRyzI2mWN3coh5ZgUGz+3fF2o34dm37/9WY2KWmoOpg5g8HT4f0pBRk0Agi+3IAVUxAIDuLOlBvWWD+21MkCctCi6tPUzynfrB+S2V5TfOKC0eqCWpPJG3ZNPY29j7auuislI7AJbZdHV70jLyuTAAmhffDzxhnAlh85Raxpy3ieND9yczykH4xyfVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=aHs8yPVIxrSWZhhJmWV3PS33Ay9zxIOEsmii6bPK1T0=; b=BrZ8IJkNlE+yyqnZJKIYVxAyTfaZaJfJNyNyf1/q4HPNnwcrMHtEtTM+ti6HVQxXL53D0bQXg6z8b58FCoINJzWLPLWNYqjA87Yl34KS5ngAwV2t61fgP7EvlWu1xnwuECG7JbPgpBepD8DK6kN5h7Trb3OjgvqmFhssbCba7xJ62PPTSH2PkJ+ZNAad5ROhAty8WZVn8zA81+qRnslQ19u+nhahyrySNi2PjRztJqW0GSBLF+Z056EvWCJyz2xNm7xqeT+uU7lSfJP1L6Ns9J2u4pZq92D1g0NjQ1C0hfZ/jFSX468Karg42m2Pzj4BViMw43PdNgvjwIiHxOtyAA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=vger.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=aHs8yPVIxrSWZhhJmWV3PS33Ay9zxIOEsmii6bPK1T0=; b=dCV2wnZX5JOs29doD6KMDQCT9jFC3YeTzOq8jm+af9P0ZvSIW8z5ppTJThAG3QFPX5yvK62eMeqDVpDoAaoyRlLm/xL+AXOkGKD+1aYWKivwYtWeMpN1lxf4McvO88sO/GB2JCO3pAmG0JTVldDI9j0hbzsMW1ibMdzYLhMw834t3kHHGbSerecL/tx1IsxvtmDv6zJoORUY6L1tG0Z0mCm/u13/zf3GY491vHPOGBbiREsRmeSLzQP0B+hGhiYfx41Lp+55Pi+VwsBFkrDLj3H5UIiSGNyeORJMlsEQJTnwFli3lMeKtEfgEoe9CNHtj3bjXXu4Z4zpQ6IVbpWlnw== Received: from PH8PR20CA0012.namprd20.prod.outlook.com (2603:10b6:510:23c::10) by CH0PR12MB8461.namprd12.prod.outlook.com (2603:10b6:610:183::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.29; Mon, 1 Jul 2024 15:13:33 +0000 Received: from CY4PEPF0000EE3D.namprd03.prod.outlook.com (2603:10b6:510:23c:cafe::a6) by PH8PR20CA0012.outlook.office365.com (2603:10b6:510:23c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.33 via Frontend Transport; Mon, 1 Jul 2024 15:13:33 +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 CY4PEPF0000EE3D.mail.protection.outlook.com (10.167.242.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Mon, 1 Jul 2024 15:13:32 +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.4; Mon, 1 Jul 2024 08:13:22 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) 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.4; Mon, 1 Jul 2024 08:13:21 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 1 Jul 2024 08:13:16 -0700 From: Krishna Yarlagadda To: , , , , , CC: , , , , , , , , , , , , , , "Akhil R" Subject: [RFC PATCH V2 07/12] i2c: tegra: config settings for interface timings Date: Mon, 1 Jul 2024 20:42:25 +0530 Message-ID: <20240701151231.29425-8-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240701151231.29425-1-kyarlagadda@nvidia.com> References: <20240701151231.29425-1-kyarlagadda@nvidia.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3D:EE_|CH0PR12MB8461:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a24cd01-fc4a-4f06-bebd-08dc99e05f49 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: L1eqMvXIxoMdWo9VhrMcoUkW0cTSXi4UXu0tsSgA3pfh4nC3ykqhCzIlhrq+3n7nXBpiRR3pzWZqvAZIKhU/MBRY2nzTCraqInV1K1ezTTi4aCMxDJR84Ci9CVllLIUAHIV/P7iHe0Fq5T1vKaOENXEqqCKmeI+lK3grhFmxFnIPAZFNC8eyTluISH7u5oeL0L1NybA7W/sAHqYFcB4vTWAEsp2OrWoeTP19nukrkJpIDdYmU4W2blU364w9qlfL3j3rNcre/W+hhmYNcIOt3gBV8TZaxhHQ8JZ+6fa96d5kgyE5whRq66Vppt+Hj6YIszCXw0n40egkgSGxjMB5017XTNDZUYgFtX25oYos49IF3rY8Z4wAr4UXyqsnN1rBZbXzpHt7t2Dxvjz2MjwJY1J5YPBPzxPlrBhfVdsPG63Z9Kpf62KQK4NyH5V0B3OPqHu5NjznXBlS335f8cZ8ybKeD4h0xG0MTG4m/KN4CQ1mlHyilIjP9ySFGPw8GoNGVD5B+a8cpfiGKrBET7b328GV0qJ1S/9VEu1sLFHkfaoCpsiPS73VEWvO/REEezOluRvvuv2fRHKaRwpEi41AYuluZOzD8EdYahKF2JiZk6YxlIv1u2jkFRB4siO0hK9koEGAmoDIvR+2nbgdmZpg6qBEZojAVS47crXN53YRtpIK6Mz0Sye9PYxMGIHOwDpOnOQ0xYILZJyUZOkKnhHLvEMlLsp/6bxStFOMswcYeTVxyMkBTrnqRHjz1fw5U7+vxGJyrSdUZdb6tPx2ygFomJd7rw/6CokSKNlfItdmDPvmx5ZdzzcL2nCO1FpZt9ubV0F22HAKl32yhW+ER7gM38d6JVAOU+89rMpWW/4XBtosXgeFH3yQ8mMLrMbtlBLbDlG4XhMDSCueMIbWfX+i13zPJrTR/7WxTZnDNgeDcnQio9eTiikha2OSTsNjk/ARfm16oUCHkl66lFF0u+DzOJcpQ5lnNrhvNkmxaCuKy6GKSfg9EI67DPryiA+yedjqk2Uqdwx7yvtlw0jmJM8XeOvszF4rjpJK6ZEHGTtKWUehaGmzD90GpW6iKJjRhEIWfcQf2xKrta1mtzHS1u/Uq03lYUw5aPxH6fgTk47p79Fxx8gKxwif/nRMNj7rVCHKrrzJ/NIiJjjZ9onuyq9UHXbtvXKitchqfJ2CLnk2yfYcSZW56GElXkMHdaTlaR3D4+h/Q9py1V8GEaorAX3uzfJSxEKFQRjOdOCpsKyvIliMEDdudgt+GZwT4FdkVy0wM9SsThS9lsBWZtdsHLd/dFHI8g/00qrXR8KmEbXrWlf/FwXZz28XdDLVN+7DWF7pCggq5vDAs6gt6xSyho/gtlYN48igEaqEWk55hHO/hP8COtcdhkAPoTLLgwxzwj5KyCeeN6l47+jyq0sjQ/BTrjuieVybi3NMbk4b5ili7/rEyg3atD6fq9ve3+QLraBo 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)(376014)(7416014)(36860700013)(82310400026)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2024 15:13:32.9222 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7a24cd01-fc4a-4f06-bebd-08dc99e05f49 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: CY4PEPF0000EE3D.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB8461 Use config settings framework to initialize Tegra I2C interface timing registers and clock divisor based on I2C speed modes. Each speed mode uses predefined configuration for interface timing and clock registers. Signed-off-by: Akhil R Signed-off-by: Laxman Dewangan Signed-off-by: Krishna Yarlagadda --- drivers/i2c/busses/i2c-tegra.c | 134 +++++++++++++++++++++++++++++++-- 1 file changed, 129 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index b3dc2603db35..b81925576060 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -28,6 +28,8 @@ #include #include +#include + #define BYTES_PER_FIFO_WORD 4 #define I2C_CNFG 0x000 @@ -108,8 +110,9 @@ #define I2C_MST_CORE_CLKEN_OVR BIT(0) #define I2C_INTERFACE_TIMING_0 0x094 -#define I2C_INTERFACE_TIMING_THIGH GENMASK(13, 8) -#define I2C_INTERFACE_TIMING_TLOW GENMASK(5, 0) +#define I2C_INTERFACE_TIMING_THIGH GENMASK(15, 8) +#define I2C_INTERFACE_TIMING_TLOW GENMASK(7, 0) + #define I2C_INTERFACE_TIMING_1 0x098 #define I2C_INTERFACE_TIMING_TBUF GENMASK(29, 24) #define I2C_INTERFACE_TIMING_TSU_STO GENMASK(21, 16) @@ -117,8 +120,9 @@ #define I2C_INTERFACE_TIMING_TSU_STA GENMASK(5, 0) #define I2C_HS_INTERFACE_TIMING_0 0x09c -#define I2C_HS_INTERFACE_TIMING_THIGH GENMASK(13, 8) -#define I2C_HS_INTERFACE_TIMING_TLOW GENMASK(5, 0) +#define I2C_HS_INTERFACE_TIMING_THIGH GENMASK(15, 8) +#define I2C_HS_INTERFACE_TIMING_TLOW GENMASK(7, 0) + #define I2C_HS_INTERFACE_TIMING_1 0x0a0 #define I2C_HS_INTERFACE_TIMING_TSU_STO GENMASK(21, 16) #define I2C_HS_INTERFACE_TIMING_THD_STA GENMASK(13, 8) @@ -226,6 +230,49 @@ struct tegra_i2c_hw_feature { bool has_interface_timing_reg; }; +/** + * I2C register config fields. + */ +static const struct tegra_cfg_field_desc i2c_cfg_fields[] = { + TEGRA_CFG_FIELD("nvidia,i2c-clk-divisor-fs-mode", + I2C_CLK_DIVISOR, I2C_CLK_DIVISOR_STD_FAST_MODE), + TEGRA_CFG_FIELD("nvidia,i2c-clk-divisor-hs-mode", + I2C_CLK_DIVISOR, I2C_CLK_DIVISOR_HSMODE), + TEGRA_CFG_FIELD("nvidia,i2c-hs-sclk-high-period", + I2C_HS_INTERFACE_TIMING_0, + I2C_HS_INTERFACE_TIMING_THIGH), + TEGRA_CFG_FIELD("nvidia,i2c-hs-sclk-low-period", + I2C_HS_INTERFACE_TIMING_0, + I2C_HS_INTERFACE_TIMING_TLOW), + TEGRA_CFG_FIELD("nvidia,i2c-hs-stop-setup-time", + I2C_HS_INTERFACE_TIMING_1, + I2C_HS_INTERFACE_TIMING_TSU_STO), + TEGRA_CFG_FIELD("nvidia,i2c-hs-start-hold-time", + I2C_HS_INTERFACE_TIMING_1, + I2C_HS_INTERFACE_TIMING_THD_STA), + TEGRA_CFG_FIELD("nvidia,i2c-hs-start-setup-time", + I2C_HS_INTERFACE_TIMING_1, + I2C_HS_INTERFACE_TIMING_TSU_STA), + TEGRA_CFG_FIELD("nvidia,i2c-sclk-high-period", + I2C_INTERFACE_TIMING_0, I2C_INTERFACE_TIMING_THIGH), + TEGRA_CFG_FIELD("nvidia,i2c-sclk-low-period", + I2C_INTERFACE_TIMING_0, I2C_INTERFACE_TIMING_TLOW), + TEGRA_CFG_FIELD("nvidia,i2c-bus-free-time", + I2C_INTERFACE_TIMING_1, I2C_INTERFACE_TIMING_TBUF), + TEGRA_CFG_FIELD("nvidia,i2c-stop-setup-time", + I2C_INTERFACE_TIMING_1, I2C_INTERFACE_TIMING_TSU_STO), + TEGRA_CFG_FIELD("nvidia,i2c-start-hold-time", + I2C_INTERFACE_TIMING_1, I2C_INTERFACE_TIMING_THD_STA), + TEGRA_CFG_FIELD("nvidia,i2c-start-setup-time", + I2C_INTERFACE_TIMING_1, I2C_INTERFACE_TIMING_TSU_STA), +}; + +static struct tegra_cfg_desc i2c_cfg_desc = { + .num_regs = 0, + .num_fields = ARRAY_SIZE(i2c_cfg_fields), + .fields = i2c_cfg_fields, +}; + /** * struct tegra_i2c_dev - per device I2C context * @dev: device reference for power management @@ -288,6 +335,8 @@ struct tegra_i2c_dev { dma_addr_t dma_phys; void *dma_buf; + struct tegra_cfg_list *list; + bool multimaster_mode; bool atomic_mode; bool dma_mode; @@ -340,6 +389,16 @@ static u32 i2c_readl(struct tegra_i2c_dev *i2c_dev, unsigned int reg) return readl_relaxed(i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg)); } +static void i2c_update(struct tegra_i2c_dev *i2c_dev, u32 mask, + u32 val, unsigned int reg) +{ + u32 rval; + + rval = i2c_readl(i2c_dev, reg); + rval = (rval & ~mask) | val; + i2c_writel(i2c_dev, rval, reg); +} + static void i2c_writesl(struct tegra_i2c_dev *i2c_dev, void *data, unsigned int reg, unsigned int len) { @@ -604,6 +663,48 @@ static int tegra_i2c_wait_for_config_load(struct tegra_i2c_dev *i2c_dev) return 0; } +static void tegra_i2c_write_cfg_settings(struct tegra_i2c_dev *i2c_dev, + const char *name) +{ + struct tegra_cfg_reg *regs; + struct tegra_cfg *cfg; + unsigned int i; + + cfg = tegra_cfg_get_by_name(i2c_dev->dev, i2c_dev->list, name); + if (!cfg) + return; + + regs = cfg->regs; + for (i = 0; i < cfg->num_regs; i++) { + i2c_update(i2c_dev, regs[i].mask, regs[i].value, + regs[i].offset); + } +} + +static void tegra_i2c_config_cfg_settings(struct tegra_i2c_dev *i2c_dev) +{ + const char *name; + + switch (i2c_dev->timings.bus_freq_hz) { + case I2C_MAX_FAST_MODE_PLUS_FREQ + 1 ... I2C_MAX_HIGH_SPEED_MODE_FREQ: + name = "i2c-high-cfg"; + break; + case I2C_MAX_FAST_MODE_FREQ + 1 ... I2C_MAX_FAST_MODE_PLUS_FREQ: + name = "i2c-fastplus-cfg"; + break; + case I2C_MAX_STANDARD_MODE_FREQ + 1 ... I2C_MAX_FAST_MODE_FREQ: + name = "i2c-fast-cfg"; + break; + case 0 ... I2C_MAX_STANDARD_MODE_FREQ: + default: + name = "i2c-standard-cfg"; + break; + } + + tegra_i2c_write_cfg_settings(i2c_dev, "i2c-common-cfg"); + tegra_i2c_write_cfg_settings(i2c_dev, name); +} + static void tegra_i2c_set_clk_params(struct tegra_i2c_dev *i2c_dev) { u32 val, clk_divisor, tsu_thd, tlow, thigh, non_hs_mode; @@ -712,7 +813,11 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev) if (IS_VI(i2c_dev)) tegra_i2c_vi_init(i2c_dev); - tegra_i2c_set_clk_params(i2c_dev); + if (i2c_dev->list) + tegra_i2c_config_cfg_settings(i2c_dev); + else + tegra_i2c_set_clk_params(i2c_dev); + err = tegra_i2c_set_div_clk(i2c_dev); if (err) return err; @@ -1772,6 +1877,8 @@ static int tegra_i2c_probe(struct platform_device *pdev) struct tegra_i2c_dev *i2c_dev; struct resource *res; int err; + const struct tegra_cfg_field_desc *fields; + unsigned int count = 0, i, j; i2c_dev = devm_kzalloc(&pdev->dev, sizeof(*i2c_dev), GFP_KERNEL); if (!i2c_dev) @@ -1808,6 +1915,23 @@ static int tegra_i2c_probe(struct platform_device *pdev) if (err) return err; + fields = i2c_cfg_fields; + + for (i = 0; i < i2c_cfg_desc.num_fields; i++) { + for (j = 0; j < i; j++) + if (fields[i].offset == fields[j].offset) + break; + if (i == j) + count++; + } + i2c_cfg_desc.num_regs = count; + + i2c_dev->list = tegra_cfg_get(i2c_dev->dev, NULL, &i2c_cfg_desc); + if (IS_ERR_OR_NULL(i2c_dev->list)) { + dev_dbg(&pdev->dev, "Config setting not available\n"); + i2c_dev->list = NULL; + } + tegra_i2c_parse_dt(i2c_dev); err = tegra_i2c_init_reset(i2c_dev); From patchwork Mon Jul 1 15:12:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 809572 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2083.outbound.protection.outlook.com [40.107.237.83]) (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 A819516DEDF; Mon, 1 Jul 2024 15:13:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846828; cv=fail; b=Y3zqkr32Di0F5EuPgpYNxKAP+ynLYdfgEkdMI2H+IFi/3Apx2rIBIbtm03Uyks9bZ7rq3SBP31/Pwvpz7QfObtubFllXXgFXBBD8wHmWkATTJZOWlJ/90g5L8PEeUMHqM8EtCEOcdnd5Zf3xJDRz1ep1FxA65D4dEl/J0LPQNpU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846828; c=relaxed/simple; bh=y/wjBm+f6K4y2iGw6Ns26MdfGiap6J9fYJM6YJ+D1bQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sWi07w+ksys9wlX/ZXo95loNpWXze1UGF0YRXoP762jw/swIE31qkJkaP1Lm2It2tai8fqOKWAd4/q/+q8TOvzGlj5YpX0ShRIAR65xypEl1DnlW7i9+IQPuDAvBx9fTL2blFkw47rqXPZcBvq9TYDE8oONISoRBdTCCY5FICoY= 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=qEU3jESp; arc=fail smtp.client-ip=40.107.237.83 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="qEU3jESp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EWEutwLVt1HA26cbLEHn3Bw6pWboYJYU8FLwbAJ1DEy3wKB6DWCcZB7ZSsWblhRHaop0Thn7iAlGxu8k17Gvxz6qiFDnl+jVaO39NX2M5fVSBLuv3HPDgeekXEKaucxd9NEyVRo7+k2poqd07h8noXU6hUbb7T9aH3vt0qTrflTS3oEYJ+iF2eauTnHrBsIS7Zeztx8iMdugUPJXyOdpvtGbcvhE9sFG2RXeTJyJexwvKJ9RWxw2h76Ry0o6ctd16chc6R7I0hz0oqtqes+gW/sE7NmNSPfxpxMynOwDu2GCGxq9m0EnCKtRALSPPmeSjGe1Kd9k5GGdBpql1dCEJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=VdL9LKNTJ9+ndhYj3bpOj5HTy0Ay9tzm0CUdzbMJwxY=; b=R2lfWzqB9EXriUnphMspP7wxjwwAE8bBSIPEgdE5yd6KzAZT+q1QGfrYEzSjnix0mFA5HJqs8YQ6Wb+cegk1h/LtfyoP/NZ5ATPZus/pcT4bjHXB5mgoa5gI3OW4G73mWFRATvsrnWXiJrCuV6oMVZwD5J+UXEu05JlbBbLj3e95JguCfTfXAJujyI1CqDVj+vwraI3J9FfUT3VQ1JQw3mpO7qGNyvziZLDLxz4BbQGdJ83K6dWf/0CUTSMS0a3iVDAF8Z2J+xgnPgytfHEtfvF1cYLyTSVjTsN2MRgcnKHctsHPL9VsUl8kfRcig09qff1C4z67Imm7tT7OMKJCIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=vger.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=VdL9LKNTJ9+ndhYj3bpOj5HTy0Ay9tzm0CUdzbMJwxY=; b=qEU3jESpJ+gjSJMttGENDLH+9gtJCE5vrn4oqLMFU3r9gsj3oXjeQTqDiWMy5n4HHhjAg8sojnD9bjHdiqwiSf+nYdaUeNsLB/wnKnot3pEad8E6HSjYQLzGZzCMYKn56SklSWc/p1Z0jSEnZemhK2bIlWEH4bP/5pjw0N5FKETBSiR/vXq6B70aLNAuEsgaOGOJhjP7K4g0g0mycT/GxCmrR64OqS7pds7yY1AiZHK7AJ3Qy2Prsm3F6nPUXl5TeBMQzYPTZnZjVp1onbAobxHmp461j6V6haO18bri6QhreJ7XdWsWuVcjkXPnOT1YkKp2vhAGOz7GGGlBy8ueuQ== Received: from DM5PR07CA0120.namprd07.prod.outlook.com (2603:10b6:4:ae::49) by MN0PR12MB5858.namprd12.prod.outlook.com (2603:10b6:208:379::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.29; Mon, 1 Jul 2024 15:13:40 +0000 Received: from CY4PEPF0000EE3A.namprd03.prod.outlook.com (2603:10b6:4:ae:cafe::9d) by DM5PR07CA0120.outlook.office365.com (2603:10b6:4:ae::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.33 via Frontend Transport; Mon, 1 Jul 2024 15:13:40 +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 CY4PEPF0000EE3A.mail.protection.outlook.com (10.167.242.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Mon, 1 Jul 2024 15:13:40 +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.4; Mon, 1 Jul 2024 08:13:28 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) 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.4; Mon, 1 Jul 2024 08:13:27 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 1 Jul 2024 08:13:22 -0700 From: Krishna Yarlagadda To: , , , , , CC: , , , , , , , , , , , , , Subject: [RFC PATCH V2 08/12] arm64: tegra: I2C interface timings Date: Mon, 1 Jul 2024 20:42:26 +0530 Message-ID: <20240701151231.29425-9-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240701151231.29425-1-kyarlagadda@nvidia.com> References: <20240701151231.29425-1-kyarlagadda@nvidia.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3A:EE_|MN0PR12MB5858:EE_ X-MS-Office365-Filtering-Correlation-Id: a7e5a22e-7247-4d74-b308-08dc99e063c4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: FyzICOAn5+jShqQ/mWZcM6lfIGn0+k3HbOtf/O5eOalihLNoz9R466Ja+uxAFPU59TDjaa6gyG5Sb+GvuWg1r+ODR8mZ7M1vMHqcatGrm3zmr/ZqM5Kx/rHECjmrCXie6G9nsCzIBcwFdvaSR1wvZg6ufcn2ZEBmAAZzjp0J2hIbGVmYfsJDJk6vO8trxwaq2O8MJuDcVx/FwTJAVrGxOIKz0bFX+XKO+6iVW0voV00cgetRuVP673ztdEktT4uu4MedRmW7+eS+4eUQtZJRLADnltPEUD3N3EnswJjJ+nW0dDBmkny4S8U/XUsOV6H3dKySxrGBKc1AmnmtI3S++OcwJLqESFY2rUSlpd6RmlqLlHhLunUMaFZgI9uJRfM9yMsVcaOnqNJfxTWlbx2Md8qECbw3/1TDbZLfPIF9J8ZzyTuE5wQgT03xU+4T76wTYp/Aggs1VtCh8eiYCAJT1kSKGimeoKyiVEBaVoqLqVidhzpD6dH4fPsAh8Qeb6/RPIw3UnUph1SCkhh2kI48FhX8JwvOPgrSFCphPJb15/8vUW0oZQHZv5XkATAE2KQrJypuJYfnK84s1xnEN9j6KRPXy5oN/yqUPCnF+0T9LBRgBI9xOfJQzZ7zi9qkl1o4YoLnA3i7xz6QJ9OGXi/5C9ad28d4PpkjA4DS9e+mF21y6TeXlVlvgtffts1ILxip+9W98LkSZ5qGBo2GpGRycrjQZ7zOdcooer5sA/t2G4WtNUM+/jSMFnWAhZn26wqu8MUhFEmbMRNktM8c/lEU1TirVTbBt+tPVOXKs5YYki5ASljJhyp71hQ4VPa+SiJme8aYFVtHGKvsX+df3k52I4RCI5q4aj328Id4RgrbXV9ck3gy6u3+DJ8ptEPcHiBCJu3OtSeXoBxa/94hjQdpVlzvTxa+CJfJECIjIqdYxTb5fgSL5Dp9eUVVZEhx8+cyAO5afqj8jxYp25EMYEPu29g9UVmjfUbvwKAyquOOPbMADjX/3N7ql+Pg/1kF6Wk6NBu5It1kHUVfFiZSy7vesfaqfuo/TrHrJBQ8luYxgPDk0yoBxXqw0nHm9rYWMVcLfyCO8nwWz9P1iUww7qNCzwLAHObnNH8N1vOtQYfmoWVyUTDd4nXZkWODjE25iZLbsBsSyRUKLXyxG3L51Gorq8PdnpqPllZF2qga5p8JenkrES7f24OThdpzL1LgtSzZWsQkuCGmYC32ags9O4N2rauP8zq6HjvmuTKBGXurUWXLztRt4kYe/MGCmBHCX0qGiP6LZPAMne5wD7o+cM0e5T8eIZuBBS5UG1Br1Lp5cHTcVdzOsmnuFfBErbpRwLYUnUplL95q2Bo3Pgy66bc7RX+aYHZHiwfgrR2v3/faKC6YSWPOGconxQUW8pmKgP5AkTVxxbp+3VFqJ7pfvVfgJ3dclQQIHrSBst+ALowglL4pxR6D1xnvmtBpV0WQzPX0 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)(1800799024)(376014)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2024 15:13:40.4702 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a7e5a22e-7247-4d74-b308-08dc99e063c4 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: CY4PEPF0000EE3A.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5858 Set I2C interface timing registers through config settings for Tegra234 chip and P3701 board. Signed-off-by: Krishna Yarlagadda --- MAINTAINERS | 1 + arch/arm64/boot/dts/nvidia/tegra234-cfg.dtsi | 465 ++++++++++++++++++ .../dts/nvidia/tegra234-p3701-0000-cfg.dtsi | 107 ++++ .../boot/dts/nvidia/tegra234-p3701-0000.dtsi | 1 + 4 files changed, 574 insertions(+) create mode 100644 arch/arm64/boot/dts/nvidia/tegra234-cfg.dtsi create mode 100644 arch/arm64/boot/dts/nvidia/tegra234-p3701-0000-cfg.dtsi diff --git a/MAINTAINERS b/MAINTAINERS index 23e79a878f2a..99495e159e70 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22260,6 +22260,7 @@ M: Thierry Reding R: Laxman Dewangan R: Krishna Yarlagadda S: Supported +F: arch/arm64/boot/dts/nvidia/tegra234*cfg.dtsi F: Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml F: Documentation/misc-devices/tegra-cfg.rst F: drivers/soc/tegra/tegra-cfg.c diff --git a/arch/arm64/boot/dts/nvidia/tegra234-cfg.dtsi b/arch/arm64/boot/dts/nvidia/tegra234-cfg.dtsi new file mode 100644 index 000000000000..7e5b9c10c617 --- /dev/null +++ b/arch/arm64/boot/dts/nvidia/tegra234-cfg.dtsi @@ -0,0 +1,465 @@ +// SPDX-License-Identifier: GPL-2.0-only + +/ { + configsettings { + configi2c1: config-i2c3160000 { + + i2c-common-cfg { + nvidia,i2c-hs-sclk-high-period = <0x03>; + nvidia,i2c-hs-sclk-low-period = <0x08>; + }; + + i2c-fast-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x3c>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + + i2c-fastplus-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + + i2c-high-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-clk-divisor-hs-mode = <0x02>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + nvidia,i2c-hs-stop-setup-time = <0x09>; + nvidia,i2c-hs-start-hold-time = <0x09>; + nvidia,i2c-hs-start-setup-time = <0x09>; + }; + + i2c-standard-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x4f>; + nvidia,i2c-sclk-high-period = <0x07>; + nvidia,i2c-sclk-low-period = <0x08>; + nvidia,i2c-bus-free-time = <0x08>; + nvidia,i2c-stop-setup-time = <0x08>; + nvidia,i2c-start-hold-time = <0x08>; + nvidia,i2c-start-setup-time = <0x08>; + }; + + }; + + configi2c2: config-i2c3180000 { + + i2c-common-cfg { + nvidia,i2c-hs-sclk-high-period = <0x03>; + nvidia,i2c-hs-sclk-low-period = <0x08>; + }; + + i2c-fast-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x3c>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + + i2c-fastplus-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + + i2c-high-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-clk-divisor-hs-mode = <0x02>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + nvidia,i2c-hs-stop-setup-time = <0x09>; + nvidia,i2c-hs-start-hold-time = <0x09>; + nvidia,i2c-hs-start-setup-time = <0x09>; + }; + + i2c-standard-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x4f>; + nvidia,i2c-sclk-high-period = <0x07>; + nvidia,i2c-sclk-low-period = <0x08>; + nvidia,i2c-bus-free-time = <0x08>; + nvidia,i2c-stop-setup-time = <0x08>; + nvidia,i2c-start-hold-time = <0x08>; + nvidia,i2c-start-setup-time = <0x08>; + }; + + }; + + configi2c3: config-i2c3190000 { + + i2c-common-cfg { + nvidia,i2c-hs-sclk-high-period = <0x03>; + nvidia,i2c-hs-sclk-low-period = <0x08>; + }; + + i2c-fast-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x3c>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + + i2c-fastplus-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + + i2c-high-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-clk-divisor-hs-mode = <0x02>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + nvidia,i2c-hs-stop-setup-time = <0x09>; + nvidia,i2c-hs-start-hold-time = <0x09>; + nvidia,i2c-hs-start-setup-time = <0x09>; + }; + + i2c-standard-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x4f>; + nvidia,i2c-sclk-high-period = <0x07>; + nvidia,i2c-sclk-low-period = <0x08>; + nvidia,i2c-bus-free-time = <0x08>; + nvidia,i2c-stop-setup-time = <0x08>; + nvidia,i2c-start-hold-time = <0x08>; + nvidia,i2c-start-setup-time = <0x08>; + }; + + }; + + configi2c4: config-i2c31b0000 { + + i2c-common-cfg { + nvidia,i2c-hs-sclk-high-period = <0x03>; + nvidia,i2c-hs-sclk-low-period = <0x08>; + }; + + i2c-fast-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x3c>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + + i2c-fastplus-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + + i2c-high-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-clk-divisor-hs-mode = <0x02>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + nvidia,i2c-hs-stop-setup-time = <0x09>; + nvidia,i2c-hs-start-hold-time = <0x09>; + nvidia,i2c-hs-start-setup-time = <0x09>; + }; + + i2c-standard-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x4f>; + nvidia,i2c-sclk-high-period = <0x07>; + nvidia,i2c-sclk-low-period = <0x08>; + nvidia,i2c-bus-free-time = <0x08>; + nvidia,i2c-stop-setup-time = <0x08>; + nvidia,i2c-start-hold-time = <0x08>; + nvidia,i2c-start-setup-time = <0x08>; + }; + + }; + + configi2c5: config-i2c31c0000 { + + i2c-common-cfg { + nvidia,i2c-hs-sclk-high-period = <0x03>; + nvidia,i2c-hs-sclk-low-period = <0x08>; + }; + + i2c-fast-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x3c>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + + i2c-fastplus-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + + i2c-high-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-clk-divisor-hs-mode = <0x02>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + nvidia,i2c-hs-stop-setup-time = <0x09>; + nvidia,i2c-hs-start-hold-time = <0x09>; + nvidia,i2c-hs-start-setup-time = <0x09>; + }; + + i2c-standard-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x4f>; + nvidia,i2c-sclk-high-period = <0x07>; + nvidia,i2c-sclk-low-period = <0x08>; + nvidia,i2c-bus-free-time = <0x08>; + nvidia,i2c-stop-setup-time = <0x08>; + nvidia,i2c-start-hold-time = <0x08>; + nvidia,i2c-start-setup-time = <0x08>; + }; + + }; + + configi2c6: config-i2c31e0000 { + + i2c-common-cfg { + nvidia,i2c-hs-sclk-high-period = <0x03>; + nvidia,i2c-hs-sclk-low-period = <0x08>; + }; + + i2c-fast-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x3c>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + + i2c-fastplus-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + + i2c-high-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-clk-divisor-hs-mode = <0x02>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + nvidia,i2c-hs-stop-setup-time = <0x09>; + nvidia,i2c-hs-start-hold-time = <0x09>; + nvidia,i2c-hs-start-setup-time = <0x09>; + }; + + i2c-standard-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x4f>; + nvidia,i2c-sclk-high-period = <0x07>; + nvidia,i2c-sclk-low-period = <0x08>; + nvidia,i2c-bus-free-time = <0x08>; + nvidia,i2c-stop-setup-time = <0x08>; + nvidia,i2c-start-hold-time = <0x08>; + nvidia,i2c-start-setup-time = <0x08>; + }; + + }; + + configi2c7: config-i2cc240000 { + + i2c-common-cfg { + nvidia,i2c-hs-sclk-high-period = <0x03>; + nvidia,i2c-hs-sclk-low-period = <0x08>; + }; + + i2c-fast-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x3c>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + + i2c-fastplus-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + + i2c-high-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-clk-divisor-hs-mode = <0x02>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + nvidia,i2c-hs-stop-setup-time = <0x09>; + nvidia,i2c-hs-start-hold-time = <0x09>; + nvidia,i2c-hs-start-setup-time = <0x09>; + }; + + i2c-standard-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x4f>; + nvidia,i2c-sclk-high-period = <0x07>; + nvidia,i2c-sclk-low-period = <0x08>; + nvidia,i2c-bus-free-time = <0x08>; + nvidia,i2c-stop-setup-time = <0x08>; + nvidia,i2c-start-hold-time = <0x08>; + nvidia,i2c-start-setup-time = <0x08>; + }; + + }; + + configi2c8: config-i2cc250000 { + + i2c-common-cfg { + nvidia,i2c-hs-sclk-high-period = <0x03>; + nvidia,i2c-hs-sclk-low-period = <0x08>; + }; + + i2c-fast-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x3c>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + + i2c-fastplus-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + + i2c-high-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-clk-divisor-hs-mode = <0x02>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + nvidia,i2c-hs-stop-setup-time = <0x09>; + nvidia,i2c-hs-start-hold-time = <0x09>; + nvidia,i2c-hs-start-setup-time = <0x09>; + }; + + i2c-standard-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x4f>; + nvidia,i2c-sclk-high-period = <0x07>; + nvidia,i2c-sclk-low-period = <0x08>; + nvidia,i2c-bus-free-time = <0x08>; + nvidia,i2c-stop-setup-time = <0x08>; + nvidia,i2c-start-hold-time = <0x08>; + nvidia,i2c-start-setup-time = <0x08>; + }; + + }; + + }; + + bus@0 { + i2c@3160000 { + config-settings = <&configi2c1>; + }; + + i2c@3180000 { + config-settings = <&configi2c2>; + }; + + i2c@3190000 { + config-settings = <&configi2c3>; + }; + + i2c@31b0000 { + config-settings = <&configi2c4>; + }; + + i2c@31c0000 { + config-settings = <&configi2c5>; + }; + + i2c@31e0000 { + config-settings = <&configi2c6>; + }; + + i2c@c240000 { + config-settings = <&configi2c7>; + }; + + i2c@c250000 { + config-settings = <&configi2c8>; + }; + + }; +}; diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000-cfg.dtsi b/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000-cfg.dtsi new file mode 100644 index 000000000000..72ce8ee5a57f --- /dev/null +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000-cfg.dtsi @@ -0,0 +1,107 @@ +// SPDX-License-Identifier: GPL-2.0-only + +#include "tegra234-cfg.dtsi" + +/ { + config-i2c3160000 { + i2c-fast-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x3c>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + i2c-fastplus-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + }; + + config-i2c3180000 { + i2c-fastplus-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + i2c-standard-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x4f>; + nvidia,i2c-sclk-high-period = <0x07>; + nvidia,i2c-sclk-low-period = <0x08>; + nvidia,i2c-bus-free-time = <0x08>; + nvidia,i2c-stop-setup-time = <0x08>; + nvidia,i2c-start-hold-time = <0x08>; + nvidia,i2c-start-setup-time = <0x08>; + }; + }; + + config-i2c3190000 { + i2c-fast-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x3c>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + }; + + config-i2c31c0000 { + i2c-fast-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x3c>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + }; + + config-i2c31e0000 { + i2c-fast-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x3c>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + }; + + config-i2cc240000 { + i2c-fastplus-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + }; + + config-i2cc250000 { + i2c-fastplus-cfg { + nvidia,i2c-clk-divisor-fs-mode = <0x16>; + nvidia,i2c-sclk-high-period = <0x02>; + nvidia,i2c-sclk-low-period = <0x02>; + nvidia,i2c-bus-free-time = <0x02>; + nvidia,i2c-stop-setup-time = <0x02>; + nvidia,i2c-start-hold-time = <0x02>; + nvidia,i2c-start-setup-time = <0x02>; + }; + }; +}; diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi b/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi index cb792041fc62..71506c51a5ea 100644 --- a/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi @@ -2,6 +2,7 @@ #include "tegra234.dtsi" #include "tegra234-p3701.dtsi" +#include "tegra234-p3701-0000-cfg.dtsi" / { model = "NVIDIA Jetson AGX Orin"; From patchwork Mon Jul 1 15:12:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 808906 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2051.outbound.protection.outlook.com [40.107.94.51]) (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 0CAF616E87B; Mon, 1 Jul 2024 15:13:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846830; cv=fail; b=vBV3PAPMH1bKbKDTlD/y4TNjMCoUvQETQEEdxCeAFmrgLx95izWRl2Gsmx/+Jw1Kn08LmV/i+tZF5jYzACGGvbxBj0YxlFJbUAQyqRWL5zaIEM/kum1DBue6tyxYw5AC3Vc05FQUBGzj+lQufSpL8udLdk1L1aZho5CaGWFbTy4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846830; c=relaxed/simple; bh=sr+e0zELZ1ohfIllOX/kYbzwIXCuL4Cr8D3hU8XMivQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JmYStilc3olr0pqjHlmAecKLHRN9DlAHemtxYm1/N86wFpWVyp2QOkwhV4sBnWAkfo/k3PzjC6BDnglRqq7yG0Qmo1mSrK9XpTuMN6ummbe9LA4Tib3jqxEWRHvHUEFuHXC7RvWEzF8z6s7nxYcwV+lanlxDVd7A5j65btLC8/Q= 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=RG4xgRog; arc=fail smtp.client-ip=40.107.94.51 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="RG4xgRog" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QfwuQWeJiapWXhByrIIKL9D5prILfrY+r7ylawsL9wD+XJCEyHZ+4ATlS6e/1+fzQM5gR+dH9hsIkN2zF6zSnwF0tOw1NiSn1tLyK46+KLTOCKo0hRAHazxdOlEjB9bhgIJZMjexQK/n+4Ggf+UPkzcN7x+1DQPY0ZEf8H+Ia8oj+PVrPWty0doCt4U6MCYiCuyY79OS0ll89jlmqFaU89xwq9HKny2ziQ3iKVw0Z8N1VvwORVgZylwlaMMTrD6oVTvyS+4rYqadUeEAo6EGFW5Lc7kuhkGIe1EdEouUuIhKg9a0ikfi2/yLOTmTKY/aoMaPoeXmhn4QU4vGamBkFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=JiZq6AI25H0VZLOjJEX6kyw2DMqiDhv5yTTIyrIgAHI=; b=NmjsFVylOazandBi6Py72vcs6BSRne27pYChgrH7efkldMOeih1c/UBXLji6eSwCQAlyMljJO+st0axS4gAH5kbB3yGgM+4fpW9fA3pztkXWma3p/5dWz47DxCaw16NjinQ95ptt6qjNr6TG1s62zFGk7eoqUsbD2ZL/aBurgOc6KPeiifs0bLE9EQq9QVJrmoKxxMw92YCSMcKVnkPxRG31MDywNNPwdGalVd3VWLtryrF17vFPtZbrHsc4WmNCQSS11SK5QODEVwW8/INzwSz1Qdq9+WQizqwQDhWz1XyJ2abZtTrZI2TnEy4UqT2CJQy9HwyzG8oQOxsY8o7EYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=vger.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=JiZq6AI25H0VZLOjJEX6kyw2DMqiDhv5yTTIyrIgAHI=; b=RG4xgRogQOL7PaxRaQRZYLt3KdIcguXU5Jaoog1vKohTBWKjXgw9ASCjf8a5NTN9EvDwhEGQMTbopDtyzs6ylhbIMqT1YxQGCYPBrH0xdnUugYTv8kslWqXsyFpXUehD9zrUBetAVTdBOpL+Q+yV4AoR6j2Z9vPOHzju5UlaVxRkAJGEw/doXe68vBz+11U053HWzzrlyiZ4r99SBG55jg56Km7wMfhepwYONozenjfEAzrOjAlG57s0SO6q48i0yEtpurXBg+bB+6CyabTyJJHuzsTjIvBF6qnuftTMriAxRrWtFIObWMCnaTzqMHNhn3SMYdwISkGitall+5q9ug== Received: from PH7P220CA0137.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:327::22) by BL1PR12MB5898.namprd12.prod.outlook.com (2603:10b6:208:396::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32; Mon, 1 Jul 2024 15:13:45 +0000 Received: from CY4PEPF0000EE3E.namprd03.prod.outlook.com (2603:10b6:510:327:cafe::dc) by PH7P220CA0137.outlook.office365.com (2603:10b6:510:327::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.33 via Frontend Transport; Mon, 1 Jul 2024 15:13:44 +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 CY4PEPF0000EE3E.mail.protection.outlook.com (10.167.242.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Mon, 1 Jul 2024 15:13:44 +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.4; Mon, 1 Jul 2024 08:13:33 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) 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.4; Mon, 1 Jul 2024 08:13:32 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 1 Jul 2024 08:13:28 -0700 From: Krishna Yarlagadda To: , , , , , CC: , , , , , , , , , , , , , Subject: [RFC PATCH V2 09/12] dt-bindings: misc: tegra-sdhci: config settings Date: Mon, 1 Jul 2024 20:42:27 +0530 Message-ID: <20240701151231.29425-10-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240701151231.29425-1-kyarlagadda@nvidia.com> References: <20240701151231.29425-1-kyarlagadda@nvidia.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3E:EE_|BL1PR12MB5898:EE_ X-MS-Office365-Filtering-Correlation-Id: 55cb9556-631a-4ff9-2d32-08dc99e0664e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|36860700013|376014|7416014; X-Microsoft-Antispam-Message-Info: +XoaABpTx/We/bH+iVYULkWwf7ZBTEhgTTHtdbCH9JKZ0vRljVf5aGGALFq8kzJJgn7beJHtSgyCL/yxCs8Z/Bpxsf7d/tKowDWXJVbgElDkPt61ROu8/YFQWKEu7Jq7wGBZQZ/IKnGpXNaWbO7GcUZVWs4jzvLmynZlvvAKtwyjSqqA18E7r6qsmK9PJzwQBeG1wYlHHgHtI3iJNAi3HKSGA4Sp5MeVlp5XvmeaG8lSO97jNJMRX0wjpZ5SLaXdC43s8UBtYL4Jm9GPqL47xfNPQvLdBTytNUfRH8ZYYTcVMsfSWwCjkvE6VbB1MSRwdIPEgNlFFJ+pxp0e8vfc+w7ApQA52LjGAJsdSQW2Ho449mTp8HKwW1WDiDwEM1dmyPqgYK9xRgVM0YQE3bZwKtElLvUwv/+BMQZwSr2tBi+61JaTQJmUwcesH/3lXqGQtbZS/NJI2edWe+oxNsm1nCjzehADFr8DXRbv3IApT8s3XmcXswv9WeVB7oR4562MeJyEMRFXVVomvqpUOUdtKduxErH7+sIcVMxkAVU5TQndh6vWXIBtV0waUyeDK6O93xzeQOeMmadBgf2bMya5bWZXrFJrthP5mJZSVNpj6olYaWUBI2X8baWUNuugLpfrlqBJT6Nz7sdlKb32vd3N85RlG8qGwMlQ4KebRwKsY7cuuyT0qlu0day54vmZyPCzjKrN2CXGqjKesEbEswqD3yoCcns4/tuGn1TkxKeK8bw4md4Eb6djILKJh3mn4i0P5WykhvrN5Sb/SWKDUKcmN7NkffOQ6peNTFSaTC6T3pq/lF3k5+f3JfEmUEJNh0ZBU6qKja1IbYNTmFzsZsZw3miECJsxY0Lit+abkFDmms2+k+RE9XGagaIpjaFLIyC/FzJwUzexN3zTaHGuuwLUbA3emBoiTor7qgTQ6LBh5WYMImaDe/Hp3PcfAQbH3FhtFf6PU0ItN1IAPfmyveN/XpLPHPl8P9YmInb7g3XxYsGLWYhFB5hiMOWByGIhQGx1dfPrbMu3g8pS0uizR8+YYQRGJUIZ5iVpR8RtnfkcuK+PyPLAFpT9N088SHMxk7WflzcCPFYlnr2rwf39wptWMgQR4AaSvX6zuL+cTyhNwIJzHNzLLukh4qfecdNDV4HrtYCF3LgR3yfIdF70iTHAoRgXW4ZfXBSEzRstCk70rn1qde4XRz5A0ExcV/NS114EHZSsKkdJdNETQmw3Sgt1OUB26Lqr1eW5kxOjVOFACEmDjtyaWBQ0VAhw10B8AGV2SSOVMZb3HaRrkEOele26rV004tYGSRass3aIAn5e1Bbl1jXwsRR4nhcqv/8HoCQmHHR2sN3anZZpCPRL0VwhJ/IWVE/Ad3InJAHWVyGa852GzQXJVbZvumyQgWZOsSmag48dJHypVWlH1c0JntvenjTu6vDDyKDW0TUBFaN9znCK9xaLsCzc+KLMBJnIvJ/h 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)(36860700013)(376014)(7416014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2024 15:13:44.6953 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55cb9556-631a-4ff9-2d32-08dc99e0664e 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: CY4PEPF0000EE3E.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5898 SDHCI vendor tuning registers are configured using config setting framework. List available field config for Tegra SDHCI controllers. Signed-off-by: Krishna Yarlagadda --- .../misc/nvidia,tegra-config-settings.yaml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml b/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml index 5f4da633e69b..f4440cb6286d 100644 --- a/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml +++ b/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml @@ -38,6 +38,32 @@ patternProperties: additionalProperties: false patternProperties: + "^sdhci-[a-z0-9_-]+-cfg$": + description: Config settings for SDHCI devices. + SDHCI has configuration based on device speed modes. + - common is set on all speeds and can be overridden by speed mode. + - List of speed modes and their config name + "default", /* MMC_TIMING_LEGACY */ + "sd-mmc-highspeed", /* MMC_TIMING_MMC_HS */ + "sd-mmc-highspeed", /* MMC_TIMING_SD_HS */ + "uhs-sdr12", /* MMC_TIMING_UHS_SDR12 */ + "uhs-sdr25", /* MMC_TIMING_UHS_SDR25 */ + "uhs-sdr50", /* MMC_TIMING_UHS_SDR50 */ + "uhs-sdr104", /* MMC_TIMING_UHS_SDR104 */ + "uhs-ddr52", /* MMC_TIMING_UHS_DDR50 */ + "uhs-ddr52", /* MMC_TIMING_MMC_DDR52 */ + "mmc-hs200", /* MMC_TIMING_MMC_HS200 */ + "mmc-hs400", /* MMC_TIMING_MMC_HS400 */ + type: object + additionalProperties: false + + properties: + nvidia,mmc-num-tuning-iter: + description: Specify DQS trim value for HS400 timing. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 0xffff + "^i2c-[a-z0-9_]+-cfg$": description: Config settings for I2C devices. type: object @@ -124,4 +150,9 @@ examples: nvidia,i2c-sclk-high-period = <0x07>; }; }; + configmmc1: config-mmc3400000 { + sdhci-mmc-hs200-cfg { + nvidia,mmc-num-tuning-iter = <0x02>; + }; + }; }; From patchwork Mon Jul 1 15:12:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 809571 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2069.outbound.protection.outlook.com [40.107.93.69]) (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 5258B16D4C0; Mon, 1 Jul 2024 15:14:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.69 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846844; cv=fail; b=YRxlbOsKlVhqeabtf/OOyyEEZqz3LbA32+ldwrAynN1kt5xR13Dhi01mht4cpleO+jg4oY8aWHSNskCvHZxldAbB/1obxAmFCzQ2YooNSHYnpl6L+p8THDBkWq/YiYBqn1qfevjE9wkRdd+4rT0udyNtkYWu8lOmimcv8fBvY3I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846844; c=relaxed/simple; bh=OW40ogSE1nK+6GyBTZvqWoHgZTNKai77LP3930/9vE4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rYKXbZMe8Ely41HLv7fT0WF3BouHCpCFGOtLyHX55MbcfY3wj+05tB5FIdpBDBV0nlHTzyaxNX7qr8Od2zDrgk/PDBCKCPeHY3rEEbKrq+R6Oe80eNbSdAJILTQoiFX+nFK1jIRpuBoVe8HtD+M2vb7X+QbLKYXfjJJUtX+jBcw= 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=I6PS3vNC; arc=fail smtp.client-ip=40.107.93.69 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="I6PS3vNC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gz6thvVZH1xsTdBT78HEZUg7KfVhlAD6ijJDHS2ST9FWCbpJqjLiRVw19VqBB0XfbYcTKrFg0YKvvzVLcMgFByuGR0cKG+4MmPlp5IjvFhAmwi+l6Irtz6eHI+93VEE0RvYn6rfwkAyZDa1dKKZq80ZWuV+TCjy7/qJ3TAmw9EmAD1KslkrG2p+37ms7c8tiMQKlSeg5Gj3Tgnj4j6j+h1a1WPP5IVI/BPfg99T9b49m1pKXuK8KW7V9eXulE4seNZ4qaQhNnX0x/eJeQteyt6tzWuCPiB8rN90f8vTXmlTM5omG4oCYwLzCG4unfhOCeo0lWmpsYD6SwHMSS9nfuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=/8MmBcG6p5veTatA5jYc17PKVm6PDOVnskR2/JevhJs=; b=UzufAnIWQiRhP9uioqm9uAQwbowQusRwKyO9W3efL5x6FVfmLNU4Kb27eX/2oNHQAouMttXTxNchDSTG4hnWngWSyvx2mD0BS5iHpCpdkasb/yyhZqUHDM9X8hK7vFWY/88JK4ekbpo/x50OD13Mv/dgHZWd7GNoavZqPRBaP28ft3M7eChpPTUB0zhdClkVTokIQlzf4aali4+UpynvhDVfQeGjM9N4Ta8yVwF9gE0lmxzeuwet2MXwtihhYDSRWWB4xLUvy4r7LjRFICxsUiG8ZLBOvksVORYYJbkThsjpA436WVT0vneqdGNuvxcS+37nuGRZ0tW3lL3jQ6SoHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=vger.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=/8MmBcG6p5veTatA5jYc17PKVm6PDOVnskR2/JevhJs=; b=I6PS3vNC6qUbmexjEMVxGYjQtl8KbaK/hGJ7Sre/SC7WHFvwFaS4ARGEE+4JLJK9bRhcmHeX6TCPxKkKc3woBVPO7tZx9N+LrIHtdqG9R7oTOHYMxY1k+Ns4nueYcJCJSIKdfFKEijAppbj79wJ0SYXo0v9lgubdzuK/dMLv4kIFXl37X7ZqRvbFOm6kwGxSKbkDXPdGYDpS8kBuhVSHQEP5R4luDFZXngGbvZgJp/T8sHSkJyqjYk+IWeQOZ8LTxyPllrNqdwfPD3c7cIdNDkOGnbpxfCYLyEc85j5erTzjwOnwNhRyKSj0MVH7cyKfqTKnXzTzgGjLDTqjAtkEOQ== Received: from PH8PR05CA0018.namprd05.prod.outlook.com (2603:10b6:510:2cc::21) by PH7PR12MB7938.namprd12.prod.outlook.com (2603:10b6:510:276::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32; Mon, 1 Jul 2024 15:13:59 +0000 Received: from CY4PEPF0000EE38.namprd03.prod.outlook.com (2603:10b6:510:2cc:cafe::49) by PH8PR05CA0018.outlook.office365.com (2603:10b6:510:2cc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.22 via Frontend Transport; Mon, 1 Jul 2024 15:13:59 +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 CY4PEPF0000EE38.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Mon, 1 Jul 2024 15:13:59 +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.4; Mon, 1 Jul 2024 08:13:38 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) 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.4; Mon, 1 Jul 2024 08:13:38 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 1 Jul 2024 08:13:33 -0700 From: Krishna Yarlagadda To: , , , , , CC: , , , , , , , , , , , , , Subject: [RFC PATCH V2 10/12] dt-bindings: mmc: tegra-sdhci: reference to config Date: Mon, 1 Jul 2024 20:42:28 +0530 Message-ID: <20240701151231.29425-11-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240701151231.29425-1-kyarlagadda@nvidia.com> References: <20240701151231.29425-1-kyarlagadda@nvidia.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE38:EE_|PH7PR12MB7938:EE_ X-MS-Office365-Filtering-Correlation-Id: 08e297bd-0fd1-4561-eaf6-08dc99e06ed5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|7416014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: SLQ0QZtQchyx8NDqJ4SH/Hhde2tK5mffRGlKJKfi/+eoKpVk732GcVXG3rnURgxC2Jlyz0+/63wUgw0A582+BCcYqKGZggaVz70eSrSplGym8ecxPkl6nnf/0yvGWpAn/yoHhS1qIfZfYBHB0u5Up6v61+qASo1+YCDBZkP/6sd7JeTW3z9rbgPBBsMvwYBW6GoH6Pf4Od9Vfo6UhQyNLaOpLlWeM4+6fAYEkps8tIuUldrd3EqLUI7D1sGF5xahcJdHMbCRKgnPFHf5x9Vxtbdwc7FQRGWCjqgU0jTmVTGHLxutVTYZBN9ZT56v0UYpOMIGAMHz97+jIO2ESNW6BCucEpuDvrHv2PBb3hTRF30ypfhX5bhKtT4fhoCDRYlLtuAkbC4fbRskZBJq1uwH8CM4Ny1vpwyd6l0LkY0ZDgfrlfmXGdiBYGHQaw3OEZuH4UkTn2hMzyQLOYXnPz4uzsE4XlKRMulLUHWmN5xy4gQLJLVu3/7TRp7zE+c2YVd349g8O0tn4Bg9vglsFdCxMAe/5VOnx2QpvtDL1O+rnxkqgPuUebWEm5inm4s/z0/semAZoju5FSxE/tIGIB8Xdg4+8x0tskh9iVHfZihVPp6dz+FhQgqiDyMe81zd9cPmtRRe3auoxpbFo4PCx7z9R1BeUY2sGAaKnfF0v8PlVsZVkwdMVU+bwEEpHeKTYXdlAaPoVJpBhvGUfmq12Mp3dRMebhnamW8b55UsSXT1uBuq6IKxQT1Kan3PdUcQqf0QjF+kubEiA/QvBfryw9fNRAfFWBputJe/a9CwTPooItmu7r0YRHivSikdn7Q8q8+ZxbaMN24RYdpT7Bfr/wvxsYhD/RfEr/U7l3zYjdA/l63aXR7bHc9+X9OLI1NLo2BmhYVlttjNq5N6+49SVdM6QIJm0w1jN1So/nYRI6/KixG+leGd2VRjpuy3z6GdMH6z/bR5NvUqUhTH1JE0LbjUOR31uRf3VPqHvxou9Y9N16Jt0X1uQ3Egad9BXyrFK+oN2XIhYU/aMWXYzaYXeO1XRv3zuQjGWdh1X0SwyJZmvV5nDyrnOFoJuktuvy0V9SLoQdQBc5Glckvg1jbYR59ZsyepHMJJrvsLBFq9qFM8ezWzDYFMbgDH2e8luXxzr0T1perzsjqo0uJpqRtE+8trx+yipp3rKtplvJpck99CE09gD3pa6ztMPX6+DUrKAuqxt1TsG0K4N3Fom7N6ZBAK/6V3ALq3VwqmgOoYGoZKxJNXdEBfnBLvA71Sp92ejS71TNFYcR09rMT8d86E9TrLHMApRXf1of8UyKkmlIJkCJytGZOITCnOaFF2FaQcPaRh96DlogAILPpHUdb+2Pm2eCfFbzrTUUq7S32XMIZYkh7wMS26pg5+3B+ak7ronslO1rkvWw2i4EwXES4SRqPW8baeDfZgeb1BF6y2t920bMSIGQN1kLNpe5jozNgC4P86 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)(36860700013)(376014)(7416014)(1800799024)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2024 15:13:59.0067 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 08e297bd-0fd1-4561-eaf6-08dc99e06ed5 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: CY4PEPF0000EE38.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7938 SDHCI vendor tuning registers are configured using config setting framework. Add reference to SDHCI controllers config settings. Signed-off-by: Krishna Yarlagadda --- .../devicetree/bindings/mmc/nvidia,tegra20-sdhci.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.yaml b/Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.yaml index 72987f0326a1..39bda6ce1e50 100644 --- a/Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.yaml +++ b/Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.yaml @@ -88,6 +88,10 @@ properties: items: - description: phandle to the core power domain + config-settings: + description: phandle to the sdhci configuration settings + $ref: /schemas/types.yaml#/definitions/phandle + nvidia,default-tap: description: Specify the default inbound sampling clock trimmer value for non-tunable modes. From patchwork Mon Jul 1 15:12:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 808905 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2076.outbound.protection.outlook.com [40.107.93.76]) (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 E030D16D4C7; Mon, 1 Jul 2024 15:14:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846847; cv=fail; b=sx5YlN6Y9O59flMZhjQ/nVws/kbI6i0Dq4aVhTlwnQ+SLLiVylN9rNaViQM0AsgCu5wq8Y1vZ+anUT7PuGYOcc7HRSRIE2FDFpLjQBaqtWgIxvq8KkwD6ujlo9faOclfBHxrkxLQs/teRM/0BMBSpqDB5lWjyfDwG/UT8Ajotn0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846847; c=relaxed/simple; bh=h7UVqoGORQcYO2hDjsHiv2WxkdGfg7sYWgTpDhFlKRs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hHC9PVH10+u72E0xnoY29KDoH/PAdo7OLSbNfM08NYueL1J6RIsYWs1jAp0XL+D4PmkDRALkWbkH1HG38fbhnccjUE1LzbgcstcjpToi+hs7WgsF9mbGgn8QNU/P2/OgcfSgPUXGQgeiGTHQ3bOPu5EXYoAIsKrD1FAdjbUJM0k= 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=fyZdgf79; arc=fail smtp.client-ip=40.107.93.76 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="fyZdgf79" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jQsS08P4rh4J8q9p/aRQsqoCNj4jqsIvirQGJFRBUzUOBIaO5R6SKCb5tUOzPXXtzBrfmYGwLvruOeFry1lPHRaBK4PZyGXcEFLo50kIQU2OuXWWgu2ePa5xpqxlQaWv33kbAf4aUso0KPYjbr4Viw2STCohiPEtYUh4pGH6hxiIZCZ00/w9jLeedzpNMNJrrkf5aMFvTld381THiCXHTtq8tpMCFODwnsbQe2ky2vokRo9e8fjKpepaj+bv7St6fk5VD6BPh0d2cN71X7vVApYKt5A8ATZprArC+ost5/e4wkfzVyq9VP6Z7mBGCrdaP+k2blxdLEVS4hIWU8HdXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=qom37yDkR0KLoIpCblghUA7a4SAudJQrHosRPDYAEJc=; b=OsWlLLUwfdRLl1N0B3NS777waH8mncPoBdDlDxHZPhHFfF24MC0rVVfJ+Hlj7l2IpSwUnrdvU8UZ9V59eKgmZ5GjoNPyh/DkMCMRTTz7Jpv88AthPIoeC/vTES27htdYxpYfEXuUi8oCpHXhAZ1DWjJtQw1/+NK9XcGui/B4GyN7pNfxTpNvqkq8oeEK5kWkkoCmAR5/RWnDkQXfDJtoZYsr6CQVUwxZFqMLFb7+97Iw3yFrCO3VQH4SWYBEM3asMGR5NaY04d9VI9p5TkhoxAxXVoEpdWY5Ts207Peb30H0NpdEHUt5Xh+8SBbmIOTJS2ZQTve+0hzxv+1MmuLZAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=vger.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=qom37yDkR0KLoIpCblghUA7a4SAudJQrHosRPDYAEJc=; b=fyZdgf79i+Wp0DPwGAvj5LiIn0v5sOGk3Jf0u526ckFc0IRd0fKSMbEor5mJQwj9f8RKBFsBCrGYGnobF2c08fF7Ql7n5MjmTYbGMIWtPYj3b1fhZeKwEqugG9jZ4Vrxi20x19pnSAkJf5As6dW8tZm8XdNOBOvagt65nFVV3H4JErrsTBDtVstYPzSTvmB7xXS2pi82dM1QEG+fiUK72SJLul+0VHUlaDoW39PCIKPNSCkqkhJ226bo8NAqeusBPbKmhKUv9lzovCoeiezDegDhQ3uPNobqb02pjBWe33yKMDhWVWwOyRRP1/lKJbGCAmQrMc1w3PWtNeGqCTRovw== Received: from MN2PR08CA0015.namprd08.prod.outlook.com (2603:10b6:208:239::20) by MW4PR12MB7117.namprd12.prod.outlook.com (2603:10b6:303:221::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.29; Mon, 1 Jul 2024 15:14:02 +0000 Received: from BL6PEPF0001AB71.namprd02.prod.outlook.com (2603:10b6:208:239:cafe::72) by MN2PR08CA0015.outlook.office365.com (2603:10b6:208:239::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.33 via Frontend Transport; Mon, 1 Jul 2024 15:14:01 +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 BL6PEPF0001AB71.mail.protection.outlook.com (10.167.242.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Mon, 1 Jul 2024 15:14:01 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) 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.4; Mon, 1 Jul 2024 08:13:44 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) 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.4; Mon, 1 Jul 2024 08:13:43 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 1 Jul 2024 08:13:38 -0700 From: Krishna Yarlagadda To: , , , , , CC: , , , , , , , , , , , , , , Prathamesh Shete Subject: [RFC PATCH V2 11/12] mmc: host: tegra: config settings for timing Date: Mon, 1 Jul 2024 20:42:29 +0530 Message-ID: <20240701151231.29425-12-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240701151231.29425-1-kyarlagadda@nvidia.com> References: <20240701151231.29425-1-kyarlagadda@nvidia.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB71:EE_|MW4PR12MB7117:EE_ X-MS-Office365-Filtering-Correlation-Id: 935b4f8f-9195-4cca-992a-08dc99e07086 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|7416014|376014|36860700013; X-Microsoft-Antispam-Message-Info: lmPmQ/pSfGtMd/KAZRfLLaph3igZYer27pWoZ/L6lxdwwWLMQIR+r6nmpf+ZrukIF3QYlOk8P8W2E44eZiliUwjeeuvvBjn9mtPgsrUAhJYsNsR9VTA+LDqHmp0kTma+bZ0Ok4d2l6yykW4jTRlBgtNyCWcBYwhm/wRPW9ptR0UzWJVo+RZg2en1y/JDaQiF6maxQwbcekW3i7RBw4ABgX6iMXg2ir0TGofZhSw3bIfvdZtWZkSNHg8mGbQf4R9zKbC6voobJ8UgNQ10R/ZH+X3CPrsNkDaktFXutdIISZnuy+XXh6l2o7NXDaSkfkoCS+KIH0MHHBxeVAaZn8XN6eS3HNj4n2gHZtG6HjqwBpIXYxf+RQSyRR2hC/QEvvRegtlI5jZyK4hrDjPCw2+xCAJ1NJlpuxHB1fGBelSUq6ndRx3FkuT/3Z+ttXVrp/B/zHOP3wdQUgQlM1v1Gj0xumJ9DkdgKs0Jz8Fh3bgkx3kDdYyIXaXHXYfYjN5jdDcRtcm2TxSlnbEy6kv/oT91aJG0hYyB/lbkmXfGFFLa161X0TBabP5M1zS4SAVqG50sijp8pXwWfoDpvQF2P1Xe4A6LiWLvHOpZFV8ohCfk1Q2IKdMSaM1tn3js0XKTzMnm+1R8yt4RJjmpuTzazsYWPblpVSIZxYuHLXkGVaCkkKroNrLJaZCHQHbT8qfMK89zquxw8CoWXej9BIFwWg4J8cwDW12Gwck7CNAJHfS5B8E+isN7ykPzcoo3mhyRqDFcUGVyzDwWnw7QUTTn+NHIth1bZ34oaFFjV+4zaYPHtOpne0vgMtHxdKFiOneH1M3K5dBekKRAS/q+BMrzsWwwgENFjMVVRg4rU6b6U9H986GsOzAJ2J5Zj5KWC1woicOKJ4ifKUjTTHit6D4pBFR0aB7ga6D/8gV1+mGST7F2yPrrAAT8VtGVJZy4QTmwMpA73IWYdS/ljtAvoe5ng+S4QgUEJY9ITsJBPviXqbalXfMeyzytXVNjf+14bzsf9OAMdD/R4bDF93qXRlsB/juJn8rryrmnjONeXOVPf9Tjbu5RXoYE53xR0nRb7sKuiOJQHZXHqinBb5sMIQSo02KsDa3lIRhQsl53eDqkGMNg8ZmsDfkRl6aNHyhBd9y9DzQW+qq+adci4eJm/DWkAIoCTKdda2k9dVLBOnpkVDi0iMmJr7gAY9HWeYDMByvtuCdG26UX11pFaWEitT1bCmN9BB+NO9U3ZzzDn71tXqlXcTMSS8ch0xsaoZH1PJJJM3X5vhVotJagFoEkgffDqVY4JFrUkaGk/HU6Uq5q6nratCuRRXEiXBgJsNYJFJV7eAamL92QC+L2zTXvqyL4imqLyI8MH4AVns6+EidZRekZ5E3CGyu7nFokleRWhQIh4kDUjcQwhQn9l0MpobI3ayxAcD8nG+0QYNGplsJCDqbZ0uF48Z+ut6s/rKrZgMyGWEn8 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)(82310400026)(1800799024)(7416014)(376014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2024 15:14:01.7017 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 935b4f8f-9195-4cca-992a-08dc99e07086 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: BL6PEPF0001AB71.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7117 Use config settings framework to initialize Tegra SDHCI timing registers Signed-off-by: Krishna Yarlagadda Signed-off-by: Prathamesh Shete --- drivers/mmc/host/sdhci-tegra.c | 84 ++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c index 1ad0a6b3a2eb..abd664359ddc 100644 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c @@ -28,6 +28,7 @@ #include #include +#include #include "sdhci-cqhci.h" #include "sdhci-pltfm.h" @@ -64,6 +65,7 @@ #define SDHCI_TEGRA_DLLCAL_STA_ACTIVE BIT(31) #define SDHCI_VNDR_TUN_CTRL0_0 0x1c0 +#define SDHCI_VNDR_TUN_CTRL0_CMD_CRC_ERR_EN BIT(28) #define SDHCI_VNDR_TUN_CTRL0_TUN_HW_TAP 0x20000 #define SDHCI_VNDR_TUN_CTRL0_START_TAP_VAL_MASK 0x03fc0000 #define SDHCI_VNDR_TUN_CTRL0_START_TAP_VAL_SHIFT 18 @@ -74,6 +76,7 @@ #define TRIES_128 2 #define TRIES_256 4 #define SDHCI_VNDR_TUN_CTRL0_TUN_WORD_SEL_MASK 0x7 +#define SDHCI_VNDR_TUN_CTRL0_DIV_N_MASK GENMASK(5, 3) #define SDHCI_TEGRA_VNDR_TUN_CTRL1_0 0x1c4 #define SDHCI_TEGRA_VNDR_TUN_STATUS0 0x1C8 @@ -134,6 +137,20 @@ SDHCI_TRNS_BLK_CNT_EN | \ SDHCI_TRNS_DMA) +static const char * const cfg_device_states[] = { + "sdhci-default-cfg", /* MMC_TIMING_LEGACY */ + "sdhci-sd-mmc-highspeed-cfg", /* MMC_TIMING_MMC_HS */ + "sdhci-sd-mmc-highspeed-cfg", /* MMC_TIMING_SD_HS */ + "sdhci-uhs-sdr12-cfg", /* MMC_TIMING_UHS_SDR12 */ + "sdhci-uhs-sdr25-cfg", /* MMC_TIMING_UHS_SDR25 */ + "sdhci-uhs-sdr50-cfg", /* MMC_TIMING_UHS_SDR50 */ + "sdhci-uhs-sdr104-cfg", /* MMC_TIMING_UHS_SDR104 */ + "sdhci-uhs-ddr52-cfg", /* MMC_TIMING_UHS_DDR50 */ + "sdhci-uhs-ddr52-cfg", /* MMC_TIMING_MMC_DDR52 */ + "sdhci-mmc-hs200-cfg", /* MMC_TIMING_MMC_HS200 */ + "sdhci-mmc-hs400-cfg", /* MMC_TIMING_MMC_HS400 */ +}; + struct sdhci_tegra_soc_data { const struct sdhci_pltfm_data *pdata; u64 dma_mask; @@ -158,6 +175,18 @@ struct sdhci_tegra_autocal_offsets { u32 pull_down_hs400; }; +static const struct tegra_cfg_field_desc sdhci_cfg_fields[] = { + TEGRA_CFG_FIELD("nvidia,num-tuning-iter", + SDHCI_VNDR_TUN_CTRL0_0, + SDHCI_VNDR_TUN_CTRL0_TUN_ITER_MASK), +}; + +static struct tegra_cfg_desc sdhci_cfg_desc = { + .num_regs = 0, + .num_fields = ARRAY_SIZE(sdhci_cfg_fields), + .fields = sdhci_cfg_fields, +}; + struct sdhci_tegra { const struct sdhci_tegra_soc_data *soc_data; struct gpio_desc *power_gpio; @@ -183,6 +212,7 @@ struct sdhci_tegra { unsigned long curr_clk_rate; u8 tuned_tap_delay; u32 stream_id; + struct tegra_cfg_list *list; }; static u16 tegra_sdhci_readw(struct sdhci_host *host, int reg) @@ -362,6 +392,30 @@ static void tegra_sdhci_set_tap(struct sdhci_host *host, unsigned int tap) } } +static void tegra_sdhci_write_cfg_settings(struct sdhci_host *host, + const char *name) +{ + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host); + struct tegra_cfg_reg *regs; + struct tegra_cfg *cfg; + unsigned int i; + u32 val; + + cfg = tegra_cfg_get_by_name(mmc_dev(host->mmc), + tegra_host->list, name); + if (!cfg) + return; + + regs = cfg->regs; + for (i = 0; i < cfg->num_regs; ++i) { + val = sdhci_readl(host, regs[i].offset); + val &= ~regs[i].mask; + val |= regs[i].value; + sdhci_writel(host, val, regs[i].offset); + } +} + static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask) { struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); @@ -374,6 +428,8 @@ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask) if (!(mask & SDHCI_RESET_ALL)) return; + tegra_sdhci_write_cfg_settings(host, "shdci-common-cfg"); + tegra_sdhci_set_tap(host, tegra_host->default_tap); misc_ctrl = sdhci_readl(host, SDHCI_TEGRA_VENDOR_MISC_CTRL); @@ -1011,6 +1067,7 @@ static void tegra_sdhci_set_uhs_signaling(struct sdhci_host *host, bool set_default_tap = false; bool set_dqs_trim = false; bool do_hs400_dll_cal = false; + bool set_config = false; u8 iter = TRIES_256; u32 val; @@ -1027,6 +1084,7 @@ static void tegra_sdhci_set_uhs_signaling(struct sdhci_host *host, set_dqs_trim = true; do_hs400_dll_cal = true; iter = TRIES_128; + set_config = true; break; case MMC_TIMING_MMC_DDR52: case MMC_TIMING_UHS_DDR50: @@ -1059,6 +1117,9 @@ static void tegra_sdhci_set_uhs_signaling(struct sdhci_host *host, else tegra_sdhci_set_tap(host, tegra_host->default_tap); + if (set_config) + tegra_sdhci_write_cfg_settings(host, + cfg_device_states[timing]); if (set_dqs_trim) tegra_sdhci_set_dqs_trim(host, tegra_host->dqs_trim); @@ -1129,6 +1190,29 @@ static int sdhci_tegra_start_signal_voltage_switch(struct mmc_host *mmc, static int tegra_sdhci_init_pinctrl_info(struct device *dev, struct sdhci_tegra *tegra_host) { + unsigned int i, j, count; + const struct tegra_cfg_field_desc *fields; + + count = 0; + fields = sdhci_cfg_fields; + + for (i = 0; i < sdhci_cfg_desc.num_fields; i++) { + for (j = 0; j < i; j++) + if (fields[i].offset == fields[j].offset) + break; + + if (i == j) + count++; + } + + sdhci_cfg_desc.num_regs = count; + tegra_host->list = tegra_cfg_get(dev, NULL, &sdhci_cfg_desc); + if (IS_ERR(tegra_host->list)) { + dev_dbg(dev, "Config setting not available, err: %ld\n", + PTR_ERR(tegra_host->list)); + tegra_host->list = NULL; + } + tegra_host->pinctrl_sdmmc = devm_pinctrl_get(dev); if (IS_ERR(tegra_host->pinctrl_sdmmc)) { dev_dbg(dev, "No pinctrl info, err: %ld\n", From patchwork Mon Jul 1 15:12:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 809570 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2060.outbound.protection.outlook.com [40.107.244.60]) (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 180B116F274; Mon, 1 Jul 2024 15:14:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846848; cv=fail; b=HVZ6dPCrarbCTE5vpca7WrFrLouTlwFUuduXxsYbcRHOXeR5J0puDifPEtMoFb06/WahuCxGp9vEHRb8juxyj+fVEZq245qruCZkFSRVcA8NUeZFa/t+XClWaF/if8LJnZyxUxKr4pDE/wMblejb7ahQ9MygjYSNynrK6ZVf004= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719846848; c=relaxed/simple; bh=w8nOHJEzyzx/rqGB186Rg9RFwoQRrfLzbqfBMd0Rt+E=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VFCWiyG0IqanSvqLyM5YmiREcLSORj4X1K1sRwarWVCR5NgpOglfpT3azrQS+20y4IWnPuzAP0ecSqCCQ2wVqde7ubzLORXAjZUrWDzCk9FJYamCoHJvZJimcenJI8KezRrai619SISjfDRMscMhvzDsOFo5fpbHq3lUfYXjdO0= 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=nCu9Fefu; arc=fail smtp.client-ip=40.107.244.60 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="nCu9Fefu" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S2+eZewIN/alsvEdtVOWpjUubvBdO+PJ/ZO4EMAw8UQcnE/dsFqMVvqdClNEBz6HJdCfGp4Rti56zTIhaXbOe9dutObIFX/oBLDnUloWotzyB91Z2DRBNSq5qP94ENUSQ7KPKJMObyPLcgxxm0DDM4I1K1S+Z1G9jloeMMhvhtnK4Nzzzc0Lswjgh7Z/AaB0Y5hhtuUXjJd/30FD4qqE8L+NJ1WavHsvaND3lyay2QRxrNCD05d2cNiUnU6W4lQBllUlS5zBZ9fKOnGUrYmfUPQRxueCR03b8DxpTQmq8fQdXxW5PIgr2vxt95L2uB8Uxmvi2dAhlb8+IT6RpDFXfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=fG9bitokcp9htrBGCsfTlwMtj+UydWce9WL2H2+Su2Q=; b=h+uHqVSeg/AQda/GQhJPtEaG8pJlAnGvzF9CDIg4dafWtwspGia9ZEd8e3stYqFw3uCLCTctQLWmxYjpltI/YjmBkB+Gq9tV5ACP7lRrs1wimAj8P+ddPSi659P0+Uy85D/CyI+75qx2OKUz+5iZRu5CijPU7C1hW60pBDyjJlojW3lgWFLZrhnXClvsouhtV481hI2FLKCURFuJfhtbBYHRvsJstPJx6vmG1ZcCPs+mfPIvBvabQ7NeRuuB03Koz5HMjTA5UjDAeMTj0H/DV5mrXtSmIXq8xuFZ1Bab+rWiwrKHxZtUYd4ClD+mJGwqZBuHgwwPCf58B0UwV3fysg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=vger.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=fG9bitokcp9htrBGCsfTlwMtj+UydWce9WL2H2+Su2Q=; b=nCu9Feful4So1y3ZnZV91R+3tV2/t+zFht7GsTd8m+1ewDt7PEWXT9vLWhOYKpKPPe35a7JUQx/TulHvm+c+h6eRY8b3KTQvJW7TOYNJSW75pG8aclJ52xmBe+xHWqQzuQ/vYP7yHkIH0ZD6vosOL5SjIlNMgYB6/BaA+GLsUPTOtz9YkyPfcLmPBxsgykrFv0k6n0Oh81b7ELmz4QzWakxwrawrIxqFRu/e1WcPUl+u31wiZmG+rwfn/Jg2wS595LCXBNgaSgeCsD8wf2xYVGBcLWRT0oSremnHfAHitpP1zHmNY/ctSEfoGOA5x+vAL1ANv37ZNIRgvfrdNZK8Mg== Received: from DM5PR07CA0095.namprd07.prod.outlook.com (2603:10b6:4:ae::24) by PH0PR12MB8174.namprd12.prod.outlook.com (2603:10b6:510:298::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32; Mon, 1 Jul 2024 15:14:04 +0000 Received: from CY4PEPF0000EE3A.namprd03.prod.outlook.com (2603:10b6:4:ae:cafe::29) by DM5PR07CA0095.outlook.office365.com (2603:10b6:4:ae::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32 via Frontend Transport; Mon, 1 Jul 2024 15:14:04 +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 CY4PEPF0000EE3A.mail.protection.outlook.com (10.167.242.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Mon, 1 Jul 2024 15:14:04 +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.4; Mon, 1 Jul 2024 08:13:49 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) 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.4; Mon, 1 Jul 2024 08:13:49 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 1 Jul 2024 08:13:44 -0700 From: Krishna Yarlagadda To: , , , , , CC: , , , , , , , , , , , , , Subject: [RFC PATCH V2 12/12] arm64: tegra: SDHCI timing settings Date: Mon, 1 Jul 2024 20:42:30 +0530 Message-ID: <20240701151231.29425-13-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240701151231.29425-1-kyarlagadda@nvidia.com> References: <20240701151231.29425-1-kyarlagadda@nvidia.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3A:EE_|PH0PR12MB8174:EE_ X-MS-Office365-Filtering-Correlation-Id: 36177853-95f8-4dfe-fc22-08dc99e071db X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|36860700013|376014|7416014; X-Microsoft-Antispam-Message-Info: Dx8vdj0yP66t3L7F+Xsdt6AId6IUZxUh5+0knHHMMIc7pbjTsmMkyUuJGZXGCfAvNul+U4ix6+4yBlL3hh3ZFpF6kkVv4CmvrcCpe7QdOel2hAeGNMlBw0KNWrAuQn1DJph04+xYPdzMZg3NEIZX+GwAJKZOpP5jjwzQD4zVbrfKM6hpltS7RhpftnMfrbL9ECgpVFKD7QCuNgTYkEkZn46Au5qY4iCmF/J85gR+nr9bSI4k2dSjXawTWXOW/fD4o7iAQg+WtOsekGjIpAb1IV5qjO/mgEFPkuM5e4wYwBVIsIhD5scfxFigxrgrTQkCs1WkXKphetwmJ2WcXlUKw0y0JZBt4h0WWtHRd0OD0AariNLBotL8woyfr+TajEy4+fACZsmFf7tsbeaYxU930amV7PoBG4rUcqLQuM5Lw1KETWSAp1qaEuYCfpJUhDJTgC56WULG4QM2JWxgvsIxnafDT6LW3m00uHDyLCbELLxu5aAI93xlRlSdY3E4ZnxKVVDaUD8/lBP5pIJtMmm/lMsj5BRSlMTyKIOjeYisrt6hK47D/dytyTo3MMDkRtLfF8/E+84LvKvUi/R/Tade0EaJOd5OHLCcdM7APpubzaUtR01qtaQwggasIRyCtF7hShhLX6A0yFMDfws9WKBIkaijsj2vdFd+tcoPBmMC5BqZwzGsoRr+8dcfJYEHUZF+T2z4Nsrr8fXns4GEwL2Icos3CDaQmHiTd33QdISXXlJZrGDT6O1s4MlPcL8XuM71ddnR93+BeqDfmpkCDi5FyWrZgLwJ29DW8lxsNMdx+x6hBYEl7yNoZuTkPNUhETr2drLkId5ioBTs7l5O03NBH1wNvh86fIdqSY2DKqyu6WFqGGiPmRlOi/q2IYntKQ/kQobNsegPo7UAaHpV/YPzXfGTN6rM7OiLBKB8ta/nvVYoj3e3Su2tjHxA5/8EDtIyiYlXqj9GxR6F8Z2M3WrTiId1YNwecdNf3j8pVUIHKnQoywMGtcvUPXg4NOX+HsBUIKw8tFp8Ka5SVua2HXKJXKH19Xwy9krQayjuBNBTa8QSiHVIrazgfOGigk2DM32Q3TGys7kVVR38qAR1jvA9gOJuKjFqLu30pkj1I/0SgAmRml9HZdBLhQfrWVbxbG3M4zPJBhW52sBweRlZ2Aq2m503EtpcrbCUmX1ot6g2ZcNztOwC+2HYMqsc87S5mf2nh+i2jxZUEgMGX9MnvEFHdes+xm8BrTHFcStBRzzKUsDZ9BLSk4WaRQNBbEQVOnZp4YW9co+utWzPfzsU0uk7aprQJbrPRs6p0RG+H2HQC41kA0m6zMLQ8FinM9+c9wbwbOIWt3YdWsSsnnW1nQ0wEu3Wp4APQN0Qlj9+sty8JDhJYzXpMXbVlPNZXWDJSgHrBrPBIpLON4R49yfS+hxiJgQE8ImOZQ+Ea4hzTTRUPMtXfGHj+bZjM0mmBzKwOdnX 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)(36860700013)(376014)(7416014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2024 15:14:04.0640 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36177853-95f8-4dfe-fc22-08dc99e071db 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: CY4PEPF0000EE3A.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8174 Set SDHCI timing registers through config settings for Tegra234 chip and P3701 board. Signed-off-by: Krishna Yarlagadda --- arch/arm64/boot/dts/nvidia/tegra234-cfg.dtsi | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/arch/arm64/boot/dts/nvidia/tegra234-cfg.dtsi b/arch/arm64/boot/dts/nvidia/tegra234-cfg.dtsi index 7e5b9c10c617..30c125636123 100644 --- a/arch/arm64/boot/dts/nvidia/tegra234-cfg.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra234-cfg.dtsi @@ -426,6 +426,34 @@ i2c-standard-cfg { }; + configmmc1: config-mmc3400000 { + + sdhci-mmc-hs200-cfg { + nvidia,num-tuning-iter = <0x2>; + }; + + sdhci-uhs-sdr104-cfg { + nvidia,num-tuning-iter = <0x2>; + }; + + sdhci-uhs-sdr50-cfg { + nvidia,num-tuning-iter = <0x4>; + }; + + }; + + configmmc2: config-mmc3460000 { + + sdhci-mmc-hs200-cfg { + nvidia,num-tuning-iter = <0x2>; + }; + + sdhci-mmc-hs400-cfg { + nvidia,num-tuning-iter = <0x2>; + }; + + }; + }; bus@0 { @@ -461,5 +489,13 @@ i2c@c250000 { config-settings = <&configi2c8>; }; + mmc@3400000 { + config-settings = <&configmmc1>; + }; + + mmc@3460000 { + config-settings = <&configmmc2>; + }; + }; };