From patchwork Thu Aug 29 09:17:08 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: 13782825 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 A5A6FC71135 for ; Thu, 29 Aug 2024 09:18:04 +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=WOsKPfMfVNg4xe gaBOHar9ZvGQkxkjcliuuwotsCjgHB8YymuzJX0NutXy/lcZkMk/X9aJX+dm0ogdGe0hkto/EuRma KGYYZwAHpz4cq/u/N0CMoRQAeUDeV/Zhy0TywxCodbo27ZkRUE6LY43NuuJj31ATPhlaa/k3vnpnG zLpd375UnNQymNl5wnH3a+LES1RrBuLukobnq+M0mMUpAEALu3oNSSC1TYPIijgleEmoJYDsa7TOS RxMRaB0cvyxGEtPFkoBZ/NbTZS/iEv4RyBkdYLK6y8Nwr03AXh37FesdHsosMe70e4yMewARYhq3V qjKyKTWFbxGPVuBZW2sw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjbI4-00000001KFF-1TGA; Thu, 29 Aug 2024 09:18:04 +0000 Received: from mail-dm6nam10on20604.outbound.protection.outlook.com ([2a01:111:f400:7e88::604] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjbI1-00000001KBo-0PoE for linux-i3c@lists.infradead.org; Thu, 29 Aug 2024 09:18:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rPpmCYglYTYt4GbnFgzeSWiWPHRxYSJjxltOpO/fETv7Ltxw737OdbtiJBuwzRWF+Uc4EZ8bShpldo/3xcZb4e01qkFvm8x8AEXmjSQOudZwxSVgh2s/gifovx9ChJS1KJpTHj6pQ/DDCQwYGNmDgR9+5X8mRaPU+/N8Fn+aic+/vTJEvFWzLBA50bBOmQhpyUa1pygvbsn3njF3o16qhCFnE/7n7OYlRfFslkE14KZkAyeoG5VJ/5w6ao/GZ8/9683xJh5Ez8KFNchtKN6+8ImCjNbyH0gd0eYZerrPwlWn0rF70UUByNAAxIiOBZnXhYTLVZdSRaRkgaUJQ7xmVw== 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=UT5lGRcgs64PT3LasHpRfjBgB/x/qeM00S2tdeRj6tMOdzcrvZRMH20/dnjRZUg/pBen98MBg+E3JZiVgxja7V1NrHbifc0KBF8wL7dmLcwcMJRZ3RQV3AMihw1rzrHALg79f4f6jfIx6BMYRrCPQKla6O8+s/yjuGyx+pFa7OzDwWOKl23QpElMgHQuNffha+LHzk2KIDjJp4FkaD/93ZNyQWN6/6OHoW0VFhVAEgxE2jugaB1bNXXs90j/JZL9jiDsS37xQfVQ/Gs2gHVbzakC0Y0oxYnpkjz9nwxvybJwLBsERgyn0XlYzRmXAO6h6T9FB+56S2kiw/z6J/Kvfw== 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=Ze1yJJKJXiaiD/RguR8iHl1r8Hj7OlYB/AWEWCGpHNCf0Sv2fORkjCAK8cJURc7cg+0GoOQCahQqctzzKSk6+3nmye4pbdjWFgClsZ4I6LOO+sLOFokWHQyfJCoBTM/VdR5rqdH+EYAvF1A5AzNUg5wXZEsdr9TZ5qFKL+VqwYQ= Received: from BN9PR03CA0941.namprd03.prod.outlook.com (2603:10b6:408:108::16) by PH0PR12MB7096.namprd12.prod.outlook.com (2603:10b6:510:21d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27; Thu, 29 Aug 2024 09:17:50 +0000 Received: from BN2PEPF000055DF.namprd21.prod.outlook.com (2603:10b6:408:108:cafe::f9) by BN9PR03CA0941.outlook.office365.com (2603:10b6:408:108::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend Transport; Thu, 29 Aug 2024 09:17:50 +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 BN2PEPF000055DF.mail.protection.outlook.com (10.167.245.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7939.2 via Frontend Transport; Thu, 29 Aug 2024 09:17:50 +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; Thu, 29 Aug 2024 04:17:45 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K , Andy Shevchenko Subject: [PATCH v6 1/6] i3c: mipi-i3c-hci: Add AMDI5017 ACPI ID to the I3C Support List Date: Thu, 29 Aug 2024 14:47:08 +0530 Message-ID: <20240829091713.736217-2-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829091713.736217-1-Shyam-sundar.S-k@amd.com> References: <20240829091713.736217-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: BN2PEPF000055DF:EE_|PH0PR12MB7096:EE_ X-MS-Office365-Filtering-Correlation-Id: 297e6cd2-19a8-4784-8313-08dcc80b7467 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|376014|36860700013; X-Microsoft-Antispam-Message-Info: oXqBjgLYxZWve2HWz4WgSdYJ6YMJRT8Qvuc1+r/bPNjhNNqdm96qMHnEWqKu5nclWUVPjuSNyeQeyJnRUGG8e3rgP3VOW3syf9ZAJtpQPSdzP0+0fpgn2YPKzEO57NxjfQdeDRjU3VsGAhMYNgDpXC+CtFXh+fuvXiL9wxMyRgzuMHL6WHvY3N6HI9+P5wHURO1yL60XsxkUj/ePM6bTjtq7eEjGs05jbdbQB9cvX3B9h8BsoDxGsJly7r2deQh5AqdJsI1heF3i96xUnmGSes4rIOWidO8VsIUXeKEfLNi34/ZHlcg9OfrFL5xoAi8XmzpUVUNTtKqg4YtMBb2/yEymz731eZDuh8F9y7LrsctAxLtT6A0WarNeP6PKbDBWsI5GzNVdXLosoWj/OEK+7KTT3qNtnhMRjMmqchte9oAgOvwuUEo/qhqyuN+33pRgiHhIVsg7M4Un1XzEL/W7AMLaAoCfwUZjfRhVpCMOtpQvicZRreSKlOUfmXdszRs2HAP4JnSmwxUycL0oNzNi9Wqx+f5vGyt2X1BNVsWf9mIka6M2pjwd3uwvoD1Gjna8RdAisdN/peQGrW/y6SOu0rpTrOWIo35kv9FAiNab1N/DXy6f78NUPPI9EgueV5TR4n/uwxHh7Y7FNCGjXnI6ZdWpM2ELQ7mkw1MgQ+YpIVWal+jZlNGXEatd4+72We/5F1NMpdxwag7fmnWBDSwQplD1wwVq1KJ8JXInc8HO9fDvWXqY+nlt/Z5IFLxabTs8xB65WNv3yi+nsHjZ76fFTt9EpN4flm2/zIgY07o0gKn1ZPIZROEnxbxpsx2wtq9FZzFIVpQYCPTkWBuZ9DuMFXyMk/N8pP3KJIKjNT0EiWtHCfsl1MOWM4WU/XAAPUW29m47FkMBTPZ0rMSz9wDCfHbRkiq9nMwTyfHmMakkxweDibMdQb8SEW8XAActv/GoUUJxpQhSadsAe3RKNXHCW7Enkd3//W77ZraqXtsedM0Tr2VFOxNnpU5Cv63cxLUTK315n3awo980w0wVHq4S+MNLTSknKNS0G0ZxvvZ0MQuQyTK6DllzrsnliNkK+WXGlbtSIiLt3FtjG4hbnGCLDoz66+vjLHoVm0lkQgtzfib9yGcyr1gRLBkQJBX00MDztNizVSoieXyuMOxs8oA5KboA3t24UM0+CwK0RKo50uzZXoPdDBJWIwIW29+R/H/V/OjfNEYGLBvREp7DeYMd4NDKfe7uXKgDUWNAlz69Z1wqh8lxOE/ecXGdqDlfbuWlAudr6AkcSUvHfew2QqawraSEpGCZdUOlp5vV4CFJMD6Wc8hWDyx/SZZkVIoJbCIoMrE1cneLaWPbjuGKMTO2kLDNB79kt1WB7Y1tbgPd0Y42c9dWPWMI+eSoZVX/Efy+8+cGgs+Cjd0Sf4wJSCpycM9CIw2/u+exlm7HsbK10P/TV1aQQhGiGNYRlKW4cQBW 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)(1800799024)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 09:17:50.0249 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 297e6cd2-19a8-4784-8313-08dcc80b7467 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: BN2PEPF000055DF.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7096 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_021801_178974_7BD05DE0 X-CRM114-Status: GOOD ( 12.02 ) 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 Reviewed-by: Jarkko Nikula --- 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 Thu Aug 29 09:17:09 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: 13782824 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 14A6CC8300F for ; Thu, 29 Aug 2024 09:18:04 +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=K8m/GMuKmXutUP8zUBQOu8A0tPAGk9psjJmMY6xWNnU=; b=emKQ2ZSULjE99/ 5hTmyv/qTraveZs5027e+59sI+Jae/CdqjeHSoJcoJU6Qqx+1VPE+7JDICJvC+f9gBDBgr+K+S7pf PtXNFhRno4CT1M8GJv/9ouHlHtvumFXcD21gbuwhKia3lm9rLVKBstoh0oW5n+ywHVqKjF5iFxlz7 nojWMgIl0Q1GoYddpBDGZtgNPqzezCQunM6JLsxFgkcqx5ovnXDYczH+Y5lr+NAVpIgYyzaK79IS/ DF6ZT8VRNuXDIvXvPoIkVy4/0zky9t+erzkWRJn+Zst9sFcMb7hGB1foK/xkPPOk/t7ANJbhjmvY4 aT0bs04Ro9bBA5olvArA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjbI3-00000001KEe-2rWT; Thu, 29 Aug 2024 09:18:03 +0000 Received: from mail-dm6nam10on20617.outbound.protection.outlook.com ([2a01:111:f400:7e88::617] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjbHz-00000001KBH-38g5 for linux-i3c@lists.infradead.org; Thu, 29 Aug 2024 09:18:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TkSFIhR1wIMC5jLOgn1ugigf8zkQTRdNZ196QR0kOWhOA1+p7QH8wxFpURfzc9QeDg5afsypcOEzA0lcepzWCzgdC86cAdNxl9Yx/W0NCcmsAhADuHAofkl3rQ3I7X6e2zObkrEsmXyMZyRv5z7/kcmm6Ohj8xNmIG6gdxDuNBvvRLoTe0hNB813ePUpPt5vQNV+GoEoodcYydTs17xTFnHTIL45uJ/4kg94ucEqNFRJclFMVmMcxrgrml/qLUeVH6mgYcAv0P2XA7HLMbPlnVkX9OdATrw6U8ob+omNGD3Nx1z8WajtWR3w98i+BzXTtXuRrYkdUY6mWnnKgQS2Yg== 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=xp1T/tWQWGT/oxhp2sezXe6N04bSJ5E3tjcz6ey9T74=; b=JzNrr4ZIfcvIpSJYN/Y/UGE82hHeXaX+MqnHlAJF1bYPeR9qMKnJhlFa1iiqcy9XT19c9s17AXhUuY5ORsjsnmxN3O938D2gtBFWUCk0gG/SxBI77kTL1BbAl1QY8am161pCX0BKXEf8Jn12RTBBcSI0C/XgpNgzcRvp5m4GtPiy73c1ZSE5mTEh1wBG1sZpEW7lXhRrSw66ABtRUdX1BsIhiLD/db94gDldZfoQvAvcEmCT6lmIphJ7vHQyjU3Q+lSGRu9NWEYBkbjBwHNlPxXU0ysDOqp9vPMDTIRGg+p0RKwCjvw2usTg5SiZ8JEQZuHH6TNttQKjDV2emqBMSQ== 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=xp1T/tWQWGT/oxhp2sezXe6N04bSJ5E3tjcz6ey9T74=; b=FR+P06f/o4ggTKwlvKUUAigCBWrkwkLpdu/yjfhYzr5uBx9uEvosYdlBMGUef+nie1/I2jZ/wi0PgR0W592X9y/8sGcCqBoKDNtzwIyc328Z2iCwbKF+/USdmbxVm03DWahx3Qr+GJDeL2w4EAQ/nteAUtBudwl1TaxGGhf6i7U= Received: from BN9PR03CA0946.namprd03.prod.outlook.com (2603:10b6:408:108::21) by CY8PR12MB7587.namprd12.prod.outlook.com (2603:10b6:930:9a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27; Thu, 29 Aug 2024 09:17:53 +0000 Received: from BN2PEPF000055DF.namprd21.prod.outlook.com (2603:10b6:408:108:cafe::62) by BN9PR03CA0946.outlook.office365.com (2603:10b6:408:108::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend Transport; Thu, 29 Aug 2024 09:17:52 +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 BN2PEPF000055DF.mail.protection.outlook.com (10.167.245.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7939.2 via Frontend Transport; Thu, 29 Aug 2024 09:17:52 +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; Thu, 29 Aug 2024 04:17:49 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v6 2/6] i3c: mipi-i3c-hci: Read HC_CONTROL_PIO_MODE only after i3c hci v1.1 Date: Thu, 29 Aug 2024 14:47:09 +0530 Message-ID: <20240829091713.736217-3-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829091713.736217-1-Shyam-sundar.S-k@amd.com> References: <20240829091713.736217-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: BN2PEPF000055DF:EE_|CY8PR12MB7587:EE_ X-MS-Office365-Filtering-Correlation-Id: f973ab79-4632-4754-70a4-08dcc80b75fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|376014|36860700013; X-Microsoft-Antispam-Message-Info: DpJecxKZxb8tQ2iVR4bihNGYJ1uIUO5JPkgQ+WhtNSkY5E35PB/xP6J/Xs5L1L8U3jsyTHEBvW5aBO9M8E/YQ39C93xPwpD8V0wrwWgtem8HAu2mEMZgOv1kkJg3ypV29+82uUtdXHhi2pqbz6jwFpZ+9Gb5KB5wE2j7l/398w+2NmxUlc9JiHNqZ/MOvUt1mdXt1uYadpr2REQRlN3yYJmFsnxuwyH4HMn+FSLaP99SxR+gON4THxvgg5Q8IhT2jeqsbEpWL2ntSk2b75kpzwqgj3/9YwC38i/jyn8IDuLTVEI0F+BtkA54u3mGGZeoALZT9kUfqgs9E0nx152mGdvEbkfyK8Glgu9j5X5GQfnGBXv3ElRPNHx744Tz2HaEOROgKokFmSP/fu0md9kkLsXxGlVqNGpUIojRCPzkAKoXAysmb0sJsuon9kPY/fTyH/d6lwUNUzd7uUYYxQu0NzY9Zxolpq/VUL0ZESv/OiTYtacLCTAE3yCPlK/AiJe1S2xOLWgsOLUL+CY+T4eO65bD70sTiDe4FD8kueoCKK+mp9sEjBnBVdwzuS949ZaHMle2MVUpEuCQejBJDPyU0laCubhzRNMn/TqW9cuojimI5wMovQ2PBHOxTYUQ384fjROQK/90yP0YK87noP9v0w5pCSMtzHTdbhK6YVgERmH8fF/D12k2HJQ/t/DR9aEEbfid4YEmp6ZMQ9141E7yYMiGM3/g6Afv1Cv1RkMo5d9kAbKe24MFXQZklhFkZA4zSSbcqV/+V4yjH8txeRK5dMCSSVCyiAyymolESfLD5TFk4/XpUcRwH8EceJIZuc2fsRySqILaCjM3yQgZuSah17iFaXz0Go6QOQviJHRhuolZvimD/dpjVRc2e+0kOhmhcJi+XIMKLkMoYJptfOuwy3Y4/Q0Y2iE75tL0srLMNrL1PkJs9joaTGQmZagDHPvtUslBtZJc2d/s/QcJoqZgPiMEVsfZjURhrMAqZrSK0/lOXFALVDFEi6aRMseGaQ5MB+TILOQpWJznMouM/jk7NcEhka9WM9402sxY0oueDGey7CbvNYp+/mpw6vPrJAzA6A5rVR9Fkn8mJu5p61TLr8hyUsFOzPRgS9ZUzoqOFK6TynM5uWpi5/OrcJsRPelzckMSBV+nnzfoWhlwR0xKV3C4r8ISeFORNwF9mAxIxJ/Rsx8qHaFDxv1pXwV5eGRiQJpRdJBF1jE6J+zxopKZ6FTJ3V9dgiTxZt2jzwYOnhTf30j3EhFbtVBvjhXK0V5GmwbnKsRLdVzRn9GjjCS40m6vdtGv+k8/sfCTIPpEtVZ/KCJnzNY00NchC9/6xwOtgiTcNIUkMRTfycGkd8eECDgfkicwVLFuVkEgfF/1wMK3sSbx+LYpFVJVlKCDYV3fOYr+3x8PCkVcLLCQJViDiaEcrJWub11xesN7/EF+TomGc9N6eILXRAdT5i7I8AXU 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)(1800799024)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 09:17:52.7435 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f973ab79-4632-4754-70a4-08dcc80b75fa 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: BN2PEPF000055DF.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7587 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_021759_818486_BDD62B3A X-CRM114-Status: GOOD ( 13.45 ) 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 Reviewed-by: Jarkko Nikula --- 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..a6781cfeebb8 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, mode_selector; 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; } + mode_selector = hci->version_major > 1 || + (hci->version_major == 1 && hci->version_minor > 0); + /* 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 (mode_selector && (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 (mode_selector && !(reg_read(HC_CONTROL) & HC_CONTROL_PIO_MODE)) { dev_err(&hci->master.dev, "DMA mode is stuck\n"); ret = -EIO; } else { From patchwork Thu Aug 29 09:17:10 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: 13782826 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 AEB73C83010 for ; Thu, 29 Aug 2024 09:18:08 +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=E4QmxQNoIRdCK+QHJ9tR0k2u9Npu67AEJ2DYxch51J8=; b=bKLuDisD9jsdnT rCN2QQVtVscJqB10mDZQ3uCUt8PK6LnbUBAVkGfaJBi60E45wPOlkYCyE9JjTVnsRt4ZHfOH0UunQ xIU8GyA2G1m26eUIPar0kEV5+RrE2Aiuj1M6X1rkmtySdJ7OCRxioo1BWAIl+KAedJnyr8wHPMuW6 AMWmel5Ebxasdq/JLfaGDxfy3A/NKN1V1DCZFUdc5pdNaXwRSUvI/zgHtugABvBItIpGfq/Esbfeh EcwzoxVDnGuMQp5E8x8hW3MKy8lalOBihu2j2rQga0hvbcB5kYUhLXCruffgNxRFDJnYmirsUm+i5 GUK9vNc1q0PzvMwytcQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjbI8-00000001KHa-0m9U; Thu, 29 Aug 2024 09:18:08 +0000 Received: from mail-bn1nam02on2061b.outbound.protection.outlook.com ([2a01:111:f403:2407::61b] helo=NAM02-BN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjbI5-00000001KF9-3nNb for linux-i3c@lists.infradead.org; Thu, 29 Aug 2024 09:18:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d6QAlJ3Fs5xl5gLYmYmJSYJmaHu9XW4X7L1eeoD120CRIlZWN6lukLm6H/s4DxvD475/kigmoxSyKo5lo+Bm8v8NLLmc9xGhbrNo3wMKzzjP4NiInYmalZMMVMKpiuAqHmyVzNEQ9zSr7aJhfgwnVWJG3Wy/B7N/1wlMiExy4Y+nCnQzJCdbgveT6Dy+K+cNzqRiLtPIIxuZL3KyCDWEOtNgj228l75FkfYU54k/lny4xa53RRmT4ZKwwgIGYDZT0Krepf4BZFWkJAkCpbBkOSATGIdRnXFJQPCH0WbrP4Oyno2aed05CK+jg6l4WKPdjVItf4AejonNpa1Z3ObD3w== 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=Pvej9JvHf1Qta+VxI8zXPBnnl6bwXcF6dwcKtcLK6SI=; b=U8NN97jI2gqYvPbJ/ej0wu9Ml6ZzO2XOaeiRP9ZKAYRHbwcwAIgIxMn/KOonAeVMdWiEkENBNAKl8PLWqLz1DQpuvv9nvKn5OdJJI1Pbi/qOdr8A4gXkmbzkmm6yAUDzGNp1I7r7aBDxejPObrlNuVB7esa9GMfec9XVPxpQptxVi7x+nR1kI4xECBnen8GIqt5XMHe9UvhncjbOQ+MrN80GMVfAYww/WIQST9rhwj0r7A6x57bsAe+lkZhJ35SH+dKTPaSLepvjQhGC3jXcn2UOzQ+Su3Ny3C1fYGUUqtN7x+cWjwBW0g6PpLO5oSxhQ0x75+P+9Koa9IHW/Hj93Q== 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=Pvej9JvHf1Qta+VxI8zXPBnnl6bwXcF6dwcKtcLK6SI=; b=f/aSWceCGeRruiEQw17Y6I9vo7F5C+Vd1K7om3qHMlZs8oUSJc4squfB+wLKnTN8cPmRZF4Tc8ptI5w382bsiUNPcfQm1YSDhpeYQ1lyelddpdCWHqlBLQGz+uEpl3nm35NGhZn/3nK+AaeXHJ1zdWSeFwV54RVW54VPVNcVxxk= Received: from BN9PR03CA0933.namprd03.prod.outlook.com (2603:10b6:408:108::8) by SJ1PR12MB6362.namprd12.prod.outlook.com (2603:10b6:a03:454::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26; Thu, 29 Aug 2024 09:17:56 +0000 Received: from BN2PEPF000055DF.namprd21.prod.outlook.com (2603:10b6:408:108:cafe::89) by BN9PR03CA0933.outlook.office365.com (2603:10b6:408:108::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26 via Frontend Transport; Thu, 29 Aug 2024 09:17: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 BN2PEPF000055DF.mail.protection.outlook.com (10.167.245.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7939.2 via Frontend Transport; Thu, 29 Aug 2024 09:17: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; Thu, 29 Aug 2024 04:17:52 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v6 3/6] i3c: mipi-i3c-hci: Add a quirk to set PIO mode Date: Thu, 29 Aug 2024 14:47:10 +0530 Message-ID: <20240829091713.736217-4-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829091713.736217-1-Shyam-sundar.S-k@amd.com> References: <20240829091713.736217-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: BN2PEPF000055DF:EE_|SJ1PR12MB6362:EE_ X-MS-Office365-Filtering-Correlation-Id: cd9101fc-f263-4390-9824-08dcc80b77a7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: +uDt0rdoUH9lPq37W/thkBeaiobYjEm3DLNJhfB5Mx853uB5m7VvXvG/sqNV3XT7lbTWwVXF9+WZxEvLmmWS+nCEsKXEvML3pbHqlHkI9+BaJjbuu/OL8N5sqrNtxczIzgxbIh/T21wZBi+38g2awjyBSsANtc0Dvj4F97KMBbKj/MVHPyJYdw9RkBFPeulmGYz5feF0B0TFVFj/d4QTXTXN4PO510KnFpqD8M+1G/Tc/FiP9p0TWO7YuJQTIf79GnRctDrf9LmqauoLeC/tbR201mmbSrlCLuYzliB7rRT+Tr2UhGlpZN9BPexUIdxJuOqATAu2e/I7U+Xg77lxHMfNdv3NQIODvY7vC1B29pH1iPkcC1OtuZBYd+bGn7YewNXVe7G67ZO0sdlNwQHWd+NPf4+5M433zXTBQqyCDyydX9/je/QQ+1ilWTKqa9BR3xfjEFGdDOdeJ/F2M8aVhr9satPnXf6zls1EwHZgV1L2sEwadoRhgsUjESAOQH3+wIvNXZX4Rozv8fOkxpy+OriXKV0OwJZD2T6DbdtTMr+x/vvOozuqxgbBkK7Rtdy4/eacODQi1TzWcYswJXhEv/4zusk/VuVW/nBQE4VzEdPaNDIukmfUuth/wuHDUQxz9VgT6Q/oQCv6sEEuHRS2GHZW5/IkVj8ClyYXAV9ASlngwbF3vKkSliQmzeb9YDD34jJaadskOaEjQfmFvhq1Y5pzYSrffa8ccHTWodwLXcypQRkTE+DrBkzQ7vLpk1rk89/HJYaD7Apf/gv8bztb8dEIR1+BDiLwRLF/epUs4r/RBb1RVsTb7PsV0qA3P/7RgNQz+3F3OzWPf3mtpD1CqK1lJC+kSzHGETa8yKkrn8g91ikp1ttJcl8bGGE5R37qAz9ikmfzREt9tGZfXjqHpx4HwwCyC4XhuLXUxPbPctPM4pQiMBmPZs/rPpuU6XaAV9gjeAZohQLIqzPeiVlGry1FK1OYe/OL+CIKQBdRh2W4khx62ns7/gJHte38e87Mk+WEZRMgRtsKrUsjYYss9GAMTjYa8SKk5PWwvOoi12dtgo2foOahP3lvGYo9Xbr9kEptliR8ayPaq9MQNuVli38df982MlFcYqdFBYl54Qlt0K1ygBAzHoqPmejBlr7YxWxmn7mE3Qp0hzz9cfu0Rx9i4xhyjiXy3I+TEidOWYbQhh7jJjdtfUkfDk47hSVNi+VH9ReYx7kQsPmDpHoZfnRIDn/fLmFp794U2gx3Z3xCxuwz+i4+2+TGbYYlpjJUock9aAZlcHNWPAjtq6XJdRJZaraWYadx3H8P1pxWxqRyJMpiWqjE+3SltiSseHpKofXVKkUhj1GUGYyp3c3HdteM/Uhf4ZpW+7mPRANwCIozflYSXj8wjZaZ1JNhZWAAHtFvtGhLo8ogiXF9ubcirXiJc27DtiTaZ6DxrLC186Y3BwKL5pz4hxQuT+JIZNAh 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)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 09:17:55.4935 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cd9101fc-f263-4390-9824-08dcc80b77a7 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: BN2PEPF000055DF.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6362 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_021805_979097_8B07DCB3 X-CRM114-Status: GOOD ( 18.68 ) 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. 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 | 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 a6781cfeebb8..23abf91b277b 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) mode_selector = hci->version_major > 1 || (hci->version_major == 1 && hci->version_minor > 0); + /* 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 Thu Aug 29 09:17:11 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: 13782827 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 51D69C71135 for ; Thu, 29 Aug 2024 09:18:08 +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=82qhB266s5vjhR0dpcw8fJp29UajZq883XdHNB6X/1E=; b=IOOGQv9RSwhYjU +5hpSSdFXubM7zGjz+y1DSEJqTEYxwQPE2A4GjmzjbbhndhshLRClchqNqCZ523nyhDWzw0+yP/d9 E2DS7cnBShBHb9ES7RoqawlfPwsIeOBujOzwWiufQRgfNI9Io5drqxYXY0KY0glX1pFYCEvw9HzlW /KexaTe7+kKvzgQcnrs58uOkCdzAk1aDdzbUxRhCWA6qc2FsGKOGqthET5c5UI6o41Jvrfkhg28qx itKdkSzM6dZdMq0eTEgTdiU1KIKOrlqSb1SYGJpq6p3XwhKZpivCBKBGiCh/T88a01ITZSRatlCl/ c8rSuUAkjygjhz46yGJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjbI7-00000001KHN-3c5I; Thu, 29 Aug 2024 09:18:07 +0000 Received: from mail-mw2nam10on2061b.outbound.protection.outlook.com ([2a01:111:f403:2412::61b] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjbI4-00000001KEG-2xv6 for linux-i3c@lists.infradead.org; Thu, 29 Aug 2024 09:18:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PXadxcOTAoxgWtPy9lu74xsxcPR3zwJC7B24TDvM30v8KkM9HoY4+VWJcqpC12+o78cN+iHd4I11pVPYtkTr8AaNjPAbM/K0POMOYnUTh8f1+EkcSdsThWQ6eL+j7VZPh8kFrHNob9OrhTWzH6ZPgEAXSr3YEjQr9nmg+LhJjIsb4QB/EXebKliOc3Tl6uPYV3eCvza/dcoHOnhjDTdZHeauFlUCNlbBoDpNEWFnc7rrPns0PNbMPDKuvwO7n5zX8TK7dYFX2bxKKEor3L4gujsOqSIMK1/ESNaLrmD/lIkb9z21EPQW3HQvRozVitGnojqTyXlmsN7rGzkXXY1BFw== 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=9d5Gk5/JUm7XtUbQv5NU0gsffOG+nCOQ2JvPqACiu6U=; b=Sag7BImCl97lpJs1pe3L/aqRd6goE3MzHxEOGEFZFrgRxyzydm9q/9an1MKhfRqOYAAF5kvXldcn22o4A8fnpXCme7g5JIQrphFltiHkbO7ep5+iTV5mhSw4ulotqrso8ujGj2AXrnCkOmGSTmh0bgvLBdo89/Alud7ineoDPm3I7GqFxtlUx3FblCNv2FwR/bVfX4QhyDYAqE/OYrnW11wSm33ttTUH7DjIRNIWeT9RXFNYAPJ0gH09km6p3UP/NjsjcaPb+eN/3GGgK/xyQqEY/OJzeaXsfFCfXeDnxWwcIF65dpo914L1NMwp0dfWd/9kS1QG5B13forYVozAEA== 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=9d5Gk5/JUm7XtUbQv5NU0gsffOG+nCOQ2JvPqACiu6U=; b=JxnN9d+ZmLJjLKbC6UAnxt+CHSIHgMnGbTxudWkrsvPskAzy5EIqcSVZIDLvqPpqhz+I6QQryMCTwQVIW6IJuEKDjKjb1r7VH/HxN5cXAOaktqNSc3GR4jU62xcrbV8yfXnYw17vh+6BtH4Jtq+cwROLC/wH3u6ynpw2zg1+uaE= Received: from BN9PR03CA0940.namprd03.prod.outlook.com (2603:10b6:408:108::15) by CYYPR12MB8938.namprd12.prod.outlook.com (2603:10b6:930:c7::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Thu, 29 Aug 2024 09:17:58 +0000 Received: from BN2PEPF000055DF.namprd21.prod.outlook.com (2603:10b6:408:108:cafe::fa) by BN9PR03CA0940.outlook.office365.com (2603:10b6:408:108::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27 via Frontend Transport; Thu, 29 Aug 2024 09:17: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 BN2PEPF000055DF.mail.protection.outlook.com (10.167.245.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7939.2 via Frontend Transport; Thu, 29 Aug 2024 09:17:58 +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; Thu, 29 Aug 2024 04:17:55 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v6 4/6] i3c: mipi-i3c-hci: Relocate helper macros to HCI header file Date: Thu, 29 Aug 2024 14:47:11 +0530 Message-ID: <20240829091713.736217-5-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829091713.736217-1-Shyam-sundar.S-k@amd.com> References: <20240829091713.736217-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: BN2PEPF000055DF:EE_|CYYPR12MB8938:EE_ X-MS-Office365-Filtering-Correlation-Id: 4878e49e-dd29-4121-4a86-08dcc80b793f 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: NpqSBJg3AE1r1+WXD1lEpPe0h23KOBeVDfHzRPXeRH68SicuIM3EjszqEWN+pMZ5/VooLg2LS1icyI++P85B5dGF+In79RsMk7ITSRJDmfLuhHjNa5jU5DvxueEH9gHAsEc6X789eol/WUh9dZGiHttew21o1ZpR6i/coP4fekJ8jbOagh8Qn8RALXFnyLSER3v3k885Go9c43LNSmBfXv9emjBCbd9mH2l9BcMEf6rxp6a8eFrksgTyIQ0H/uXKyBalOMBBmi5a8rjgrpBD21ucHC1UWsFyBLIDKADg1YYNghhwxNi6iHToIwmGwF/zyWCzmCR7A+ArmVEZ1/Jzx02LEJEgoPKdzf2WpjG38349r5hLgtaJqE/kbbZb1puWSNFnKVWwK/JiehP6kbNqkyQaKWZI2COc9yMWeqk5VxuBO+2LxkzDA5SMtNa4EFmh03VjohU5CBDD6LR1S4uI4GBPTBG7xmhyVjljPxBprJe9jMrHTDBAN+ohwVyZPDUHdqGWb095uXqklejNmXQCJRNSdhvSZ+G4SSRhC+2dwsQHIaNvSs3wcSRFpEj9Do62olVW/ZEnigIB0hKf5gYQScmCVH1dROUvlr5pShbiZjEewApK0MOyZIJEhssZ52cEZlczzsXqn/tS9KSgrYqTc7gc/5r7vNId8uZ7L8aT4imhWUG9tArqwhclehgSElQeveBjqq4MQyE3fYoJ7GNneKGPzZAYHmxIswA8u1trZbJoM8hm0chFV3BerHHc0vF/RS5LxsOQ2B2A87vBgoFECjrcGjiKDTpdn99y6Gok7WOyfY4/Yhzp0g8p+pew5eWhFzsn2gG8O7yddrH3ozUqx7ufEZ8pu632tEIDJDB+hiyrKrznt8PwmeCVdUkneQD4lXwVmRWBPchlLykgUvkH7TjfIX77vWuHOQbkse/r5kTOEYU9A4IJaSLWlocosUqv2f9YEncAFF0CGwhtN2RcVYj4AXjSnjGGOMoJeW014OSXtNFxv9vXS9wt9Z0LrWx05ZEG97GC8eQNOAHG8ysrWQ2lanqXhVfshetRvTaUj/M7pSaj0hgVRMUWPX6GKJK1zGco4y3vzw66jiY0OaCZQwlFPhOp/I6Bgcqa3ScE8DgVmT2K9FtkJW0jNsctFcVOBZE9hdDNJbQVUhPVA8bWg8GLnKs5LMfoS8Pz1boQae8x1Boa+K6vFvWH8AmVJa+Sw87QDGsXUYwK070V7FGfytdi+Oq7fqGfqRWTdXbrPXRaZlC3iAl35xMMuZcDBtEe8LJyut5BBTkvlrvcrK9zQq/vK/fDZmcSyKtc5sfFWCXMAewUcA8bj+i9jp3aW7T2U8d6Y4Cxl96srHv8mPoaaqwnHXm6JuSN4L7O0EgzsklaER8js1AFzlnrFeeNlvAg6MNLR7tAba7dcMQSDjaOAYbzh2ioyULBcWiLDeTNEzpOSRtKkTE2toys9nALx79B 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: 29 Aug 2024 09:17:58.1654 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4878e49e-dd29-4121-4a86-08dcc80b793f 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: BN2PEPF000055DF.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8938 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_021804_792391_002F3E7D X-CRM114-Status: GOOD ( 11.85 ) 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 23abf91b277b..c03e86690073 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 Thu Aug 29 09:17: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: 13782828 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 61EB9C71135 for ; Thu, 29 Aug 2024 09:18:14 +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=j1XtVk/ZW9KatoGFEIKz9w8RjsUrbEl0z8oyc1B1MwQ=; b=4oKV8t+JrGSIVM DnRE/Foaser6aDQVWUfRL1bTM67zGLyEiJ7U2GqwGlBOd1mQ75uwTkdP90fUqOGW4M5N/gRW75i7O yhqE2WqeyGJWzf9iwy9/lYeYVpD20yjDucvqRE83Axxcx2uMKWIo0jWThpGmcZJiKsmpNkfX2vqDc sv1kCuBsMjfjQmEMvsw1v9Tgo5Ut1Cvmn2ufto32PwVfMQTCNAs0vG6DT2EZqRNRBilsiIS2fvERb gKy/ed/t3D8wkfRvt0HwS5tS1Fy1M0WLgJ1RKZtJKR8eqK/4z4Kld3miAi64X3vrggJEehjUopbD9 v6jCnCXgQn6oUBym8jCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjbID-00000001KKS-3vr9; Thu, 29 Aug 2024 09:18:13 +0000 Received: from mail-sn1nam02on20615.outbound.protection.outlook.com ([2a01:111:f400:7ea9::615] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjbI9-00000001KHZ-2y4B for linux-i3c@lists.infradead.org; Thu, 29 Aug 2024 09:18:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MiXutxEhF8IGCiHpxgeNcFwJyDcTsg6xjuApPnW6ZAlZ0qqueMiPHUu9/RpwegWfvUdo25Ih+pggPvxOdc96bYSt7NTyIWd9FRceG/67YF1Lih/0tYZ4dJtU4H432xywiXGbYo1hBkbmi3LiLeCuXCdK5nCyKHvtY3nyib84lkWxhhJElUaHuDdZKIZvqBhK8pZSLqLRFuXqq8r3dxZcHUhdy7f0baou34wkRPreKz8FezRfnsmLZ/7De0LmfXo13PvgpUcrlW3zYIAN3sPRrD+7Hp7kYtkXRJiuWpEf8NVHvHD+i2EV0VALoJJp31otWfFhJ6BNYBIjWXeiBDxpSA== 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=Q2OubIrnw3mxMYjtKeePPgIRHDcp4lFIbTDrZYRDziA=; b=xVnN4pSKcG1hk4sCWWmviI64lRBuQXMaohOt7+/PTN/kf6i7KPkh830kb0EEz4E0tsA8+5EyCPKI6pEUokkyhcHknpqRZxu1iKkWdxDdXMGY9e/kPzOBqvQuN+vb4ygsmehRNo71AjJZiKqvepQw6WxZs+CHT0A12dAH0wAfazT8UV7FJIosaeCHPmIOYVw3yHY67deARY9Y+dNAVZNTWlQznbl32kMVu0q8H3UA1iFObHr/mCyukpORJQEkIGPdpqKjOd3jy4C/bFbNF/WBp01tBs4JqSR7m3HSOcd8U8mA81jPHIc+4yqa+B75iseaCTmky3zTmwPeDzdmDiffCQ== 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=Q2OubIrnw3mxMYjtKeePPgIRHDcp4lFIbTDrZYRDziA=; b=CAwG3k6lIiSC1pdHlC7ooCmc1mkiE7zunjdSJq3vAtteB078cfUT5Ar7mMKYmvvqOpGp+WtQTkcQ1cpkOw84bSGB7rXtUGjMWLJZsZMmnpVR7aJwSKjtUxuzPWm5eee1x6mP8sKs9ZZqWBHRuFNoXmSnhRcPldeBeNXIcbnBy84= Received: from BN9PR03CA0950.namprd03.prod.outlook.com (2603:10b6:408:108::25) by SJ1PR12MB6122.namprd12.prod.outlook.com (2603:10b6:a03:45b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Thu, 29 Aug 2024 09:18:03 +0000 Received: from BN2PEPF000055DF.namprd21.prod.outlook.com (2603:10b6:408:108:cafe::56) by BN9PR03CA0950.outlook.office365.com (2603:10b6:408:108::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20 via Frontend Transport; Thu, 29 Aug 2024 09:18:03 +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 BN2PEPF000055DF.mail.protection.outlook.com (10.167.245.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7939.2 via Frontend Transport; Thu, 29 Aug 2024 09:18:03 +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; Thu, 29 Aug 2024 04:17:57 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v6 5/6] i3c: mipi-i3c-hci: Add a quirk to set timing parameters Date: Thu, 29 Aug 2024 14:47:12 +0530 Message-ID: <20240829091713.736217-6-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829091713.736217-1-Shyam-sundar.S-k@amd.com> References: <20240829091713.736217-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: BN2PEPF000055DF:EE_|SJ1PR12MB6122:EE_ X-MS-Office365-Filtering-Correlation-Id: d73b7506-9024-4cc0-ed4e-08dcc80b7c2b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014; X-Microsoft-Antispam-Message-Info: cSzIoiOnOZRC2afiStD4dcYs6nvuh9nTzYumt7MLgSkfhkRD2yPVvd4JwoEKtEqdFscaMHB4Bvc7shZ0c1EF+mgURBhdkLfn0xxA9lreifkNuvFYhvI84V3fBT4TCNSsRpbvoq0/4HJIzTyYS70ukm1YSUZVLpJk79kPRLGHoiaAUSgQ/qYAAP2tHGxC0yfh3+J/aA86TsKg+VytrBknk0pVDZdJB0THtfkey1vwf6PZNIZCEU6mWO9fH8KZqi9+BWmofn4lmmVx7HMEzdWBkx5foIpugjkrT7TbSRlo8c3ji+D2W51Y2HwuMB+O30K2JlNVmY5A6SxKEN/8Xs2Nf1qBdEOrw34YafUfwQSLOqMfaIO3k4SNIEuVy2SrYD9bAGatO4djmT0dZAZUAE37D8Nu+TDMfpZCeAXagQBlf6KcGw2GzrdR3VSSpZ27ey6XOPxHFMHl6LyHSFAqIEribg9CLcNKJEwa4pVJboP+OxNzRN16GgJPcpcXNMIcTqtXbWdCYDEcRdYJI2WJ9tQDM90f5haE0fjDSkHsD0g95+V6ZqEIEVeOSnVHGwmWx6EOXyDE4hK8nrw2/ccCfUU4TiXUD3ccrdRgQ4eKb/zgnMPnBvx4tj6r+Go416y90Bhm86lxqZffRE4eYadhGBwxdmbmwFiqqEbuOE1nI9esDyv4PfSD6IS8lyjME3N1WroDuPaRzCr4VWswX9e3i1fffzLo+CQ2PjjOYLIjDY92HeVvjrM19+75We02ic76i/jThhY7apKyWWkyssQWdW1510uk1Y1M9eRpSPuE1XeRWVxN3eXLrsaQzfPQcYZ2A3UTBSmn55+C2GQacpWlr/ngr8LXrDG6n0NXYY5S19z1inKW4r2oyaWFvNAFqf4EtDnoVywVsp2rUF+5nvDZh9ap2/LvlSF+ZP/rBX6u82DIueKJm4qgMDUjVg312bS3WfQ/HqmOr7izaURWjmK2baBjltBhrA/9RBqymOX82jvwye7VfXLK9LBMGslbdSwb2dSEWskmnQ3QzHCMg6TXhjlEYUVwgxPO7iapMWv1n+6znXWUQB6G+QdBqP5OR0PBsjMxSbeU2n4KfHLg6OCwSNtQv0g9N7bMGM3FGhi7pT8hxyf4LK0fQldbiZCnOacftHQcvG9lJhAPZwYbrpD/EVp2oDqt1ZW/u0PFtXB4r//2NXrAdj/rEIv/lhYPXAf4BI9utOLaOLhnTCvPb6Yb8dQKA0GX1zXXZqVUkuTAGTudc5z/uJTxJ/NRyzJya6D4sLZrIJSgLrb+cx/zzzDNkM6ZeS2JuyGshhteT3Z0XBV8zBotGOlGvNn0Ry4kcvyOGf8HZCKkIlTd7z8x+XEDmAG1iH995S0Scum6QrUQXpru0cm9bqRWsGsfNtbJKT4ARJIyAxOlfaEiSc5ljLSmrgRqvm057HSmziG23SEF49tTw64= 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)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 09:18:03.1498 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d73b7506-9024-4cc0-ed4e-08dcc80b7c2b 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: BN2PEPF000055DF.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6122 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_021809_795482_F10C0CEA X-CRM114-Status: GOOD ( 19.56 ) 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 c03e86690073..f9ce0ee2cfd5 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 Thu Aug 29 09:17: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: 13782829 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 108D3C8300F for ; Thu, 29 Aug 2024 09:18:18 +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=qHx9v89ttWspLCMrJvZq96GJbvG00Y6OV4gJwIQMAls=; b=bKo0RJxRyM5puk N+Rpd6ReW+yVqO+oXOFbf2g5phSqewKHLSk2Z2vnn0H2dYl93eGYfre0kUzUqLvFB/4WjQqUUb4o6 bj+ZotzGSCbOJbZ/aJwrYahNm3PI4LuB0bu9NpYJl7kGoTTAnQtG84yOB5zZsoBWiB+JYhPxq56XN 9Dq2Uv+eafmCtzVGjO9aBGPyGcVFoTNMVZqViiSSW3hiamTBV2uI9LQokz6Cz0V1BBvIQplPnMGz/ x/d9Rk0TWCMMDx3h26jqvsVaAe1UJzbRBDsj51Xa2a3O80DfIyPm0Nr1oKzML/LMwebjTSXyoicb6 AJn4EFk9YDa8mGmRCY7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjbIH-00000001KNW-328h; Thu, 29 Aug 2024 09:18:17 +0000 Received: from mail-co1nam11on2062a.outbound.protection.outlook.com ([2a01:111:f403:2416::62a] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjbIE-00000001KKE-3Sgh for linux-i3c@lists.infradead.org; Thu, 29 Aug 2024 09:18:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ov+96bNuEliVnB1waWh/mxfuH3T+gHdi974yNis6Z1S7kz0ub1JzRd1PSBahM33gLhu39n9bmbehIfMwQAiKpD/Tod+rvohrgL1zk3lfbtOQSF4oP82Cc/fpllVbwKhpe8GjKjEeeRQt685ur1978fIaLEGAtlNJ3ikklssteruYcmli+xFFOqRP45sWeyy+amuTc+0mxCSXt0kISB832y6v+yVvWKdT9dpcS1VF7GhZwY52d92ibWtgiaBADi3sChVzUFYN0mEEAQf/A6zsBoC9gwS2JoI6mW44/buhkcMr6/U663sDWvMVE16k97MWjg37qB816SM1RN9Ai7tlvA== 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=Xbg0qkfhOolBOgB4wq2O2qvTMJYxtirSIgzI33VZFwA=; b=V+7rin9jub+K2JX69DXTrFrI9XM4LtGgeE6nV2x1bs+/7vcnuxE4st7MOiVFXGXVxiP39PPvuEphW16WR2pJaQTlaefOgEKyUZEVEtDsScKT4aY0Pdp8/1fPfw4LyKUm6IyeqvQ45Api1ZNpNeq2++m98obVbjOBtV2EoRl7j/EbKgvEgQRlIlT7NHd3Q1UcC4KvUgg1hnpWlbTPWU7NcOggHJosi6gZiiWyn2edxc1OPlcSFSv95wB8auKS2Iyc9qMajEBcGVXQ3HGXod9vOjYnI9Lu88YGqmyDYsaP/DEi2peAFODdtkmLvT6zergk/F04dIzb2xch/wmuy1rwOQ== 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=Xbg0qkfhOolBOgB4wq2O2qvTMJYxtirSIgzI33VZFwA=; b=AIFBsgS4g1rn/eo0IjD6ujqCrPAqOZwLtTHJXnAsW88mekYXovZPEStoP54Ioa9fdH/Nn+K/ORDQUqN6ZSJXi/VgrCdRrB271XBk8fWQxhvHkqfjtupfQ/MKBuO/b/pCoq8R3LR6mN/z83QG5O34ljo/HVaS3cyGQEzHvCi9IM0= Received: from BN9PR03CA0954.namprd03.prod.outlook.com (2603:10b6:408:108::29) by DS7PR12MB6261.namprd12.prod.outlook.com (2603:10b6:8:97::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27; Thu, 29 Aug 2024 09:18:06 +0000 Received: from BN2PEPF000055DF.namprd21.prod.outlook.com (2603:10b6:408:108:cafe::c3) by BN9PR03CA0954.outlook.office365.com (2603:10b6:408:108::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend Transport; Thu, 29 Aug 2024 09:18: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 BN2PEPF000055DF.mail.protection.outlook.com (10.167.245.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7939.2 via Frontend Transport; Thu, 29 Aug 2024 09:18: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; Thu, 29 Aug 2024 04:18:01 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v6 6/6] i3c: mipi-i3c-hci: Add a quirk to set Response buffer threshold Date: Thu, 29 Aug 2024 14:47:13 +0530 Message-ID: <20240829091713.736217-7-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829091713.736217-1-Shyam-sundar.S-k@amd.com> References: <20240829091713.736217-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: BN2PEPF000055DF:EE_|DS7PR12MB6261:EE_ X-MS-Office365-Filtering-Correlation-Id: d1a3b967-c155-41e0-1523-08dcc80b7dd9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: q8x6siZSmv044SyebxDvj77zPd6YZgAPPbiNNDNiwuTIcdi9g2bfle6lVRqWnUS6Wob2g/XQlLmezs0TlfO90Mcz4rezLHKP8Af14dRBWr5ypDKizJYGLzlzRwmLQCVMpAblFyghfLDMZ9z8v/+wJBvovqLn4KV/xQeCpk5Q6HwUbMPMd8r/o4ROoEcTcEOfgJf4Lcnh0QqtzeLCCVWdJqpzFFADjjQNJawfX3bmNQcUjWT6iXKftpsBiQWMKXYcqmKA9bbtAh5RCub8vMhVkG2QsB2NMIhgQklxQGo2C+uG5kPWSGYbq02jG3OGmqvOHmkpvHsot8wz98JOw7S5mWdf25EunDsQhC6p26OhU9a4sTQPUmnVtbYjKE3hC3D8OCsrH690RSeGFfzM2JPQyTQAVWwbq9Q6zbyTHyIPQcPbT5QHbwzirPGyEI+zGBxgY0YvMKq27P8Kw5sGdjsOPAdisJa68PYI0WxqEjHYYtM40RlGTjJoGBF647hl7OT2D9kEzMWf4GTQKDmVblz5Jn+m28sqqGtDz7U2klEU51fPVXFhj3KdTgy6BpIMWlCcbvAFyjZSj8X5zSafk5ySK/P7xK2AqrM795nyT5suYa5wnaTWoUscIvZicE+xzV+ak6vHAgjmswstdrtTOp72mMzJ10ta1IySTqEF0nhWvUC8bxrQ5j1Rwfe+kmerTGAsMFA0pIEW8pR71cRRKARoMc617vGLVR7i50/wIZx56OBhzkOECe5B5bSaPC58leLlDTOhXC5OGxsytf7HLhI/tZaltuiBlIfJSJEjgIeuHQ93/wyBt3VkGy/Lc7Lg4z5OkG7zowN5WhEphjVyA25Pvz79kU/8cOozGDVkt/wZ2XbhlebVA7Y29BndroY7+DQrFZoZ4+/5Su/LepQhm6d0k3XeqRq7OC92Ek6SCIBvupROEohZZfJxj7NmS/3Bg8QdqacfgmG4AEcsUY/MG5+42fM3zCq+tB4WPQIxTvHr5aRT5kZviawAiJgyRQGUoUgCXqKdjEuGLanvaRjepj9UX8Ovg/vrbNKw2F9N0snOtk6x3dheh4A0r3m3yvTe/PETAW5nqN3k9v08cJW5UEuhyKAwOEn8vx8WdG9A3Xg/ULY+AOrrhulyIL4WwrZ9YRU4sMhUNjDQowcB9KRtp9O1SXoyyji9xoci4KlK/YMWLaTIvdKPEyUZalzSTtXuksh3LoICBj4goL6JUTxzwsJDmH2DLqqpp8+h2s8H2/TXn9bQWMO3XAPBi1b8rvkkCLOQP1v4CBoHYYrqAM92nMKFYWXeQqQiGrHMjPaRGPsiV7Oo2jfqe+J86+VGHsN/0jIhUx+KLaB0cX9Mvb1Q7LPeq9UrrE4Aw3iqzrR+oetaKwlXAIfd+jfcdlOoEhocZBNHh2xXya6gLe6yu98sosr6NDcSsYe1/hS5INLY+u4pyEA= 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)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 09:18:05.9467 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d1a3b967-c155-41e0-1523-08dcc80b7dd9 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: BN2PEPF000055DF.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6261 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_021814_904171_A64A51B1 X-CRM114-Status: GOOD ( 15.91 ) 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 f9ce0ee2cfd5..a82c47c9986d 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); +}