From patchwork Fri Aug 23 14:19:12 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: 13775301 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 05EA3C531DC for ; Fri, 23 Aug 2024 14:21:11 +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=jSxn+Zoqj48v10R3tF5ArQAudJdLE8ENaL3sn5UD3Jg=; b=VN/Jzyv73PqlO4 mxWQYo5uvaZqe/NSwYNTQPbY6sbQ7BZe/1Bs4o3hxMTR5BQ1/JFL4lTOx1Hoaa1L6/C2JEk8Wsr50 z8vkE2TNOHLa6WbThGFncIROs3v9okF8moZweYVRxj449KKEQOxcCAallh2ebvWUXPLw+O6HRfPVk H4R00YNF26WMODZSofskQjaTpJykLMZai7mWMK7PtKn171cfncTpgwcuMYsmsmgzixZE7ae9Dm+je 9b2EvjYQDi1g6jd5Ab3skOlGRQZnlpKMoIBiCMFxdpoExRC5OAFiKbnMO5dqfVcJXpUHA9PQ2PgK3 IW3yZ5DCyvACNtaLaH5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shVA6-0000000H4Fx-2r8N; Fri, 23 Aug 2024 14:21:10 +0000 Received: from mail-bn8nam04on20611.outbound.protection.outlook.com ([2a01:111:f403:2408::611] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shVA1-0000000H4BF-0wrb for linux-i3c@lists.infradead.org; Fri, 23 Aug 2024 14:21:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ag/odkmUQVzXXbVSRLd0lux5F8I6zRSwdlM6CzRG5BmDgR7fjAVEzPWENbMGmaQ1VYJniIEjJUVTY+qF0GJM5GDGM0DPPVDbg46ryVZUcfyUqVLXOZGKRo5AUxvMu5BDYgJUwc1hVpVT7dPnPAEhs3Py+mXV9PFjI3Q3uyJSykkVAOJuHwLSpwin60o0+60Rl05LboGC7I5TbqpeovfM+5yAgMBkkmQKR38YcWs6jBKF2XEsurHlYQz9dPDkO+eZXsG1vgPRKcYmw+077TF8Uq3jXGGlkU2QuhXWCObjNbYSf5G/cGvDH74G12H2m2DSUb6OIWZ96K1QiaqXouAmSA== 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=zrSocucoRmLTE8ScWqPj7g3GkvhEChjjPuu96aJWPGU=; b=vSPUT7VFcRyIiyqt6EaFcI2nAHcmtXNJTtGrJsD1/grlDwa+TFtw9Bj7qy6JdolKPArxDIC4vqVunnUakxk2PKYqQpi+ODXe6DFwog4nSVTpH2+9bRXDVdKqvV/hSsfY4PsUQVoksbeiWLQvqUNd3dz3pQk6oDXdI9rRlBlDoQW4syty+84OPNcbuMK5Orf1ILNb3mdSa1Yyiu6vbMwt2a81paNc/QQZzHCBCdsJQbsv4lCFHv/+mDWp61Q/e2b58ST63MxM6wrviDGpq8czhZhW7UF8Xz4OzeNp/R76xFq/tNxwExpdIrp+3SRanDoKspquPejqNll+v+/PbqHBTA== 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=zrSocucoRmLTE8ScWqPj7g3GkvhEChjjPuu96aJWPGU=; b=JXxRjtP81ODwFcibCZpWSpEMDDWHjNvPlIZns61sOoRd0eJhv0HXTGSXT6n/VgKhWu8Lr1sCdsWn+jlJJm7uwLxTxTnI7glizQTorwTmyO10xdgpkJgvBuMrtvLRUFOIvLokOyg9tmm30p4bvYEE5l+ja7zPRZX8ISf0j51F2EI= Received: from BLAP220CA0026.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::31) by LV2PR12MB5991.namprd12.prod.outlook.com (2603:10b6:408:14f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.18; Fri, 23 Aug 2024 14:20:56 +0000 Received: from DS3PEPF0000C37E.namprd04.prod.outlook.com (2603:10b6:208:32c:cafe::5e) by BLAP220CA0026.outlook.office365.com (2603:10b6:208:32c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19 via Frontend Transport; Fri, 23 Aug 2024 14:20:55 +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 DS3PEPF0000C37E.mail.protection.outlook.com (10.167.23.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 14:20:55 +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; Fri, 23 Aug 2024 09:20:52 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K , Andy Shevchenko Subject: [PATCH v5 1/6] i3c: mipi-i3c-hci: Add AMDI5017 ACPI ID to the I3C Support List Date: Fri, 23 Aug 2024 19:49:12 +0530 Message-ID: <20240823141917.692336-2-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240823141917.692336-1-Shyam-sundar.S-k@amd.com> References: <20240823141917.692336-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF0000C37E:EE_|LV2PR12MB5991:EE_ X-MS-Office365-Filtering-Correlation-Id: 6073d552-4e33-496d-a339-08dcc37ecd39 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: qIGWK8aHqP9pYpe6K4yWuGA3+Awq/BXBI+5OJUY9fdV+fjhUjZXRcqfHT1bH3Be6H7k2bHtWXlMhbtrbpEAQAOya7Wt4ocY3jMy5Q6lwPTe5p7IMykxDQGxtci2MU0nuGbuEmTuvy5rKT562dghZxxpLnSZaDwU6x9DY1pLL8B687SnZ0Ts6SngMAlX3B2b5q8zxCBN9JRUKWCnRzitQSYWyVyS/Vsq0Xd/oNb8x6sPT5JaJlYeYnwxk9tv7Z+53RUYOZ9c9wDnpLvGslH6D07/MSHVK1aRp8E4zBY6HcRj0fbyx4O1mObBkGnpxbnndd3xIkAd7s/XTFfoBbQc/uT04JTA+/5MAaPi007LELdS35BdrUR2728mr4IshyDCK96rgBnSx4RUm3q913qS14TdUrCCUpnimOEottS04zI+h7oOprNrpVX8LL4f+mG/dA6eb1ubZEEheDgvqCounRS8Ik4IPbzF0nN2T6flMhzzZZ/8YMarNHNV8yB6JdmKSDDbLLvUmDC9gm3p+pyknlfBFdtcBuDUalshnFoawONaD+0k6JsVXu5lvd6XMfZhsUnW6ObM3DEovVSPb3u7DtUuRex6PxNXF5hU8xJXaaxpMHLFftYrbqyjnY0YTlZ0VWDG1m6ws2TumnGzNzq5Pph50+WlmjHghJXUn23oSW0yRyrighk7qSRiMXI7oqbRdEkAE0NndmQ7BCYxvKmZSRc1lMe2NNu8rqvAnVTma4+imk9+uJGMpDoGvdDs+dbjI5UlE4/RjcZFY7LQhKMn0vpwsxoSb7KhAI58WJ2i8QP0n0Pi2fsUDhyLY2B0ayWS1r80qk1688qKHkkQjq4ylTx1p5i1hiZ/+PulCWKP8vJhSTQWkuUUscfABjLKK6fNu+B+MLsCfino1THh/AQ4PhofTF0gByClyol8N7RN/DZtpAfJgZXqwMnax8KirCNDv+OZLG4p5pXvNqzIWATCdODkcy5BofQV6ddpPkJqzSvOZmD14UUoJSBHinvYoz26fHeE1biEtDukwoMKWk4d2SAbMpmMue1c5bKxIFSBoYpEidzCCKyiMGcdmHu9K9AAdZ8WxnICclVx2cCkXHVQPFzyRlJKPHLOEAlE0tKh4YagUaAwOJrIYa7h73i4oPxAZezdYTM1jXsuBrSpIYhxqqaXZAaoETK2laP/lMd0WZY7hT/f3ia1ZC9B9VN+7k3USOB9Pm7qgd6OF2k5Y020HQDjIF+LxMuDIGA0MDe92+aYl18Ihf9a1HsDgDv5JBoGNyJWzb57Xo0dAgQMErfrFnvgSrt/lcQ1jGlpaFUD8skoZBjBq9Ig4Hp+ib1EQDVBBfk52Lkt5fpbqKcuTYwUBzIomeeEOvEDL0l1gRfJsIzwpjXGxrNB4W1aB5UMr8eZ+LIPe1tgpKbttBljuASLRZVKw31etYX1sjybWsZET8RJToM9uSsxorp4VtFQ0hUyt 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)(376014)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 14:20:55.5076 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6073d552-4e33-496d-a339-08dcc37ecd39 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: DS3PEPF0000C37E.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5991 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_072105_324729_C2B13CEE X-CRM114-Status: GOOD ( 11.33 ) 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. Add the AMDI5017 ACPI ID to the list of supported IDs. Reviewed-by: Andy Shevchenko Signed-off-by: Shyam Sundar S K --- 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..07de1cecfa30 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 Fri Aug 23 14:19:13 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: 13775299 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 15F56C5321E for ; Fri, 23 Aug 2024 14:21:10 +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=ts/ejWIIIYTBzds+0FSG8JZBtEYJyaK2OO9lRhVl9PY=; b=4QbqP1hMDbP+0D 3TxpE21hubYaRYfUZvjv2LRnczsaJEnCnJjl7+P2uNnV2tRj6L2SCcVZHxozh3tNgCtHFRav+7Ve7 +WZnYiWZmeGw+SdTyxJCOpE3+vDnj952Mqf67T2wVr8AZKhxkWdFbHJips3RDGapUYEhuO8XS+HT2 PQfmB3bV9k1B5gocWYpZCbBHYaX0w74SCjblP6DY5cNpR5Jwje7yaIGcEwoPJ2KwxkoZJl/1zNJ71 y0nA2Qe7B8z6u6rKMZeQLWhF7x9/IGvNE+AJqOzBiU4jrLMhMqLoJmDWbfaEF4s3U9Uupg+JwiRTG 6JpZ1H20RLqePfWG0MPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shVA5-0000000H4Ex-2kQx; Fri, 23 Aug 2024 14:21:09 +0000 Received: from mail-dm6nam11on2060d.outbound.protection.outlook.com ([2a01:111:f403:2415::60d] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shVA0-0000000H4Ay-2wCM for linux-i3c@lists.infradead.org; Fri, 23 Aug 2024 14:21:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZiN9DSESP+uOAmam+OEFJ9ZFce3XSB0tULdfOtRQ+mdSj2xJT8dNo6L7IOZxA2couKRcjgFPCUmZiEvcZMaO4A37/FO98sbtQC0oEs6m1aV6MYJjWj2A+feO+uzxfj1sd9d7khEHvzsdyTX2h3JsxXArPzQAy4cpUl+SJxjAFwJqmAbHGME19mFLQaDU7f0HlmYcEqEMgihSR1cDwHrXsm1eWMzwuCwwGMZc75VrC23MM8IC77htBhMCvmBocQ4H2rzvgpH3YHAA3hlL/6syKPzK80XQz28dpGUfTpGcQR+28uIh1Fzf4mKQwIzbnlWubN02789uuAnCHFJljJGVPA== 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=V2XNRZIHJv3vl0L1ghOR1iqJ+WQGba+DYJt1stgshww=; b=LWsWCNtvmwnva8XK8/AGushCcOge8MA5ClCBXtqaE4DRbSbYsjHLTlKvSSZtRxXgmjDtYX+udQhWOXUJl7a1FFbGZeeo6fAP5sOyDu+34Q0w9JMk6n/XVmWbSKTtpoRnXdrR/h4hWmjQeLIzxxQVRq9vAWSsD3Qj3rce+w4STevMjdxj1m7SdIp9gd0TI3dfVNeQOhoIgRDedq3FsMS25iJubWcI4IJXNqr4wpEOSWUma9BiPcX4FQWsX3b75TP4gXWLVSF0+pppCC+Dw3Z3x6SdS/18VunWyeRLmkxWowP7mNYjYMbONxGOc17E/PcJ4dbru48uKa94+1q3sHz0Dg== 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=V2XNRZIHJv3vl0L1ghOR1iqJ+WQGba+DYJt1stgshww=; b=fKI0xcf/1RDEIjgFYptOJrKMGJeSldg7YNBuyZUFfPFGKLtT8WUBgFzE1eL4pBo3PUHq8mm1AD/FvYaX09Aw5XXS0QTVl9MzZHKoyl4JZ60bXcuRVd7UdAlHl5IU+C7PWezTBnD5gUKlP6Od6Ly75vQ6rjVZEV8buny5uR6REIQ= Received: from DS7PR03CA0283.namprd03.prod.outlook.com (2603:10b6:5:3ad::18) by PH0PR12MB8798.namprd12.prod.outlook.com (2603:10b6:510:28d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.29; Fri, 23 Aug 2024 14:20:58 +0000 Received: from DS3PEPF0000C380.namprd04.prod.outlook.com (2603:10b6:5:3ad:cafe::6a) by DS7PR03CA0283.outlook.office365.com (2603:10b6:5:3ad::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend Transport; Fri, 23 Aug 2024 14:20:58 +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 DS3PEPF0000C380.mail.protection.outlook.com (10.167.23.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 14:20:57 +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; Fri, 23 Aug 2024 09:20:55 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v5 2/6] i3c: mipi-i3c-hci: Read HC_CONTROL_PIO_MODE only after i3c hci v1.1 Date: Fri, 23 Aug 2024 19:49:13 +0530 Message-ID: <20240823141917.692336-3-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240823141917.692336-1-Shyam-sundar.S-k@amd.com> References: <20240823141917.692336-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF0000C380:EE_|PH0PR12MB8798:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b55cd5e-cce7-48ff-3f55-08dcc37ecea9 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: sEcVVhWEvuZD0SUihixk6+yj2D/HRaZgtHRWdq8w6ZG9Gl0+H4taGf6jDJbbBQvu/psAEADHkVZG/WgKIPkjxrXG+7IfqeaYjYqhDbgjtskSyIXeoZJvwMSTK7z98bwgiZ4qXuWql6EbTfT/GkEa5m8pIjZh/+FG3JCmu8c6/6Hmfa9N2xUKYJI+rw15MWNw8+Kv6TGgvDBiB1dZK65sp+TPeTCjOt8DEPhXkluNTgKGBnYp6zsfKsIQMa09a1SK7uVZxVuHp0phYSDR1c94oRmKW8bXohZ3oY7lt/w6fvP+FAexkAA8Y5sB3xKpTaBNNl68ebs61arSfSMUePBG9MT8AKDn8UZC3xWBelzLeOy+cidTJKGpbxRpjQCCVjC/d2BJOR2SAe3oBrCktAYS19nA2y8XYfblgJZ5ub6Kkds+IpeT3sz23VfxZp5DGrUxeJjdxk9DMWuhYdqLEkBmcSW3H7B8+ts18mRi9EdEAK0FvY0iWFvw5i4MJnjcIyNvXpLcsVeuwBxOTMN466pHoy06HggepyyC5Xx9IkKEue/D1KNyf0whqby3S4rwG18IFAG7AHKi6xYPpLbQV+dDliJyKLGGVJfthtiEP0KBLOj1Pvpx3Ps/JY2Bi3P+mDuZLesWxRsnIQHYJvX2nofAWIGdXOh4kUg48IfQb6gQbW+6aerBdCHcN2jNqyWCJzupdEfU2f44UtCJ69xsWEgaOtG1KzQXCEhf8A0HqT5HMPoU9J5mbRcGaxbn3PI9pr7jiycn4Lk/2HjMpDbNBVZAPbFs+19WCkELpDUXGLBxi3LtE0hUbmAM1I3TAWbB7QrK+7StN1I/l3TIFRJTzcTAH+7hGYv3PZUQ0JsxPi4/AT+ZwFn62a1triYAH4innxbSmd/XU2Laz0DNjDtXReuvy4FhAZjfpbwegI1dOB5E02E84CoP+gY3bZx0Waswzaj/HwTFiSkhALmyZdBRX14MxJ2KL/mVw8QRbnOqiwid27xonwWPNINmGiRuFmSSs4bGAGJbhMmcQeu37Ilh4F/n9iQ8vC/SzmnyMUsRT6IZU8GB9Kf2KNUfokxYO6v9fkpCOMIt+MVC6I8hka+vIZldnP0LsZbCIAT9wvvoqJHuf66DOgHq8Gy6Mf9R9r+VJhu6JpruZJilF+NlE5XF9DFel0AoV1K9ZX/TqA6wyBRQ4bG1dYM6o5rsdOnhyDRYvZ0L2FPB7vvVzRt83296u4jbePnCd/vdM8PQYvwFu4WRH2hfJjWTXoVom6DnDuMedQcO2U1vkmIfcpTkK9H+X8RplR48her2Ls6q/UhxYvBqHTL97IwRzhTaP28ydCRxkiZgokxE31YKkHXjuLMbFUhavwPebU0WxULLR8oBrbbHpsFCPA/KbpunuBIYq7LiSJd8hz4L1/bVU8ozvjv9lGj9K9TLY1C8qpmpm1okWdL0UEpvFAqzgYxdCJn1NeJgkTak 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: 23 Aug 2024 14:20:57.9324 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b55cd5e-cce7-48ff-3f55-08dcc37ecea9 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: DS3PEPF0000C380.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8798 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_072105_261102_11F4CF0D X-CRM114-Status: GOOD ( 12.86 ) 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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c index 07de1cecfa30..42d2362d072b 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -630,8 +630,8 @@ static irqreturn_t i3c_hci_irq_handler(int irq, void *dev_id) static int i3c_hci_init(struct i3c_hci *hci) { + bool size_in_dwords, pio_mode_support; u32 regval, offset; - bool size_in_dwords; int ret; /* Validate HCI hardware version */ @@ -753,10 +753,13 @@ static int i3c_hci_init(struct i3c_hci *hci) return -EINVAL; } + pio_mode_support = hci->version_major > 1 || + (hci->version_major == 1 && hci->version_minor > 0) ? true : false; + /* 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 (pio_mode_support && (reg_read(HC_CONTROL) & HC_CONTROL_PIO_MODE)) { dev_err(&hci->master.dev, "PIO mode is stuck\n"); ret = -EIO; } else { @@ -768,7 +771,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 (pio_mode_support && !(reg_read(HC_CONTROL) & HC_CONTROL_PIO_MODE)) { dev_err(&hci->master.dev, "DMA mode is stuck\n"); ret = -EIO; } else { From patchwork Fri Aug 23 14:19:14 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: 13775300 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 78554C52D7C for ; Fri, 23 Aug 2024 14:21:10 +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=cqWCBPBv+8xz0okRdackp08Ou28FYaszRHOR8tvqHQM=; b=F5s6liU/Lxofts ztUU1WcND554ji7QPA+BMwW6+NdZ6TdZUulGh3cDY03uNbuwmj25FyV9ly3ng/O0wFWIsAhJA9thq XqBRnn6HCyacnNdxg6+buaI6267FTodqfuFOawD5u85G+fqj5fHYqo/Pt89mgPdYLoMHTCOly/WpN QC/J+qHwNMMhZ5Wjh6vJ5c4uAmc7nWP0bLk5CuG3oYhpuUppmQVscf2nzWy67QjLURCX0MBv+ZnRz bNRsx1XLF364jsOGl8S2ctEo/by+vH01eWIZAntVT9oMoAcmhdBGkfTQlknirgWDvPAz7c9KbpPM1 Xj9O/ZlrCb+P/PKZ5Neg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shVA6-0000000H4FF-0lyw; Fri, 23 Aug 2024 14:21:10 +0000 Received: from mail-sn1nam02on20607.outbound.protection.outlook.com ([2a01:111:f400:7ea9::607] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shVA1-0000000H4BJ-10kz for linux-i3c@lists.infradead.org; Fri, 23 Aug 2024 14:21:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Fs1ShQ2f+MUnlWidkI5W6HKpEiFEXKWBA6H0RnUHSKsH3jAmK17yoAjN/cTBAE2zVbbH0xZ/nmQdybyHePf0iysMb45/a/aCj0vg35FO1Ua1+Brm8aT9EbShjYC/aUpCIv5s8aAUAtTDOBPBHE0aOFVD4tEZYHQmue3zo0Oz2zelzBw9oyZwSFWts9oaTDFsriNyHIhYz910yAre3eOGA12MfXI93x9W5btt9ebNK5Y41pTUO8jvGcI+ldHmjKQ4Y0BU3iaPT47fGgUFuDxIAqg/IEhPjvduSTX4WhoakrBbQFgKKH2cCOy+btqN1ODf10Snj/jH1eJDAxymzFa2KA== 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=078x5TqlbMlFMajgTQWnSzSxWojU9nd09Hfcd3+SN+0=; b=o+vzHZIRBfguQdjVF20w3+A2xQ0EZZBlmmpF+DfeI6UA06tfkKJsxV0iI+P1BdcORshCDlTySLtO+kMMbnSKPdRkwgbroI5iDsQpRa8u6dWjMdZF1niR0ov9eW0TqAB2ynTMdfdPUBsY5R74477ZGypFqcIs2azN0rp7BqkwanSRkgldhKDyenhBR3ThJF9EM69wmOpKdamk+MhNaRFX13qLGmFqn1ETMf0IPz58mq3m/7nntH9QtzDM7ZGLeLy4UfLFxHmrnnIvcTZQM30WFmIoOJUwgQamvXhiP0ARTdbpsJfLdjRGdcEDybB0XmvnJnbnW771HkPvzaKtpstGOw== 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=078x5TqlbMlFMajgTQWnSzSxWojU9nd09Hfcd3+SN+0=; b=UwnZUNLPhv+N0gKc/Lm6W62aWKGMEkkScVjpLn1VUIpoAjj5mEzQfcaVCUTtJe9yLxBWFZLcdwaCUbKzmL61/boyJQpf3KE++s4o/dZNzJQVi+Kzv8xtuEV/Q3sEFmz23MYXvlQeUSYPQnb1wx/K+I4HJJUH3BMkMD1zsqjsdgw= Received: from DM6PR02CA0151.namprd02.prod.outlook.com (2603:10b6:5:332::18) by DM3PR12MB9327.namprd12.prod.outlook.com (2603:10b6:0:42::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Fri, 23 Aug 2024 14:21:00 +0000 Received: from DS3PEPF0000C37C.namprd04.prod.outlook.com (2603:10b6:5:332:cafe::c2) by DM6PR02CA0151.outlook.office365.com (2603:10b6:5:332::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend Transport; Fri, 23 Aug 2024 14:21:00 +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 DS3PEPF0000C37C.mail.protection.outlook.com (10.167.23.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 14:21:00 +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; Fri, 23 Aug 2024 09:20:57 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v5 3/6] i3c: mipi-i3c-hci: Add a quirk to set PIO mode Date: Fri, 23 Aug 2024 19:49:14 +0530 Message-ID: <20240823141917.692336-4-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240823141917.692336-1-Shyam-sundar.S-k@amd.com> References: <20240823141917.692336-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF0000C37C:EE_|DM3PR12MB9327:EE_ X-MS-Office365-Filtering-Correlation-Id: 19c22fee-b10f-49a4-dad3-08dcc37ed00e 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: ZDRPaaJCsYwu0s7YkaGEcc8jNCkcPv/BPyRpLOVx4G6ZW5D6Jd9kZ2tHi0O56zfKZRp967qI/K7A7rr4JxV6usVIQPuj9bSMcYNdB7JqH6cZzh4hOz/qMw2YMZ+hyZbPZxCAFFl6aQl/nQ1v2vYFbJd0UdWscsY6K2LUNB1WjdPaq0vL0Hb8n7HKNKJpdonlizWYYXbTsbFz0QYb75fUmeuWv93Ckbj1imPPZuSF4TW4awKVNrwPSCjepq1hE5/QfOuZRfC6cL6QEwTDfPkOUiX467YdW1LwEOetpjlhLxi90lWKks9uQcOx+z52P1XnZd4noUlz+0GKO7YubhuNMdT1jQnAeiiaCihQ1apMHeOYuhFg5l7J4MAfiyCI/Ub9Asn0Ts7eN2Bve95UrCTcTHSgPyzC0blFHWPO6ncnsM5mfIrW2I1moVvgJs2F68sgfAioQLgZ9OZGJueUf5JGa5iskLlHpqY0FS7bLNjf+Wxf+3jeFQS3Brfju0ACzPFutaX29R86IoEkfqLarIbX6DE646aZQvioTXc00rfJbQNR+WUGXuN7Fcv0/uluByNzQPwajTbcfp/5PWDvRrIF7aTLR5gd+QMEEizF0VRSNkzL0PIcmkov5CvUsRlpl52KjTMm/DdGfgSgr6+ll0G4Gp7wcdPHN7iYr8kaoWnbnGc/840FJ1+VFYT4uofq1bm4tRE/hz3mu2wJz8uEFheZg8VU6T7TjkdBulXj3ilgMUlONAZKV4FdCsGw73kF+9VYskLAY8tNWYkABiGYwcFKC1qcgo44SM42Vbo2tYfKp1vw64oCzn1cJMwZLq8u3uzQBe8nv5COZRs9cHqjnduG7CMWBaM4KP7Yd6oH6AFKAyiQ3E9tJUhzcbHv6EowRFoPVNbEAb76E9q4prWYPRPIuUbYlrUIgMVrD1hfMxTN7wYezbGfWu4RsJHg8Y1k+m7s4sl0IulT0NcbC2bGHndxkTPFOB885P1cl1l2DAQPt8RWmcHcKH6VgWau/144HNb1QPNX4J7e9QtZah2jtvvrKRBzZOzKjbqospNC8HA+RwkdW+zhaGt6FRVA5rlQ8croWPl+jtCWKWkSvGaLQFTZyyiTYIaVfwCfype5QhSTyun65iZk8lj2BllxkZcf1jyPN1v0waaDw84kD45GsS/7hoCgcQwcLUndXg+/PqfCluO+hA4nMvAjzq5V+M4myOxNZxelkMKZnGMQPn8OgoLH6puGD5i43cLBWGKLBkRDLiWgxdaDtfwSidSw8WrdnDGHe3VXsDSqAGGRm6xqEQmtguv5cGMWED27MskcqwzPaYgDCtCtjJ+lalIv7NNnTMy1jXjz4SXNN6BPsT2NegcEoWwXWLw+A9h5Yq8710jpcSmemSSlU2waa/QjXwLOfO/QtNbenVN99rE1tblEOpO3PNJjFaHB7+e+GfYj26LFmLVjGPliNVW2WQ7rwP4T1w0b 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: 23 Aug 2024 14:21:00.2760 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19c22fee-b10f-49a4-dad3-08dcc37ed00e 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: DS3PEPF0000C37C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9327 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_072105_316407_5AF7FAB8 X-CRM114-Status: GOOD ( 17.86 ) 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 Reviewed-by: Jarkko Nikula --- drivers/i3c/master/mipi-i3c-hci/core.c | 8 +++++++- drivers/i3c/master/mipi-i3c-hci/hci.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c index 42d2362d072b..03a63ad205ae 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -756,6 +756,10 @@ static int i3c_hci_init(struct i3c_hci *hci) pio_mode_support = hci->version_major > 1 || (hci->version_major == 1 && hci->version_minor > 0) ? true : false; + /* Quirk for HCI_QUIRK_PIO_MODE on AMD platforms */ + 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); @@ -806,6 +810,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; @@ -838,7 +844,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 Fri Aug 23 14:19:15 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: 13775302 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 417AFC52D7C for ; Fri, 23 Aug 2024 14:21:58 +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=yqvEvDhX1JJrWhnO/QjYVpLfJKYEXQ2C1FzjQd3mbYw=; b=bhb2d1394l8kFA v+1sRTAzMU/ORabXzSUKn+dCdVtOXhTP/X4AkjwQJ834O9IWzLI/f373/quB3ARj6DWItstDIgXyD jTgt7A0dprhESNhMxxy8iGxoCHBMdY/RHy9WAK6JZuyfDc8w8VcLuQ4+zGj6CjSrNxfRdRMnsN40y npv7cger6etydVmdR1NQr8Flsq2eZeKxtSsg4GLimCoEvAP57tQEzZi3O9az7i5trHVefgxfSbFhC +/2Q4QWmD3Gi5zpB9iYdkeYleBlHbR9+g9RtD/M5fxYqDiAY6V6QibEe+YVqVFZ6u+yWV+FpXhqXp Ne29VFQvCaw790jmC0Hw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shVAr-0000000H4Qx-42Z9; Fri, 23 Aug 2024 14:21:57 +0000 Received: from mail-dm6nam12on20613.outbound.protection.outlook.com ([2a01:111:f403:2417::613] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shVA6-0000000H4Et-27AX for linux-i3c@lists.infradead.org; Fri, 23 Aug 2024 14:21:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=i/j7BWJ9+flnHidT7kEi32wPRMRZKSIdLnOYru/m8TqmixFdm7RoSuqnGC0XdWwIA0EvAJhbHRPw2G7I5AbfbAY1R+X3wooHOmSN5M514BN00f5Fp7f9aFIXRicRqW/OHHdJGh6n3ayKEuihVREm1w0Sf8f07GudYThe3oyt3+f6MgAyM6wqxWfN1zO+gk/2TSNTl8c4MC5jYft6eo8th59RuBSY6MMb/8d1d3N5o0bBdflv9997gwPF5DUBdP26P9+nroTxYHGy9SztE9iTbxd3vNQLLsuxRSNcpox9CHprKxO/InueE9D4lC/fuvEcSFoI+m3zD5vDefyRYd+GmQ== 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=QdW0ZluYv0uTIXnmLUpn+8Gp1rCsUIqTvyQ3h36Yahs=; b=T3HgUvwuGS2qn8TqwWABOgdG33kgsiajv1Uikc1boTyGpUcwtbQkcaLvPlM+LaiQ6TTt7aNWAzDZtbpaj+phYk/50qO8TUp6bUi/FLGY4/hKjcoczA5d/PfXuZ4HNM52RSWcfk6RC82oXjcqcVnZIiE1rFrWppSxUjmimnAc5EV49YYtnUhPP7wiP9ggCBR6xQ3/0Ef9zIt9fsa9eSEnelb35/KA2OJC+FN9b/a8eT3IEzTdKqNfoLbsEc5Hz7sswtu2v4WfQyygGDgYThzP2GDhNvov6by9C+EO3DoJNMVhTLzqr4qqG5O3Nx3vzMNVsZ8iSLnAG8lYxgwf08xGVg== 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=QdW0ZluYv0uTIXnmLUpn+8Gp1rCsUIqTvyQ3h36Yahs=; b=2LkTtnD/LKP95vIVwfdo4o7zJR275CLAQHkkzsiCdrUyhLaWQBbH4bcFJ9nxSeP6/zVx8zMJtUMUqVRITzhzHp0h3CTis369TgNQSQHPETSCU3Nhh1yz4IaRl2gzdxK4bn/cAk0UUiL2sykI9Dt3Io0a4hkFTjN9INSgq4e/FMk= Received: from DM6PR02CA0140.namprd02.prod.outlook.com (2603:10b6:5:332::7) by CH3PR12MB8075.namprd12.prod.outlook.com (2603:10b6:610:122::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Fri, 23 Aug 2024 14:21:05 +0000 Received: from DS3PEPF0000C37C.namprd04.prod.outlook.com (2603:10b6:5:332:cafe::1c) by DM6PR02CA0140.outlook.office365.com (2603:10b6:5:332::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19 via Frontend Transport; Fri, 23 Aug 2024 14:21:05 +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 DS3PEPF0000C37C.mail.protection.outlook.com (10.167.23.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 14:21:05 +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; Fri, 23 Aug 2024 09:21:00 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v5 4/6] i3c: mipi-i3c-hci: Relocate helper macros to HCI header file Date: Fri, 23 Aug 2024 19:49:15 +0530 Message-ID: <20240823141917.692336-5-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240823141917.692336-1-Shyam-sundar.S-k@amd.com> References: <20240823141917.692336-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF0000C37C:EE_|CH3PR12MB8075:EE_ X-MS-Office365-Filtering-Correlation-Id: 43a9ce0e-5858-461a-0751-08dcc37ed324 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: QF1VVTy668+gJbNgDuKAZkBa0uvfipPwS/hQ0nIHpHZBpMucUOUZwDR/tSStLgRe0gD5EhBt5TXZidqZbfhh+06Zjn4KCd2WFncQBDs/zs4xgSFs0XIVUqM49hvgDQcK3PO+w+mN0zIJgE87pXNdBmKQxqIK+WeLO9zbwGoxwxiABGSGugw1gsWifBxQfawKk30Zq4RPZWN1EsZ5w8Pp0Sm4+pIKg1PEcXqhC28DL/CqqTcWSlKEfILGNauJacQIIiI8hR6KaddjKSOuYYooRFakGk5jNOcMgk/7YokU5cydE9/0S8ouM9pqQvbY3MJwlavAo4P1wiETkPioZge6EQdFCPRWAQpr9kSt/mq3vxtN7dwEqA63wgQcAlTFs5wFD2OoTRt5Tld1eXD4KCcljORYcnfcIsZFJFLrisIiqqsS7wUBnpaUVzRpJY6bhW/7qp6RDJVzCORsoNtS8cxfcxR4wcUqLLRM2Z4/abUvM+uB73bgPVPgzvGqTCHUb3kumN+XuKFWZvGd6iD5ddh72PUPm1iIKuWrHN/W7C/dkW3r4xUZbpNC/XqvEYdS7feywXJrXS5c+GNPHF5VObNMjqxcGaOwxOQZhlXyIWj3LGec3FTW0HBe0scf6UWwxtHvvxISIttiF0JP6W3QUfGc2FTh273D9cvgrkbfTzTW1j1sCaWOJErthduB+KRc4Jv0TQU/B+qgJcq5ZOIGi6ZjsgIyhTZJ7Rv+9nB9fB3ipKilT1c3SBlPQ3d9i9IbrPQbOHNxVECq6J28eL3uJRQpEEYleqBk4ukGkCXhg97gaBLV884xWPfTIUKjygOajf5s/4reaOyja48lvz51q5mPl6ZNYyfAhIWzoQB3uYzhpl9H12JTa0GKCCfWTHYBA8u+gv6N/TVfDUIJ82tAG6x2nQMLBNUeK8tXZhsaVUpvdxq9BDv+hndj6dP8FfTm624gjcrTcfvmBaUXvqBYgn0ZPsX+xs1EaIRdMMbgAVHobFwElkbsvEUPTK66w1EM4wMgjPWJB0Awt8M614fr+zfQDZGcLHaHVn3BxXlREaPP2v9RliBCjqRaFCpz869GDNFhHcPkhm5OuYuf1KT+unLfmOJvByNb29YyeJmxWufKLhxFGf7XyCYtXVi0AdSmrcNXzyrvBQs5SzeW2T4D6POrho0Pb5PFfSrQKhqarCtU0XWTmMeLbhw0+oJBSOKJ8RhVQdYmXs5r7t7sUTIJiUQ53YbjsDO6ijyKLrPzmWJEIEy0qbLso/Cz/vWQq/2pNxUv0WAK0l8pCFaHGJbH2svmyIt8xa4afD2D5OWcKboRgo4AiwVd7mOvkFuEK6GqHzwwBsF2GEGz5b/9gGq0PXXFo9tpar5zf4tgedPU8YaTC3jF/ZgBXTqdNScQQlAs56sCeublc1vb7xvD/v9S9I3T2ofa3a7w7j9tBq0Ck8OoFslX8yaiZhqGhAQRxqmpnMm7 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)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 14:21:05.4323 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 43a9ce0e-5858-461a-0751-08dcc37ed324 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: DS3PEPF0000C37C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8075 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_072110_573214_AD77C10E X-CRM114-Status: GOOD ( 11.16 ) 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 03a63ad205ae..a64657ab5007 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 HC_CONTROL 0x04 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 Fri Aug 23 14:19:16 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: 13775303 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 8E0F4C531DC for ; Fri, 23 Aug 2024 14:21:58 +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=55oDn7XbyantoS532TcpxiVtCFXog5jwpDwR6AmrsBo=; b=hn3uANYpPX8Ou4 Mp3slREDv/ej4SuqFeiJLX4zE/IZfmGfFC8+1sCfms4Bhd+vhTnaXn+UX3uvfJIRP+MXIzcu0U0BP cuf2B2HdelnPfig0rrXQcJfJ8a4sx47k8vJEq8HXASIJ/6jnOJ99LGBBe+0ehBzGRKtMxLaYQWsU3 OspVwrpmhrpEaI/QCw+6JIX8b2AeNn23BuZiwcqXcv9iwZa6fvbihyYJNyNRK1Rhr7FGLoFbME3pt hFeOgaT2PKU51M6cozPDQgJ+yWBHjr8fu3xrcg+PS04mMZiSBhqzjIzxtnZkH0rgyw9Nhwk4IY0lh a/td6BPvG9A9iN2U+9dg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shVAs-0000000H4RP-1Efn; Fri, 23 Aug 2024 14:21:58 +0000 Received: from mail-mw2nam10on20607.outbound.protection.outlook.com ([2a01:111:f403:2412::607] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shVA7-0000000H4Fz-2XpS for linux-i3c@lists.infradead.org; Fri, 23 Aug 2024 14:21:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KKo7FDbqZ5+6Gpue49VqPh+ndVFMYT7Nkw3JL3rDTDD9t/kndulkk1AY9r7pewlGQE6nEheApUQFgKZzMa/E783WwLWeKikUoRV8Avsto3LnLg6w54YYUHhFFM4cLczP/r+qfz9EXpPxZEydwpUkkuwXf9PHd7JAapa7IwXrloTHVKEXf/NBGaEUbkz8FI9zXcMrFi0lCeX6dZo/0JVFHXpZbsVGt+DQ7hsvQ3Ejy2z0rtUUp/HJ02z59TltqmTwklsyF/YLk3GZ/cunxlfbvW1nDnxSmeWLCPqNlrPhBUrNM9MQ4ZOXEd0CdCEXycnvbZFi3lOzi19EkqG3a2ufhA== 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=ZIeqVL5B3EMK0SaMu2YUYdS8H/8AzWnEnVeQT8NegXc=; b=gf9YUwxetRBflklMvTNhDK048T5U2uqO6dT6uwkjWvR9gQWMdM9yd1UW1HsO9oiIWSqLidyuV84Ev5Xeq1X0cBrF/aV/v6QV+lHa0bkbrQY/7scBVK22FcaqLcxv03uZcjaC/1fiBWaD8MDCiJ6G3yFLzhbfowSnzE7SH7KBq3DDEXGvxW5s2kbIb2cIgJdQgpiRsu82OmVTD4mlhAe1aIJlCVKoe8xm/qINbhCIQ8QQ7SSWrBPbTilijs2LdtIuSnTzEnUNjZkztpDSG3iGiShufgiGMqPrkT0h7WGsieYmgDmrVbPOFas+OGMO3icPUiuuAthx2gvZrmRAy3FQoA== 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=ZIeqVL5B3EMK0SaMu2YUYdS8H/8AzWnEnVeQT8NegXc=; b=auJQUThdFAvQnsfJXeEJ/SIsOxJHxun2ZO7/fBmTaReEF8aormzoJWwIwpEgYE0sh57Z63x+32cDItUISTHshY9pWDP5mSRh//9C3y0YqcE/BcvqAdZdQrw15z7hDLCDaSuxEixNOVl83Z/GBSKNjnedFowW4IVq6778xKHZr6k= Received: from MW4P221CA0013.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::18) by MN0PR12MB5812.namprd12.prod.outlook.com (2603:10b6:208:378::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Fri, 23 Aug 2024 14:21:06 +0000 Received: from CO1PEPF000066E6.namprd05.prod.outlook.com (2603:10b6:303:8b:cafe::f4) by MW4P221CA0013.outlook.office365.com (2603:10b6:303:8b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.18 via Frontend Transport; Fri, 23 Aug 2024 14:21:06 +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 CO1PEPF000066E6.mail.protection.outlook.com (10.167.249.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 14:21:05 +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; Fri, 23 Aug 2024 09:21:02 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v5 5/6] i3c: mipi-i3c-hci: Add a quirk to set timing parameters Date: Fri, 23 Aug 2024 19:49:16 +0530 Message-ID: <20240823141917.692336-6-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240823141917.692336-1-Shyam-sundar.S-k@amd.com> References: <20240823141917.692336-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066E6:EE_|MN0PR12MB5812:EE_ X-MS-Office365-Filtering-Correlation-Id: a364e181-e524-4cb2-928a-08dcc37ed35b 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: D6KXZ803zYUsSFwFaa03Xxbe9f2jY0sjNbVbe9YjxAY6XJoriAQI8WjH+Ld5d/4bNgXepiR4JM0bwoXxNi6hy/oiAUrjDIyNOruy2NrDmCmZB+2yqy8ZQIMN2S6dYtEROMH6vj5DZGkJ+RPYSL0gLQ4FJlnZ4fcqYqTB7VH8EjclBLqpMpu36vj/Y6xfiFByTGgwPojgtu5PaA9bio5DiE7ajYVLfSlZUfc1N2oK9WOOpu459Ie4okIwUKDCsCi++nqHTo9II4VtJ3M+U+Bp3UGET+oeDhGPhaefibnr7hRXc0PeQ+m6yM2OBZKq4Nkh7KgHw0d7D7vYrPmir9+MFqC7fQpZu7LnYunVSfZCwTjxRvwCjAaY1FDlzK/BCRxmC6GL/DEsHOym9hSpXQ+v7ZbVQ9cusCQ+hQltolaTr1d5Pihn4ErSvBzjmvM9/9fiJNr+SPSXa9X7OUd4zV6qyqaH8gMNFzkD3gSc5RQAiyeOB8XRn7M3mXmRPJG2ck3RmP2E3fptJFCMDhMcAQqM8c+uUtgWvnotiK3rXLEtVKDb7N3GkTRfwBAxSZlosPIWPhd/wMwpzmnY5RUA2hBeqiIje+6OPtiF3oVVScrnVqdIxtAriTzYG11OwEwIQSbiqcMf1aOj+btRwuY+LnWbwjBWzpce62AVZXM63WBTj245aFCQ2y5M00fuWd7i5ybuQir6/ADGE8guSK5HvuJAOaL/gmx4j/4WNqPL+rs8kqAdLiTTnVr6XC00noEerfUfcLnm9iQURoum53va/slfExzEB5DMM7/N2UrKvvubqRhQL9aQD4UsfNox6FJwmLmTjb1Y/CEkg/vcligYe7C4Qsu9ntkawoKi/CEwH4w1Awdx4noVe5cloORfpPrtBT82t9Y/1uWVdH1IShitQ7Z2uOTXh/aRhAswF9RrvrBPTn/MoCnvroZfrysDIILTbrdiNdjuBbP7P0ICckaa7hlz0gOU7FdYt3Xf/uyl5t/asHGeJImqWJbtNb86BjKZ34XRI8tzHz2S/0uznFmeBmbBbew//bWQSHTArQ9CDIkHjpQ2ldFWnuKqi09Abq+L+7jpkr4QFTUe9HjHxpS/WqmvrMPiXKko73Sal2hbor0+B562znp7J9iuAvAipJWCPxBtubV8ObXSU2FJzPb5HxpdNyt7iPqdXxV0fnZCf7NDwV0rzGloWdOP3YBEdJ/rc0Vkj48jngBrWAEWeDFhCzpw4AycazqFCkouud/jb2CAgAQ+YdjhgbejdNrVyfBEkp429otCYdKHdoFoGOCy1FET4Q/CXjq+qX6wnkdK4er8kXWlBr8FKd5lpTcvnAjUE5mNPyFH+Evk5aart/Ga80j7YUqgP8Mjjo/RzNe45BYML6hYOYWVcJ80Wfbfa+foEGOYtrhEiQ7bazL81n4krXUgjCC+v06vrCrAyoLpGWaXKqg= 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: 23 Aug 2024 14:21:05.7494 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a364e181-e524-4cb2-928a-08dcc37ed35b 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: CO1PEPF000066E6.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5812 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_072111_682070_8CD5C44E X-CRM114-Status: GOOD ( 18.87 ) 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. 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/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 a64657ab5007..6c6029e6edcd 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -785,6 +785,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; } @@ -838,7 +842,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 Fri Aug 23 14:19:17 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: 13775304 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 E20E1C5321E for ; Fri, 23 Aug 2024 14:21:58 +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=LbZcY5mTBX5vRWyxhYr2LS2fNZv87woeqQTI1hNrPb0=; b=AJvAjDCmTwsFY6 tuzLmkkg08MaiBNGzSIxAY8ws1Z1m7s0FjlnkvBYKVXz/tHATswM6yGEN9RHAT0HxKrLDNQJXBgEF ltQuhJEdktjyt8kUzm7oUoPFGSqDkw12he/0UFtClRdQVKQ7RdXlfy+LxJhSpaVI34Df4gBVju8yc w31a0cRHZ8pJnZVMv5VjbuWTwFTQzzcXM4kqkyC+/Rhl3jrPCQCSG7XkG0SVxt5MZ7OTGXFatSnBF HJLb4HAaeJMNp9e6pLtFhGhV9SFy/Uj8XTuy9xKhALkjduNq8ER+v0YzjOkc2rUbc703nzK2W7mzU p8wOG5puf+T2TIIsA8Bw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shVAs-0000000H4Ra-2YZe; Fri, 23 Aug 2024 14:21:58 +0000 Received: from mail-co1nam11on20631.outbound.protection.outlook.com ([2a01:111:f403:2416::631] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shVAA-0000000H4HG-0nlA for linux-i3c@lists.infradead.org; Fri, 23 Aug 2024 14:21:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IduLOnXr00LUr/TcNSvaLaTAsPn1ImLUJbL5PoK6eRkddfeXxS4cMG37u1ZriycEAM7GMbAT75gtHQ+d4jniuJhxxz7KJByIQQ0UVVCP64SnWCwL/F9mm+u+J2zCP2aLrpR5kGfnJcrAIYuP31t00YeCKU4PAa24mKIi1HWDarWpUFXLQgi0NjUvf8POtVP+ZGA8CSE95abzd2wGwIzAFaTC3getWMLh7azbsRljtroPU70Ij3fT7ghNW3vtlVEBdoPCszFF8SMgWOcoG580c+UmVx+gJbHiUDqk9yqEY4U+g5cyg+HTc+M2hnxpFMhQvLNMkE84h2VEZQRLFeIcTA== 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=plCBiXczcfa3cQMdMY1qi4Wnpdsx9NRUXYR2EcbtojI=; b=JxOxFMLTzts6IoOORmIlQIzcOfGiVxysUQQHX2Vz2HlqfEQECZUpElKVtrpOO45fWt7xYGc8zTxmPn4VoKetZ3EKJC9yvgUGGum0TeucQ8KdMyhTizJunqjB2xfWqvVSBI3uLNapAxX3s5jkfjJwW7n8LBYYCdPSnp9ZkBq91KavINhfw1HBPVWZlqe+acLb1PjDQMiDAlphtvxZ3KbRxNdT1gLKm485twOVvbUsZONusZhW+HJNuQAj3rVt2tjeNvsDtAJJmxaHAAlFv3/tNBg3D2+WssSkpy7J/u3GTQej6pa5oQVGohctv0OogV1jqq+nXMvlIG+o6DMTG8jdDw== 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=plCBiXczcfa3cQMdMY1qi4Wnpdsx9NRUXYR2EcbtojI=; b=QyfX+XMvaJ4X+M9ry73vB4dMV48a6LyFTAu1g+Vc7Q7vsnMAMPdqdCmKfXnQWJbFshRl1iU54LJ3P4nKOpfdWEZxfMzGRnZDVFdBNp4IxPWA4yb8fxX40eKLIgmSmTdzPHIOrvUwnbuv/UKuYuO6Y+4LvyW8BAOkbMSbBfa55N0= Received: from SN7P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:806:123::34) by CY5PR12MB6526.namprd12.prod.outlook.com (2603:10b6:930:31::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.16; Fri, 23 Aug 2024 14:21:07 +0000 Received: from SA2PEPF00001509.namprd04.prod.outlook.com (2603:10b6:806:123:cafe::85) by SN7P220CA0029.outlook.office365.com (2603:10b6:806:123::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19 via Frontend Transport; Fri, 23 Aug 2024 14:21:07 +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 SA2PEPF00001509.mail.protection.outlook.com (10.167.242.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 14:21:07 +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; Fri, 23 Aug 2024 09:21:04 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v5 6/6] i3c: mipi-i3c-hci: Add a quirk to set Response buffer threshold Date: Fri, 23 Aug 2024 19:49:17 +0530 Message-ID: <20240823141917.692336-7-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240823141917.692336-1-Shyam-sundar.S-k@amd.com> References: <20240823141917.692336-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001509:EE_|CY5PR12MB6526:EE_ X-MS-Office365-Filtering-Correlation-Id: 72afca8c-1fe4-4a3f-96cb-08dcc37ed45b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: X0TOg1zZZYCqJm+YmfWK6olyAHcN1NOtzzk3nUfL5x+XPQNBYyPklBQyw+KXsrTLv4T4TAbSmgZcpEdMdHmkqjUAfZqAHpt3A0HmObpjZp4mAgr10ajTOBEiW4ZrFRJYVBfwu8n6dYNKRxq3kngYQAvKIvJyfJcLwjADN30Mkk6G4eYzSB1w4DrKDUanUzHi5jnTphfz4SmXGFk6W1m2+o1tHBqFytW7rWTF+kf8nlf2HXbI194cCAt3nI7jYKxF8orfwNrJZLEs3SrYDFKUPL+4P5NWBQFCKu7Sbxai8/DX0s3axBg8MdL7gdC353/XCwGn6Ynx6MYw1p35eiWzjr1vjXKMnpsmVVjbiCnFU62cjjSkRdA4KUHDv9HJaU0Pz8hZ85WDISquM+x2ld9e/wN3s7eq1umiuKR6FkKuMgaeI9zGVYem7AtjtmHtDURj68oweLZAyWTBTSedxKthl5/uJ7FyzVphh5JvPEo799da8W9mdWEGjPWZSm3CibcBPZaghuz7uejGQmf8EP7zGGzWx0YdGrfQkqKAYF2cG30izdHEBFyTdVQyDzoOxoOITp/qkSjfswfa2s0Qm54kddPRsizPQ/gm++baZslrsqEBPRrlu9Snp82tW9B+KXNVmzx+csv6cufUs6hvdgUVQseYB1zSlugSgcXD2EGPv0bHGZMqqy6TZhInbDo4xFBpnmq2XujF6A5Ifs9b79iAux4Z8BAbj6AThOAEYn7KngXvqaIuwyRimF6hU+nIRbllbEMswPPL6kn4Ob5sLYim0Atxiu3EIeVAuWK983kdGWHlgJ+avk2FqE6FdPNzq54ThgQd2xMX5nQ7umZ/kkRPlkSOwY/A0BB9u+4vT8CT3hMHaanXBve5cgiczaoAry1L6LaF08KC6Tcd6hlCDydxNWxO6TiwoUVejqJyn1IQy/4hVt8t7/8N3Ud2L4JXk+GsvzWflHnzZw+oTKeesX9dqPt3jGGl+y1168pBNPV9oxQY1/2+bW7e6FIYDkqNeoQPZQ5ovGPJebh6InWlra+YaeM0cuRPfVn93yJgF4MoEyfQVzzv8w2ce5Ct2jtPgR18EtWMSY4wtLLT90aLz7c02AIuDAPWomptoUUqGyeQg6AZVmERls3ufGNtlvfR1MAaXsGFDRXRqsOfBxsoiV+pWx48uzfGFTDinoh69mx0+b1jDnT4eRvYlGiaYkwhUWwv1vi9VZj8ygcxKqTywppbFtJghH+Jt+Njx79Z0Ug9Lu0keeFjzTjv74endt3vy3ALkrjgNG3zKFWpjvD4qAYKtnLv7LW+Cb71n3/V602/6N4RKQkPgJIkOlMdPOyG3Tst4SgVuZSmLcp524yh00DOwguvWhvlekXYGJgKIIY8g8GHnTkC0vgW97Zv786qmww2sUlyCZP5zu40flSc59P9VepKf1AQosAdapQ8vH0fo6c= 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)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 14:21:07.4898 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 72afca8c-1fe4-4a3f-96cb-08dcc37ed45b 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: SA2PEPF00001509.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6526 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_072114_301570_62EEF9CE X-CRM114-Status: GOOD ( 15.22 ) 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. Reviewed-by: Jarkko Nikula 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 | 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 6c6029e6edcd..4e54238444bc 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -146,6 +146,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)); @@ -842,7 +846,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); +}