From nobody Mon Sep 16 19:01:04 2024 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2080.outbound.protection.outlook.com [40.107.96.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 26C2113BC18 for ; Tue, 23 Jul 2024 17:36:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721756180; cv=fail; b=P64HH92C/xSVhRDdwUPDvbHAB1CGbufvu1LNdnv6mPiSm/E7w/BEFYz5EvIdzU0NRlmBX9Mj0vn0lN/JE/+j2UaXMTCkEBXWL+smZ5xw9zd1c3Rp3fVaqXw74EuAWD3CY1aOmKcyR1k7q+fUI8zAD2wIx+SHLFFjAEzZ8pDGTdY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721756180; c=relaxed/simple; bh=iV3XUw236wpqJ+Lt8sM9Ma3c96siQ04tJb7dFOKCw1g=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=S0caT6DVbAIj+E80td/8qn33Karl54hI59FjcZdKTEcEVpeclCM4SmzxtnSmeglFhR4BA6ShjgWfrBubP6Pr9n7NeQzp6XQ7CKuRz7de72U9Ba1A5uhqarY07lw23q/IKY7Z2WOK0+xniyl+T8RfwLcBCoPm1iyx4/CaSUvd/rI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=jp11sr8Y; arc=fail smtp.client-ip=40.107.96.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="jp11sr8Y" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rujTyDbHt5hXHkSds3l9ZglH0zqIG3LTW+SdwGZIDEn2ylhPOTXDqxPG6aPydvuPdvPJLo+9GaEA1aVNkZpMBRJs3evTthe01kFQnhq/xChHFEAXYUaUhUezVhqx6P65nUBLj3Zj/rU8g6WpFwNjXy2/Ap/KjHE7HmY5ZkAEn310NHywtfAYvlMX0l4OdN+PEIvI/zC/jov60oxTPmnd178jFdY0ZVMc+DbahJibyZ63wQO/O7XKpeevxomFYSoVJ67BZwHPREQ9kdmvfsvzUXT2+I1llpvKxpVKwLvIEphon8XOvXNswpFCGkdqH7FFDFSXqpe/gnQSHpBoWQuzgA== 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=EMrvv5KaVaRLzkoKWn7MmSXd6PTY5shWek6qlzF7EXo=; b=m0HmOeBUon13w+TBDZSz5tKI73oTA+1/sKaVybtteLTy7TY1Fto64R5611+WSs8BKZLycnIL2vHDINEGR5K32RTj8xb031Q37sdyIMLfJOlpKpnE07sqXo336T+2mox+T20+k1S1K7v2xmPYEAaOHAoVCDmMGnFpnSUPQ4oXXWjfwAKPzhXNDVJFyht1nn0FI1scyqJzA8VRtjXQqIXbgm/oj2wptz7yDEGqNoOzqo77m8xiqdkYbv7rsWzzZo0b/oZ6PbFIzSAx3KKL/LlePA+qNO3EklppHLEA/YyoLzD7KiXanVdqQNV8HMYxG187jL5FnNUVrL8m4HGVOvINFA== 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=EMrvv5KaVaRLzkoKWn7MmSXd6PTY5shWek6qlzF7EXo=; b=jp11sr8YjBlb4YJ1XoLoexnfp2N7gw9AJE9UDA6PZKkInIYq1Z3GeLXeq/ksTfmQRKkxDvSwOQJIxDrjXEddDk1IbHcTQaxlZge67uK27B9YyMRR3qWnccvdjXIZ9BuoX1sgM6v/uMfNqOB/n7isAAPU/pWyQIMH6LYJjhU3aPc= Received: from BN9PR03CA0665.namprd03.prod.outlook.com (2603:10b6:408:10e::10) by MW5PR12MB5599.namprd12.prod.outlook.com (2603:10b6:303:194::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.19; Tue, 23 Jul 2024 17:36:14 +0000 Received: from BN1PEPF00005FFC.namprd05.prod.outlook.com (2603:10b6:408:10e:cafe::d3) by BN9PR03CA0665.outlook.office365.com (2603:10b6:408:10e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29 via Frontend Transport; Tue, 23 Jul 2024 17:36:14 +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 BN1PEPF00005FFC.mail.protection.outlook.com (10.167.243.228) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7784.11 via Frontend Transport; Tue, 23 Jul 2024 17:36:14 +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; Tue, 23 Jul 2024 12:36:11 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH 1/5] i3c: mipi-i3c-hci: Add MIPI0100 ACPI ID to the I3C Support List Date: Tue, 23 Jul 2024 23:05:34 +0530 Message-ID: <20240723173538.3493935-2-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240723173538.3493935-1-Shyam-sundar.S-k@amd.com> References: <20240723173538.3493935-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-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: BN1PEPF00005FFC:EE_|MW5PR12MB5599:EE_ X-MS-Office365-Filtering-Correlation-Id: c6beedfd-f2a2-4667-9d4c-08dcab3df36e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?jtKd+eEJdud9QksjNdyowTenHAGvuTZI9szFcAupjt8T3m/Bk0iPYaM+SkXu?= =?us-ascii?Q?I0wmHcEPpnmX7NL9lx3iqNXRWd3ULfK6tRI6yooig6m7GMQDauM1vkYl4UIa?= =?us-ascii?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lUGriR554IzKW7Xcl?= =?us-ascii?Q?N6h2uvd56bXTqfmN/5eFnqZoJFyTJYwjP3xpb80uhqIxUmQnRi6jRWnzNkPx?= =?us-ascii?Q?vyU8/QoPZ1KA10ZpWcOekwhg1ATpKOmycbHYBZIZ7EYRTgOuoN64F521vTNF?= =?us-ascii?Q?XCS6JMrU17w/SzTPasRa648iJqH0M4HokCIFNR0dlek+LPUAuOUDO6lrlQt6?= =?us-ascii?Q?OveBaP90wFwIEbWkokqP/QPaYAnwoUqYrBARmTLln12WyGLNicAux12+0gXQ?= =?us-ascii?Q?Uj0Ihuh8grnptEzUqibEnTYAe+Shnq+nmkhryKvOga5ulYvwEzMgUyXUpIO0?= =?us-ascii?Q?70la0LACiFAslnhQ494GwO0zhq6fh2SGqxDCMy1LsnhOIcaEmNSZJD6xoR3a?= =?us-ascii?Q?1ALxpKnTyLTwJNOXLE7zAwO6wRACYzeoHc0Io6V/bIafKCb7tfGYOjvodYms?= =?us-ascii?Q?JedP/OqOhN8sONeRdDZNrjzRnnSZEWER?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2024 17:36:14.3672 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6beedfd-f2a2-4667-9d4c-08dcab3df36e 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: BN1PEPF00005FFC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR12MB5599 Content-Type: text/plain; charset="utf-8" The current driver code lacks the necessary plumbing for ACPI IDs, preventing the mipi-i3c-hci driver from being loaded on x86 platforms that advertise I3C ACPI support. This update adds the MIPI0100 ACPI ID to the list of supported IDs. Signed-off-by: Shyam Sundar S K --- MIPI0100 is the ACPI ID as defined in the MIPI I3C DisCo specification. drivers/i3c/master/mipi-i3c-hci/core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mi= pi-i3c-hci/core.c index d7e966a25583..dbc8c38bd962 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -826,12 +826,18 @@ static const __maybe_unused struct of_device_id i3c_h= ci_of_match[] =3D { }; MODULE_DEVICE_TABLE(of, i3c_hci_of_match); =20 +static const struct acpi_device_id i3c_hci_acpi_match[] =3D { + {"MIPI0100"}, + {} +}; + static struct platform_driver i3c_hci_driver =3D { .probe =3D i3c_hci_probe, .remove_new =3D i3c_hci_remove, .driver =3D { .name =3D "mipi-i3c-hci", .of_match_table =3D of_match_ptr(i3c_hci_of_match), + .acpi_match_table =3D i3c_hci_acpi_match, }, }; module_platform_driver(i3c_hci_driver); --=20 2.25.1 From nobody Mon Sep 16 19:01:04 2024 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2078.outbound.protection.outlook.com [40.107.220.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83C48158A19 for ; Tue, 23 Jul 2024 17:36:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721756187; cv=fail; b=UX/EldyLK4q873Ob80NHk1Lqxs007yOSqENrXE8Y3t9aE5bOFgKScaZWqTjcdL7NQEEAA7rlazjCvPy9bOmCg1+EEHhhvwpdj9YVEM8TDK6VNZ/N05zHmOuWD4L4sordTqu0zVpi9HamuxmmLc6iD/KrEvbPnX5kgAGIpCI1/QY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721756187; c=relaxed/simple; bh=RoNETKBoejaYGy9rbtJm6AGin8ehjmKDmfSBHCgGj1U=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Yk0WJ63SsPyIcZrUv/wg++PXkJhP3MyqGDTx63V2OvbmTfUm76acIuwf7xkuOwVgfFByB7POMBF/8QWcxE61OX59+VGkob1SMchpAT1iab5YY3u1FabD4RHamkthUbznZ20AKFCpzb4zyPHfZy/DbIu22LtfRQK0M+SqUpUsp2o= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=edZyf+FN; arc=fail smtp.client-ip=40.107.220.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="edZyf+FN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dDki/NQ8bM0Hm/rhtyVTcXo/2UjEbpTh9l0apf/KQ/d6ArSNk2DuYoHKy6YS08u7fzviDw/FdyUQ4QZYD3xWofUKhuYJsXLbwcO4+kbJumynD4UkOIh4JergDrSbfgZj6hHrB4RV6z0Lq2Q2ASpC9P9m39mRpDva7p7jJzbMtxGHbsX+ZvqEApnZvjmLWcrNujq6/48LFZ09n715cM5HgM4UniDywK5rFbACWWsRLvwDpt6hkWjWzT5vP87LG4htqcXDcfefUu8AZd5Lvbx6TMfOpY/SyuJIPQPOc6oGP5ePhFghlLUmfBPbzBd3DPGOeyYrJoEr95VwWwYUt0ZLTw== 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=UtBl23dy1zJf9rkzc7HruH/ojUo1R9wqQ1CABqtj3vY=; b=CaFqvvLiGKYebsQlrez7gj/Q74KstqqpVWPkwFo/8jGjihjTgQlsOERE97PZS7hr1PxcoLglW4xmQhbE/ss3WvwgZjDAaHUCjmdu8K4W1+EzvDUbwOdfEAJPTwCcxQQuz5vFX455LZcXJCgeslyFL9pKAf5vmK8ZGeug9AMZcPwVACb4Zt9cxWzM3Y6L4EGBaAtdjCGvqv83d7KKBJsdNe0ZzEub+/hT+ojAqKeq5WircIGkTRALPMo54bHxN95br6ZVj1nq17KOuN2KZFMKUtXUEn560PnS6gvvFFeA9obHfSMKytNnyNuRq/Bbajlx/z0oUWNsMsfZccZzSmVMlg== 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=UtBl23dy1zJf9rkzc7HruH/ojUo1R9wqQ1CABqtj3vY=; b=edZyf+FNao4XvBCistEwSkSLmBZoagbsuwAwp47C9HCMMbIqlYyRoBB8FnxvzMYxY+1YrL0MrBDRZiTOUivWmeWdM9WujvO3VTQOYhtfYz5Vn4gabzdwSv7RtM3EwUK4nDre4hDV2C1aZsB+xhgubVxl69cmvNoILtRUJUqkdZU= Received: from BN9P222CA0026.NAMP222.PROD.OUTLOOK.COM (2603:10b6:408:10c::31) by SA3PR12MB8045.namprd12.prod.outlook.com (2603:10b6:806:31d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Tue, 23 Jul 2024 17:36:18 +0000 Received: from BN1PEPF00006002.namprd05.prod.outlook.com (2603:10b6:408:10c:cafe::7a) by BN9P222CA0026.outlook.office365.com (2603:10b6:408:10c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.16 via Frontend Transport; Tue, 23 Jul 2024 17:36:18 +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 BN1PEPF00006002.mail.protection.outlook.com (10.167.243.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7784.11 via Frontend Transport; Tue, 23 Jul 2024 17:36:16 +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; Tue, 23 Jul 2024 12:36:14 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH 2/5] i3c: mipi-i3c-hci: Add a quirk to set PIO mode Date: Tue, 23 Jul 2024 23:05:35 +0530 Message-ID: <20240723173538.3493935-3-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240723173538.3493935-1-Shyam-sundar.S-k@amd.com> References: <20240723173538.3493935-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-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: BN1PEPF00006002:EE_|SA3PR12MB8045:EE_ X-MS-Office365-Filtering-Correlation-Id: 106f0d17-761f-4c69-c49b-08dcab3df4cd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?CO60OEqPNSBJhpX1v7jbkuuWj+QL1sGMF5WfiUBw8tGJZcuzCj52KlJepEUI?= =?us-ascii?Q?12lqgmphNq9T0H6JxqHr2YoHooAquxEdUwoOB+29VM4R/1LfSM+OECkODSW4?= =?us-ascii?Q?PRO3kothMqPmZH159rxdWZQtZZMpZxTNsERTg9Y28x0g2VpGsKb6J1inGluV?= =?us-ascii?Q?a4hb+wOA2nBFs+edTLUiqkeF9XkzUu0fuyTb4nCrMy3jsg1mGa7PxPTz4xkN?= =?us-ascii?Q?HO3kM2RbbnQ0c51YM6fLAQV+eqYy+ZT9+hDmMNnKeVDMIyNJuQUB3KGu7x5H?= =?us-ascii?Q?WCckAoJfYu/i/iGr73snbL8Pij3MPmvQjDPwnds15YpvFCPk1xpXtj0lIuwH?= =?us-ascii?Q?dOzY4MVhoO8Y+N8Y2iBgMfgj8BcrfjH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wtXoETaXK+GL2umIoo1k02IYxi/KC6na9wrYvkV5JNNhdjTD?= =?us-ascii?Q?Y/e8Jdxwhm+4RU1uU5k20kV1tG4ieISnuFjXIOwYUormkvBeABDpWnGnx9n3?= =?us-ascii?Q?5oyczD8GwGKurPpqw5h9qf33Mw8RWAZ7bccDuZUJ8e5x33wIQTJ0tFmlx7Xl?= =?us-ascii?Q?/9Ki109VHNFKQeWb1s5HXrqW3T6qa4/U?= 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)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2024 17:36:16.7465 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 106f0d17-761f-4c69-c49b-08dcab3df4cd 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: BN1PEPF00006002.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8045 Content-Type: text/plain; charset="utf-8" The AMD HCI controller currently only supports PIO mode but exposes DMA rings to the OS, which leads to the controller being configured in DMA mode. To address this, add a quirk to avoid configuring the controller in DMA mode and default to PIO mode. Additionally, introduce a generic quirk infrastructure to the mipi-i3c-hci driver to facilitate seamless future quirk additions. Co-developed-by: Krishnamoorthi M Signed-off-by: Krishnamoorthi M Co-developed-by: Guruvendra Punugupati Signed-off-by: Guruvendra Punugupati Signed-off-by: Shyam Sundar S K --- drivers/i3c/master/mipi-i3c-hci/Makefile | 3 ++- drivers/i3c/master/mipi-i3c-hci/core.c | 15 ++++++++++++++- drivers/i3c/master/mipi-i3c-hci/hci.h | 3 +++ 3 files changed, 19 insertions(+), 2 deletions(-) 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) +=3D mipi-i3c-hci.o mipi-i3c-hci-y :=3D 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/mi= pi-i3c-hci/core.c index dbc8c38bd962..8bb422ab1d01 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -33,6 +33,7 @@ #define reg_clear(r, v) reg_write(r, reg_read(r) & ~(v)) =20 #define HCI_VERSION 0x00 /* HCI Version (in BCD) */ +#define HCI_VERSION_V1 0x100 /* MIPI HCI Version number V1.0 */ =20 #define HC_CONTROL 0x04 #define HC_CONTROL_BUS_ENABLE BIT(31) @@ -745,6 +746,14 @@ static int i3c_hci_init(struct i3c_hci *hci) return -EINVAL; } =20 + /* Initialize quirks for AMD platforms */ + amd_i3c_hci_quirks_init(hci); + + regval =3D reg_read(HCI_VERSION); + + if (hci->quirks & HCI_QUIRK_AMD_PIO_MODE) + hci->RHS_regs =3D NULL; + /* Try activating DMA operations first */ if (hci->RHS_regs) { reg_clear(HC_CONTROL, HC_CONTROL_PIO_MODE); @@ -760,7 +769,11 @@ 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)) { + /* + * HC_CONTROL_PIO_MODE bit not present in HC_CONTROL register w.r.t V1.0 + * specification. So skip checking PIO_MODE bit status + */ + if (regval !=3D HCI_VERSION_V1 && !(reg_read(HC_CONTROL) & HC_CONTROL_PI= O_MODE)) { dev_err(&hci->master.dev, "DMA mode is stuck\n"); ret =3D -EIO; } else { diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mip= i-i3c-hci/hci.h index f94d95e024be..046b65d43e63 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 { =20 /* list of quirks */ #define HCI_QUIRK_RAW_CCC BIT(1) /* CCC framing must be explicit */ +#define HCI_QUIRK_AMD_PIO_MODE BIT(2) /* Set PIO mode for AMD platforms = */ =20 =20 /* global functions */ @@ -142,4 +143,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); =20 +void amd_i3c_hci_quirks_init(struct i3c_hci *hci); + #endif --=20 2.25.1 From nobody Mon Sep 16 19:01:04 2024 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2041.outbound.protection.outlook.com [40.107.237.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 823E015886B for ; Tue, 23 Jul 2024 17:36:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721756184; cv=fail; b=eQOmaVQueGzenlNMONBWALA0t+PAT698rBC/5QfasIdilrrVisiRBUQnWO+dP0GQiIjpX6JAve3VVDfGy2OZlGTamubyq1FGSq2o1FbIxdouWSezqSI3uqd7WMjWinpDcEv7gHT4PVsGJOLCbD7iSsbU3BClflGkiEBCaePNPvE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721756184; c=relaxed/simple; bh=QXLpnYMrQMugOH0wSMRXXzMvshlDJtv2OvcaSkbbCqg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SC8F9a5MpgedAsUn15B7d4xt5hQWGoizzDXgbtOdjipAVBrTsJ8/NY9j6V2Gvm8uxs/UwCMpRt3G3L+iWh8LK4eRfTowsxpECBakMJ7LUssGSbwXEWTvkp7K+7WK3ctK9C01I5NgDEvc+mruz5wuXbLVAcDiUwOttUa4L98mldc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=F6kKzLDI; arc=fail smtp.client-ip=40.107.237.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="F6kKzLDI" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=myMSWdfSBUJRjKyxwxPBlDD04+P4SvE0ImeAqOD9tj4Yj1nroIvjHVEJnlFykKAEBZEOmyHYq+qnHttLQ9QiQ8KIMXX6/UM7mfvBNUmQ6nncJxfLdij4W/F5ZLmFY4GEpFSFxsq7Nrp3yImzFu9Z1+vDX5AU/PXEnRiH2P27glqLmafEM3DqYU1ycKAUvuHnUiZyerpl1icSbvNvACJEpCe4uHmODz8wWJwscHz7cXDOT5v7UOUsNVwcnluhHqfOIRiQOnCmbvR2cpYVHlUzpzdPRANTv3ZaoZdE+z6FPdWsMmoAh/5h7vLHCShUj1P9Mjw1WCIJcGaFHSJmrCw1rA== 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=abEkoVyCVlmnqZh0zy/ndC5u3G3HYVhEVLUPlH5dyIs=; b=lE/AVUDmak+qkCOiofeEF65LvmgS1/3sU5nQnL/T6ViylDlNpwFisaiPBIIoQfgYh7MsKx3tq3KigYV+dClAg7NYH/nkFgIpf/2PiTrPc/cZHanZvd/MTaPLwhJewaYwFS1YPfg+yxAE9hvk45rHQQNU10RGioKbud++SIYWNkOgMqq7UPqRKi7T0FDHMM1AKXZW+YFS34aZDaPKy4/1MfXBgyiO59cUUxrmLcpwYplrfiH0nJhKXyEJKpGjQQhNH797fNOB/duVXHoWLk25NLqAsYqDTq9yB5S6Hu78NEI632qXN0LoSAGrUdKaFP2p2ywBPa3qWLAosuB1nBQ0bw== 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=abEkoVyCVlmnqZh0zy/ndC5u3G3HYVhEVLUPlH5dyIs=; b=F6kKzLDIjFC2+3EodXm/J68akJsFJxBmg2/cHs+73Pkj/fsBsP40RZ3ag2SMbhgud45wYAZFvKtX2QqfTTBLBIkhc1nl+OpZ5Pp6usv8PyA/dWtSRH1/Zygxt6dN0k9YCae6fBL9WF9HoaSmakS4BmlZGSErXYPceNDSme0rwA8= Received: from BN0PR02CA0034.namprd02.prod.outlook.com (2603:10b6:408:e5::9) by DS0PR12MB9448.namprd12.prod.outlook.com (2603:10b6:8:1bb::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.33; Tue, 23 Jul 2024 17:36:19 +0000 Received: from BN1PEPF00005FFE.namprd05.prod.outlook.com (2603:10b6:408:e5:cafe::71) by BN0PR02CA0034.outlook.office365.com (2603:10b6:408:e5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.17 via Frontend Transport; Tue, 23 Jul 2024 17:36:19 +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 BN1PEPF00005FFE.mail.protection.outlook.com (10.167.243.230) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7784.11 via Frontend Transport; Tue, 23 Jul 2024 17:36:19 +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; Tue, 23 Jul 2024 12:36:16 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH 3/5] i3c: mipi-i3c-hci: Relocate helper macros to HCI header file Date: Tue, 23 Jul 2024 23:05:36 +0530 Message-ID: <20240723173538.3493935-4-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240723173538.3493935-1-Shyam-sundar.S-k@amd.com> References: <20240723173538.3493935-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-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: BN1PEPF00005FFE:EE_|DS0PR12MB9448:EE_ X-MS-Office365-Filtering-Correlation-Id: b7355927-4f2d-4427-ce95-08dcab3df63f 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: =?us-ascii?Q?I+pNieW8Xjo+pGMav/dVwTECNIYWiBctUdxxv8AyTshUy0b/ibe54UibJrN7?= =?us-ascii?Q?wFrQY2pLJ850UoopWnkvDH9DLrTBPg2ys8EkRjdYlenUg+cZsKM4K6qjJyQl?= =?us-ascii?Q?CQtBh8f4gg2VjlH7JIwoeZRQgQYMESZtK4xTYTSSkSt56nVQJUXRgUgoztDx?= =?us-ascii?Q?UQxSOMf6Lyu4g0TVZoQzBRjC2kWgzIuZLtNnam0UqPyVGLQR2KglwR7qiMQl?= =?us-ascii?Q?Ykr6emhJq4b3wMrvVO+qp3VldRxU7axNxsN7qnr6+aeuz+fA0SqEeTZxPhdw?= =?us-ascii?Q?rC2oVrVBNc+cDVuy6uXUfyALyzvW+6WkLRf5J8xzKLfb8fVD1skNUbu6FsfV?= =?us-ascii?Q?7lZnKan/vDeZFqIrbjKi3HWgZl/KZGu2z6jOIDQQIxkYIpoObzkRa6BxFXUS?= =?us-ascii?Q?piml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?= =?us-ascii?Q?LABrdiI7DLyXUlyJmnA6xsBxbS6hZ/KPW8ghdtgDxazgWEtyLzlH7FmBM17E?= =?us-ascii?Q?3RMxRKxLs5QllR0s6joyvLX7JDhZfKescCFmbQo7V7qG1c/WYMCO8n+LQltx?= =?us-ascii?Q?/K8d1OjoCcMg4ErTbdQ0TkwN/hvn1Fqt?= 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 Jul 2024 17:36:19.1874 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b7355927-4f2d-4427-ce95-08dcab3df63f 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: BN1PEPF00005FFE.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9448 Content-Type: text/plain; charset="utf-8" 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. 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 | 5 ----- drivers/i3c/master/mipi-i3c-hci/hci.h | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mi= pi-i3c-hci/core.c index 8bb422ab1d01..ae5b1a144506 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -27,11 +27,6 @@ * Host Controller Capabilities and Operation Registers */ =20 -#define reg_read(r) readl(hci->base_regs + (r)) -#define reg_write(r, v) writel(v, hci->base_regs + (r)) -#define reg_set(r, v) reg_write(r, reg_read(r) | (v)) -#define reg_clear(r, v) reg_write(r, reg_read(r) & ~(v)) - #define HCI_VERSION 0x00 /* HCI Version (in BCD) */ #define HCI_VERSION_V1 0x100 /* MIPI HCI Version number V1.0 */ =20 diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mip= i-i3c-hci/hci.h index 046b65d43e63..56361adbcc14 100644 --- a/drivers/i3c/master/mipi-i3c-hci/hci.h +++ b/drivers/i3c/master/mipi-i3c-hci/hci.h @@ -26,6 +26,10 @@ #define W2_BIT_(x) BIT((x) - 64) #define W3_BIT_(x) BIT((x) - 96) =20 +#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)) =20 struct hci_cmd_ops; =20 --=20 2.25.1 From nobody Mon Sep 16 19:01:04 2024 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2078.outbound.protection.outlook.com [40.107.95.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3BE1C158A10 for ; Tue, 23 Jul 2024 17:36:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721756185; cv=fail; b=kSVVFXOo+gc1NFp9xYW/pFL0ds3gGn6SdQ/TBrM+14YARgArgUWEbhFVl7PSF5Bi9URxDIFXu9zV+DipAqYAfi39YK4hqDrk5gqPjHk7ps24Lie8miEUyIxUWvhVbAqy0gs4oNt4gB/AfnVMXt43Udk/krdmyCi+N5z5jOMc6iU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721756185; c=relaxed/simple; bh=BY/iDMaE9nTqvF5J0ekZZm5x/7CyKIOFD+NFGqalHc8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QnjM7m8VNd1S+iSj/9Wyy7HVkFCbGpiOG0XUcVtqE3FppwFFvjfQPwxv3ndoPS8AQ3Ie55ayV6wCQCQjxP2C7Dsn0RFjJLNcDBRQWfjwFhmsW1mx/0zusTb42JaEKQvrMyw42KpbB2ty4Kq+6jSux2vDAbwO5QnOG7dyPBY0iLo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=Jm5MSfYT; arc=fail smtp.client-ip=40.107.95.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Jm5MSfYT" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KYb/eI5HdEjbwNnMBRvL/d61rUoVnQzlaD8/UdXiQ6SDDvx89Wwg/ij6Pj2Np4gwqXy8ss7ykz+8RdrMfBhF/kjfB5uBMOxTOnAS6NQmiyhv6ik5q4v14eLYANcNi/lH/NOrTuIdIeiIe9A06AYvw43ay+hUk6GqVfycdyuPWCuXVQiveMxodGtPKEP3vd5/z68YKwnohYaYCxkm/V6MrSFlj0otz3im4cn9GAKRU/YZpPBKDZ5H8I5bCRXSQixmxjkjYKkL65vQK/yW0R0o1P2+wOHAmVZdPt0pHNWmkJtNZVO+IfxQ9vWKsjFiuVD8YLJbjoTF9b32uGXXbsAR9w== 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=v45OyP2OYym0YYIo0LaPDjJTYuuBuXGW6+CxzPOclUI=; b=b15B+KuhcnyqcN8TzODK2tnGNA8YuqYeTcDNRvjejIYZuNCQ02a5n8ZxEuQ3vW81ACVJ4lKQ+d/UhrtbJ6jYPjWoPGl4Iu+p0S5Vfhke/ySMSzAjhHI4igmGuRpvRoS1rGXFGfuQFeDe4zIAi7Kfnx4or6UxvWGLdrV/UAiOept7y59ATS0sE73kTZDitqhT80Ha0olBWSJkzbDN/FPPBpehlcLkpEvA+TbYobNafcnqfob74qIZEJq5+fCUZdMFRpPgM7rANZMa0euZURd4POZIDR3YSTMBPcCjHgYsOzXafUqWeo3pWHd8pUTg0LO3g45FI9rxgWtzIFt4bmOs8g== 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=v45OyP2OYym0YYIo0LaPDjJTYuuBuXGW6+CxzPOclUI=; b=Jm5MSfYTBwNOdFs1gGY/1GdXDwb7HrHLM/wNTP8uPzpKxjMpTG94dxAkAOfNe8HLIgTB5S1I9/4J6Yvr1NW2LcRJG5cWmTFWkgqRXv2EPiSdAB8R/HUEcX1/8FPxD3Ztg5/dtkXqUUt3Wkiy73JbCawGTBL+lXfHBPcS/QCkGwU= Received: from BN9PR03CA0668.namprd03.prod.outlook.com (2603:10b6:408:10e::13) by DM4PR12MB5772.namprd12.prod.outlook.com (2603:10b6:8:63::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23; Tue, 23 Jul 2024 17:36:22 +0000 Received: from BN1PEPF00005FFC.namprd05.prod.outlook.com (2603:10b6:408:10e:cafe::94) by BN9PR03CA0668.outlook.office365.com (2603:10b6:408:10e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.14 via Frontend Transport; Tue, 23 Jul 2024 17:36:21 +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 BN1PEPF00005FFC.mail.protection.outlook.com (10.167.243.228) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7784.11 via Frontend Transport; Tue, 23 Jul 2024 17:36:21 +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; Tue, 23 Jul 2024 12:36:18 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH 4/5] i3c: mipi-i3c-hci: Add a quirk to set timing parameters Date: Tue, 23 Jul 2024 23:05:37 +0530 Message-ID: <20240723173538.3493935-5-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240723173538.3493935-1-Shyam-sundar.S-k@amd.com> References: <20240723173538.3493935-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-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: BN1PEPF00005FFC:EE_|DM4PR12MB5772:EE_ X-MS-Office365-Filtering-Correlation-Id: cd0bf749-b1a4-419f-9535-08dcab3df7b2 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: =?us-ascii?Q?zWOVYFkP5EDuSFMSbkz5y6XcxA1rvxTf+3rnrZeQjW6bnAd4frybFnicX7eP?= =?us-ascii?Q?lC/6TvgFoDjNox7I6lviceu7K9vwkQ3EUTqRm1MD+P7HFACARUJlntqISCPl?= =?us-ascii?Q?iCGg5LZT8goQfuEkUZ4ZJq/kVfGB1aNshpF3HkSTQBJSCoG/6n8Js8D0Ct+A?= =?us-ascii?Q?jQ3bF7m/TFjUaghLc3J5kYZd9oyy0vffFXIgLOBgTRB3w1pGBmJnfmDCbWeJ?= =?us-ascii?Q?h1Ld+6xQqMUgsNyeIgetksEGZl0e4tUr+sgLJCqqB5n8tgHdbA33JFTd0h6m?= =?us-ascii?Q?3niPAKKY780rrZmRuqQtzVhy0+EeDSPoFtK4UUM3lROXSf0BNEn2GU3FYOx7?= =?us-ascii?Q?ih7Z09MEoQyoBRr+1ubUgaawtvlr/In+zeRrCA89ZsTQ9eyev51v7va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vtFuEOTJgBGoFCRfZF+aVu1/FaMySoI271?= =?us-ascii?Q?r25coXBC3FDjxQrFevx+qvSVbBSXHvHVChq9FKttQ2/oXGqjIvyn43NcLaLG?= =?us-ascii?Q?J8QxNfehvOgDN3Ef0g8+FUarlYpoymUBoEO9ltj/wFCrfXAP0kr+Ll1uFtQX?= =?us-ascii?Q?H0gi21STcqMJNzqtZpYI9cu41I3Endqg?= 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 Jul 2024 17:36:21.5548 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cd0bf749-b1a4-419f-9535-08dcab3df7b2 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: BN1PEPF00005FFC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5772 Content-Type: text/plain; charset="utf-8" The AMD HCI controller is currently unstable at 12.5 MHz. To address this, a quirk is added to configure the clock rate to 9 MHz as a workaround, with proportional adjustments to the Open-Drain (OD) and Push-Pull (PP) values. Co-developed-by: Guruvendra Punugupati Signed-off-by: Guruvendra Punugupati Signed-off-by: Shyam Sundar S K --- drivers/i3c/master/mipi-i3c-hci/core.c | 4 ++ drivers/i3c/master/mipi-i3c-hci/hci.h | 2 + drivers/i3c/master/mipi-i3c-hci/hci_quirks.c | 41 ++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 drivers/i3c/master/mipi-i3c-hci/hci_quirks.c diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mi= pi-i3c-hci/core.c index ae5b1a144506..9fc142ca7532 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -784,6 +784,10 @@ static int i3c_hci_init(struct i3c_hci *hci) return ret; } =20 + /* Configure OD and PP timings for AMD platforms */ + if (hci->quirks & HCI_QUIRK_AMD_OD_PP_TIMING) + amd_set_od_pp_timing(hci); + return 0; } =20 diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mip= i-i3c-hci/hci.h index 56361adbcc14..f4ec6dcb2ecf 100644 --- a/drivers/i3c/master/mipi-i3c-hci/hci.h +++ b/drivers/i3c/master/mipi-i3c-hci/hci.h @@ -140,6 +140,7 @@ struct i3c_hci_dev_data { /* list of quirks */ #define HCI_QUIRK_RAW_CCC BIT(1) /* CCC framing must be explicit */ #define HCI_QUIRK_AMD_PIO_MODE BIT(2) /* Set PIO mode for AMD platforms = */ +#define HCI_QUIRK_AMD_OD_PP_TIMING BIT(3) /* Set OD and PP timings for AMD= platforms */ =20 =20 /* global functions */ @@ -148,5 +149,6 @@ void mipi_i3c_hci_pio_reset(struct i3c_hci *hci); void mipi_i3c_hci_dct_index_reset(struct i3c_hci *hci); =20 void amd_i3c_hci_quirks_init(struct i3c_hci *hci); +void amd_set_od_pp_timing(struct i3c_hci *hci); =20 #endif diff --git a/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c b/drivers/i3c/mas= ter/mipi-i3c-hci/hci_quirks.c new file mode 100644 index 000000000000..9d8c5eedc8cc --- /dev/null +++ b/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * AMD SOC 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_i3c_hci_quirks_init(struct i3c_hci *hci) +{ + if (boot_cpu_data.x86_vendor =3D=3D X86_VENDOR_AMD) { + hci->quirks |=3D HCI_QUIRK_AMD_PIO_MODE; + hci->quirks |=3D HCI_QUIRK_AMD_OD_PP_TIMING; + } +} + +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 =3D reg_read(HCI_SDA_HOLD_SWITCH_DLY_TIMING); + /* Configure maximum TX hold time */ + data |=3D W0_MASK(18, 16); + reg_write(HCI_SDA_HOLD_SWITCH_DLY_TIMING, data); +} --=20 2.25.1 From nobody Mon Sep 16 19:01:04 2024 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2088.outbound.protection.outlook.com [40.107.223.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DAAA158D92 for ; Tue, 23 Jul 2024 17:36:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721756192; cv=fail; b=M8wqrd3K1ou+B4GwnYdBFqAOBlT9pmCvjDD54VU6xVnezVTWlzucN9QwJ1/yoDCp0Jhve+2spME6syU8c0SDSyUFdKSIbAIRZniOQ4Soqh1uUexnL9aQeMxHOo+Ew8o3m52G33EdpUll/jqY+auWPvOo8MHkvYtLE2YyU01yiH0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721756192; c=relaxed/simple; bh=KkvhZJEEroH25uRQsVzKqseCzHDcrnzY4eMqimp9ycE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CKj74In3e8RvzfOjt/ZSRLwIx8JR8F6Fu5HTKkpOeMd7N9iC2z2ksJaSWbluceCqh8AwAZHPhRCadQNZMpXio+MlPsHgpETTc2yeMWPyQNgDaq0yTS5KYsRTIuqA+apK4Nd5h55dpLANYk5Tji9/hG6nmYOJ1iQXsJq2Fa0DJ9s= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=fyB/k90Q; arc=fail smtp.client-ip=40.107.223.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="fyB/k90Q" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nw+tU1o6pFir7OK1tDQVtiG0MZ0GKSi+J7wCTq4/Lb97QPCuTwfcEKHgUzdY8S356zJUGnM/Sao2X6dBOyH2hVAc6mVw4U71FzNtKuDjqkzNcP28T1XwDAz0c2DdVMbCtAfRti8P2+H5W2FCCRywFubGQrDOwcUlZHfmTlzIAu12f0/jyeA12MQlXUdacTWS1SJiXmh2Rn09AfoD5HDtrz5mWoUYTxPUZhWz3BAShjZmV1DpaCUSQdWnV64IjHSxYE/79drG7g+rt8LdNBN7hAZnkxSGVEIZWGd+HwikecWhQYPFy0bPedWzalHL5iWd/V6UQuJ4Y6dZMR5TR02plQ== 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=ZaiWfxwrVVegUP28PVwsewnIbKV5Ajon6azAXqQupMs=; b=fQR3tH41CnN/gHHv4khjuGBGQP4IwmWN8Ct5rgPKCOgpSRWlKPo7Qyx+wjmYKEXlFl0lxvqpNiPegwXIKk/RnVDfd4V/cKf7vhKqzHIkujmEpCHUTWIO0wEH0X4DDGbtmn6URNvFnJrDylk33ExH77uZi07tyiNgmK1S1CbGSI4phyu8WoLm9YVc87YqR6gvn8rPW8bHo5mN3Bmyvwmo29eMhbmit+m10hmqGlQaMFyRsYFXnaXqYm41dA3thtfIJHYZtR6Zav9xWjcpP1EPQlQM5ZsTxRhSqN2UFUfiCfIg7hWuqR08mDKoVcy+vWzd5PZXOBvPoAyiyPcVOhxZQw== 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=ZaiWfxwrVVegUP28PVwsewnIbKV5Ajon6azAXqQupMs=; b=fyB/k90QV9dGPd5LBhcb+aBX2of7lP6iq4xlg6DyQ0REQ4WKQ4406bqD1xPfLYXhKaKq+oUgqUwJbiUQHCCGY1lNO2puMAr3wrEpG0THI3SVQyvhnpiccEzOoN71VAdBbXP+n8U2LR1Oyc/aOa1pHaC3tqNW3E5rtQUmVFAA/cU= Received: from BN9PR03CA0457.namprd03.prod.outlook.com (2603:10b6:408:139::12) by SA3PR12MB9107.namprd12.prod.outlook.com (2603:10b6:806:381::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.16; Tue, 23 Jul 2024 17:36:24 +0000 Received: from BN1PEPF00005FFD.namprd05.prod.outlook.com (2603:10b6:408:139:cafe::43) by BN9PR03CA0457.outlook.office365.com (2603:10b6:408:139::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.14 via Frontend Transport; Tue, 23 Jul 2024 17:36:24 +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 BN1PEPF00005FFD.mail.protection.outlook.com (10.167.243.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7784.11 via Frontend Transport; Tue, 23 Jul 2024 17:36:24 +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; Tue, 23 Jul 2024 12:36:21 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH 5/5] i3c: mipi-i3c-hci: Add a quirk to set Response buffer threshold Date: Tue, 23 Jul 2024 23:05:38 +0530 Message-ID: <20240723173538.3493935-6-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240723173538.3493935-1-Shyam-sundar.S-k@amd.com> References: <20240723173538.3493935-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-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: BN1PEPF00005FFD:EE_|SA3PR12MB9107:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d264888-4d9e-4d22-d84d-08dcab3df92b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Is7IKAUb/mBPBxXBBMjTtoVZKZ2QT0h/6hUvz15pGsXfBbWCPgARXVtwLfkv?= =?us-ascii?Q?XPWj/X9jCF9Ei+rbMJJuza9aFkoaEsH2v7brlRN6xKKC4ubV7mQF3YlIKaGw?= =?us-ascii?Q?K2EZLVYSu8rYK7zWTxbC38rw8js9DX1W6PwwlPhj3PuhSl+hp+qo2UFBw6DR?= =?us-ascii?Q?wEYX4HCPhL3IY6uJF3AzKgwppUyk0DbNhu6NurUW17EHyKsEAlfVz9G87snQ?= =?us-ascii?Q?hTPRQIJaVrKhY6HKQ6nifYrW4jhhrdS0E5sCiTVTdnAuhDsglsGcJpP8h0Li?= =?us-ascii?Q?SyNvS7CS3MfWAD1jmkkiZbrPSfR+ghpQqbxymGsHhFa502YOvF10leaGWCPu?= =?us-ascii?Q?S25cuKCZp53qD1ftQN4vvPS6dpr/EObRtAwDEf3dDef7uLYx6/S4GjP76K3u?= =?us-ascii?Q?PvsvBchhQ6Tn7v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eD2?= =?us-ascii?Q?GhN3+tXzlhz2eio1bAc8JGHKTo2jyTVaqqNJh/jRn85FbzhDN0/ykaNP1uNp?= =?us-ascii?Q?+7+GpssXvjSahrpEFdNDy8oORlTvRXaxUvWfq1w8l+ohGv8xa79lBZ7pbvET?= =?us-ascii?Q?UVSykGu2eEk=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700013)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2024 17:36:24.0741 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d264888-4d9e-4d22-d84d-08dcab3df92b 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: BN1PEPF00005FFD.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB9107 Content-Type: text/plain; charset="utf-8" The current driver sets the response buffer threshold value to 1 (N+1, 2 DWORDS) in the QUEUE THRESHOLD register. However, the AMD I3C controller only generates interrupts when the response buffer threshold value is set to 0 (1 DWORD). Therefore, a quirk is added to set the response buffer threshold value to 0. Co-developed-by: Krishnamoorthi M Signed-off-by: Krishnamoorthi M Co-developed-by: Guruvendra Punugupati Signed-off-by: Guruvendra Punugupati Signed-off-by: Shyam Sundar S K --- drivers/i3c/master/mipi-i3c-hci/core.c | 4 ++++ drivers/i3c/master/mipi-i3c-hci/hci.h | 2 ++ drivers/i3c/master/mipi-i3c-hci/hci_quirks.c | 12 ++++++++++++ 3 files changed, 18 insertions(+) diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mi= pi-i3c-hci/core.c index 9fc142ca7532..2da00a5b590b 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -148,6 +148,10 @@ static int i3c_hci_bus_init(struct i3c_master_controll= er *m) if (ret) return ret; =20 + /* Set RESP_BUF_THLD to 0(n) to get 1(n+1) response */ + if (hci->quirks & HCI_QUIRK_AMD_RESP_BUF_THLD) + amd_set_resp_buf_thld(hci); + reg_set(HC_CONTROL, HC_CONTROL_BUS_ENABLE); DBG("HC_CONTROL =3D %#x", reg_read(HC_CONTROL)); =20 diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mip= i-i3c-hci/hci.h index f4ec6dcb2ecf..07b90a68ec5e 100644 --- a/drivers/i3c/master/mipi-i3c-hci/hci.h +++ b/drivers/i3c/master/mipi-i3c-hci/hci.h @@ -141,6 +141,7 @@ struct i3c_hci_dev_data { #define HCI_QUIRK_RAW_CCC BIT(1) /* CCC framing must be explicit */ #define HCI_QUIRK_AMD_PIO_MODE BIT(2) /* Set PIO mode for AMD platforms = */ #define HCI_QUIRK_AMD_OD_PP_TIMING BIT(3) /* Set OD and PP timings for AMD= platforms */ +#define HCI_QUIRK_AMD_RESP_BUF_THLD BIT(4) /* Set resp buf thld to 0 for A= MD platforms */ =20 =20 /* global functions */ @@ -150,5 +151,6 @@ void mipi_i3c_hci_dct_index_reset(struct i3c_hci *hci); =20 void amd_i3c_hci_quirks_init(struct i3c_hci *hci); void amd_set_od_pp_timing(struct i3c_hci *hci); +void amd_set_resp_buf_thld(struct i3c_hci *hci); =20 #endif diff --git a/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c b/drivers/i3c/mas= ter/mipi-i3c-hci/hci_quirks.c index 9d8c5eedc8cc..503c81c504f1 100644 --- a/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c +++ b/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c @@ -20,11 +20,14 @@ #define AMD_SCL_I3C_OD_TIMING 0x00cf00cf #define AMD_SCL_I3C_PP_TIMING 0x00160016 =20 +#define QUEUE_THLD_CTRL 0xD0 + void amd_i3c_hci_quirks_init(struct i3c_hci *hci) { if (boot_cpu_data.x86_vendor =3D=3D X86_VENDOR_AMD) { hci->quirks |=3D HCI_QUIRK_AMD_PIO_MODE; hci->quirks |=3D HCI_QUIRK_AMD_OD_PP_TIMING; + hci->quirks |=3D HCI_QUIRK_AMD_RESP_BUF_THLD; } } =20 @@ -39,3 +42,12 @@ void amd_set_od_pp_timing(struct i3c_hci *hci) data |=3D 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 =3D reg_read(QUEUE_THLD_CTRL); + data =3D data & ~W0_MASK(15, 8); + reg_write(QUEUE_THLD_CTRL, data); +} --=20 2.25.1