From patchwork Wed Aug 21 13:35:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13771634 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BB1E8C52D6F for ; Wed, 21 Aug 2024 13:36:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MDonFiSEeQhjEHg7WYQbMzpGRv+dsR/yBq1ANln6DHw=; b=BC6ae5bn1sz7T9 3dFBiPZ4DeE8DnypfsKlzmK6w4KYX/p5Zs5ukxv4J20wLJIX+9r52f80FpAnXZtBiS0tNhVPhiks6 AXcTDPwZwmFcsCyBbHrn0AIkrO4mbYN2tDeJfFSeaMGeTlzSizLcmXxFCyjEtKKjqbdKpzXSutlMn mwZ6natwnA3hVWtDHbThleUl0wpp4tM5+mxp8m8gt2EUlZLcJ5nGz5ByJ29atmwGogT81B8Isb7CJ anc4bc//okv6dSoqjJ1u+RBxXOxdryntZXZXP1aTtrP9E1a/jsEQ6UWVsYeh0NHbZthZbsQ8gtlfa m1joAr7CVgbsgLx/Y80Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sglVu-0000000999c-27Oh; Wed, 21 Aug 2024 13:36:38 +0000 Received: from mail-dm6nam11on20619.outbound.protection.outlook.com ([2a01:111:f403:2415::619] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sglVs-0000000998S-2iMS for linux-i3c@lists.infradead.org; Wed, 21 Aug 2024 13:36:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KyTGwIRh3ri9jNfm9IK08UnfZB+NIA3EiOKe6ysmMwqME2VcfT6p6XAlT9kJgverjKsOni8AQ24awqnAEDV3QZH5P01/9c3trEidUgt3TbuBKeDaXDz3M/tfwQs6Wp7I2pwHHP7MZd/XCFOfRtWdUPTBNJmflUf9TxSghIigEp/qINKnS7l6oCL3Fkh5mwst86CkGmy9m/wB7EW91bGK+hWMBicdC8vLfvolM3hRDcAycYWtt2iC/noclOeA08RcGdG4qK+SYeNFITrP+ORpaPIDNxSU9PmV00wE5FRee1mCBpJX7c+i2Fl29MGHp/JMCoVXgXrCmT+7MeNyMTR02A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5kcFPD9kGzS67atyf65c9Z4Us3HnTkZIXae5xN0lYOI=; b=Zxe0aVVR9RZeHmXRU5DsJv4sG2yUAPqxvvUEuq4WwiwQKkW7Rm4HlnWlYhgXqaXjyVhG3iIMwYxycHvWV6F+ocDLHoAqlrCjEmAzbR2pll2vd60mjIxZBXoT/EH+vS8DXXdXiPlwcCvDOS5/rzZTcQSRN2mKgpVrzhhjGG9r0+9+2RBirjtQE+kkWmYzSlbZ9Y0D3Xxa31w7shQLnccqA7ew/TqmYKlryMx7HHXOSQmlGI1SzqGmxAYdt+9EFwizkeN09Li1Z96jmsEi21PwXAfIcI36+XM4Ux7BhqeMK16Q7bc+eoUjllAS1pobpnDI5qF37icJeVqKDfWB4NeGbw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=bootlin.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5kcFPD9kGzS67atyf65c9Z4Us3HnTkZIXae5xN0lYOI=; b=Ywx9BztduPahg35VEQ5dmRBktkq3aThScs5nTkWYR5xh9AhWCITF/tsp5RsoVE4tQLlxs9s1DZV1WjN/0R1da3i4iy9aesS80C404JMsclc9mth0v0DCCvv+8oX0kjXnzi+4mUFLu0nLBhSOuvPbFnd2lYQIyk6mwmmX+Rx5suU= Received: from BN9P223CA0027.NAMP223.PROD.OUTLOOK.COM (2603:10b6:408:10b::32) by DM4PR12MB6229.namprd12.prod.outlook.com (2603:10b6:8:a8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Wed, 21 Aug 2024 13:36:29 +0000 Received: from BN3PEPF0000B06E.namprd21.prod.outlook.com (2603:10b6:408:10b:cafe::3a) by BN9P223CA0027.outlook.office365.com (2603:10b6:408:10b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend Transport; Wed, 21 Aug 2024 13:36:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B06E.mail.protection.outlook.com (10.167.243.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.4 via Frontend Transport; Wed, 21 Aug 2024 13:36:29 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug 2024 08:36:27 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v4 1/6] i3c: mipi-i3c-hci: Add AMDI5017 ACPI ID to the I3C Support List Date: Wed, 21 Aug 2024 19:05:49 +0530 Message-ID: <20240821133554.391937-2-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240821133554.391937-1-Shyam-sundar.S-k@amd.com> References: <20240821133554.391937-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06E:EE_|DM4PR12MB6229:EE_ X-MS-Office365-Filtering-Correlation-Id: 53285335-d0af-4da2-b6e1-08dcc1e6436b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: H8hBL4qRxxGhAKuqCSTx6MXkh1vmH5xb6ZYGpRRm4u23SFYWiIsH2UJds1HUgUeOpz8gTNn762aLUHruiLzESh1GgEOc6yK1s3Y1dC3Vuht/XC7nBqxmZ4ZGUCBb3eucz68u18H9Jc0avZrVsZsZ6sgTAsLc8EUGfMuMcxO6KMNtQc7H2q8L4FNPawAWMOUBwwMkSROrM/bbO89dWshin7JfDhkfjSMUjqHjDCzkOaafapv1lwBQjPLFMl8rqBqbPN+DxQ827ZM/4cBjfIczBs9uV8uD512cZdUcdXh34LU7CxV7TNmcaRLR+hDwq5hz/DC3POCLzr2mBuZOqv9CqA3pUbSynCfVRFNUEbFVoyokOwHxp5sWDKQuh/YTPcRl/LmxEOUqK4L20j0hkyx/lE7uB8WamivGQ/3m28BLBJi4ujonmR8rPYC/RQdLjSiycOap5oHv5AZ5vesRsYFCmCFLlqJgOfaYkeCIBEpUcMXTYAKTIU1OnAqGIMHTU2L7KbW7InVyukggDdFNdrM3kpToZ/kNX4nhpNdJP6fRRGlUy5kR+gSQI3BY7f9f2vQ3X5xwg2Xu/Re6dhXZvqnV3QybtJgrgcHoufaaPxSZq+NZYoBRhF5B6sZlYObPsoGLiDjFx65LQl5AZf4PO6JWFtULSMPiE+QDzgK9WuU3lN3ackekLbkN287HbJYnIlemZv9U2X51XPvqwwwVN5/T/RT0TbtpTajyNs25nijSzYFWwpqCpHsL9RZErz+jK3lzR/IFh/fPUbgC+mW2N/34b1sVZzMvZU23JBFSfXgnZXoygkfalaJ5v39Ltk/XwKTp74qtXDhQvWFLy9DA1iy/OT1jJtnemj09LOyBW3MjRSeFYYpIZ1puAguckuD4/lpnMnrSSt0V+rAWRjkT9YbxptXc8TmbTm2oDclOjF+HTUvpFPXZw+M15E+cMoEJqk136DKCihZBlezo3Zv3iZG1cli8utWchKP+A2khEVOTTraSZ0SgxGNuFQ3IFAEMjDCzAIuwyk3eAvjQ1o+QEQygGm2ATJ1MqgkmmoJFbwbhHX+7Ow2rlHyZxVM7ruVy0KcHGghRD3x+UpGQ1yxpb6ojgMXL69rY5TGPp0W0/gP2yVyXG62f6R8L3y3Hy2HTWCdM5gYOnM6t6Am9HOxI7TtbaNtMqoOup7qM2yPoOD4ZF/aKHJbYupuh/PSiFvjsMdWUouW/CldYg2uGEDu1Mml3WfEMWGNOY4pQpK9XSThYdX6qefYJqolH6B7aGzwQZ3TFHfUoHlDbYSHyH8V7vPYIEb29wYYcgRextHZp5YPUnYN6H1dyay3+GX15TMkI3YJLBDMEsovHVKDkufmJowe0bTWeamFRqetSx3F1MuKZber050i159J2B+w2AISGSyunqLKWNWqf4xdfOWbBEqVvH6Asfp57b2a/y8B0DmB7AGb02o/36Qf4K0rCysNwQ9Ip X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700013)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 13:36:29.6758 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 53285335-d0af-4da2-b6e1-08dcc1e6436b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B06E.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6229 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_063636_709528_B72FAF32 X-CRM114-Status: GOOD ( 12.98 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org The current driver code lacks the necessary plumbing for ACPI IDs, preventing the mipi-i3c-hci driver from being loaded on x86 platforms that advertise I3C ACPI support. This update adds the AMDI5017 ACPI ID to the list of supported IDs. Signed-off-by: Shyam Sundar S K Reviewed-by: Andy Shevchenko --- drivers/i3c/master/mipi-i3c-hci/core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c index 4e7d6a43ee9b..b02fbd7882f8 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -834,12 +834,19 @@ static const __maybe_unused struct of_device_id i3c_hci_of_match[] = { }; MODULE_DEVICE_TABLE(of, i3c_hci_of_match); +static const struct acpi_device_id i3c_hci_acpi_match[] = { + {"AMDI5017"}, + {} +}; +MODULE_DEVICE_TABLE(acpi, i3c_hci_acpi_match); + static struct platform_driver i3c_hci_driver = { .probe = i3c_hci_probe, .remove_new = i3c_hci_remove, .driver = { .name = "mipi-i3c-hci", .of_match_table = of_match_ptr(i3c_hci_of_match), + .acpi_match_table = i3c_hci_acpi_match, }, }; module_platform_driver(i3c_hci_driver); From patchwork Wed Aug 21 13:35:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13771635 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24BDDC52D7C for ; Wed, 21 Aug 2024 13:36:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=n1yuYf/TcLwMuDPGhf3HLZ/ilX6RCAVMCgb1Nrp2NU0=; b=c8TBagXtPCLM8S jdD9DExR5yuZ0pxXFLwLaglvYqG/y/c96xTDYYNLw8oldX/E7VPT3Bdj/OMTm4H0s54r/HcMJle/Z X8tolvOfwqVOY2iZC4aInC+dHp8bJec4wuSxPP6FriHKVF2azR+3ZxV/iNfMAzY6icxIQ5mnvwZ2t qunkngjxcUUNAbM/BqtA86vHuIh0AO+YSCiHDr1v/SLSoLUWzPQflqgl0vxNVKnJ/Nm42q4R3X4xi T/fhOoPj1TErHW+Rh6ayUd7yYKfEZ0JuPAfPkiLtSPsOsC68LClv6/eBjn8UCswHePqT4XVaylUxo OuY8VmfMmCdjhNrx5sQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sglVw-000000099AT-3f1c; Wed, 21 Aug 2024 13:36:40 +0000 Received: from mail-mw2nam10on20603.outbound.protection.outlook.com ([2a01:111:f403:2412::603] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sglVt-0000000998g-3WEm for linux-i3c@lists.infradead.org; Wed, 21 Aug 2024 13:36:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=K4rJZa1Pjyjn9W1Fi0KvhE7enWWDjW/4UP9Pr7gq7jpqURxtFOYZa5wxmXUkC0g6UuPE9UWYsqi+YleoH1l31Q1xGGasPkIsKBug8rz3dmLYt3zEjiCysRVq5SPDjjLFhz1yDejs3FrcmiQJn2WJhKJYaVKciaEfRSvPZFmJUhJiwqCT92PM4fXKPX8N5joMeQUqKf3MdGyuB6Tq1plaCf2xxDR6VPXLqMi/rTM7+gus0fiq1z1MLFrrwEIkx73CS7D7zUKeRBVgT+tXla/BfEBgKEKC5IQzNAM+cOrSVjkBzPmPiFMwIqnq8WmrqSr26eMtuESVGbjGRbRMfsLl6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IrkACrkJSCfrA89HtK87N21G+oA9tQzNZbJxm/EN1qM=; b=uW3IGfqpZp7EJ6dhjdQt+CLWsAJ/8cmEatOfMw0c1ZeSiukguKzGtdOkgGg8Hx1vOKxDEMYTwWhFmi3esRALdv4mkx06J3wwaEPSXEDdw9/ieBvYv2ok5B0WcyZNOE747cRBTXvV2uPOet27v/pc2mf4rAVhco/7EvpXWDc30WOHwkUw8dJdwv+7k08dYhUahpL247rv59Rl5cctzSVdPzZXPsTtzUqitv8IFhNHpOBYfH3l4I/3Mm+/okZRnAV81HV2+yPQIDfZidyPQd/S1z06UbSdu9LhuLikSfoKH2scIegpJJon0XETJ5S6HKkvxsjD/fegPwfTXsj4TE4hsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=bootlin.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IrkACrkJSCfrA89HtK87N21G+oA9tQzNZbJxm/EN1qM=; b=r3A1lAoU8a4cwUoX3v668YF60B6hxUib7uUaiQmsMtff7JDTx9e3KkVSRfuW7DuzhlfL2bbSTx+2aWU71v9enDWZdGgJ7I/3GqdKajfUXGFUUkskVSMTHXMeTfC7gEJb6asu6CduIpkz3rG8OSCSt6/TfIxnKHb5Zo1F5/HXFV0= Received: from BN9PR03CA0125.namprd03.prod.outlook.com (2603:10b6:408:fe::10) by MW4PR12MB6753.namprd12.prod.outlook.com (2603:10b6:303:1ec::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.25; Wed, 21 Aug 2024 13:36:32 +0000 Received: from BN3PEPF0000B06F.namprd21.prod.outlook.com (2603:10b6:408:fe:cafe::66) by BN9PR03CA0125.outlook.office365.com (2603:10b6:408:fe::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19 via Frontend Transport; Wed, 21 Aug 2024 13:36:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B06F.mail.protection.outlook.com (10.167.243.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.4 via Frontend Transport; Wed, 21 Aug 2024 13:36:32 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug 2024 08:36:29 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v4 2/6] i3c: mipi-i3c-hci: Read HC_CONTROL_PIO_MODE only after i3c hci v1.1 Date: Wed, 21 Aug 2024 19:05:50 +0530 Message-ID: <20240821133554.391937-3-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240821133554.391937-1-Shyam-sundar.S-k@amd.com> References: <20240821133554.391937-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06F:EE_|MW4PR12MB6753:EE_ X-MS-Office365-Filtering-Correlation-Id: d290cdb5-cb3f-4daa-2d0b-08dcc1e644f2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: gYQN5BkbTnXm39gpA3OCSXjvv2k7jrqxnyZtTq+2+Gv60IUm2kiUPEWqKULEk5acSzdXVhvz+BFfLqVTKPXH1Ui0D6Ahd1h87IIYSTumrHJx/S7HkOj2aDdN6kbV/lKlQ1cEucM3Y6Lm0M5XhPg2yu2Re/sDtqr9uNJQ82ryHqN159PjuizhLAP5dCoogbFf0OowQEPpHf2TYcr0H2IxKXHL81Uw3D7nhCPeaXkZ/Ez8awWN75M6d924PCIpsSYCmIwm1+h0aCQgbIDQ/xrbMmWDx+9Xk+9AHPs0AGw4d7DUTslR5uSNJgnPxgDQV2YdKeBz4677ZLXBuFQCrk9BUN7EJR+swJTiHCewpdnzYuWTpNhIQZhpGgys4dfJUgTPneN3FbdIjr2fB3to12ufUGn+Z0irqtyBAIjaLc+BhCXDOWjnzSSCPdGi9Ta7u3MNW2xhvP99yfhcpnF6pgLgB929EmvOlWNOdbKThgSea+1e2OT3CoVV8swyx2jSo4X40qK4jtRwOWDq0gVML11poMJsCWhCt/vdC5PaXC2TVeStT/OAMreSiLz33hzuzN9lpGDyVYdJBm0Qh5HqO9xwzy3vwnnPnt+1oIh/sJCr9V6rUa5TDsxiRMeZiyC4vcN+mBwN/9/Mv3NwK8MVcfjAXM36W8m/Pmhay2Ebmt7MYwS7X6OvQo6BDOnmRl/PLQiYN2ecmJejydN1GBWmuZdgEFluH2IguTLIQIt9uWPNagqyUJHbaswRle55sg3se6WnqIivzpRt5w8zPCceCGB17gjN4GbAkohFte4szU5Hw2jAjY9z3OYXU/xDR/YaVK+A3nuwHktwdw5FQp6YC+t337OOuAc+xmISgXoNDYN+45xEGGuWR+NjaLRfyS8SK3i1LtmgoRT0z/dZsuJkCic4BFWQNogYOUSAvLZJNFKFvc0Q2CAjbJaizZJ09NAFXdNogWuGEM+YWg4rFkYYYGk2zJB8XPM3LMSeTYx3koxyHJLV5ql4FZh+uI+W6mWTpob3GuoyZAJzoG68biPyB0gAjNZ4zlgdzHrv+jSfPeS2302ZFqdD2TVy4PJ36QyLFv4nhPd8bmQrC++PW828WsmWItgdfv3QoHYJgGeBnol1CE3dsW6o+1mPIE/0dv7w0469QMvPXYrjrGFf3yaP79AlZ+h0Qg38ZN2OzOs47dSnEFpA54XqvTdV50BmhCIQGN8+Pvcgb8KHS+7VkvJtCX5qliqZoUIBNf8G44R5JJBl91LLKj5fjVaJ0JO+wF+tgRR/levu3NvZYauiuIr8e8yFuZ6Hlu4N3Duazz/l6ozNGVZluvIG1ELfejZ8XljgTTG/rCF7B4i8N0J+R4mi7ZlRyjHKPZbgHfYzIPFC3qA16OZcV4/jXwyDJGXe43hTiiPlf1tF2e99iQZlbcXSBLq4i3jVhgTwkrO4kIjC/CzAYcTNLKH7WBHqCpUhcmZnP9sA X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 13:36:32.2503 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d290cdb5-cb3f-4daa-2d0b-08dcc1e644f2 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B06F.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6753 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_063637_908300_A6A69DF2 X-CRM114-Status: GOOD ( 13.93 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org The HC_CONTROL_PIO_MODE bit was introduced in the HC_CONTROL register starting from version 1.1. Therefore, checking the HC_CONTROL_PIO_MODE bit on hardware that adheres to older specification revisions (i.e., versions earlier than 1.1) is incorrect. To address this, add an additional check to read the HCI version before attempting to read the HC_CONTROL_PIO_MODE status. Signed-off-by: Shyam Sundar S K --- drivers/i3c/master/mipi-i3c-hci/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c index b02fbd7882f8..d1952a5619d4 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -33,6 +33,7 @@ #define reg_clear(r, v) reg_write(r, reg_read(r) & ~(v)) #define HCI_VERSION 0x00 /* HCI Version (in BCD) */ +#define HCI_VERSION_V1 0x100 /* MIPI HCI Version number v1.0 */ #define HC_CONTROL 0x04 #define HC_CONTROL_BUS_ENABLE BIT(31) @@ -756,7 +757,7 @@ static int i3c_hci_init(struct i3c_hci *hci) /* Try activating DMA operations first */ if (hci->RHS_regs) { reg_clear(HC_CONTROL, HC_CONTROL_PIO_MODE); - if (reg_read(HC_CONTROL) & HC_CONTROL_PIO_MODE) { + if (regval > HCI_VERSION_V1 && (reg_read(HC_CONTROL) & HC_CONTROL_PIO_MODE)) { dev_err(&hci->master.dev, "PIO mode is stuck\n"); ret = -EIO; } else { @@ -768,7 +769,7 @@ static int i3c_hci_init(struct i3c_hci *hci) /* If no DMA, try PIO */ if (!hci->io && hci->PIO_regs) { reg_set(HC_CONTROL, HC_CONTROL_PIO_MODE); - if (!(reg_read(HC_CONTROL) & HC_CONTROL_PIO_MODE)) { + if (regval > HCI_VERSION_V1 && !(reg_read(HC_CONTROL) & HC_CONTROL_PIO_MODE)) { dev_err(&hci->master.dev, "DMA mode is stuck\n"); ret = -EIO; } else { From patchwork Wed Aug 21 13:35:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13771636 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C9771C52D7C for ; Wed, 21 Aug 2024 13:36:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=40HBFMQwW+xdHATGYl5+t8l1U9nKXaF7MgH6B/XIWSo=; b=nWAhZWjwb1zsDL hNN4rZemuDBNNLanrdGCoc4nahpLbyYNdytYivQkSnaas7i4g7HICt2h0JBAlDPI8fO+SfQ++6eei 7UVgRdps6xwgxTLrYOvtW1riJoSZbqlbrGGodWIveb9YQ2T2eQIdPO+JWrgy6lqc/MYUS5JeIMQmu z6UymJ1fVoOj8E6LwMTJT5PpYV1f0GAWNYnn5rke5bamDDJvlZFphb0wJpin/UinkuoZc3NoKm5XZ l+61C+Q+X7VFVseS+hx9/uMLyk/DZMpE2tOVA9orCfmLHHBetdSKY1WU+qJ/DmbPjkRLi53cWG5nN lQMowLjkRwKC4vIVcOJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sglW0-000000099CX-2Hjb; Wed, 21 Aug 2024 13:36:44 +0000 Received: from mail-dm6nam11on2060c.outbound.protection.outlook.com ([2a01:111:f403:2415::60c] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sglVy-000000099Ae-1T87 for linux-i3c@lists.infradead.org; Wed, 21 Aug 2024 13:36:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LZgmSYvxxGDpledFf33C963hl84ekdfjMoMhcWJFyjh0psOMcqxPoKYE6UnlSludBg6zBP2QkyGEULeNIHu+FtKLHKTyWeZFNChGE4J3Hnf2JhA2/etmOlkbh6vL+M100pk4C6lIv9rhUBAr+E+YJC1nUAQn/pkBe7tG+LWayqbZnUnswkpTXUaD7+06MOmx2y5JS+wPIQ8oqNQy+rhL3Tljy1XREDqwu3tFQYY3eR+k/uG7iScIc+Bxg2SvqlfKJvodZicHC7F3qfbUzfmIpHPjIyci3q3l54554Z+3f44gKFORdfee9Mc2LDJBFjf+zWEcIg1W5cc9064pw/7RMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2i6iAN0UNrHS44VLGPaZAuChVuWx8UXzuFHKZHt+2n0=; b=NXD9VLIZpLJiAYWDcoF3RDuO5dJ5+iAonI9I8amV8VAoFu/xV0Njb2rtXXHU0iSkAkJqRPl5MPPLdEE4CP5LqnjZQOcLPTzlIc4X0P8vDzVpJbym6fdJbhO33FpFUriL5NgExO8RqXLO9X8EARDe/c8UePikU71qF22z9bkd31CIza+7NhM82QWy1+SAmnjzberIfhUvVEmW2Xg4abEPQVFMLwk7ZPpMSC7No8g+m5u+DjP7e7mh3c9oEdsHPgC94nr/XpgLfkPXXGz3+0wC1kO0M7N9/cdnXbBDHGxGcTa1qSH87DbS6voJ5OWiX879I2J+qAZ8JURsyQ9cJEdleg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=bootlin.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2i6iAN0UNrHS44VLGPaZAuChVuWx8UXzuFHKZHt+2n0=; b=Hzs5giDSYaHJRsg6p9JY2AQ5ulHOf4MZnXX+FZWDDiASgMkHPFLjAQkxT+pIrVKG5NTIqt8s5fPNPjlKbo2EH3amq7V14zAIGnQI9BKyrdzteRwMlOH07aJROGG1Hn1Hrh/gbEcgiXMo345XsimQPNx1ra9qqQFGAwajh9pB/yY= Received: from BN0PR04CA0084.namprd04.prod.outlook.com (2603:10b6:408:ea::29) by SJ2PR12MB7918.namprd12.prod.outlook.com (2603:10b6:a03:4cc::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Wed, 21 Aug 2024 13:36:35 +0000 Received: from BN3PEPF0000B06D.namprd21.prod.outlook.com (2603:10b6:408:ea:cafe::31) by BN0PR04CA0084.outlook.office365.com (2603:10b6:408:ea::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend Transport; Wed, 21 Aug 2024 13:36:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B06D.mail.protection.outlook.com (10.167.243.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.4 via Frontend Transport; Wed, 21 Aug 2024 13:36:34 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug 2024 08:36:31 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v4 3/6] i3c: mipi-i3c-hci: Add a quirk to set PIO mode Date: Wed, 21 Aug 2024 19:05:51 +0530 Message-ID: <20240821133554.391937-4-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240821133554.391937-1-Shyam-sundar.S-k@amd.com> References: <20240821133554.391937-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06D:EE_|SJ2PR12MB7918:EE_ X-MS-Office365-Filtering-Correlation-Id: fdfd9d39-1b61-422d-d58b-08dcc1e64652 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: 23jgJRIUh3Wdun5IiXwyORJ96qW76vT69gskh+hWbKzvSr7KKeoDkFUg5vQEf3iFVyX+1D927NggeAUY3H3sVdgL6xFVZLqmhCox7GW7j54iEsfd8stcJZNjfm3t6i48UCRM+uIGQIaW4hUCRvXTmB5UbmFfycNikA9Egk/Ms9QUcTAk9AtIlTGrmk4UyrGpwmPWIOMxbargflRmUwLqS4tkwa2j8XDF0kjXNnElh5dEjg0m9cz+vKfNffo1jlthfzvv7zZOXSHxlO/yy9I9KoWX3coliBkWGOG+AbVayare5naArpu2xULfzt1+cL0E124L/xS9/c1tw0TPNKS7byxmizOWPsN3MzlQrK2rW93Ih/qm13xe57+1EL+ktNIYMuH9C24TKM7min2g/UvewI60nGWbmg3FoNiiHoddggIV1z9tZKtYev+2t98Dbg7QbpuHKP0+Rgbh1qe48aPKBeGhYgVhSMQSGvSRWnaEmgtVI2SEvhmieAu/6WdeiwNMPt0ugzJYQAIysMDnQQhjNIcHcmiis+levgqeBsiz53jj4aC+nX22hJ+ecu7dum6WRHD2+dJDQ5ulB4+hbaO7KeAyLhH/ev4JZ6w4fX0am4zzl3DTecVtVCRc62389PFa+SpPqt7p2ZenDW8HSkm1pMoM7dR4RcgCVKx+cdRJtaaZLlohAJVwe6mhz1CY7jFUZwZ40QT4lAN+KR1dV6JEGg0NH3gzE9PdQYjFcrgaMo09gAUIe+fBYglY/+ciRdQQcRXoapbGc7+x/oF1OpD2NLa4lK/tVoR06KxR0I5E0WJ4G+RDFTTX7bgCmVdblcr44rfpISWrvP5SvTh+qTJmAec/LHMIoVufx01WKI1rlr0Wz8AzfNJ9qr95c0P28l2uICfznqFD/zxTYJKujF5iFraqT0RNdt3+2P2ZV6rdfQjXmNmL8Zjxd/kQCqezFCCd7zaDD8H1zGwvpU8O5G0GLsZEiG1Vwha6/AIwszEH56MqRkOeJI3nt2elNKhgziDcq0Uxsm1JLwrgE7YOquvUACOyXSCHqXoyBcMmAKn7ImQpJeXVR+qEaYIiRfyFOCwVOXygVVKPF5Pm0NzYCI7LAgo1J3tuXCsfv1KEhjb1MIQF0XnYCjju8V/qf/VSjWZnmtHeGMusQlJgyU2pBwZ+lYUvCPJ+NlFAzMq5fui87ROWrhQAscDglT3HkGiMT2CbcVoWjCNTI+WuZkV+3TB2e6CwBpZer4j5iX8v3/tBRH8YENkJuEIlW+sckUtVWOTvQvxiOU8fcNgwxVokXvbeioSr8dDPeUjmVsTaUyskJuEgjPp+V7jJ7tE1wVGEjqaXeXZ2OhiQJT4wdjDZavXujBNIZwYB9d/goAwd4RcLpQOaEgX5SXccrpze24kTvpAKV/E+FZ/itojKM9MN/JOqxa6uX+ELAYQw01wJPi8NOmiKUhJ7SVxDhF3a9s9BVXnP X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 13:36:34.5615 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fdfd9d39-1b61-422d-d58b-08dcc1e64652 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B06D.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7918 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_063642_415257_A5B9A4D6 X-CRM114-Status: GOOD ( 17.80 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org The AMD HCI controller currently only supports PIO mode but exposes DMA rings to the OS, which leads to the controller being configured in DMA mode. To address this, add a quirk to avoid configuring the controller in DMA mode and default to PIO mode. Additionally, introduce a generic quirk infrastructure to the mipi-i3c-hci driver to facilitate seamless future quirk additions. Co-developed-by: Krishnamoorthi M Signed-off-by: Krishnamoorthi M Co-developed-by: Guruvendra Punugupati Signed-off-by: Guruvendra Punugupati Signed-off-by: Shyam Sundar S K --- drivers/i3c/master/mipi-i3c-hci/core.c | 9 ++++++++- drivers/i3c/master/mipi-i3c-hci/hci.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c index d1952a5619d4..3aa4aa9deb56 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -754,6 +754,11 @@ static int i3c_hci_init(struct i3c_hci *hci) return -EINVAL; } + /* Quirk for HCI_QUIRK_PIO_MODE on AMD platforms */ + regval = reg_read(HCI_VERSION); + if (hci->quirks & HCI_QUIRK_PIO_MODE) + hci->RHS_regs = NULL; + /* Try activating DMA operations first */ if (hci->RHS_regs) { reg_clear(HC_CONTROL, HC_CONTROL_PIO_MODE); @@ -804,6 +809,8 @@ static int i3c_hci_probe(struct platform_device *pdev) /* temporary for dev_printk's, to be replaced in i3c_master_register */ hci->master.dev.init_name = dev_name(&pdev->dev); + hci->quirks = (unsigned long)device_get_match_data(&pdev->dev); + ret = i3c_hci_init(hci); if (ret) return ret; @@ -836,7 +843,7 @@ static const __maybe_unused struct of_device_id i3c_hci_of_match[] = { MODULE_DEVICE_TABLE(of, i3c_hci_of_match); static const struct acpi_device_id i3c_hci_acpi_match[] = { - {"AMDI5017"}, + {"AMDI5017", HCI_QUIRK_PIO_MODE}, {} }; MODULE_DEVICE_TABLE(acpi, i3c_hci_acpi_match); diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mipi-i3c-hci/hci.h index f94d95e024be..c56b838fb431 100644 --- a/drivers/i3c/master/mipi-i3c-hci/hci.h +++ b/drivers/i3c/master/mipi-i3c-hci/hci.h @@ -135,6 +135,7 @@ struct i3c_hci_dev_data { /* list of quirks */ #define HCI_QUIRK_RAW_CCC BIT(1) /* CCC framing must be explicit */ +#define HCI_QUIRK_PIO_MODE BIT(2) /* Set PIO mode for AMD platforms */ /* global functions */ From patchwork Wed Aug 21 13:35:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13771637 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48BB7C5321D for ; Wed, 21 Aug 2024 13:36:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=91dWbeK8Gl7zbG2sCYigZb4dmr7/LJORK7YQXk+Iqcw=; b=Uy5Mu4+p1Cf0b7 lO+gYKi+dKkunQMkuLUaXoFsI8vOMPY81Ff7IQkhRjPb1ruDj+V8qrX9wAAY8/1Mrz/8w4w5RiESS +AtBvXPulM6/nmiJYEIe78MpDtWAQma36BO2HaGnkUIU6xgTHgWIrNPzrb3P15zk5kYOPqoSTWNcc I9TPaZfKPqvp109SMkkcjtmhXCJ9Z16WzG+eGgH6m5W8IWe1Arg+d6t9KkbbRxcy0Tula1yAjUzFK 6XT4b0pxOA3n6WXB4edg3eooTgeSVknRfTGaiEGlLfjjnNKx05TQDo7tL4d2pQXJzVUWTK8RVQX3U Vlds/KKKaiI87FVGv7Ew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sglW2-000000099ER-46lr; Wed, 21 Aug 2024 13:36:46 +0000 Received: from mail-sn1nam02on2061c.outbound.protection.outlook.com ([2a01:111:f400:7ea9::61c] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sglW0-000000099Bg-2bCV for linux-i3c@lists.infradead.org; Wed, 21 Aug 2024 13:36:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XgypvoMpS4QmatfszvlDKIUlSTdLVOYCiGT+lA7MJnujJZh33t8O1HjlMwbb0XyI587Uaa6yWxWyy8nnwQrPzQlXlqTfrHj6TPsVXN02ecJw1V3T3386lqT4T05vS7qG6NNQohQgIBJ5DPn5Iyaq32XHxi/aGMkCCX9WuCE/pLyNHPdrV4iUJom8ZZpG8v5AhFKFCCssOV6BbTUwXfFDqQwDf+OygLS+FqzeQvl+/x5pqwHrI+3GtddrK8JyTYaUToqIeU57kTbv8py7i0LIGP4WL1jN9I5xuQn1HiIfpmGJXWd/5Mi9U3P3v46QhXfEQE3uKhII09cnj/tui34QGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kYLFoqW6M5Jzy78TlleUbBdALl4mB7DN4RzEDjKHDz8=; b=ee5SJ+VCT0GeAaC23LEfCwZAqMnkPbtEE1J/0XNtGz6oyFpJ0nR00EKq8pR86YAVpC0xaO+zwhC0deCs0Y/bBNEQto9CVIg8hzUT8EfKi6LQzq4h98CQdjO/0MnSaqe5JFdfl6z8v/zYX7xbbQJTVfoj5OTPpQ6SOlPJquQ68r/EqPfi2VR2BtS+mI78N4j2oUH2A3oyPS1DICYo/kUR8ljBEFqOq5U3kFIkwkMce9lzrje5G6SQpsAxUd1iPiLYz9P0P6dSZ7ACJcxzZGQAGANK85w9yQvRpW4jH6Is4BKTMEUm22AU8vd/eEDQw3/WuIslSPKiBGHpBP2TWIGpIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=bootlin.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kYLFoqW6M5Jzy78TlleUbBdALl4mB7DN4RzEDjKHDz8=; b=Nj/2OYTjU++JtfzG53Q2G7cmsroXaECguXtRpeDchJ2E4ykWHYaatg2BOcvK1nCS8r7Fhktt1MzgX5a9hUK2cfp+STjZhOxWfiQZ37mkQYrpsZBXOm4eteaVnW+bt2x/dGJE/AChuuP9JxEpZq95loXZWBwnLU1mQUDpXovoiDw= Received: from BN9P222CA0014.NAMP222.PROD.OUTLOOK.COM (2603:10b6:408:10c::19) by CH3PR12MB8211.namprd12.prod.outlook.com (2603:10b6:610:125::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Wed, 21 Aug 2024 13:36:37 +0000 Received: from BN3PEPF0000B06B.namprd21.prod.outlook.com (2603:10b6:408:10c:cafe::3b) by BN9P222CA0014.outlook.office365.com (2603:10b6:408:10c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20 via Frontend Transport; Wed, 21 Aug 2024 13:36:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B06B.mail.protection.outlook.com (10.167.243.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.4 via Frontend Transport; Wed, 21 Aug 2024 13:36:36 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug 2024 08:36:34 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v4 4/6] i3c: mipi-i3c-hci: Relocate helper macros to HCI header file Date: Wed, 21 Aug 2024 19:05:52 +0530 Message-ID: <20240821133554.391937-5-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240821133554.391937-1-Shyam-sundar.S-k@amd.com> References: <20240821133554.391937-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06B:EE_|CH3PR12MB8211:EE_ X-MS-Office365-Filtering-Correlation-Id: 2beefdf3-3b20-4aca-86ab-08dcc1e647bd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: T3w7Yve5/ddZl55GfVBUuyhvMPjT9e+EUENCRXcEFANa3RY8QjG9yQYLOyL6bJvfhAj0X0bEv15AN5moKYOxB3nhHGwGMkDX6HTsSAVEpqRTOMfh+0g56XzDPAMs32wPkqIJ1MC8WeaisWnXGwtxJR4A5aXF5iTeogF90kfreBZrwDA3sbTMu9KvDXl6Q+OiVDieNSHDoyh849jgl+HUlF0hOpbcDFVitsrIPCaaDzqF6z9JB8oonZLdgIwPBFRDcOj3ldv+wYOigKGLW5tefE9RH/d7mgjvCckWX9ZmFGonJ919RaG9Tx2yHcbjEeRRu2oCCBRiZYdd0s53bfVvgV7D4VNKJsgLnJJ4kFB8olVli2tEIErXYFuqumBKA4xnC2DaIrX/OvKvEh1uvj/Xjuoj5hGBN1fxHl78czQaysYp41kXNkRuOcUcP6FZkYJzb3o7G2Psv3bEFoUDBynrSrGRoglZEgOzIB3f4r2OTWXbGI9z9cJbQM/YqFGOUxWEYGCFLNlzDxLHDsYib+JWbWZVeffUvVNXFNppqEj2SmB9i7Qxt6xfMMYcLE4eRNwGCHG0A5htk6N38DDZaLMdXYo4uQLgrePVVltg3nwzPir8AdomYgYL4bkq9r3qeHpES4yFGEuSdNI4Re31KX/PhZadb0QbjLI0f3az9r8c5rTfqAhpAGPKhKprlSSTnJBWETEFCoD5JYd+s6VsNeL4k2EttuULBzpMAAb/0DVU0N/+cUtGKT8WbXBD86KnTmLLcH7Ah8FRrevSg3wRO9lt5X1u5kYMDyHSFyChShAzomyFP9HcJoQTfi0lJueUEq8Xo+cRYXGE8iy+rhyeSbO8wEvwYajOynxKuubwZgbDr8IxmrYWi2lo4HELr+ziIPJCJOd+JskxRqelZdJFopnQ1ir1i2kIsFVj7u45fI5BAr1MW3vbxXqDh1wo5T7CsnhoRn7TtC2yzk2Y4m9G2tMFSVZkSlWfMX8T+5wdHU1ZX+XtczfECXHOsWKuQ/NBOZQZvczkXulkHPyoOzBwrCAukiKimi1jQofCPTNkGVeq6sSNFjKv2qLpQc3Q5IntSZgFHafYaB9wDZa6t57EOt66UY3yNLWGfP9f2VdBNOkIXcFsmnpCflQ6u1rHgB+iHfTh7WrMwl8qJCIoNP85OGOrHJfI4Agda/hFTNFnCZIP297asCvM2cDRO4G2yglco6259MJMsO3eNMH9CC3OAVqn2U4A75G2Ip40XjYVUCujAG2CSwy+3ERnn2D28QfUQNOWKBS3vXgH2JRSFOHNpJQyQJR2BB3CQZp17TKGRZ0g8vugXtoEIf8LZrF9s9ldFAeY1ya0GTuTLkKVc/cEW/swMVr4Z/v+ua9BIFiFo4ob+WlrWWBoiJ+mNofET4hXL81uJOrLroyBoeZdt3Mk5q6+FdXwSeuFT4zbM/9x0JYzn9zhTwqgFv0OBNLCn5bzjvTE X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 13:36:36.9228 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2beefdf3-3b20-4aca-86ab-08dcc1e647bd X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B06B.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8211 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_063644_684172_456A4297 X-CRM114-Status: GOOD ( 12.47 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org The reg_* helper macros are currently limited to core.c. Moving them to hci.h will allow their functionality to be utilized in other files outside of core.c. Reviewed-by: Jarkko Nikula Co-developed-by: Guruvendra Punugupati Signed-off-by: Guruvendra Punugupati Signed-off-by: Shyam Sundar S K --- drivers/i3c/master/mipi-i3c-hci/core.c | 6 ------ drivers/i3c/master/mipi-i3c-hci/hci.h | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c index 3aa4aa9deb56..c0f3c0ce9f6a 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -27,11 +26,6 @@ * Host Controller Capabilities and Operation Registers */ -#define reg_read(r) readl(hci->base_regs + (r)) -#define reg_write(r, v) writel(v, hci->base_regs + (r)) -#define reg_set(r, v) reg_write(r, reg_read(r) | (v)) -#define reg_clear(r, v) reg_write(r, reg_read(r) & ~(v)) - #define HCI_VERSION 0x00 /* HCI Version (in BCD) */ #define HCI_VERSION_V1 0x100 /* MIPI HCI Version number v1.0 */ diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mipi-i3c-hci/hci.h index c56b838fb431..76658789b018 100644 --- a/drivers/i3c/master/mipi-i3c-hci/hci.h +++ b/drivers/i3c/master/mipi-i3c-hci/hci.h @@ -10,6 +10,7 @@ #ifndef HCI_H #define HCI_H +#include /* Handy logging macro to save on line length */ #define DBG(x, ...) pr_devel("%s: " x "\n", __func__, ##__VA_ARGS__) @@ -26,6 +27,10 @@ #define W2_BIT_(x) BIT((x) - 64) #define W3_BIT_(x) BIT((x) - 96) +#define reg_read(r) readl(hci->base_regs + (r)) +#define reg_write(r, v) writel(v, hci->base_regs + (r)) +#define reg_set(r, v) reg_write(r, reg_read(r) | (v)) +#define reg_clear(r, v) reg_write(r, reg_read(r) & ~(v)) struct hci_cmd_ops; From patchwork Wed Aug 21 13:35:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13771639 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5227DC5321D for ; Wed, 21 Aug 2024 13:36:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TQfnXWsTieww2NyHoIZ0Cn4dEG0yO2Q5CGv6+0e939g=; b=SIdqj+OG8hd/e5 IruFQbAkqOZVOprJgNmDTLQbGBlauce39+QAIKE0C3bTu9Nt0XIFg2Wx+rtgol86QSXw7XOnWb0Gu 98lKZRNZXROA48D94aFAvoTmGwSc3gXqMiscZWaYgSOjYS9m08tMILcxEVDDXUd8Io/gxKf6AAKFW UcHNRfhhapdpgmn1smeRiErkcxEltFWEGgTNmWWmaFDyNwuTvk/64YhQn2uF/GdiQnqn/ZmQuZLcX wdPl5XyiF16SDzbj3Du57iTN6KfzykFhjdHOQOm2/RsWCgN0WMXoyWH4xH4mXe5h+opsdAlEXuzYr XrV0CjMHAqhOwAmll43Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sglW8-000000099He-0GAC; Wed, 21 Aug 2024 13:36:52 +0000 Received: from mail-dm6nam12on20614.outbound.protection.outlook.com ([2a01:111:f403:2417::614] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sglW3-000000099EL-35on for linux-i3c@lists.infradead.org; Wed, 21 Aug 2024 13:36:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=H9xGwdYcGqjbKMF1iBQJ5W7wCKUhfZsCIs0ojsg6hBxOZekHJeec50wRjGI/HDiBkcDvx1pNsfxorVCLeqFtJVIG7Hze4GT0rwTN+MeOGJt7nfeeOBg9w1wvqMkNrOM7NF6HiH51s9uqhdLEdJGHV82SEekbr+dWSQ1xAxTqdtNrILq1YyTkt7DE3KEMe2sMexrbtoy/b/iwr5U9s9gbybKPRyK4odNQcYpvY9s/6OHUBAAM20KbO3nPqEevhVypj1zepg+52vXu/W/HRBRTNsobsnbdcaI9cWPOQY+ApUi4EfzSsRL5AIv2HfZa27YzBWsQfs2OpyePXDJASDJsUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=D9jHT+vWTnSRaO7KpjZzjJRIaO8rBSovyZSAChl7A30=; b=Irzl4dbIqnV6FKl72YOEul6MITaSIMFaZljonBmEHLWQBPhCbWWo3UFSf8L1Wk4ZR7H3E9L3Sxg0oiFD9+dhJMaCtGA96Pm6BY/xjS8lzizFqoCwDLJYMSJ2JMobrlLIp/b/9Z0e/831nLRupc+PW+rNT9WIjW5XvJxNDlqjZ8nsPvLPBuSfrSAiO/VIl48G6LulrqX3e1qCtoCyvrl4dWLevzYXFbAwg5/fqLQw8+Y5uJEMcq+zHNTbOxspJ5ZPlOXhunLtyM6Hq44lu6d79XbcO/KUBHRzOnXRU2VOXEcWOoir+7DFAzNnW5hiRw8UP/iCrDOgyTxx+NVjXOes+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=bootlin.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D9jHT+vWTnSRaO7KpjZzjJRIaO8rBSovyZSAChl7A30=; b=wOWrpWqBrKQPLzC1gT9FFTa/Q9ZCjS1nUD07vTKzJU7bYXMHVMPWhJveVGwILEpldcRknTXPsWU83C7wMLROYB5uadAp7eKqoW5EJ9ymSTUUAeJzgmCXas2lU9ZxR03XhTuQCnZDEMvGvUBF4DkAP5Fc4tWPJc4hbE267eRZxMg= Received: from BN0PR04CA0197.namprd04.prod.outlook.com (2603:10b6:408:e9::22) by PH7PR12MB7872.namprd12.prod.outlook.com (2603:10b6:510:27c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.18; Wed, 21 Aug 2024 13:36:40 +0000 Received: from BN3PEPF0000B06A.namprd21.prod.outlook.com (2603:10b6:408:e9:cafe::ee) by BN0PR04CA0197.outlook.office365.com (2603:10b6:408:e9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend Transport; Wed, 21 Aug 2024 13:36:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B06A.mail.protection.outlook.com (10.167.243.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.4 via Frontend Transport; Wed, 21 Aug 2024 13:36:39 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug 2024 08:36:36 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v4 5/6] i3c: mipi-i3c-hci: Add a quirk to set timing parameters Date: Wed, 21 Aug 2024 19:05:53 +0530 Message-ID: <20240821133554.391937-6-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240821133554.391937-1-Shyam-sundar.S-k@amd.com> References: <20240821133554.391937-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06A:EE_|PH7PR12MB7872:EE_ X-MS-Office365-Filtering-Correlation-Id: 7309975b-baf7-41d0-c069-08dcc1e6498a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: Nr8cGspREIlulwRtq7vuQ8OjmqxFkzdmUxsQHWHmCm+feSyoMhK3bBmBHEBuapR14ORyh36t8LtU3uxLYehxRpti8IaJDXyP2rl/6MD0kVfwWS57Orejul+SHRy+Gf2p+3lqKrMdoV9K4BJzTe288mBJapvxfrK6DORa2AbdKl/k5IrJcO9HJrpe/lv83yKfyhvwO6foCAeIbRvl0/LZP0a05lOzC4kRv0NIjnEHs5KeP0l1kd7R+AKu3nZkahDppi5oYmcasKLoTKGEYKDldV4qyGo3NIi9B4wABH2ettZ9RIlUIcs5cjmeE0kTEovnm54mi9cWu4Q9yHshrmDQUUcgipAcKxryUSnswBPpEVkKzSXdYJkmg+5iiqxda9Uq7XH+4wYo5olgD7mmBFwK1MDSlIM3htUCYy3mXiwKlo5rv9WtxpMwWz/UgXIKOpkv83WVHRmZ5YrhnwPGqo6CttCcV+ImmVPDdWqiMlmtepDQaXDuMkxvV7MqUfDKmoQkFY80RIqRJS0HqmbUQCKE4PgGslaD3ndgjBBz7p6AgdskY1/raM7EKZOQftW+EfVwaepyX1toZM2BuhfJcAVGiL7XjXixfmirHBFyo/srq6MFvAamvyq4pb1sEuLesUfeoWTzVKqrrM81Cj9tYedwGaXWg3Cq8wz6FLebdA0V465JKn5C9oZhNMTOAnYKP26C7dOe6PmqZPECc4b05FWP6jzKaIF1llCuK3/6ZA+ph0CW+PDkDwsGyCkxREovMufgPgSN3GvQJWtCq/EsxRjO9375DnTFhpAWe2M9uHKhzjPRFmhRs15rNsEVuZPZInB+J7kwxUsVaOzqg8HNyCt4eDJBCnB5UatcvysvbMu+nQnxIW1VUx7Sbhvl+8qqg1hBFAMUns/si/J/7hNCsR3P8BJjGQnR0ryZFEkwCNgLPxHI/Vwfrqer88/YPz6hnBUS2ADGxoZa+tu28niU+lPb1Mcpdx5fhLN0TlmglYri2duC17vVz20J7sSh1/awn0Cs1F1/vIzbUQ6sMjxTLrxGHK57JXF9kx6sxFULplsAd4ID8EXKwDgzrqL/g5sViNsKSyNrZZ2mPRiHBueo4ZV1LgLdvEnLlu+aUcPHV6BVE93XdMGhsrF6nI5X/N365DWjpr5hUvrI3f6yOChTrV8/vzx1qbk1j1E/Pj0Gp62VMVKdJOIog2L9Az53VVN/yjPxa3WOQFCNbUZUA0M3fnaH6RNuiHGDBVHTFoX1BUuuHRECkGtaL5Kam0VmCbad20kq8sIkpOEMlu3yTF7SHoLtNDkDFcaeI30GwBCeOV/AVIhEqVCyh+sgTRazOIrw1rCLqh0TGS2y9/r0OMRBy1b2R5WqFywrng+bZdSg7QX4w5/YCJ7B9kUcqSySpOasX8F/jHM91o+i7isouLCqXyEMwyt3MRn7noF0TJHfqHZVVVM= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700013)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 13:36:39.9455 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7309975b-baf7-41d0-c069-08dcc1e6498a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B06A.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7872 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_063647_832799_D397C3BE X-CRM114-Status: GOOD ( 19.84 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org The AMD HCI controller is currently unstable at 12.5 MHz. To address this, a quirk is added to configure the clock rate to 9 MHz as a workaround, with proportional adjustments to the Open-Drain (OD) and Push-Pull (PP) values. Co-developed-by: Guruvendra Punugupati Signed-off-by: Guruvendra Punugupati Signed-off-by: Shyam Sundar S K Reviewed-by: Jarkko Nikula --- drivers/i3c/master/mipi-i3c-hci/Makefile | 3 +- drivers/i3c/master/mipi-i3c-hci/core.c | 6 +++- drivers/i3c/master/mipi-i3c-hci/hci.h | 2 ++ drivers/i3c/master/mipi-i3c-hci/hci_quirks.c | 33 ++++++++++++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 drivers/i3c/master/mipi-i3c-hci/hci_quirks.c diff --git a/drivers/i3c/master/mipi-i3c-hci/Makefile b/drivers/i3c/master/mipi-i3c-hci/Makefile index a658e7b8262c..1f8cd5c48fde 100644 --- a/drivers/i3c/master/mipi-i3c-hci/Makefile +++ b/drivers/i3c/master/mipi-i3c-hci/Makefile @@ -3,4 +3,5 @@ obj-$(CONFIG_MIPI_I3C_HCI) += mipi-i3c-hci.o mipi-i3c-hci-y := core.o ext_caps.o pio.o dma.o \ cmd_v1.o cmd_v2.o \ - dat_v1.o dct_v1.o + dat_v1.o dct_v1.o \ + hci_quirks.o diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c index c0f3c0ce9f6a..fe49765fc2da 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -784,6 +784,10 @@ static int i3c_hci_init(struct i3c_hci *hci) return ret; } + /* Configure OD and PP timings for AMD platforms */ + if (hci->quirks & HCI_QUIRK_OD_PP_TIMING) + amd_set_od_pp_timing(hci); + return 0; } @@ -837,7 +841,7 @@ static const __maybe_unused struct of_device_id i3c_hci_of_match[] = { MODULE_DEVICE_TABLE(of, i3c_hci_of_match); static const struct acpi_device_id i3c_hci_acpi_match[] = { - {"AMDI5017", HCI_QUIRK_PIO_MODE}, + {"AMDI5017", HCI_QUIRK_PIO_MODE | HCI_QUIRK_OD_PP_TIMING}, {} }; MODULE_DEVICE_TABLE(acpi, i3c_hci_acpi_match); diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mipi-i3c-hci/hci.h index 76658789b018..361e1366fe38 100644 --- a/drivers/i3c/master/mipi-i3c-hci/hci.h +++ b/drivers/i3c/master/mipi-i3c-hci/hci.h @@ -141,11 +141,13 @@ struct i3c_hci_dev_data { /* list of quirks */ #define HCI_QUIRK_RAW_CCC BIT(1) /* CCC framing must be explicit */ #define HCI_QUIRK_PIO_MODE BIT(2) /* Set PIO mode for AMD platforms */ +#define HCI_QUIRK_OD_PP_TIMING BIT(3) /* Set OD and PP timings for AMD platforms */ /* global functions */ void mipi_i3c_hci_resume(struct i3c_hci *hci); void mipi_i3c_hci_pio_reset(struct i3c_hci *hci); void mipi_i3c_hci_dct_index_reset(struct i3c_hci *hci); +void amd_set_od_pp_timing(struct i3c_hci *hci); #endif diff --git a/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c b/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c new file mode 100644 index 000000000000..e8ea4d101f66 --- /dev/null +++ b/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * I3C HCI Quirks + * + * Copyright 2024 Advanced Micro Devices, Inc. + * + * Authors: Shyam Sundar S K + * Guruvendra Punugupati + */ + +#include +#include "hci.h" + +/* Timing registers */ +#define HCI_SCL_I3C_OD_TIMING 0x214 +#define HCI_SCL_I3C_PP_TIMING 0x218 +#define HCI_SDA_HOLD_SWITCH_DLY_TIMING 0x230 + +/* Timing values to configure 9MHz frequency */ +#define AMD_SCL_I3C_OD_TIMING 0x00cf00cf +#define AMD_SCL_I3C_PP_TIMING 0x00160016 + +void amd_set_od_pp_timing(struct i3c_hci *hci) +{ + u32 data; + + reg_write(HCI_SCL_I3C_OD_TIMING, AMD_SCL_I3C_OD_TIMING); + reg_write(HCI_SCL_I3C_PP_TIMING, AMD_SCL_I3C_PP_TIMING); + data = reg_read(HCI_SDA_HOLD_SWITCH_DLY_TIMING); + /* Configure maximum TX hold time */ + data |= W0_MASK(18, 16); + reg_write(HCI_SDA_HOLD_SWITCH_DLY_TIMING, data); +} From patchwork Wed Aug 21 13:35:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13771638 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8884C52D7C for ; Wed, 21 Aug 2024 13:36:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dVRoRl67CcBHIsS0psvEQgZyErf8Dt4iCrBH1hChKZk=; b=O94wgCCqvkBzgw drzHIixKSwVuDMbpzusDpSG+RroClHTEGiHb4L4ljpwG8O8cOWpX1LIwWrfa9cRoHPoT2UTqEbglX tqbv325NOvyhLkcKdw4NEwVShZFzax578q5+D8qeUGzKo5vm2YKzyUZ48lVJ689GcUaZW47S0a2wJ xtyiWuDB9WCbWftGE4ZxVrHwzc7vDxAw5gdrVdqvSS+cuKGVEi2C9I3DGzeolJxheMDlwGok1eour XalCdu412PnF1qxkcaw0kmWrj5YI+b6YYVM52WSW/+oSHEimqQcWEd0wHaYbNOQklyNmUylyx7jSs u2lANckqJekIZ7cqtBMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sglW6-000000099Go-1jGd; Wed, 21 Aug 2024 13:36:50 +0000 Received: from mail-mw2nam12on2062d.outbound.protection.outlook.com ([2a01:111:f403:200a::62d] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sglW3-000000099EJ-1fMK for linux-i3c@lists.infradead.org; Wed, 21 Aug 2024 13:36:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fAD+8FhbyQUVpVQEzQFVRGMCT9dKNj6teY1qiKsEZysGFVBFray6Ebq48HSFLQZZxYW6bVFRDKLu7lfxmo9Kx+vAyUT/GIbav5GqBanNufdgFN9PhMUZHQ6CTIx0m8N157IwaCemkex9huUEvXzV4Na3f1cxOKwXtYXI6e0I3IPr+4A3wz5sm45AlLcPzmbuEFfU3y/2gNse5OgO9+/R/cgoxEBL7AE3xgPCwojLxMBwwEc8eEKbtM8eVX0kDDQ5/8skUhbuD+QfhPB+hS0sEFT/2M5RuWdbvOCt8Ltc2oMrgNV8kscjPFNCnvRJ5YGP2j/T8xUrCoNPKIzj7c7+4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=18bYtc8BikfyPBu0K2CuzBkorByqC2GbFyFUD2nqDFU=; b=c5bjUgIWH17lgU4x9hgxs+rnfT8iXAaQ2DQkvv3+fIARsovXkv/Aig4X28IJZzyA9naN7rv2AsIPi5M14Ln2ayHxXKXztwjgMB28FWFiYMnpxp0i5ONO4wiQ4/st+ogdVwntyb0EooZrWbV8sW4Wo97ULLnrRIlPPMnsVO5HWg9xsVC7xLUZu3H4C/XG7rS1bEJiq6qf1c8jcPp4SkO6iY4Us0yJ70QDtT137zo6GENTtOpTQd0NmeZ8KZiiVY0s+HyI5L3QEF30bh9sFmiMpWnWeKH0Zj4oKCzHbwOqDCj5Sc5g+A0nrCa6oIzEuqfyeKkcTPiqvfXXQaddUcdmZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=bootlin.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=18bYtc8BikfyPBu0K2CuzBkorByqC2GbFyFUD2nqDFU=; b=RWepL+UNcpdu4ib0UPQkX5cvWffr6Om935q7L/aRTcN+eapvqANvr5dqZ4jFNN+MtryiKbUDUi2TkFrg9J9Fhyq9k5BoofYHOD2JuZ4Hh5IswjxZI5/1/hozsdR2nUrtiBs5A7m73WYxVaai1mgMKyvk97mwHFC0J5Vna+KiJqA= Received: from BN0PR04CA0081.namprd04.prod.outlook.com (2603:10b6:408:ea::26) by MN2PR12MB4192.namprd12.prod.outlook.com (2603:10b6:208:1d5::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Wed, 21 Aug 2024 13:36:42 +0000 Received: from BN3PEPF0000B06D.namprd21.prod.outlook.com (2603:10b6:408:ea:cafe::d1) by BN0PR04CA0081.outlook.office365.com (2603:10b6:408:ea::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.22 via Frontend Transport; Wed, 21 Aug 2024 13:36:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B06D.mail.protection.outlook.com (10.167.243.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.4 via Frontend Transport; Wed, 21 Aug 2024 13:36:41 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug 2024 08:36:39 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v4 6/6] i3c: mipi-i3c-hci: Add a quirk to set Response buffer threshold Date: Wed, 21 Aug 2024 19:05:54 +0530 Message-ID: <20240821133554.391937-7-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240821133554.391937-1-Shyam-sundar.S-k@amd.com> References: <20240821133554.391937-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06D:EE_|MN2PR12MB4192:EE_ X-MS-Office365-Filtering-Correlation-Id: e34b4780-b23c-420a-a422-08dcc1e64aae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: RuP8odDTxHl4oYJfMnmGb73XwDhIzNPcqWXRX23kZl8BWwfPc5GhUaqOv7K1tPRxWNWn8eXtKiC7cznBNcywua8CKR3mQFtiFJLkFzfO1YZw6P0zVS9iDX/m7ERMVphvh4fYB/2CUthZrmpdcqodBeTk2wzGDxloDSx3D+twy9TsdUy1IqtgrehXfMyv1Gc8hmQ0t8oRq5FHTp81iV5XhnLXeD+IZBq/bmd7UNFKRPdhFcWwnlnm8tYccfdbJ3BWPSWvHft/VzlXzRXFYT6Wg9rFt2QbpJcxJ4Wx0uEVCR1QBghrihSfOxxvSqDCWu911qMbZ6tgfFULzqkieIy9S4+6eMvhADih06c72lw/ogBn1ESOy0rgFWWBYs6sQrR+jlNYeQ8WR8m1ak3e+GfeSeQ7XLYqgBfi0aW2h7Zo2MdXTR22G0SgRjIRVaJYqY/IIDj7OMAtgXxjJ0ePv1LSIOMAf2PM0flQ2JdGESg/8Pu0Yj+4naaOGv0rdBeTwYg7yQFbABet6qttV198rcn908t2gXgXNbqnqMc+DA6FJMLy91yBtQm8funuZ+foetzfx8OAGub72c5oqtElI7YIS+7NmgBJOchkRy9wPZv0j8bQdX0VPzhbyegi0980yGOX4dqps21TQD78BElj/FL/6QCmgnYn7q/CP1CEc666jF731YR7FWv5YKF+ksthu3+Q1uGzqpllesiBmcDYvOxXebx2G+mpXiY3QAa+0A+7065uZEUDBmlqOJvoalCgo5kh79mfYVF3gNZ0bIyV1RUQ0/8vpYj8TgbXAzvcUIFwp2KTu69/IRfLRtkt+kn3gXYD/55g+Kr2qZpL0vmbw21dg+069mbghhJ4QBCxMgRqZ9JFBR2k7gcSahkC6EVAhhkaqJkOfCSp+7h1ZWqUkdoRB6ybc13UEtrpjsC1aAVTi4xPx7r3KlWqGpCbYwkVfzvKiMperPWEHIdxbwDyxEO7WbGCcb0qt/RB1ivrZm7zPW+Exhio0xkuqMrZN+lMHw6ppbd1sZ3qaSTeggQMp6rcSm/WKeURCkPQ1FRjbMKEOHR7n8Km5Nw5KHjrh0P/I26fjlz2NSgzmm+SJ97gbY0T5xpK5wkojl7xhni5LLC9WQHDkMEf8PJonfs5lZ9bEAmonkaW93uRVpbkRtiS+To3nNISD+Xh/lP4W8SdYXK2V7/893mO+2dm9YPQwxKuRcnI5QV6JxBBOpXi1vNF0/EOcQsC+fxh39qHwY2QHqmBhIpUy8eTfO6jqhCl4fuNVGJBXJOgSk6Wr3P7ggBDYUb7yrUkEuKTdh5ZOnRRDtTbPzFHLSn6334aNvIP+uEmkkpxzkakarvb6tzaRYXmcr5ye0Rzs+2NacZuUH0RBncMVCPbqPAPqeUfFCiargoAVX1TAa5kNfKlZKVywY2FfuvR4K/wLCDB1PcwFwbvoG960YU= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 13:36:41.8740 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e34b4780-b23c-420a-a422-08dcc1e64aae X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B06D.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4192 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_063647_463556_80285532 X-CRM114-Status: GOOD ( 16.11 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org The current driver sets the response buffer threshold value to 1 (N+1, 2 DWORDS) in the QUEUE THRESHOLD register. However, the AMD I3C controller only generates interrupts when the response buffer threshold value is set to 0 (1 DWORD). Therefore, a quirk is added to set the response buffer threshold value to 0. Co-developed-by: Krishnamoorthi M Signed-off-by: Krishnamoorthi M Co-developed-by: Guruvendra Punugupati Signed-off-by: Guruvendra Punugupati Signed-off-by: Shyam Sundar S K Reviewed-by: Jarkko Nikula --- drivers/i3c/master/mipi-i3c-hci/core.c | 6 +++++- drivers/i3c/master/mipi-i3c-hci/hci.h | 2 ++ drivers/i3c/master/mipi-i3c-hci/hci_quirks.c | 11 +++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c index fe49765fc2da..094a93353280 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -147,6 +147,10 @@ static int i3c_hci_bus_init(struct i3c_master_controller *m) if (ret) return ret; + /* Set RESP_BUF_THLD to 0(n) to get 1(n+1) response */ + if (hci->quirks & HCI_QUIRK_RESP_BUF_THLD) + amd_set_resp_buf_thld(hci); + reg_set(HC_CONTROL, HC_CONTROL_BUS_ENABLE); DBG("HC_CONTROL = %#x", reg_read(HC_CONTROL)); @@ -841,7 +845,7 @@ static const __maybe_unused struct of_device_id i3c_hci_of_match[] = { MODULE_DEVICE_TABLE(of, i3c_hci_of_match); static const struct acpi_device_id i3c_hci_acpi_match[] = { - {"AMDI5017", HCI_QUIRK_PIO_MODE | HCI_QUIRK_OD_PP_TIMING}, + {"AMDI5017", HCI_QUIRK_PIO_MODE | HCI_QUIRK_OD_PP_TIMING | HCI_QUIRK_RESP_BUF_THLD}, {} }; MODULE_DEVICE_TABLE(acpi, i3c_hci_acpi_match); diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mipi-i3c-hci/hci.h index 361e1366fe38..aaa47ac47381 100644 --- a/drivers/i3c/master/mipi-i3c-hci/hci.h +++ b/drivers/i3c/master/mipi-i3c-hci/hci.h @@ -142,6 +142,7 @@ struct i3c_hci_dev_data { #define HCI_QUIRK_RAW_CCC BIT(1) /* CCC framing must be explicit */ #define HCI_QUIRK_PIO_MODE BIT(2) /* Set PIO mode for AMD platforms */ #define HCI_QUIRK_OD_PP_TIMING BIT(3) /* Set OD and PP timings for AMD platforms */ +#define HCI_QUIRK_RESP_BUF_THLD BIT(4) /* Set resp buf thld to 0 for AMD platforms */ /* global functions */ @@ -149,5 +150,6 @@ void mipi_i3c_hci_resume(struct i3c_hci *hci); void mipi_i3c_hci_pio_reset(struct i3c_hci *hci); void mipi_i3c_hci_dct_index_reset(struct i3c_hci *hci); void amd_set_od_pp_timing(struct i3c_hci *hci); +void amd_set_resp_buf_thld(struct i3c_hci *hci); #endif diff --git a/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c b/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c index e8ea4d101f66..3b9c6e76c536 100644 --- a/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c +++ b/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c @@ -20,6 +20,8 @@ #define AMD_SCL_I3C_OD_TIMING 0x00cf00cf #define AMD_SCL_I3C_PP_TIMING 0x00160016 +#define QUEUE_THLD_CTRL 0xD0 + void amd_set_od_pp_timing(struct i3c_hci *hci) { u32 data; @@ -31,3 +33,12 @@ void amd_set_od_pp_timing(struct i3c_hci *hci) data |= W0_MASK(18, 16); reg_write(HCI_SDA_HOLD_SWITCH_DLY_TIMING, data); } + +void amd_set_resp_buf_thld(struct i3c_hci *hci) +{ + u32 data; + + data = reg_read(QUEUE_THLD_CTRL); + data = data & ~W0_MASK(15, 8); + reg_write(QUEUE_THLD_CTRL, data); +}