From patchwork Tue Aug 6 07:58:39 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: 13754541 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 D0F1DC52D70 for ; Tue, 6 Aug 2024 07:59:22 +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=K17Qd9EJHdty8GHvEfesAg3M5dREc2WA3GpL01oZ9dQ=; b=o9ueiB0hDCiyg7 iZky5ZLLh7vpurdHmqkLSPy/ew+ys9Dr78jJccQAQdWyMhc8C5EdwMBfrdvBDMoBpPqZEqW0KBXGU yv/ybuZyXGyOgMbdIOMJbF+c7oeKgfJa7rYUyhwn/CmAVslBH51nljdV695acWGyoYXoh7hRXoCiE r4y2wMr7d2wTpE9+UIZi6oIMUaZIXmFpcFmsSF0gwZaHXkgkje2j7asGNZi1rsgzjwFSA/IPiYE83 fDT1FOnkAlplI9fXq+5BYLTdab2erfY/wJ/SF2K3dVxEJpNc1ORnNBlL9wyJzjibKV1dbbnRN4+4o aqiYHYK3w2MJe6DTbD3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbF6I-00000000rR9-1gUD; Tue, 06 Aug 2024 07:59:22 +0000 Received: from mail-dm6nam12on20601.outbound.protection.outlook.com ([2a01:111:f403:2417::601] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbF6E-00000000rP5-1hrF for linux-i3c@lists.infradead.org; Tue, 06 Aug 2024 07:59:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FuhoN7eZ6S8B1QnkPkr66tHhgCibMjMvLMHsconZx59zKhynEPgnEk77Lb8+lnL4rBT1RV3aq6BSd2vkJr8YGs5xPWnfehENoeSDoQNpDEm9fJUokuQywlvSFyRnMM+jVQnj/znoEmdwsDotV/IzaUglOV8l7fhy+627juELN0M/Vp5Z6IxtdX+FrGdBaSVvGuTNSE26/4M78QfnS1e/Y8K0ZNLxnyGQfrk3c9I/AO0r8dat1PHidoDJkARvLfiZIpHKSvdQ4QQkWFce4FCPguxyHxWs1WHqT2vZ+tD0CMqPmn4Fn7d3wVW4vhVsXDHs9LdNuU7N5AcqTQsr6lOAlQ== 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=lNHgjB00ALabz0gEfsFji45NSN6Xrmn1vzcUy+TLxm4=; b=iqymCE2KeomT2WhvLiiUQDmYApok/nB15rVONFBcuuHrfTNcbUSfWoXpvb6dHVnSnc8eAHoXv37QtmeIQ+utlPdQrvGtGLorTpyXHzG398oJkT68RBNNmdKrLpAeQ1tLxvkUZ5ZgaqDVpn3qXZIOadjTYUc9KZwGhbYqHzxCEyPVJR38+xPslcZvmTvi1C2DqiihJGNQYlznw1UOIA18STYZ+h5NVbRMXvsytl+CgyyPftT8d/SCdBYyXj+I2HQdkPiwUB8LLJGV1LrIM0690XT2sFjYvK8FVts65iw4i+0SNVpB6CnYjSmZTknWHcdXVH6Dy14/SKG3hTXgMckBLA== 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=lNHgjB00ALabz0gEfsFji45NSN6Xrmn1vzcUy+TLxm4=; b=o2ZsS1rmi4pYgBjlHhvtzo4nB5mmdqPasnNF+fLwyTWHBc/ZvF5bN7+CcYL1W5ovGfZa/c5n4kIREs2dS3hi0PE1qIGWJ9uRZwCr/HtrZAyWq577gqdgFRS6H2JcP9L8MgMmlDFmfgiHBWSd6i5D7p1a6ObMnmpiCc+HwzTF6T4= Received: from SA0PR12CA0023.namprd12.prod.outlook.com (2603:10b6:806:6f::28) by IA1PR12MB7520.namprd12.prod.outlook.com (2603:10b6:208:42f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Tue, 6 Aug 2024 07:59:10 +0000 Received: from SN1PEPF0002BA51.namprd03.prod.outlook.com (2603:10b6:806:6f:cafe::dc) by SA0PR12CA0023.outlook.office365.com (2603:10b6:806:6f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.35 via Frontend Transport; Tue, 6 Aug 2024 07:59:10 +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 SN1PEPF0002BA51.mail.protection.outlook.com (10.167.242.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Tue, 6 Aug 2024 07:59:10 +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, 6 Aug 2024 02:59:06 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v3 1/5] i3c: mipi-i3c-hci: Add MIPI0100 ACPI ID to the I3C Support List Date: Tue, 6 Aug 2024 13:28:39 +0530 Message-ID: <20240806075843.277969-2-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240806075843.277969-1-Shyam-sundar.S-k@amd.com> References: <20240806075843.277969-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA51:EE_|IA1PR12MB7520:EE_ X-MS-Office365-Filtering-Correlation-Id: 70cf5027-253d-43ba-a22a-08dcb5eda7b8 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: YhsBY+RaiSqTcwHFHpGXq6I21eCcnVE28UxfKV/quTjAV/9M7YoCOM7+8fQYQlV1uYtETXxAeYtdZC+e3XjQk2ysNw+7aMy49mvU4/ygJaVExTXXsrUTVVgGgvdUV6NOxlfUzS05EQ6RwPa5Es2yzb9ik7zwtHTuDdA6GSfU41dCn09jCXCgmlGikoNXZKfG68m8qkVV6awcukCIX7HgTiKu90erR3EVu/P5IOM8ymBZb4JCmT/8z+m/IkPPYU+EoZ0NvsV6WIcSiRGLQ/M2g1kTPnS/XewrM3tpYxlRTMrQljxoAzlb5av15LH9hOdNR2WfVLjjZTJXIlJN+Z3ASWxISpRCHIgwmlBI/VAUR/MOGJOXBYJeT/BsQg2yZXzm95ct6hSCUFWIpIHS3r7YW3wXaIWlkVQZE81jbBWOnHZO3r85TnVAoZqxRtCilDuArOo0St4x/8TGGl13qQCzB72vesKM+8JscIl4P+PU+AINKHjZ3gg8+HcPi0DIdtztL7tnWrBUdx9jpoPifFBuEyLOY4NgWOuPDKgIp2pPvrIlLy+DkEijv7PFtqT8ufVFsmtB2mx9USimxaaxQ2DMmbfpGxBzs3C4f6vVCrn+6ZrieJ5OFOHon7GLDE44AEK/tdMcGv+BHI0NdBhzDUn3VmDDaf4FUyZf9lMPC2C9WKeZ3RYbuWpobx9O3GQk+/vpqLBk1+Sf/zWeLdIn1nqp1zF6kdGObBpBz+UAqo2DGqO5Bknwi3g11BrnS+17CQgh1mND2a5QhrEAIJAnmYP8KVyfTRvHHsbupGJ45Cwv9UOfLq50WoH5cLTyXrJPHniUMVWHBxlfy7/VdCEOChjQFY+Ml5zGk7c/hhF1Yz4rH0gOFMzqKSh6BY6VXDTLpqwySmKhIE5gPHy8WBs+60z5mbFUT0UXw7IL16MKmOL2r181iqN36v9udmsgtuw8RjtzLYtR737ddU1VtZd0SAV3ViuceOXXXuAQWF7GMyVbuKTQz0TuP3hLh9q+uT6SN1fuqe87U/VknH0MZZiH4ZqbKHVwLLnl9h8cgfvd+GEl3WqQEyk57M0434hQnc+pqm5dhkEHKzxwEivQFppjKNCEuAJmULrocg3+Rhv4+255GuGvOYh16/CFZqYtVK7i5eFoMiyltUiMzOFLDlEdmLL3NUWm/BzPgtgWrJ2NFzCFt8Fgm+BYBbwcN4KW/TC9Yle4KAvIzYHWLmTTv903q+jjG/Q+WapFm1a8zgrS6m69Pi3LO9QMZNo+Myrzyh0a2X4PtRPIxwjIhK8EpBAe0vS8FrtBsdXgXiIf8VLWc1+eu2mwvX9Y2ZTwWbc5Nyz47hCCtj3b/+pfvU4zGHXnDclYGlQoXBBWWwGGXqYKoKWMD4ozsIrgmlyq3A1PYinHCDByORgKPtneiCi+OIApa6x4bdk7V9sIMWOkc/+lqPD/ZfsnpR/J5KLH73UKf2S+dvXx 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: 06 Aug 2024 07:59:10.4758 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 70cf5027-253d-43ba-a22a-08dcb5eda7b8 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: SN1PEPF0002BA51.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7520 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240806_005918_479054_7A56F322 X-CRM114-Status: GOOD ( 11.63 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org The current driver code lacks the necessary plumbing for ACPI IDs, preventing the mipi-i3c-hci driver from being loaded on x86 platforms that advertise I3C ACPI support. This update adds the MIPI0100 ACPI ID to the list of supported IDs. Signed-off-by: Shyam Sundar S K --- drivers/i3c/master/mipi-i3c-hci/core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c index 4e7d6a43ee9b..5ef848833a81 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[] = { + {"MIPI0100"}, + {} +}; +MODULE_DEVICE_TABLE(platform, 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 Tue Aug 6 07:58:40 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: 13754540 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 5F4B6C3DA64 for ; Tue, 6 Aug 2024 07:59:22 +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=bbVG/gS+UR7iQrxdLf7i1ubSaXBUI6VesDS28Nrio8o=; b=3M6/IWAFEK7ZvW r6dIVZ0FGJvAyVDP9Jyk/ER8oNdDVQNNy2wd3VK12ZEg7zXlWCnq0R3jksd0/OGJUsLHfRAY9S6Rd mQs8WpQmnoh09v9UY6EY6XMGgEfqL/36D+dC49Vp+Ugew9+dP0TQBw1/Qj+pGhx2uQUH5Yi37DwCa N1qlvk9x1MnLMpL1+EssGBuu26Qw3Uyz6raVlL3cvZq+11hcZrJ3kFrt8atA6b+Y58p9aYIzdvh+M Rh2q4DqozDtG0QdTgkkAcVQl7FPrfQmlUwJ1lmjK4K6gtYXHBgTQQB38gBv+zy0hbdE5pFAlzuW6e ilByhklYqnNQx5buJAlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbF6I-00000000rQe-0FSu; Tue, 06 Aug 2024 07:59:22 +0000 Received: from mail-dm6nam11on20601.outbound.protection.outlook.com ([2a01:111:f403:2415::601] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbF6E-00000000rP1-0nXy for linux-i3c@lists.infradead.org; Tue, 06 Aug 2024 07:59:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=N3KPo5DcFcERSaeM6JHuF8fDoKf+0CMsSCscyTDNcWqGf2IYxKcMGgPQ6XiHlG9R2XtZD4yqhFUGcH8z1Jcf8a5Ewu6CGwnZfB9SLcwr9xRqfhZusJKbXlEwyHqK869brWrFgFmty/rxr8jHuXquj+00pryocXhHbZynBm66F9uiQEpeK9p2/PYM7lYy5ZQNddwm4HiFkJ9ehonQxbohj/0grI6YW7S+iVwjOpILArk2VoaG0++tOkoL0wL887vbdXF/TGnvdxdW3d8xgWPZ63zBxLKsUBqJfabqPvwxDeDPGwFVI9rQ/YUYNSUEXP4eyTuyTAYG/tyk8pnYxPGESw== 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=T0GJCDR9Gk85YbbUGbevrx9NjsFokBCv/AO2dZhpGe0=; b=nmS2trdNn80/b/ydI1HPFeE3cs2rPAkST+eJrOW+1+6nHZZyBfGSB3pqNmQOSgLPZIk8ipgObZmO8rTOjSCh2v6ZGzCnHwx9OJQXk2I0X7FJhqgYyD6cEb/Vmcw3Wk+Fi+/V9HR3OOlYTzxQkOz8FPSCRi9Ksy3mQOf5WhlNuWJwQ5eUoFqNDQDMstEGxHHA/+Ypmy8lZIV3h5nKY9lww/7w7oLCJj0/xhKAJstqEfBbXrewRobBM5Nigvr06r0Gqeol15q9cEgcx4hrpxlMPYKdxce9fY4nPpZIp2J3IFqAN52IRgXnrmfLXwjUC01SfSWowXQCChz51Udbwguohg== 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=T0GJCDR9Gk85YbbUGbevrx9NjsFokBCv/AO2dZhpGe0=; b=3uyyqgTJNsV9SnwLjhP5UfI2ycy+JjADSXJHsLxCLVuEnSuDvFPHH0wPcw+pQ6wxBbLdXXIfnHqJYz5HadcLQA6TnGSdEpgOqf9QK0OESoyd0DM5QHyee7inZtmtUZ7ecqY2nC9jX93dCQO7AELhmhYkPyl8Jps5t2NIa3h88xQ= Received: from SA0PR12CA0018.namprd12.prod.outlook.com (2603:10b6:806:6f::23) by PH7PR12MB5974.namprd12.prod.outlook.com (2603:10b6:510:1d9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Tue, 6 Aug 2024 07:59:11 +0000 Received: from SN1PEPF0002BA51.namprd03.prod.outlook.com (2603:10b6:806:6f:cafe::5) by SA0PR12CA0018.outlook.office365.com (2603:10b6:806:6f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21 via Frontend Transport; Tue, 6 Aug 2024 07:59:11 +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 SN1PEPF0002BA51.mail.protection.outlook.com (10.167.242.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Tue, 6 Aug 2024 07:59:11 +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, 6 Aug 2024 02:59:08 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v3 2/5] i3c: mipi-i3c-hci: Add a quirk to set PIO mode Date: Tue, 6 Aug 2024 13:28:40 +0530 Message-ID: <20240806075843.277969-3-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240806075843.277969-1-Shyam-sundar.S-k@amd.com> References: <20240806075843.277969-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA51:EE_|PH7PR12MB5974:EE_ X-MS-Office365-Filtering-Correlation-Id: 88ddffc6-7980-41fa-3a25-08dcb5eda832 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: 9KXgdUmN1tbIHcNWiZg+MpNw/qSWTPjVZrnOfMnNFUNw3EAdH4YkjhGO7VBarakGAXwcsWC2PGoLEco8jTqBcm9qo8B8ONetyMr0eAXJS5n6gW4S2EErga9QK5CNjrlLJZICbrHTt8Y14KfuBnpX8sonNsubWLdjjG8rCpzfYyj5Jvu84I3SV3bBFvp1PQnexX0LyCEI7TB6DXVzEzhFvtaFZoqzGtZ396U4PJQ0XUBI2gftJ9Rtw5uahFqKOOOUoKBf2Ubgf5I604P/LS7gBR5VcC7S2RlVlbj6Y6MN3m0vF5+g2XesXcVDHEAK4rNJkp1t/ZaIu5qcAgYmmL2VeJ/lI6diDE+IGYcVxKUx0NVEuoGDSkMZU8uWkuzjzo04No4UvOwz4PtEKV5bXiCXpjtV0Ta0IjVso03BowU38eSAkF7nnktQfCTMcJf3bcLc+ftuGVgJ5JmufKiu2eK5cUsiqDSNyTsBsPpRGbrpZP8ev4idMf9AYVYY7ZyDi2m9/JVbdubqUvM9eOM5qi6jL0It2RWAxUpNROLoRdYm5O+9+DNkufUADOUfsRnGddNe1hgk/AthbT0R4pbdP9THc7q7IB4lIHUULqIoAC4IEjZM5w4XLn/09fcp7zmxVJfbWRC03p3igoHXfdehStVIe9ZOAopHM95exeY+J/d+lFL80+b82ik1rz1Q/K3nqwTUpPUGn7llMBn6P91rGs4p+7cElGpHRwvb+WFg1GY9L/I07+e9V6XyOcMqtT7xwc1V6hXmiSKaQgvb0QqfPgilcOCuM0q+aNwwj/GkH436tb53noeLJp1D6lOI7ug306HdwC/0taxaD4W1KbmnwNo7GW4UAR6X3MgxtGQg+cCysE/lCU9v7opB1Vt5yCkLmvvNx+Q8SRFcvp73svU8yWS/t+J3U3s41rF7o7i9ouWhU8aAcdpgul8dGx+b5Y0xWU0w4a53PDi09fGwZ3NiEeg/xie+blDop6Qq2GoRm1tjK1FEdcDvtjdsn4OiQ16R9qmO82tAEdqAGoJ0/MIlExKXaJDj3w8ejNmgVRBbTXv1sxNEs2jM70T58RY5oocRzWg73Zlwkn1/E321q8I/IkIWuflQjA2jBRvNfePNFIvl0QuQS591+1sdS1RQuIHNz6eD9eANk06wLKKmOcQvtoKiEhc2g1cSaxsLMUz5lcX/+d1DsKk1lEp9VO3230PGV4dOT20toQmrhE0OeDlPa8zyWNrMyk0XPF/2Y34PxEWnk/Cw6VUH7EiBeR4m8JMgy9cVnOqMTVKcZVER1ByhwFJBz8uSA2jU58cCcolD/4MNWolXYdTuG0B+azliMqocYi50XcZqLJAcCsoPWQ4x8em0P9MDTh1tp/hZlOB+ZvBH3Nv3Eo7oXUpfqYoF+DF9oQtyd/yeRNCNEX9OoUxRh6j77FIaHK4LFYtUhHpEBoHgRoDY4Lt21dwA+SzvTosNFUGA 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: 06 Aug 2024 07:59:11.2883 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 88ddffc6-7980-41fa-3a25-08dcb5eda832 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: SN1PEPF0002BA51.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5974 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240806_005918_261302_EDDBE457 X-CRM114-Status: GOOD ( 20.25 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org The AMD HCI controller currently only supports PIO mode but exposes DMA rings to the OS, which leads to the controller being configured in DMA mode. To address this, add a quirk to avoid configuring the controller in DMA mode and default to PIO mode. Additionally, introduce a generic quirk infrastructure to the mipi-i3c-hci driver to facilitate seamless future quirk additions. Co-developed-by: Krishnamoorthi M Signed-off-by: Krishnamoorthi M Co-developed-by: Guruvendra Punugupati Signed-off-by: Guruvendra Punugupati Signed-off-by: Shyam Sundar S K --- drivers/i3c/master/mipi-i3c-hci/Makefile | 3 ++- drivers/i3c/master/mipi-i3c-hci/core.c | 15 ++++++++++++++- drivers/i3c/master/mipi-i3c-hci/hci.h | 3 +++ drivers/i3c/master/mipi-i3c-hci/hci_quirks.c | 20 ++++++++++++++++++++ 4 files changed, 39 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 5ef848833a81..7843a3ac2121 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -33,6 +33,7 @@ #define reg_clear(r, v) reg_write(r, reg_read(r) & ~(v)) #define HCI_VERSION 0x00 /* HCI Version (in BCD) */ +#define HCI_VERSION_V1 0x100 /* MIPI HCI Version number V1.0 */ #define HC_CONTROL 0x04 #define HC_CONTROL_BUS_ENABLE BIT(31) @@ -753,6 +754,14 @@ static int i3c_hci_init(struct i3c_hci *hci) return -EINVAL; } + /* Initialize quirks for AMD platforms */ + amd_i3c_hci_quirks_init(hci); + + regval = reg_read(HCI_VERSION); + + if (hci->quirks & HCI_QUIRK_PIO_MODE) + hci->RHS_regs = NULL; + /* Try activating DMA operations first */ if (hci->RHS_regs) { reg_clear(HC_CONTROL, HC_CONTROL_PIO_MODE); @@ -768,7 +777,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 > HCI_VERSION_V1 && !(reg_read(HC_CONTROL) & HC_CONTROL_PIO_MODE)) { dev_err(&hci->master.dev, "DMA mode is stuck\n"); ret = -EIO; } else { diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mipi-i3c-hci/hci.h index f94d95e024be..91e8a3833f3d 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 */ @@ -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); +void amd_i3c_hci_quirks_init(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..8a8fbd697175 --- /dev/null +++ b/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c @@ -0,0 +1,20 @@ +// 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" + +void amd_i3c_hci_quirks_init(struct i3c_hci *hci) +{ +#if defined(CONFIG_X86) + if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) + hci->quirks |= HCI_QUIRK_PIO_MODE; +#endif +} From patchwork Tue Aug 6 07:58:41 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: 13754543 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 D73DDC52D6D for ; Tue, 6 Aug 2024 07:59:26 +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=czpzSvTviQfe43b9+Ob5LDQsZZiXQmwonYX2SccCNjQ=; b=dUmQaNMXp0DeOB joBSQ86eKIfmiYwSFr37Ns6Kla8B0QFw4DZBw88554q9Yub4ohcYuKGXRvrOdLQQNji6FnYXOPS7N uw+abOc9Fr71Aaz2mvyYIS5P38dyRBM0wByAMDND0piw7rbf+2URDdkcYLDiCKlOIK3C0rwihqWjA zevzyJ/aGU7SGGI0K20Rpzw4pnSajXvWQ7MEeKqdsAIAnl0LCG54SLDU0/5ch+W+jgtuqLLT+rnKG QzgbWEOGMuQ6X3buVV34wj9ZBNpOV49jIguAFe+6/C5HKVtWwcoNziZqqUBl2h7mP9JhuzB4YKYqC q/w3B5ZvzrKg/et5zo9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbF6M-00000000rTl-2EBL; Tue, 06 Aug 2024 07:59:26 +0000 Received: from mail-co1nam11on20601.outbound.protection.outlook.com ([2a01:111:f403:2416::601] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbF6I-00000000rQb-2auc for linux-i3c@lists.infradead.org; Tue, 06 Aug 2024 07:59:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SLX/Z1yx6uRIcUbKeAmRnocZebFw/CDSUvu1LO88T34L244thmEgDYm7i4UZ8ywbzSVL+iU6LOQyGe6ga3M33sVUxczXJElH/P09k7nKrTJ01SVqkq5xi23uL3tMUdcLlG3lOSo25EvglPEZRTAap9NUDWVFK7hqaKOPLkt5qVVkpKSDOVwd38v7V5ooMzovRxUxH1IVsnUDoRrIHnYmhD7HMQQi8cCAAtEtQzrr8gw1/uv0Qpl1sjGk7jfrysUfSl0aA1tM5BeM/Wz6d+ohrOxFyNsMG31OZKTnpE7uqKTyR69ceM9k+4bNHHOEknC9yn1o0ddcZSADHosbHz4W+Q== 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=OyEJrgrTsFRdzf2iEC9xm5OzcqbgtowxN2k5RjCNlJc=; b=EJ7Sa7BE/TbaG32QUR7dBUI6W9Nxlxt0qocsIWxCaF/4wgXv5Ch+1n3sk118ita0Xx5+Ix9Qmu6YMdsvOlbdJxdPFW3gO5KE8hObKCfBxUKjNj0a9kjshX3v0GMJKSbYBhzezwDtHhnAaHYwBIQs55S6uP5Cx0x0kCmpy0yYhXd5BzoK4Iz3FG/mMsZNZ8yZqyi15OQmf4K0XAytKwcQ/1yECPBnolliWG9ZYe85SAAPku/3uIiNaFGodQlV93XGoGnkTn4j7tQz2GOuglRqF3gh//yBywOO9soPqYt9QuLXCfI2A7m+sCdnLJkJHIP+A0Hr9FyciuEHx2RxE+RBYQ== 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=OyEJrgrTsFRdzf2iEC9xm5OzcqbgtowxN2k5RjCNlJc=; b=teW7+pvKqMDK6DZbbjAAngvwxIYUmtdMV+Vi/D8lnmOdp2hjncvcj9baY8F2MpgtEQUlSmmoHE9i4Hzht7SeJ/BLlcw/RZq3AEmtVvkbB3zrQCQPWRp/dGeGREjpNBlb14cbR3fIXLKfPtERXPuLy4wHmIbgI7lz+jMH8vH9ZOw= Received: from SA1P222CA0172.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:3c3::28) by CY5PR12MB6456.namprd12.prod.outlook.com (2603:10b6:930:34::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Tue, 6 Aug 2024 07:59:14 +0000 Received: from SN1PEPF0002BA50.namprd03.prod.outlook.com (2603:10b6:806:3c3:cafe::50) by SA1P222CA0172.outlook.office365.com (2603:10b6:806:3c3::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend Transport; Tue, 6 Aug 2024 07:59: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 SN1PEPF0002BA50.mail.protection.outlook.com (10.167.242.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Tue, 6 Aug 2024 07:59:13 +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, 6 Aug 2024 02:59:10 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v3 3/5] i3c: mipi-i3c-hci: Relocate helper macros to HCI header file Date: Tue, 6 Aug 2024 13:28:41 +0530 Message-ID: <20240806075843.277969-4-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240806075843.277969-1-Shyam-sundar.S-k@amd.com> References: <20240806075843.277969-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA50:EE_|CY5PR12MB6456:EE_ X-MS-Office365-Filtering-Correlation-Id: ac7ddbfb-9ef3-4fba-6030-08dcb5eda9c6 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: jXE2yJM0TxXo5ZAeBrjAtCTa/pw7/o4bX4kQCPlf6JnYzfLWmFSTsrYE5Z0/rEea9ydjllZEYYsf8lLbgnTOjD0+lcCQeOU7PdtG8S6mYHa8dBYqdnYUM2rdHq5qzEj1Z0WDvXGahReJE73c/Z1Su5yWjwkdZe9LcCnQBIV2dmFJaVaS3SfcARK8+Px5Aah29eBhq5+zMFqEEdW7KYQEclPNbVxu9RoBtOnT11+LvXoke9Ns+dFO8swteClIRZua00VjoDFweYuuETBBNrqb3wLJrUDh3j4uj8ILHP+kRkJZCl3DxYeqNZmCkNGl6fu55WrDqHR8RREifCbVzXzGGJeGIqiSfEgLOaDULLBKNyil28N9FGsEuq8tHRER4w0MSkvW6WLKPjshoikSD/yYxmua/dQwn65f26XvebpzaDe71Ce2sMJSklJh/VPj+EjQkZTpABGhe39MR/OanNxDfmZCde37UOVZInE9rtPMJSxRMMjtpKf2dW96+sQUCSdcuBFhGk3rx1IY2su/lbd+xA/hpboIoNMNA9FfqDu1TNvzThGioVnXbqHdaSdDaxZrMA8vGITF3e1+YPy3yujWnUaNdrOjSCTyS1ulq9+Fl4X3nJBIWXL1spWadppGY+l9Y+Tp345sHc+o1knC0XlfnFNiDTggvvf7gr4rVPm30Jk80QyNwWDxxJRxWW5FpbvhX3hKtI8PXMWwIWeNmutOInIkiMyCcJ4HWjf4KvgcP2Dw+0aEW2L0PA0hALbdUU6YnksTHibsOPqFmH5Z3THvqSs+P7BoPtTOcWi8C+EibSl2SHmAZV//DDEF5tzn0EyzZcMdA7ZdfZMHFdj8AysxaqSA1pAElre9h9wX6zvz0nvcTXYs4YS+CRPwne8qh1h1PXdLJjh9DvkWQMECpWSL81v5yppNUGQ1EXv0Kk/fLkEOaQhPWwCOQGOXivLVRUPWQJhM76LPD/blAnhG1VLj/HqMde+uRl9uh+a1H2a2RKeRLx+tL77u1jqDhp1+WlKFDJF8LT+7/8QXW68i5XmeU95MML0jN51ZG8q5H8EjmyfRb2wpdtrjIBVgAswCIAVClnxsVDS4vukGo9nNxoFQotD9BGvgknKvd9od4vy7zexLhPplXfFh/w0nT4nbXYW1EtLtIMbwTSascT7kdxBASBy4+/ykW8+OWDkxI4aJjPiTX69WrkUU7OSfr0OsB9SKFG5u+xfB7FjXtY6DGpmbFW2GdVVWPEo/LbDLx0VNJ7DhPH8m9I5IGJacKL3zpWzCe04sT2o9CrtzTiHITQXjRi1yjesI0OrZvj1YpZfKMhA0z7pEYQ62ExjYaIOorWgLccFhbG8bfjwssUOkOuYue6RMCP3ap413jMBhDBOr4P9dJa+Z8GkibqLgt7eFZyyurG1i5IZgbsuAXSEyY7dRs8AG2vJeMzC3cbQ4MM0L3I9YF9tV9BdtpWC+hEY1nZvR 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: 06 Aug 2024 07:59:13.9057 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac7ddbfb-9ef3-4fba-6030-08dcb5eda9c6 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: SN1PEPF0002BA50.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6456 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240806_005922_685694_8472C0EC X-CRM114-Status: GOOD ( 11.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 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 | 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 7843a3ac2121..5c4fcb740856 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -27,11 +26,6 @@ * Host Controller Capabilities and Operation Registers */ -#define reg_read(r) readl(hci->base_regs + (r)) -#define reg_write(r, v) writel(v, hci->base_regs + (r)) -#define reg_set(r, v) reg_write(r, reg_read(r) | (v)) -#define reg_clear(r, v) reg_write(r, reg_read(r) & ~(v)) - #define HCI_VERSION 0x00 /* HCI Version (in BCD) */ #define HCI_VERSION_V1 0x100 /* MIPI HCI Version number V1.0 */ diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mipi-i3c-hci/hci.h index 91e8a3833f3d..2b7560149520 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 Tue Aug 6 07:58:42 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: 13754542 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 7FBE9C3DA64 for ; Tue, 6 Aug 2024 07:59:25 +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=HVRVrI6cS3Gjh37WpNNp8iNZBlS/dkSF7tIDsyTXopA=; b=XJdtBFFWM9SdE3 prrMb99kZDIHv+C0M6pPZeDrouUSUU7cYC9DyVYyR+20XyJ+f1zHrJollj8xU66tscCi2VZWWx4FA /GqM99KBVFXIbJplvy+oeZZnE0ImAnU+KtgNiTxMtmLHBNwNeAvbF1YI7ym0SIh7qnszQBDUvsq/1 8zx2zbC5Puk89N/+kxvgge5dtz8t3ykQ3AFLscKjTJPjdBNwsU/sROpX6Cttk00CF3mgzqJPoaA2u ekOWFGrWcenzTMrd/JeqF/mSlE6QPRRtO4cB5QKPk0wQhdddF7Y4l9xRD3fmIOlkPdtakczUQoefG PCZI0NWgeo2lejhZOTGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbF6L-00000000rSt-0Nyf; Tue, 06 Aug 2024 07:59:25 +0000 Received: from mail-bn1nam02on20613.outbound.protection.outlook.com ([2a01:111:f403:2407::613] helo=NAM02-BN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbF6I-00000000rQP-2A7W for linux-i3c@lists.infradead.org; Tue, 06 Aug 2024 07:59:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=N0Dlm5F0HnpLTb87gxKMkHLKAFOQ6IG8hFVFuuJFF1+/xdvc80S0r7CdsZ3nGhq9aHxW4+FQWKH6ZVLafsq5ZMulTiTzYQyCTLBj7A8YvLQQBwGkA4b08rjCGfV3oBXlxg9y5R87VHrgji8jGON4LoIOXeIBpQ2f8+dAnvxDXSTaEyNUQkMn/ylEuiVMUS8ZZlPg9NINSPpy2ObvUMm0eAlYT7ndJ9zZRu574lElmuARCkbNe+nPiGgiq+coKQhVi1Rte1+DUn7AeYP5Facqewicq5sdb4MWksL7in3pbgq8WIe7+V1YoINU25uRv+q6hVPq1tB15oF1ka1kJIKs7A== 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=Fu6+K686Dt5XCNF6lBu7lrGF24EzmvRoVMOApH89cAg=; b=tTNUFqkVWJG94ffWqmrqAT78dZNCn6MM3pO7aqTJ4SSih6ihhnOCEBgt1RrF3V93/o6wHCcgg+Ctz5318H5BQeopH1uTXSFrHdfPaCf8TnnSoMZ7trisuGfgWsQBrg2Q+vUrhR02gL2rwLUaozBJ5qAamcjY51JeRloabXAiPWcJCxLqsrwzWYjLkPE+UyI7u6qy8gVm/baAdVzV+xgYkHD7obKA9sHaaSYLFQi0K4W6+t+5r3bN8R0EBstsFLrWX2RPhib1Fpz3AUarGUTo77DDjAhSiLi1TofTxJQzZV3qyxdjDrXGQ2+VPCbqXx/gTLF6o59E8GrV2kl8pbDrrw== 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=Fu6+K686Dt5XCNF6lBu7lrGF24EzmvRoVMOApH89cAg=; b=KcyURGzFIu3jhKpN8jfWuiCcSDky8Q3yuiv6tzdx5/yCusfERiQEpsqExTk/s+zXdIZynz/7NYM8HWU09APaaTqGeDMV1Mocy4YkLuKN0fne11AV5Gn6KIeRwyDpN3/+wBhFVH+VbMnODNc8db4Nd4rVHOmQiQELW4uPLd3HsQU= Received: from SA1PR04CA0009.namprd04.prod.outlook.com (2603:10b6:806:2ce::25) by SJ2PR12MB9211.namprd12.prod.outlook.com (2603:10b6:a03:55e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Tue, 6 Aug 2024 07:59:16 +0000 Received: from SN1PEPF0002BA4E.namprd03.prod.outlook.com (2603:10b6:806:2ce:cafe::1a) by SA1PR04CA0009.outlook.office365.com (2603:10b6:806:2ce::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend Transport; Tue, 6 Aug 2024 07:59:16 +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 SN1PEPF0002BA4E.mail.protection.outlook.com (10.167.242.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Tue, 6 Aug 2024 07:59: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, 6 Aug 2024 02:59:13 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v3 4/5] i3c: mipi-i3c-hci: Add a quirk to set timing parameters Date: Tue, 6 Aug 2024 13:28:42 +0530 Message-ID: <20240806075843.277969-5-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240806075843.277969-1-Shyam-sundar.S-k@amd.com> References: <20240806075843.277969-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA4E:EE_|SJ2PR12MB9211:EE_ X-MS-Office365-Filtering-Correlation-Id: 60d66725-0736-41d2-d650-08dcb5edab03 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: tvVCvjxkyUF1bAj4V6jkkWJherKErA+dDeFj98/sD0MJz0Q5FpWj0QqSuNx8lx9ZbLxb6M4d2F+vsn0nIQtlp+p9KcYB0OkGpkjWiL/Io5/3FhjHpMn3HHDM5W7sE3M25AcABQpCNRY/q9ya8Vd6HwrB5OgoQSURau3Vl67KqUZOxIW0YeIxuZ23Cx0FByg796uHZANh7skpWchhCKk08/yqWyLGz99jH54kKOmat512w3Sf1Fr1S23c8RFZ4AEnhhNpXD6SBiMX9bCWvxuqDj4tRARbSrBcwlRFiZAJmCze2q+UsubPxMJP3xK3NJbtZvNJUJ0EHRaLbBVv7gHfFLwsr1rlmRMvKsNSr+VAmbMF3tV91oxrWIXKegd+imr+pyHWHdfMdyJVlkq8XdqrZj8AWygVX5peMto56e6UEvguJrXVuqomwqvQbBbv+SlGoCOPlj/ivR7wOQRJNnSpVBozF8CK+vgSHTvNt6ZSzas/Q/c/lCnl5DIYvYqr7yNLL5h5jeln/SxQ1zGmIihrR+/MSCvxef7jX97YCc+K9tSoEg3CWQ9SpN/AkLzNnFBdkzEiQUfRwGqDcvck9PP8gGOYWBEuE05N9unz4ByvcqyQTs16XwW5uJ2cHDaAMXUyOx/8e68djSfKD4VXkkdEpknUTJVrKPe734EeZPjlt5ER/CnSfkrqYXBOx430b0slwmG+kac0RhKZsGOInv+r5TcT5g1XvLVEQ1nC+jwgF/qNTPOAGSITjRQrUCLitNXjhULJLvA57eg/HWipfjP+bpFGIz28UMBeAVyePi6OdN34y4BQu2WJ1Q1IYQoHi8ft184ifkQjSqBzgGctcX93KVuDLsdVDqKjo7gNhcDgEa4WA8nGi1tp20yA3C45ZM6bWo5EzvRUU1gic/FRTqKljd86j/tB1MQ7iyn/eqkOJ1nadOvPchWk96FcpFHkmMTTFYCKDYBwMPjUT6AFGEEQ9/Alr54G0D/SEfWe3vHJkOBCRDI3g92HZCUPjIdNBAngDF5fwMXDNPfmiVdjwaNBU/1a0T/zEbXfQNG9NrzEVMUyjPrrRuRYMqGo924dFFaczrIOGeYtN5Ugpv/xHOXaPsE4/rRNDHr1Vrx75RHhMvzwG2FhWD7YdZVMwd2W6TPyLPRCoWEl+k4BnLMbDFJZk4FGFBivfxsfSGhJ4/e1/m3Gj8e1APCd3yPIhEGXokMgZArpAvrwcUzbzP/zE1gbO86h1wT4kzGQKWdc8DNTyx60FHjVcM+VHcBZwHM6B5EuJrJptvI20RNVJerO7S/LDBaqH1I8mDOkVKwCDeOBnk3HrQIe12WrD0lwgqa+7IgFWYfWiyq2Ci5gBXDZgv/s0aUD3hJcA1nkEOnbneOKuW02zGfLJC5QV55mxbUn0TwItXSratL9dPC2k4uS6dO9ztS+mNaPynqeiB+I60tn1SnKI7v1HNdzACutD9ce1T2R 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: 06 Aug 2024 07:59:16.0018 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 60d66725-0736-41d2-d650-08dcb5edab03 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: SN1PEPF0002BA4E.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB9211 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240806_005922_586057_BD3E9A49 X-CRM114-Status: GOOD ( 15.16 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org The 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 | 25 +++++++++++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c index 5c4fcb740856..baec2c42e0e0 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -791,6 +791,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; } diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mipi-i3c-hci/hci.h index 2b7560149520..e1a65cfb43c8 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 { /* 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 */ @@ -149,5 +150,6 @@ void mipi_i3c_hci_pio_reset(struct i3c_hci *hci); void mipi_i3c_hci_dct_index_reset(struct i3c_hci *hci); void amd_i3c_hci_quirks_init(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 index 8a8fbd697175..a222bfab0676 100644 --- a/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c +++ b/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c @@ -11,10 +11,33 @@ #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 defined(CONFIG_X86) - if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) + if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) { hci->quirks |= HCI_QUIRK_PIO_MODE; + hci->quirks |= HCI_QUIRK_OD_PP_TIMING; + } #endif } + +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 Tue Aug 6 07:58:43 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: 13754544 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 95165C52D6D for ; Tue, 6 Aug 2024 07:59:30 +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=qhfZhxQpAb77yqEcOb3AMprWKbVMCYTQXuUbi7dwcHk=; b=lR275z0DD4dlri /IugAxPy/N/NtrDGWumjchWf49hYpvPo2fHmoRkf6PkN+aO/rDXwR905xfWYk7ztAwAIrunZMkG99 hXph3BI8KBb0r8pZgZkRUuTOrMaMhvkMAOrSFfGe1o64aYhSPyBDNYIpBX0ZWEVp+d6Z3l3tqJLlP ypSO6WUdqbZ+pzhO/iqfuWaNwmjchEASR8vG+1Bz8WqgWGHZV/qE5yZAqx3nDP7nwOsMf8JQ5Bn52 CzdBRv9aI6uqFemCVk14XzH63pNjWkjBfTnTFxXIgkiEr94xMLeIQTdORkSX8Ns7vmqS2BbMb0NUS icDo0y1nU+IwCUuCSm5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbF6Q-00000000rWk-1Klz; Tue, 06 Aug 2024 07:59:30 +0000 Received: from mail-co1nam11on20601.outbound.protection.outlook.com ([2a01:111:f403:2416::601] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbF6N-00000000rU9-0Sg1 for linux-i3c@lists.infradead.org; Tue, 06 Aug 2024 07:59:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yDRDjECauwaVln+sMuYrtyy+w3Cqro5Mp2VvAhADFGPbZcmgxCtgl+EQugxSxCmwpevZldBQcpONYsRU+22ZdyGWf3MTeu+O8ZSx6WQhkiGP2ps3HLVuVmb7sUGZkb9QHyYw0anEjPiKEV9okj5mkSM0Z+oibt9qUOSjIr7BtW2bvQIwDHXORTw7Ld0Y8JznZdW56lfJA4LjQC+K7hvSXSbhgs2mW3vrs4b02Qh9TVS77jCCJ1ILEKEs15nz9zDah0zVucXJWQ3xO3ippSP5eU6xvIy946Zzli9yCyaDneF6AxqXLFfQrN7pl3lw4ii6kzRhrzpT2Yw8dxxNalC8gw== 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=B+MpG3FQ6f6K1sK65Q3xCvKHWgQD8wi90mDlKI+icwk=; b=QqGe201aqsan39XNJMxNIbNaRvFnwPVf/O0qsK3KCIQDGj9InsvRxZa9Q4GNghCsqo7EhVMXZeggpVzbZ73bW9ri0YXnNhSwvQdKvYG6i+nVFsLBv1T9OwZ2i3qVNR+wbuTwXQaaxGJruL+uAECFh3chQvBf6UZSXFt8PXJADSS1QEdomS48qHNntZdFNO0ibh36AXfv/y4Xk78YpVIZSc7h38UzDXkpOSrGqxTZpkL6n2BWM9/yKZgXWVImrt3AgTCoGKo6FDqsXXpQuyfbSVhqM78vbwC5T9CGTxdGNrHV+m2wm6FiFKjGIQM9Rxtrgz/4RRvV7xwh0iPqOWTpew== 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=B+MpG3FQ6f6K1sK65Q3xCvKHWgQD8wi90mDlKI+icwk=; b=BNZTqeVsMNRrYqsumjenkxQ7q64aobJwTTGgC7B/eHS0m7TZt9dibyXVIEcY3g/jiCDYtxtucYp3th+un0n0gT2TaTELa6GAouXJ3vP3VtuS6u7C9HibG5zm7nCRvTKIIGfJrqJxUrWkx4AHBIS/x6D/6u1tOSsNkto9dagipqI= Received: from PH7PR03CA0001.namprd03.prod.outlook.com (2603:10b6:510:339::26) by CH2PR12MB4053.namprd12.prod.outlook.com (2603:10b6:610:7c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.27; Tue, 6 Aug 2024 07:59:20 +0000 Received: from SN1PEPF0002BA4C.namprd03.prod.outlook.com (2603:10b6:510:339::4) by PH7PR03CA0001.outlook.office365.com (2603:10b6:510:339::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.27 via Frontend Transport; Tue, 6 Aug 2024 07:59:20 +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 SN1PEPF0002BA4C.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Tue, 6 Aug 2024 07:59:20 +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, 6 Aug 2024 02:59:15 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: Guruvendra Punugupati , Krishnamoorthi M , , , Shyam Sundar S K Subject: [PATCH v3 5/5] i3c: mipi-i3c-hci: Add a quirk to set Response buffer threshold Date: Tue, 6 Aug 2024 13:28:43 +0530 Message-ID: <20240806075843.277969-6-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240806075843.277969-1-Shyam-sundar.S-k@amd.com> References: <20240806075843.277969-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA4C:EE_|CH2PR12MB4053:EE_ X-MS-Office365-Filtering-Correlation-Id: 48b494f7-04d8-46ce-cc11-08dcb5edad8b 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: kiaUt6MqE7x6OHy2j8tEYASPE5SjMzbVFxI9XmFD1TzX/XiLMCOMA3VsuPf4ZkfNgjFz81qJVDegMvTX1K7n9fD7gw5IM9rlf6NSSSZIPpe8sAY1mdBfP8Z5Gxil+9/hMAKykHxLT+6dLipXSVs6Cu7aXCPXFdA1Qq+f5VJEPX+GV1BOFL4ccgBHz3nwWGgN9Co/F7DzhLFA0P8wqxxdZcRaCbQDtK+5W8TLsK1uPQ2Lq82FcvmOWHGtxh5OwwYDTIdJnrn03kw4YGywVmQqZwyn28tyyyAjrjpT0r/9mOg3KTSsf+Ghv3wMfF7ZuutxjhETuvcuy4LGLWg7YPV9hbbWRwp5Mm2LqYldW5RCVkvX0glJCT0fVuUxhZf7P2Px/308AsLBpC7eM5ZaotwiWqrOzk4Yhv0GYzzQlQtJg02HZyNnvjdwTEaoHneXQXjNrDAprXwmQf4ckKTcL2Q7CjDyoVdMGUxDi5ZaUhm/+ldLtwabSte29Bbut6H8ptyd/rUUvaHUegRQJRwWYze3/DfTL+JRVrdhmFbEVpc2aG2LCYwdQtxCUPysYYCfpcT2IQKX3iZFV5gFRSWp5DfmFSvxIF4N6LXzcQ8qGFNHiyrjdGGxl2xjZVAq7Lwxkl+UeAJQP6H8gy2+Ku8s1h4PA0umtE5XlUu1YE3DY2Zj5EXNHR0ux4KTcoeOgd5K25dAIvquvvopYeWKLCbw3Ntc1AJ2cd6hp4i4I1iutahBHyXNYZkyMFJ8Bu9rYyOO4+zdwft9DvJF7lR+FTwzCzwolFo5Rr0PZHDOIGKIOQPxsQbwZmQ0Pjwdj2nQu9jhgoreqUrwB8ZbqHUBw2sUQvmIWa9VLetgZ9983pw0HXsKzChQXUgZng/sZJULKmH9FdNeMZ11QA7xZ7fKNNxUH9cchhkhecWvR7xtfN6ejgfcXpkgLGv9VTm3GFxAPLURIauHXm2DEDD8Dw/zdNVg2UNvR91Zw1uJ3ezNjpOV+XpgiyE8USzjYvb9tYpspJMOn4S1wK8SejRSFiz75clRYi1B3YeGhwxNeJ9jyUicCwnMeah6gbIVWojLR9QwNamqL4CBPDtXjNyodxh4hTpl959beZy6m4QXZTbf98jBy0BFqNP03w0yDSlID/zKpceoNZTUEwszsYtIbsjwx/Kc1VT4hzPijyK8NtFJ+R0BqlUmCljxMzmROWuy8q2dn9jfuZJ7ZBozRegzKprIy/iD69yCXSd5TpKTyYb1sExsGiEXjoP7N8Ad/IuV0OXfm/cOxYVKK8tbjbckuYa8wZbkQr2P3TcaahpLSY/MYFTOLf+VKYNOMm2G/fUM5lxjBA8bK23wzWSMPQJ9tBh7NvLHeTX5TqnpzchnsvTfN6NprPJIKtwcMkd5ebfQB2g0tjyzx1O6Egs8lv6KUaoRKohtHjpPGBczDi9Jo3z5FmVqWNAQk00KH26jGRkv2uOwq8AojIJF 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: 06 Aug 2024 07:59:20.2483 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 48b494f7-04d8-46ce-cc11-08dcb5edad8b 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: SN1PEPF0002BA4C.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4053 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240806_005927_188308_BD8DEE51 X-CRM114-Status: GOOD ( 13.67 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org The current driver sets the response buffer threshold value to 1 (N+1, 2 DWORDS) in the QUEUE THRESHOLD register. However, the AMD I3C controller only generates interrupts when the response buffer threshold value is set to 0 (1 DWORD). Therefore, a quirk is added to set the response buffer threshold value to 0. Co-developed-by: Krishnamoorthi M Signed-off-by: Krishnamoorthi M Co-developed-by: Guruvendra Punugupati Signed-off-by: Guruvendra Punugupati Signed-off-by: Shyam Sundar S K --- 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/mipi-i3c-hci/core.c index baec2c42e0e0..248f07f41c16 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -147,6 +147,10 @@ static int i3c_hci_bus_init(struct i3c_master_controller *m) if (ret) return ret; + /* Set RESP_BUF_THLD to 0(n) to get 1(n+1) response */ + if (hci->quirks & HCI_QUIRK_RESP_BUF_THLD) + amd_set_resp_buf_thld(hci); + reg_set(HC_CONTROL, HC_CONTROL_BUS_ENABLE); DBG("HC_CONTROL = %#x", reg_read(HC_CONTROL)); diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mipi-i3c-hci/hci.h index e1a65cfb43c8..b6f1b97f9e04 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 */ @@ -151,5 +152,6 @@ void mipi_i3c_hci_dct_index_reset(struct i3c_hci *hci); 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); #endif diff --git a/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c b/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c index a222bfab0676..43210882ec4d 100644 --- a/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c +++ b/drivers/i3c/master/mipi-i3c-hci/hci_quirks.c @@ -20,12 +20,15 @@ #define AMD_SCL_I3C_OD_TIMING 0x00cf00cf #define AMD_SCL_I3C_PP_TIMING 0x00160016 +#define QUEUE_THLD_CTRL 0xD0 + void amd_i3c_hci_quirks_init(struct i3c_hci *hci) { #if defined(CONFIG_X86) if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) { hci->quirks |= HCI_QUIRK_PIO_MODE; hci->quirks |= HCI_QUIRK_OD_PP_TIMING; + hci->quirks |= HCI_QUIRK_RESP_BUF_THLD; } #endif } @@ -41,3 +44,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); +}