From nobody Sat Nov 23 04:50:34 2024 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2087.outbound.protection.outlook.com [40.107.237.87]) (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 2AA991D1F6F for ; Fri, 8 Nov 2024 07:34:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731051249; cv=fail; b=Q6hAedSfcJgtDnWbIkNbubvPVsyHB1rUm0ozkzcoxVLs9YJ9+IDqGjOGn11PtMpOnyuMbDUmI+jAo4s0b3YbL44TDJJ+O5CegG+a2poL+Jo16M3DFk+Rvew8a3TXA3SQGrCL8F9poa9zFXXaTty2bjvT4uKU0KH8ws4XB7AXxHc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731051249; c=relaxed/simple; bh=M/PfHRk9nXYNICDKekfonDpK4aCZfcw1z5GLsz1Mf0s=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NS141JOWvAzrz8/HswLRs57ZlM8F/kVMF9RDLgQddbME20zyvvtGDj4Br6vcSkm1r3wOKIA2FS5aezkbglYhJjdRAx3N0ps33mkGWocKFJrsSgWlif1vrfLXLfOUKkd8MkHmbOst4b7iu2ep3W9+RNxiHwvFKze06zXwa8ixk6g= 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=s3SHmX2u; arc=fail smtp.client-ip=40.107.237.87 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="s3SHmX2u" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QNLQlu/pqbj7RXljicKm3vICHBCxJro7AB6aDad129YD5opOwRfB4mqPBiKUPJxLZHD1rU6LSHQDXoI49q8FVTEABpNW0Jc16j5XwzIroZ1CQvE1oYaTQKVMzbzqUfURq6s14hlEeUEV1mZlU5e7eYHGnN2cEBDNM5Am1huKbkW3u07ZMMGMjzJ47f4m7ijBxzCwsnT9Q+kQYvWKMjilgPeEwu+4tm0Blpor4bZrAirHAOpmv9Rt9J6jBQrF09bIYzhyeQilZCNuaErvwF0gAVHpAqWiEYamnV/TO/nu1WmT7PkoFP8IhHY2DurYiO8MWDUVViUcQ6COxlVOBUxXIg== 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=ZjwErfDQy6CzaMnw4++rs8wsNhqpWYxjOdTyHdGRSDQ=; b=qw+8o6hmeK5Mml7S0+z5uhfo4pt0DT6MDi/jsEPAJWklgBraVn/voV71m9V6A4bufDCV2Ap/Kf85h72Ci4u+xlrtg/htvN+vPldTHHGqPYdemWULk94w4L6ANjmBgmHebCqHA9qaFDzoEQI7zaUyiyiv22y81yhH3Z7IcIvk5wmJEKM8mlKkZTCkwLPTuhz+jxF/cXlH1RkJxhmB5WHzM9uKUQhSm9ODr+GggAmJpmWgAdt7Tiv2I2NwQNyUMFy73srTxe6fhIMnSJddJ4C/P+UZIXj76yWIkTekKtE1PgTgpvQ73eFJonXRAo75mFYKqa5RUwoBgolb1Evs775YjA== 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=ZjwErfDQy6CzaMnw4++rs8wsNhqpWYxjOdTyHdGRSDQ=; b=s3SHmX2uALhlDc04lIW9E/WUD8s0lBLrWBplRo1V+gHBGuWRxEsBAVKw072npB5Pu8vSDe7+FqRTxw3YKXZCJnseM9DxHF8IorflBkdXu4sTMeKU0uzGnt/n6RjZFZd8i3KLlriQ0E1fwWmBd6prfJ/iTZH4ao4ULR+QRz0Thwo= Received: from MN2PR01CA0063.prod.exchangelabs.com (2603:10b6:208:23f::32) by DM6PR12MB4076.namprd12.prod.outlook.com (2603:10b6:5:213::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.31; Fri, 8 Nov 2024 07:34:05 +0000 Received: from BN3PEPF0000B06B.namprd21.prod.outlook.com (2603:10b6:208:23f:cafe::b2) by MN2PR01CA0063.outlook.office365.com (2603:10b6:208:23f::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.21 via Frontend Transport; Fri, 8 Nov 2024 07:34:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B06B.mail.protection.outlook.com (10.167.243.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.0 via Frontend Transport; Fri, 8 Nov 2024 07:34:04 +0000 Received: from airavat.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 8 Nov 2024 01:34:02 -0600 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K Subject: [PATCH v3 1/5] i3c: dw: Add support for AMDI0015 ACPI ID Date: Fri, 8 Nov 2024 13:03:19 +0530 Message-ID: <20241108073323.523805-2-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241108073323.523805-1-Shyam-sundar.S-k@amd.com> References: <20241108073323.523805-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: BN3PEPF0000B06B:EE_|DM6PR12MB4076:EE_ X-MS-Office365-Filtering-Correlation-Id: 5cbec23f-7213-4bad-09bf-08dcffc7b935 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?9ikngAceGnxJTp6B8PUBAqLKCKSfW0HrFijBA/eN71o++jWDYXWp6GvSmfg8?= =?us-ascii?Q?a+T319+9cJOeYflft3rMIreH/DZY6WvRrAHK/Ur84XMPGPSa5l67cGNL9Z6D?= =?us-ascii?Q?kf6zHmVccINMttS8E3tLef/0CpsbSlKiQH86e3b/QGxqip3T/kCr+7aZwKsw?= =?us-ascii?Q?HhgeDfWZ1Ou6uDlzdR7fxQ+fB/jWkWjKmO2uySKGqojaESh7zhjRO3nNuzJE?= =?us-ascii?Q?jl2xDuRmQtYOf0fCYOr1drUh/i1fovUWu+ElN9kBXPaawi1umqPvTvrrmyas?= =?us-ascii?Q?EHu6/cyppRB0Y6U7cGNbyZ5vTiNjk7z0A4dbgwB1Ly4TmgWmOKvSRVdmoGwf?= =?us-ascii?Q?zd7ifWxSWxVyrwZS2r5oM52M+nw04IOc1j7/1P1+jicNoNd8wNE/fBkUwRBm?= =?us-ascii?Q?PWeo44z4EH2Y6rrOMGaMz1vZkejGSC1G80fhXhBgJ5wzihp7lkex1fbby0pO?= =?us-ascii?Q?d0Iy9Ci8kvGqSczNFPLzliqYxOTQXTj9i8Whaiyu+nfkahOeWnqh7L1lVl02?= =?us-ascii?Q?tHnDhX+xSeAeg00oUNEZXKFh8O1Z0P1L0LNNzHW0eQauaNwll4pC2NAjAuis?= =?us-ascii?Q?9uA9WFPJ8fIBsTWiqD24isvkIhBVncmTzdqEolI+DLHZUYbix+95KNj6hQEy?= =?us-ascii?Q?IN58HuQYGgdPg8UOxenrJLVvookCUnMxABHGQOIQ5GpPbtm4+2C1BaCQCTUM?= =?us-ascii?Q?HhPFRoWcSszPJj85yRZmupjgZ1pOw/T0K/qWh5V4FQ/F6wzzpu1E858EfWBY?= =?us-ascii?Q?klp6U7PTStAGdlCPRGg5L7TEXrDC5xz/o4X7d6Jp4f9FlXuSUH4HXC/pDDT+?= =?us-ascii?Q?anbCbL6SWjgjT2bNmXAVfDGKn0eUKt7gKsvzXu93exWTZJDQfdICXpYbqdfs?= =?us-ascii?Q?OwQftuynqU8w5lKPrJbL87EfuEi/GZcG1mVhPRuOpIa9+omQGpIpNDidFgMR?= =?us-ascii?Q?exQVJPmNQG7v3/dn82kR3FU9KIyQuTwrEYvx0PBvj1ZOr+ANeOjRyEex0lPB?= =?us-ascii?Q?KTed8QdSsL25/zGLXXqQ9WbWrOq2PM6kfYVw48+gBEvSoE0HZNURVmmO2Nlf?= =?us-ascii?Q?Am+rp0DOYcICMsYUrjCPZTciU9ZX6Q2BnQFaU0n2LbpVlxbtbRsXE+woUESb?= =?us-ascii?Q?yjepGHbinU+nXqoY68NU5ixUUgm+czdkkl7CsrmJH0ymUkTItyJr69xGPmtL?= =?us-ascii?Q?ROnrJB5UqvzsJBL3KfFgaGt7Z6+039UkW8G70C4QRjuLywbAofo5GMAhmzuW?= =?us-ascii?Q?fmzrV690JmTOdsmLHAKv+6QAXLux/um05xTGe8pzy13FT/UHDjEtbSUs1yZK?= =?us-ascii?Q?AWL7eT1U5V8ExX92u4nAHNkGwjKrAGOqXlI/6EI4mVVBw9VoMjceiySnLtxe?= =?us-ascii?Q?eIuzkj5q5t9ID4DtTCKvPcyBChd2zMNU5Bebmhi74r1qsTGkKw=3D=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)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2024 07:34:04.9978 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5cbec23f-7213-4bad-09bf-08dcffc7b935 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B06B.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4076 Content-Type: text/plain; charset="utf-8" Add AMDI0015 _HID for Designware I3C driver so that the dw-i3c-master driver can be probed on AMD platforms. Signed-off-by: Shyam Sundar S K Reviewed-by: Jarkko Nikula --- drivers/i3c/master/dw-i3c-master.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c= -master.c index 8d694672c110..1a7c300b6d45 100644 --- a/drivers/i3c/master/dw-i3c-master.c +++ b/drivers/i3c/master/dw-i3c-master.c @@ -1748,12 +1748,19 @@ static const struct of_device_id dw_i3c_master_of_m= atch[] =3D { }; MODULE_DEVICE_TABLE(of, dw_i3c_master_of_match); =20 +static const struct acpi_device_id amd_i3c_device_match[] =3D { + { "AMDI0015" }, + { } +}; +MODULE_DEVICE_TABLE(acpi, amd_i3c_device_match); + static struct platform_driver dw_i3c_driver =3D { .probe =3D dw_i3c_probe, .remove_new =3D dw_i3c_remove, .driver =3D { .name =3D "dw-i3c-master", .of_match_table =3D dw_i3c_master_of_match, + .acpi_match_table =3D amd_i3c_device_match, .pm =3D &dw_i3c_pm_ops, }, }; --=20 2.34.1 From nobody Sat Nov 23 04:50:34 2024 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2081.outbound.protection.outlook.com [40.107.223.81]) (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 63EF51DD534; Fri, 8 Nov 2024 07:34:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.81 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731051255; cv=fail; b=U6Gka/XY2JiSGD3ekw3Vfcwu75wuB/xgfDL2yKZ0na5z3n7U0qX9TgLTvTNumthZv0a0/BBYyTeoCxscs9JDa1y6rqeAvVQOsv2QPzNWudSLD99syc/oHGf7imSOdAAqoyV0DKZAxaLuX+9vn1HmIQJ41ZPd5P6hRKKMwZgRZvE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731051255; c=relaxed/simple; bh=CMpLd/ppwkOdLGaTKuDB6VBK+x/6q9wNyw2ObLUK32Y=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hbaj+0BjQXLWNxk6+a/NwZEA2MrfLtVd/brqi4juompqPeADSp5RzzeNjvAPvrkDIY+yAWuYlbNtZovHmur69Ig+wiB1ZRUDD+9BCTkKJtIttRGrnDmfDrykiHFOlerANC71zT1JAKCiDbdUywr/YJ2K9PUU+oaMtGUwmG5jM6o= 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=PEpYro58; arc=fail smtp.client-ip=40.107.223.81 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="PEpYro58" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PGM1vIZKiYj2DCz3mQUVMhGofI6waQ9HbtVQ1tvrIDfODxb9rSVNjvMhzGUWXyfLIu4Qa1T2sNlhv7RX5B0DKp1oqkmk3j3dzT7LTWB2Im7k2iAZMcuROtaPBWYkIS6/QNnkmwYDXMJd4y+9VRerO595h8zGkLAoL4Wo9FVCymsBxEuggxcMXkgjhyaw/AetH3LR7lHHBQy9yXtHCqKHDWw78phhcj4mny2+P07XSxWZ8TV6K0Sx0AWe+vCHzCYuUnJq3muNxFqX9WN6xS1WY0NoiAefajQx3WoZUjXmLYvYS318Lb/wKp00/PUXTPivg0rLD5kGMjSd4YFVa2Dpng== 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=sRXYIMj9DXO5K83mxgz8Uk7g7yYrTUHeXmkGzndIkcE=; b=v1ziww842Owd45hDIi6W7OA1DUwS4HE6WysP3jsoqcxn59UpsI5VQDAiSrpSDQ1TosaBTgZC5artcQR/im4X2BF2EhRbyWeXEjHAWddV5F57w7U9y8O9GvPe78lV4uONIkidKKjqCmc24+CG70uemlvv5h4yd7GtvE80n7cvakS9IOLm8vv8D/75OziS/ENgzqzc4zwp7g+vEPRuXAgmVMDu2BwUo3fZINnkI3fGGypEFl563OkaEYliqLe+qg2Ec6CD9/pbF8+bOiNItdr5zW8g/vxxHZ0HPYznlMUyRhcg2vYw1XcpTf8dkwBPf9PMMTuKO5fBwnv4FwizRgCqxA== 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=sRXYIMj9DXO5K83mxgz8Uk7g7yYrTUHeXmkGzndIkcE=; b=PEpYro58GuWF7KyU/5SdMjwCuNoVUHQJ7ncrGBnUueZl8bAxC1PrGS+xDpWgdTInetZm6lyAQZ4QeVwDpKA6evKPrkK/F0ZixLBkwkU/1OmKEG0UbQ06lUjtuO7vh3HLvW+z6no2MwF1fLAmKMoqKM193d61WHDxqJMl4gbgDME= Received: from MN2PR01CA0060.prod.exchangelabs.com (2603:10b6:208:23f::29) by SN7PR12MB7228.namprd12.prod.outlook.com (2603:10b6:806:2ab::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Fri, 8 Nov 2024 07:34:10 +0000 Received: from BN3PEPF0000B06B.namprd21.prod.outlook.com (2603:10b6:208:23f:cafe::4d) by MN2PR01CA0060.outlook.office365.com (2603:10b6:208:23f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.20 via Frontend Transport; Fri, 8 Nov 2024 07:34:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B06B.mail.protection.outlook.com (10.167.243.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.0 via Frontend Transport; Fri, 8 Nov 2024 07:34:08 +0000 Received: from airavat.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 8 Nov 2024 01:34:04 -0600 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K , Subject: [PATCH v3 2/5] i3c: master: Add ACPI support to i3c subsystem Date: Fri, 8 Nov 2024 13:03:20 +0530 Message-ID: <20241108073323.523805-3-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241108073323.523805-1-Shyam-sundar.S-k@amd.com> References: <20241108073323.523805-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: BN3PEPF0000B06B:EE_|SN7PR12MB7228:EE_ X-MS-Office365-Filtering-Correlation-Id: 51b1944a-ecea-46e2-688e-08dcffc7bb3a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Bxd6FqmmyKLm8wosaBInKbzEtiiYsFRy49D+ls8cVP6/elb1kDqcjudgHDPc?= =?us-ascii?Q?eSZPRFity9gvPRFYKtos7bhDa9gHUX6r/6BMk7gM2K7MznH5I+zeKiCW01IW?= =?us-ascii?Q?8T0zUrg/z9pkbtH37p9xMWgqUddhT91fnu1hGiucRNVTJ1kMwU9+lwmGofRC?= =?us-ascii?Q?Zz8swlCdAMqUIl5HY80RBGyKuf/c/+7Z2YY2SfbrgNitGKaMj2omPZjx/Ixq?= =?us-ascii?Q?Dy5c2wO8wukebfYL6SIy81bbLzgaxg6RpdjZpAu7jGO3YsR5LnDSESWrdU/G?= =?us-ascii?Q?vNJdyo36akZUsdlnfa56r1Z4Sq28fz21EAy8X99Amo5N2I3R8D5Oj966gW19?= =?us-ascii?Q?PGXnCNHkzua2i6wrawvhDQCEoWvUrPEkiXXGG0GOeOTEocO0wE1wZuP/ODnw?= =?us-ascii?Q?kgeVIZjzgba9Hh4RGr6Tcblt1oz18/jzPUWUuglByR4vbQrZffaCUQpLfsa9?= =?us-ascii?Q?gWUkX8FNHyXOLs7S09MEMaTXw6YOBPQcgECh1nH4ErTO+u1L7TTqkB1nuWbs?= =?us-ascii?Q?ahhidPpkGBY5HfwVgYA6K8tHEuVADxFo6/qbjqvSlJxia9xv+zq5JQgUzIu6?= =?us-ascii?Q?eCc2Dp2ez2SQ4Mxyv46+zwwaByjzl/p4DBx4xUCqVzYA3YcnHnaldgzVpMog?= =?us-ascii?Q?VcVFWPJg+7INDBtpSoo0ae5aV/veU7i2lFjUg7poOYN9R9zvvARC9Mdev6Aa?= =?us-ascii?Q?AQtixYBfEYJg/GHmcc9h4qAOHF5URtI0Q2m/R85Ib1g4+10Tp1cFTlAZOl7q?= =?us-ascii?Q?emH/kmhNZEYaOY/1tDkzCqz5zHKjklH4ncxe5zeNIKfJDsbZJOklrAEmjpon?= =?us-ascii?Q?f0DnQm7nJparaItObv5IcnwBpzjHmE+xqYTNeg00VxkBfw0zDvWoTsOI6gUM?= =?us-ascii?Q?VWvjLe3DfGxKyza5GVOEGgWdSW5jlvf++wQ+IBRYOLLxPZFPMmkweB/u8e7W?= =?us-ascii?Q?/9IAwpqX1AqQsOpmPqKOd5iKmcxxk5K8NB1mhCUILoptbJMPWSpAJoq3P0ME?= =?us-ascii?Q?Tnk6v+vzWM3KiCdB4WLg+WV9ZcBqTMP/9rhXBrzwlCWoj761zMnwk38Wt1hf?= =?us-ascii?Q?rMDICSWYDM+bDc3hTPZJBVfc7djqyv5wUt0+cT1+dE69l0+rvI6YT0D4Ku7W?= =?us-ascii?Q?fXnVMiHUWYiu+IU4CFvU/KskYcMl7yRVGe5NXsWtF+MY/MYH2HtGK7HAaFps?= =?us-ascii?Q?N8FyuFqgoBUfxn9ercJH9uX8AjLGPgm91dD2u3rfP4LsVZE7xPJgH98BZqO5?= =?us-ascii?Q?303LYNmigKpDeqA2xdX1q+OQ3+kte+CMYnbqiFRbTAeXAOriDPGLWBGLYduv?= =?us-ascii?Q?NTQl6iPECb2expq053AJXjPPf+/zHdDPs1hThIyRsiPT43Cfvh/mmcuvUntk?= =?us-ascii?Q?z0TvTOEX1iXk2R5YoJTtSMwqfw9p7qmf6TXZa+SfvUJN/sBAmg=3D=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)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2024 07:34:08.3884 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 51b1944a-ecea-46e2-688e-08dcffc7bb3a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B06B.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7228 Content-Type: text/plain; charset="utf-8" As of now, the I3C subsystem only has ARM-specific initialization, and there is no corresponding ACPI plumbing present. To address this, ACPI support needs to be added to both the I3C core and DW driver. Add support to get the ACPI handle from the _HID probed and parse the apci object to retrieve the slave information from BIOS. Based on the acpi object information propogated via BIOS, build the i3c board information so that the same information can be used across the driver to handle the slave requests. Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- Cc: linux-acpi@vger.kernel.org drivers/i3c/internals.h | 3 ++ drivers/i3c/master.c | 84 ++++++++++++++++++++++++++++++ drivers/i3c/master/dw-i3c-master.c | 7 +++ include/linux/i3c/master.h | 1 + 4 files changed, 95 insertions(+) diff --git a/drivers/i3c/internals.h b/drivers/i3c/internals.h index 433f6088b7ce..178bc0ebe6b6 100644 --- a/drivers/i3c/internals.h +++ b/drivers/i3c/internals.h @@ -10,6 +10,9 @@ =20 #include =20 +#define I3C_GET_PID 0x08 +#define I3C_GET_ADDR 0x7F + void i3c_bus_normaluse_lock(struct i3c_bus *bus); void i3c_bus_normaluse_unlock(struct i3c_bus *bus); =20 diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 6f3eb710a75d..0ceef2aa9161 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -2251,6 +2251,84 @@ static int of_i3c_master_add_dev(struct i3c_master_c= ontroller *master, return ret; } =20 +#if IS_ENABLED(CONFIG_ACPI) +static int i3c_acpi_configure_master(struct i3c_master_controller *master) +{ + struct acpi_buffer buf =3D {ACPI_ALLOCATE_BUFFER, NULL}; + enum i3c_addr_slot_status addrstatus; + struct i3c_dev_boardinfo *boardinfo; + struct device *dev =3D &master->dev; + struct fwnode_handle *fwnode; + struct acpi_device *adev; + u32 slv_addr, num_dev; + acpi_status status; + u64 val; + + status =3D acpi_evaluate_object_typed(master->ahandle, "_DSD", NULL, &buf= , ACPI_TYPE_PACKAGE); + if (ACPI_FAILURE(status)) { + dev_err(&master->dev, "Error reading _DSD:%s\n", acpi_format_exception(s= tatus)); + return -ENODEV; + } + + num_dev =3D device_get_child_node_count(dev); + if (!num_dev) { + dev_err(&master->dev, "Error: no child node present\n"); + return -EINVAL; + } + + device_for_each_child_node(dev, fwnode) { + adev =3D to_acpi_device_node(fwnode); + if (!adev) + return -ENODEV; + + status =3D acpi_evaluate_integer(adev->handle, "_ADR", NULL, &val); + if (ACPI_FAILURE(status)) { + dev_err(&master->dev, "Error: eval _ADR failed\n"); + return -EINVAL; + } + slv_addr =3D val & I3C_GET_ADDR; + + boardinfo =3D devm_kzalloc(dev, sizeof(*boardinfo), GFP_KERNEL); + if (!boardinfo) + return -ENOMEM; + + if (slv_addr) { + if (slv_addr > I3C_MAX_ADDR) + return -EINVAL; + + addrstatus =3D i3c_bus_get_addr_slot_status(&master->bus, slv_addr); + if (addrstatus !=3D I3C_ADDR_SLOT_FREE) + return -EINVAL; + } + + boardinfo->static_addr =3D slv_addr; + if (boardinfo->static_addr > I3C_MAX_ADDR) + return -EINVAL; + + addrstatus =3D i3c_bus_get_addr_slot_status(&master->bus, boardinfo->sta= tic_addr); + if (addrstatus !=3D I3C_ADDR_SLOT_FREE) + return -EINVAL; + + boardinfo->pid =3D val >> I3C_GET_PID; + if ((boardinfo->pid & GENMASK_ULL(63, 48)) || + I3C_PID_RND_LOWER_32BITS(boardinfo->pid)) + return -EINVAL; + + /* + * According to the specification, SETDASA is not supported for DIMM sla= ves + * during device discovery. Therefore, BIOS will populate same initial + * dynamic address as the static address. + */ + boardinfo->init_dyn_addr =3D boardinfo->static_addr; + list_add_tail(&boardinfo->node, &master->boardinfo.i3c); + } + + return 0; +} +#else +static int i3c_acpi_configure_master(struct i3c_master_controller *master)= { return 0; } +#endif + static int of_populate_i3c_bus(struct i3c_master_controller *master) { struct device *dev =3D &master->dev; @@ -2771,6 +2849,12 @@ int i3c_master_register(struct i3c_master_controller= *master, master->dev.coherent_dma_mask =3D parent->coherent_dma_mask; master->dev.dma_parms =3D parent->dma_parms; =20 + if (has_acpi_companion(master->dev.parent)) { + ret =3D i3c_acpi_configure_master(master); + if (ret < 0) + return ret; + } + ret =3D of_populate_i3c_bus(master); if (ret) goto err_put_dev; diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c= -master.c index 1a7c300b6d45..d44b771d03e1 100644 --- a/drivers/i3c/master/dw-i3c-master.c +++ b/drivers/i3c/master/dw-i3c-master.c @@ -1602,6 +1602,13 @@ int dw_i3c_common_probe(struct dw_i3c_master *master, master->maxdevs =3D ret >> 16; master->free_pos =3D GENMASK(master->maxdevs - 1, 0); =20 +#if IS_ENABLED(CONFIG_ACPI) + ACPI_COMPANION_SET(&master->base.dev, ACPI_COMPANION(&pdev->dev)); + master->base.ahandle =3D acpi_device_handle(ACPI_COMPANION(&pdev->dev)); + if (!master->base.ahandle) + dev_err(&pdev->dev, "Failed to get acpi device handle\n"); +#endif + INIT_WORK(&master->hj_work, dw_i3c_hj_work); ret =3D i3c_master_register(&master->base, &pdev->dev, &dw_mipi_i3c_ops, false); diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h index 2a1ed05d5782..367faf7c4bf3 100644 --- a/include/linux/i3c/master.h +++ b/include/linux/i3c/master.h @@ -523,6 +523,7 @@ struct i3c_master_controller { } boardinfo; struct i3c_bus bus; struct workqueue_struct *wq; + acpi_handle ahandle; }; =20 /** --=20 2.34.1 From nobody Sat Nov 23 04:50:34 2024 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2047.outbound.protection.outlook.com [40.107.93.47]) (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 394AD1DC1A2 for ; Fri, 8 Nov 2024 07:34:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.47 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731051254; cv=fail; b=A/vIDB7nUxHd2/yr5T1WE27JdsRnNXDYVvnmUDLy06pruovVwvG++YUzW8nYNn3kYzeF4h5AmXmRL6wYLGSuwsdxTPitUfWHLfmag7hGbmtyKR1bXc5U5ZgRQL1B8H3HKZLjP5JKfG4/hgSlaxS1omdhuEkWFUknjfTMOM1QBuo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731051254; c=relaxed/simple; bh=UuDe+pJvJXFAe+PEQEZMR1GwjUY2pKA0/hehw4yZ8uI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bkcwTRiUnIWqHuumKlW6BWUPRZMUf//3ILfxsddSuq8iCoKlxbXWHYZWmnUx6M1WvB18vrxJsI29XNBMbNx2mSzduY6PCy0X1Xmq9a1MhIX0VQ/q5oB4Fx1x9iB371fJst0HSfWB57+E52Zl3GTJbpaYmv0w/QjRRcyGNukLZRQ= 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=FH/3jy16; arc=fail smtp.client-ip=40.107.93.47 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="FH/3jy16" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=p92RYw6Pz9cmtGilcOSeg0PUrBCrnBavtWGsmatRDHWscUVN1UKvfG97fTHWzEG6oH+cV4Z8OF4i8+Pogx3sLsX85W0KlsDtrX3OwBWxVkT5w2hK0FVgWIFgZS1UdSbzisKfR/GAQeGRGjUl2TeyRyooDOiSKnJik12GtyTS12xee+RrTtDfsPiBOoUNZcZRUsYUqu0rnp3KJaiGod27WEOHoyMminJ7Y6yTTGypHSE9rr19pww/eDNErW8O2voYdHocrouM7rMIkC/097/LJQ7rrAmqgCCju/e9thdfT6bJG00ugiFuMoEMT7WGY34+FwIGgiyQNRJe2FdgbTRa7w== 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=1nWDynJuNFanjoN+/KI69qEqB2g6Mqrm/HnaGLHlblA=; b=NmEh/j6hWau/JZU1UmmcojICf6UcwyMk5UnH/Mbcrt4jY+qE/sBleYWKQDUOWRacla/DUOzuKQVcBQ5bl0FK70AdFE/GuBGb3hespxi0wAMSTY5LMMgM6yhG42pufU1M6Cz9o5z9ksEd5LIOeAdF0PNiPC23xyqwBW4K79URBaXun3ABpP+Voxcd01N5+9f7A1crueWfZeQc1sS5TYHNcIlOSzgiPbPjdAoAm/0WNnid2atU1FYy8TyDunBPW36rsf4FDZRkO7Uj5nalbTGtERWcR5p1tHbg4GAkEW9tnTkmoIK4ytLq96AWbRj3U78SZk9aLc+i000QXE5XUoQGAA== 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=1nWDynJuNFanjoN+/KI69qEqB2g6Mqrm/HnaGLHlblA=; b=FH/3jy16MxU26WigNUuMUeU/0GKAJ9llozDiw9c17OxYtDOTX3n25VmqABEbRTOaSb99FQlBHQQDmzFeJfw33M6L18uO8X4XYGdl4SlsGMoBoyDQ9VwmQbkDjphySV8PVB22ARpsIx28hUe+TCqMerOLZQfP0tTUAc4SAMoZcEI= Received: from MN2PR01CA0056.prod.exchangelabs.com (2603:10b6:208:23f::25) by SA0PR12MB4463.namprd12.prod.outlook.com (2603:10b6:806:92::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19; Fri, 8 Nov 2024 07:34:11 +0000 Received: from BN3PEPF0000B06B.namprd21.prod.outlook.com (2603:10b6:208:23f:cafe::2b) by MN2PR01CA0056.outlook.office365.com (2603:10b6:208:23f::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.20 via Frontend Transport; Fri, 8 Nov 2024 07:34: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 BN3PEPF0000B06B.mail.protection.outlook.com (10.167.243.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.0 via Frontend Transport; Fri, 8 Nov 2024 07:34:10 +0000 Received: from airavat.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 8 Nov 2024 01:34:07 -0600 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K Subject: [PATCH v3 3/5] i3c: master: Add a routine to include the I3C SPD device Date: Fri, 8 Nov 2024 13:03:21 +0530 Message-ID: <20241108073323.523805-4-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241108073323.523805-1-Shyam-sundar.S-k@amd.com> References: <20241108073323.523805-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: BN3PEPF0000B06B:EE_|SA0PR12MB4463:EE_ X-MS-Office365-Filtering-Correlation-Id: e8083113-a6f4-4581-44a6-08dcffc7bc9b 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?bJd2mUFEmBBB3n2uptU4jqKJ9Pb7TLOBTP0kQSLuqOqzsoUtniXD12ExCJ/i?= =?us-ascii?Q?iuDZYA5vaiaLV+8TcytPIG5V6CDn2o2/Bd9j9qvicnnYBgAMyXW+V3+WxoEB?= =?us-ascii?Q?ZXEWPRNUU5cXg+t9eskPsFM+bdDfeL6NLENvePqbjtTa0ZWxuAwYlfXeIqOu?= =?us-ascii?Q?oEA4UP73PXSxRFKQwbIomeQvwHcdjfkLZKgeuxgMprH8ZA/QroPTlmrSjYjm?= =?us-ascii?Q?MxaGrqufA6BjDNgwr+fqMotFrthQzb0ZCm0TOZ++bkMwzFAkvq89kCh9iJn3?= =?us-ascii?Q?8sWJVXqhwaM+y+6jenWVfkAw+WX3JmoJZDXDfz4xzaldFO9/cSyKKDyYz7Fv?= =?us-ascii?Q?6ZIRtZXyuefiemwSheG5CQn5FpE0UVfjxTfSe6TFeOPCeLtWR1sPhRKYKWaT?= =?us-ascii?Q?XL+P/xNTgHvNjSn5qIGwQ6RmhV0GLce8+TCkN5O2a43CRdvFyGoCgJHCXjv1?= =?us-ascii?Q?olQBnVkVSrOh/eN/1GxJwJUbIM32o7CnjrKh4f6prfXroukmeKMCa5A3+M3W?= =?us-ascii?Q?lZcT8Vn/4O1+XYTM2VbMF2NVUCLgtFchUhhD53rESyIaTeYY0PZ38eclXnJm?= =?us-ascii?Q?Ff/HcTnKwLK9iX7E4rqQt/76FA4rCjzahfAw4WsvhTYr/Fm1XoVy9bcWaywJ?= =?us-ascii?Q?OETUFvVRlEl6fcHJgVfVVfuW5x3tu19btRFknjS8W3KxnaFrrFfaN2MwYZ+t?= =?us-ascii?Q?Y9sSkqEFPIoDBiAz+3nCH6RY/lGYYDzHZjVFGTyyFSMI5WNYd4f+Cn5yR6Ji?= =?us-ascii?Q?pHpJVBQ0krjmSqI9kjgbf0xbFr2+1T6iLwamcrT4jAEXH/m+q7a2whyAeGuM?= =?us-ascii?Q?ZWa6KFLCbeTKHkk9WaSu5HtMA6413hUNhtyD5Bp6YI8Lc3S1LMN2RSIW/nYI?= =?us-ascii?Q?JZtJsZA1lA7sLcJKaXlMojuQ3ZKJDfmm00zWojhYNwD+NSlmLJm20ar2iCMo?= =?us-ascii?Q?6SAvkUHGEW5EG4ovXtqLEvRJOPnPce+q26ABD5KsX/LW28JE3BUZY7RNpJNK?= =?us-ascii?Q?8KJqi+qkxMVm9gNsc1cCNofyXcsbitl1uRcf5cV00/X64rboU832vCum/9Rj?= =?us-ascii?Q?+jYXlkThOL6NcUutpre2K55SNcwSgf4PQkmU4OMAL2gDoudPKkX+v7QnMp1r?= =?us-ascii?Q?mvXuy7nROxClgXlP+3L/zaLVpeZvpq+im/kSxeFkMG/Ad4MgMcrX4gyzAxl9?= =?us-ascii?Q?UZoeelfqeZSpWWj8LOTRKc+i3ILXEFdY1d+fTo34bRVcGyEn/s0IsK2NiypJ?= =?us-ascii?Q?CO8M43fved3+IufMv1PbgyXJVgE8np7+p3gljFH9jHp/VGAyHbreb9NPH1cR?= =?us-ascii?Q?doj6GMJ9UWiV1uH4mbTDeKjseqHnZYOHrtS6hfw8iqNPoen3RgZypBlLSPlQ?= =?us-ascii?Q?I18NkEYT7tsnWrAGZxoIA91wkh9he73wC+IQPrlDZw5j5qIKww=3D=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)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2024 07:34:10.7009 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e8083113-a6f4-4581-44a6-08dcffc7bc9b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B06B.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4463 Content-Type: text/plain; charset="utf-8" Implement the i3c_master_add_spd_dev() function in the I3C master to handle SPD (Serial Presence Detect) device creation and map the board information into the I3C device structure. Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/i3c/master.c | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 0ceef2aa9161..8f37dcaa1efe 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -1657,6 +1657,45 @@ i3c_master_register_new_i3c_devs(struct i3c_master_c= ontroller *master) } } =20 +static int i3c_master_add_spd_dev(struct i3c_master_controller *master, + struct i3c_dev_boardinfo *boardinfo) +{ + struct i3c_dev_desc *i3cdev; + int ret; + + list_for_each_entry(boardinfo, &master->boardinfo.i3c, node) { + struct i3c_device_info info =3D { + .static_addr =3D boardinfo->static_addr, + }; + + ret =3D i3c_bus_get_addr_slot_status(&master->bus, boardinfo->static_add= r); + if (ret !=3D I3C_ADDR_SLOT_FREE) + return -EBUSY; + + i3cdev =3D i3c_master_alloc_i3c_dev(master, &info); + if (IS_ERR(i3cdev)) + return -ENOMEM; + + i3cdev->boardinfo =3D boardinfo; + ret =3D i3c_master_attach_i3c_dev(master, i3cdev); + if (ret) + goto err_free_dev; + + i3cdev->info.pid =3D i3cdev->boardinfo->pid; + i3cdev->info.dyn_addr =3D i3cdev->boardinfo->init_dyn_addr; + + i3c_bus_normaluse_lock(&master->bus); + i3c_master_register_new_i3c_devs(master); + i3c_bus_normaluse_unlock(&master->bus); + } + + return 0; + +err_free_dev: + i3c_master_free_i3c_dev(i3cdev); + return ret; +} + /** * i3c_master_do_daa() - do a DAA (Dynamic Address Assignment) * @master: master doing the DAA @@ -1814,7 +1853,7 @@ static int i3c_master_bus_init(struct i3c_master_cont= roller *master) { enum i3c_addr_slot_status status; struct i2c_dev_boardinfo *i2cboardinfo; - struct i3c_dev_boardinfo *i3cboardinfo; + struct i3c_dev_boardinfo *i3cboardinfo =3D NULL; struct i2c_dev_desc *i2cdev; int ret; =20 @@ -1868,6 +1907,8 @@ static int i3c_master_bus_init(struct i3c_master_cont= roller *master) goto err_bus_cleanup; } =20 + i3c_master_add_spd_dev(master, i3cboardinfo); + if (master->ops->set_speed) { ret =3D master->ops->set_speed(master, I3C_OPEN_DRAIN_SLOW_SPEED); if (ret) --=20 2.34.1 From nobody Sat Nov 23 04:50:34 2024 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2062.outbound.protection.outlook.com [40.107.236.62]) (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 2C9931D1502 for ; Fri, 8 Nov 2024 07:34:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731051256; cv=fail; b=PaCCp03iAua3iAjTrJ4sRe3ELt4j+f3IU1U7j+roauw6+Tp196V9jvNagdcLPVmkQDr3FGpE8Vv5N0YqtI7KQ/QqoNRYFozn376fMb/jt1CRSLEUvXz5EV6T3YPT3NtQL80b6cy7VM0sPgHICg/ifh2QSFbHTr9tEAreNnJ+3KI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731051256; c=relaxed/simple; bh=zPtBB+yaPivfrfAJ7FOTu9wwXej0Tnf02EbJT2b9P6I=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UAAFzm+09WdqcUV5kVrb5lSK2IZCs9ahcpExVGHPIu4GBv2RSpkHwRQF+FXbo6Qs9WeUV1UVG2WKXpIuxiRSf1cbIiYC3CYb3IF6WzPJwV4xGvUvMN7perVNYySS/6vYPA7f+hY2k5jMOE/zaUrjFsRDNRu7lkQQfKHiDSpxi+U= 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=uizvP72P; arc=fail smtp.client-ip=40.107.236.62 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="uizvP72P" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ArtSLb8Ntx9Y4W5poSrvgjnXgDRWbJpV3JhIjS2GeC/ZhpzKi6GKZaVZ0MB2qkoGDNOaqZjQJs82Qqz0IdBq5XAI3yHoaM4wZG9NUhiid2XnRCs/UG85i1BPP5zVA4MRmzi9Lr4Flqp3mVqJpP52YJb6uiQPugrRpKWcPoyz9JM9zFAq06hA+jo7E0EHRJtqEC+KU/Cur3BlRJzV1N5HP6CDmlZ60+RRIi12/6q8Wwh5Br3WKLHVQS0FHM6AC89nGvK08zoOaXZKzBIlknuiWSHwKP1T8Rwa2u+TWf1pTcVzfrKuyzaFD0RNk8Op8oQrLz+clbkxfyyySVvoVvhn0w== 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=BFj1euUfTce0xwCEXJQnwCWXcSwneCcgZ319DR4KGJc=; b=yHzheKN6ZZ26+8o6JWhlS5macTPo2Id8tEFkTNRTEIDs9LPcw0pL5DdjTaFF1bohriaTsYXFJ8+8DOyN8bJOBbkRokDYDWsglgU83+otoymKojOp8JrgmSnrKn2DYDzAdVWal0lBvOOlIkWGw9alf0tKEx7BdGYm9VC6iX8zDUf17nT/xy2KQ+T4RG9SbP8Od9lc9tLfkeCvOfFSoPSyJZOni0msoR4ulu4vGdhwjmYX6HRYMW1txnX5+T7pTueI966HhIoBPatKp0j5JOJvaN+Fu9y/Kmc+z2LKFL9C8msQmfaFNRUjlaph0Xj3/9a9u6jgVGYEzMR06zNKYF/Fmg== 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=BFj1euUfTce0xwCEXJQnwCWXcSwneCcgZ319DR4KGJc=; b=uizvP72PVon0fG0ECbdrRpnQiV1qitsVj76HipXf/8G7mBtuCC+Tkwb7YqaPGdfyLCE2dMu/FUG6Its6zzkPEO1AacWcvJ/VVcKFsAPUECvOnzfUOHlF0VzmLL+mtzm5s4g82FT4c1Px07KrOI5B7yMxVD+G10ReJMWxaL8cOuw= Received: from MN2PR01CA0061.prod.exchangelabs.com (2603:10b6:208:23f::30) by PH0PR12MB7906.namprd12.prod.outlook.com (2603:10b6:510:26c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19; Fri, 8 Nov 2024 07:34:11 +0000 Received: from BN3PEPF0000B06B.namprd21.prod.outlook.com (2603:10b6:208:23f:cafe::22) by MN2PR01CA0061.outlook.office365.com (2603:10b6:208:23f::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.21 via Frontend Transport; Fri, 8 Nov 2024 07:34: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 BN3PEPF0000B06B.mail.protection.outlook.com (10.167.243.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.0 via Frontend Transport; Fri, 8 Nov 2024 07:34:11 +0000 Received: from airavat.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 8 Nov 2024 01:34:09 -0600 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K Subject: [PATCH v3 4/5] i3c: master: Add support for SETAASA CCC Date: Fri, 8 Nov 2024 13:03:22 +0530 Message-ID: <20241108073323.523805-5-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241108073323.523805-1-Shyam-sundar.S-k@amd.com> References: <20241108073323.523805-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: BN3PEPF0000B06B:EE_|PH0PR12MB7906:EE_ X-MS-Office365-Filtering-Correlation-Id: 97005468-f97c-4a2c-1685-08dcffc7bd2f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?OYibDgU15NUN43Y7hzUKMmuKNTHYoWtrJ512uJisdk3aha2tKxXrD1cgqfBy?= =?us-ascii?Q?54mjBAc3PP1i1vDFhPWjM+yP1eWxBIA8XGOEjDglwrwVPYQTx6MVtWw0liqp?= =?us-ascii?Q?5avbyLH58ZCTd8jU4CEnB1S7MQKD6dE/gu/o+gRTdTae63rpZAjZyubd+A7a?= =?us-ascii?Q?L88rWsHeM2fQLra6WztNsTjCSXn1DzwHBEDcPYJAhCMF2cHOSVJwIDpvNvlE?= =?us-ascii?Q?MYm32yrwhEWqPFLmWAX3MiqQh4AhHlHKykqg9Nhazq5IQIUSVgKpf2FjIit7?= =?us-ascii?Q?EGjXM0+3e+TpREFENqFBUuqxwnXLPgJQBDW59//IaWfyjByyBiU+1ILkTyrF?= =?us-ascii?Q?5wywAAAvZ8x7CiZVdQgBKrGSD1Mz6wrZOqZ54YYlgDK4J0R7OZD74Zsi3oNp?= =?us-ascii?Q?74O9TuUcifzHbfdDgLMQ3wf+O1qRnM86ImrBWCJlYPj0zzVZLOoiUL1Pf4Df?= =?us-ascii?Q?fL/H3XWnlWfVslu+IPvbOJ/RcWFsDc6aIFRToCEwH6/nl3oQGxJc4PdavHzx?= =?us-ascii?Q?L5lGUbVYQruaehlalxn70EWDg/jMbIz+1PYXviJcgkNfP9qCoqXD7Lp9sK/z?= =?us-ascii?Q?3Y48stVgrfZUbVtbBz6/iQVqyhs8FNiFzoJVfSGKM2DxjchXh578l20Ceumw?= =?us-ascii?Q?kL3UE3UM08LCsHR9ffuJKMQwFT+4yj7LgftxeMbHfkYPhKJrMT2UXJKLbxYy?= =?us-ascii?Q?HdfMkn/CWIke93+FKX9nf77ttn2ExvJnBdrQ1oEfC28kl7CEJMo6LoFBskmo?= =?us-ascii?Q?qdH7xKvW7h8WSAALwr7GXWxu8PqCMhieP3B55zQmTHWgxufH27MldigGEyH2?= =?us-ascii?Q?V4tXu9K6yPbuRyGN/MAZcfP8tWwv77KnhiXZ5eHfd41vYj0FdGfkpf3QG465?= =?us-ascii?Q?lrgeFPQIOClTNZqvn+9IwUn+2hkfoRDMlgTH0J3o4XLmKseEgFPM9ro+1wfq?= =?us-ascii?Q?OUcrOL72FjeDziAWVW1KE8B8hjQFvKmZwrgLwQKyOliQX7koQy1gMuBHDyT9?= =?us-ascii?Q?pt8kPulgPMFcEH6Sx++52eGXgPfyDTH+s6w0GUaZEDw5CbYTCViUsNkHTa9q?= =?us-ascii?Q?n7OLZHMnScxPcd+ZQxjChqryWftdF8Y1r56JV7guN4Zp+S6ugE8sgfj00S5/?= =?us-ascii?Q?upemaOmUmsrgSJs6sRp5/kjtyUZcNth/mj76anagaf482D7y28hEwDJYIyJa?= =?us-ascii?Q?fO5ipV4gyOMEpksvloKnX3Ylf+r+JTrCnBdcRI/jyO5A2dEW6UTZW7n0VFR2?= =?us-ascii?Q?jjRViCr8bXLyxe4YPj/fvollmIleE0U0ykS48Eh33UrDGgl8T6vP/HFxi3j/?= =?us-ascii?Q?esNfc9RziDrWMfhCUtSJPrVIbE1wPdxXtzZ5MiQ+51EUv2LL+jGQuGjl26S0?= =?us-ascii?Q?uPVamzA=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)(36860700013)(1800799024)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2024 07:34:11.6697 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97005468-f97c-4a2c-1685-08dcffc7bd2f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B06B.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7906 Content-Type: text/plain; charset="utf-8" I3C devices like DIMMs over SPD use SETAASA[1] for bus discovery instead of SETDASA. Add a new routine for I3C host controller drivers to use. If the I3C slave on the bus is an SPD device, skip the regular DAA process. According to the SPD spec[2], use SETAASA for bus discovery, and avoid sending RSTDAA and DISEC, as they are considered illegal. Skip this entire process if the slave is SPD-compliant, as indicated by the "jdec_spd" flag from the BIOS. [1] SETAASA is introduced in MIPI v1.1.1 specification. [2] https://www.jedec.org/system/files/docs/JESD300-5B.01.pdf (section 2.4 and 2.6.3) Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/i3c/master.c | 32 +++++++++++++++++++++++++++++- drivers/i3c/master/dw-i3c-master.c | 1 + include/linux/i3c/ccc.h | 1 + include/linux/i3c/master.h | 1 + 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 8f37dcaa1efe..2f06f168ef82 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -1657,6 +1657,21 @@ i3c_master_register_new_i3c_devs(struct i3c_master_c= ontroller *master) } } =20 +static int i3c_master_setaasa_locked(struct i3c_master_controller *master) +{ + struct i3c_ccc_cmd_dest dest; + struct i3c_ccc_cmd cmd; + int ret; + + i3c_ccc_cmd_dest_init(&dest, I3C_BROADCAST_ADDR, 0); + i3c_ccc_cmd_init(&cmd, false, I3C_CCC_SETAASA, &dest, 1); + + ret =3D i3c_master_send_ccc_cmd_locked(master, &cmd); + i3c_ccc_cmd_dest_cleanup(&dest); + + return ret; +} + static int i3c_master_add_spd_dev(struct i3c_master_controller *master, struct i3c_dev_boardinfo *boardinfo) { @@ -1684,6 +1699,10 @@ static int i3c_master_add_spd_dev(struct i3c_master_= controller *master, i3cdev->info.pid =3D i3cdev->boardinfo->pid; i3cdev->info.dyn_addr =3D i3cdev->boardinfo->init_dyn_addr; =20 + ret =3D i3c_master_setaasa_locked(master); + if (ret) + goto err_free_dev; + i3c_bus_normaluse_lock(&master->bus); i3c_master_register_new_i3c_devs(master); i3c_bus_normaluse_unlock(&master->bus); @@ -1907,7 +1926,14 @@ static int i3c_master_bus_init(struct i3c_master_con= troller *master) goto err_bus_cleanup; } =20 - i3c_master_add_spd_dev(master, i3cboardinfo); + /* + * If the I3C slave on the bus is SPD device, then do not follow the regu= lar + * DAA process. Also, as per SPD spec SETAASA is required for the bus dis= covery + * and sending RSTDAA and DISEC is considered as illegal. So skip the ent= ire process + * if the jdec_spd flag has been identified from the BIOS. + */ + if (master->jdec_spd) + return i3c_master_add_spd_dev(master, i3cboardinfo); =20 if (master->ops->set_speed) { ret =3D master->ops->set_speed(master, I3C_OPEN_DRAIN_SLOW_SPEED); @@ -2311,6 +2337,10 @@ static int i3c_acpi_configure_master(struct i3c_mast= er_controller *master) return -ENODEV; } =20 + status =3D acpi_evaluate_object(master->ahandle, "_STR", NULL, NULL); + if (ACPI_SUCCESS(status)) + master->jdec_spd =3D true; + num_dev =3D device_get_child_node_count(dev); if (!num_dev) { dev_err(&master->dev, "Error: no child node present\n"); diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c= -master.c index d44b771d03e1..dc701275485a 100644 --- a/drivers/i3c/master/dw-i3c-master.c +++ b/drivers/i3c/master/dw-i3c-master.c @@ -282,6 +282,7 @@ static bool dw_i3c_master_supports_ccc_cmd(struct i3c_m= aster_controller *m, case I3C_CCC_GETSTATUS: case I3C_CCC_GETMXDS: case I3C_CCC_GETHDRCAP: + case I3C_CCC_SETAASA: return true; default: return false; diff --git a/include/linux/i3c/ccc.h b/include/linux/i3c/ccc.h index ad59a4ae60d1..a145d766ab6f 100644 --- a/include/linux/i3c/ccc.h +++ b/include/linux/i3c/ccc.h @@ -32,6 +32,7 @@ #define I3C_CCC_DEFSLVS I3C_CCC_ID(0x8, true) #define I3C_CCC_ENTTM I3C_CCC_ID(0xb, true) #define I3C_CCC_ENTHDR(x) I3C_CCC_ID(0x20 + (x), true) +#define I3C_CCC_SETAASA I3C_CCC_ID(0x29, true) =20 /* Unicast-only commands */ #define I3C_CCC_SETDASA I3C_CCC_ID(0x7, false) diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h index 367faf7c4bf3..cd8390d8b469 100644 --- a/include/linux/i3c/master.h +++ b/include/linux/i3c/master.h @@ -516,6 +516,7 @@ struct i3c_master_controller { const struct i3c_master_controller_ops *ops; unsigned int secondary : 1; unsigned int init_done : 1; + unsigned int jdec_spd : 1; unsigned int hotjoin: 1; struct { struct list_head i3c; --=20 2.34.1 From nobody Sat Nov 23 04:50:34 2024 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2075.outbound.protection.outlook.com [40.107.243.75]) (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 D954E1DED7D for ; Fri, 8 Nov 2024 07:34:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.75 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731051259; cv=fail; b=ljP9AMOSa6cRbvbmg4r/JTxbMEzjBZCQMwVDXII7Ej4TK1iPP6Z5xe3yaeT4I6HXP8nQ9/pwMt5NjCyKM7mIY/YIEdbLmFdnstMTj+DFuPmcgMYSGAwQLwy3mX6CoeSfs042AJCIMzNCpNgWfuVJjI48Q0e4/1Ao4BglFLjBedk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731051259; c=relaxed/simple; bh=U1ZkqtrhGrGhdvmecPMT5Yh83U7r2uf3WzlVN/kxF8Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RjM+d3QClUqVSqGSNRbHUuc2qrsZDPzLndrGvEBbts24VQi5+gHup/W0CA58CxLI6VzLUe4b31eWC8+bIQpiPpNNl5s9MJhthWEJSegPOmlPy3Cu8deq6aeHa6EPCUhAs1E1Pop77d7/ZgOrL8YbLqByNqTVTbKMRWJuqt1ouDc= 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=uTCpvILq; arc=fail smtp.client-ip=40.107.243.75 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="uTCpvILq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GqAo/dBTI2iA0TdN6MXIwoor5xRod7jCwnPvUnrAcKxm7BshCfALnlEpv7/R4CaBhL1jzy7JEAbr4DlKg7QvuB9jTz4s7NWHDOchOnuP1CYdaInAqmDCDfn7wUtVGSeep7IRrN3Uh/23WFTAXSLPduX6sCZrzQXygMZbSSj4TucUQYdUhTPEZEg9BIfcPV0n5zKUayYE5hIyoVrsUEwBBf3byxxFqOZ7b85frls8bMwY7YhYHICgYqeGXiDat6/zFWtulyh8cOkesShDav8yNF0/vE86MTtAZxHgestWxKuKbBfTCjXmu0pWHLSPLAdXPoFX9xdv/JvITHm2Pc5weg== 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=5eLWDscx0DGim5Ucck6S9hlO6uZ6gHFYGZM9LRDe4SI=; b=WbRZdVa0yeVnaXP9oWwQl+iUYR9e3rI7lS6iz85bCR3xO1SEAfJ67AJyC1Rgdi/VIkr/mq3We/eaMrWIStLTtVUw/u9pZrrsC5rvp68406FbGLS3Pli8/mFHysbvUs92izvIShSDWP5Jpv37qhBnMl7FskGWnPlObdyE+7/SfV4Eug73qC5h1OZx8Cd//1CC6jn/sS7b2VfEWqUjl7eRVK0tPRos77XttVe+xu7zpCc5QiCIRxqVzoPrKv0NCmSdghFEjQIjUOLbfv5ii5KUaxqrMSwQu9GwLo4Nbjep5i8PFh7tbwq3svY72uOrjm/q69VVC/9YFuvLXEeifmlr+g== 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=5eLWDscx0DGim5Ucck6S9hlO6uZ6gHFYGZM9LRDe4SI=; b=uTCpvILqywTMfAZJpnsm1pN+NoSyWWS8D2ZBPWPdten3WjLIcRN32bifUZaD/KpY1dyzHxTMRjQYfqrxux8zhBKQ8Wg9SnzmES5rrUBB25+nAvmOTVFs93rYQTRNV2xfUEXAx032K2cseDtlJsv3COncwyP/OWIvc9oCTe+WMRI= Received: from BN9PR03CA0957.namprd03.prod.outlook.com (2603:10b6:408:108::32) by IA0PR12MB8864.namprd12.prod.outlook.com (2603:10b6:208:485::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.20; Fri, 8 Nov 2024 07:34:14 +0000 Received: from BN3PEPF0000B06D.namprd21.prod.outlook.com (2603:10b6:408:108:cafe::24) by BN9PR03CA0957.outlook.office365.com (2603:10b6:408:108::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.20 via Frontend Transport; Fri, 8 Nov 2024 07:34: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 BN3PEPF0000B06D.mail.protection.outlook.com (10.167.243.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.0 via Frontend Transport; Fri, 8 Nov 2024 07:34:13 +0000 Received: from airavat.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 8 Nov 2024 01:34:11 -0600 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K Subject: [PATCH v3 5/5] i3c: dw: Add quirk to address OD/PP timing issue on AMD platform Date: Fri, 8 Nov 2024 13:03:23 +0530 Message-ID: <20241108073323.523805-6-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241108073323.523805-1-Shyam-sundar.S-k@amd.com> References: <20241108073323.523805-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: BN3PEPF0000B06D:EE_|IA0PR12MB8864:EE_ X-MS-Office365-Filtering-Correlation-Id: bd995e9b-9581-4327-943d-08dcffc7be5e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?+jMP6aeMpSwkj6o21K3MpY78ciOl63HmXESR2UDGxvBvmXad8w4Y1kJeFJdO?= =?us-ascii?Q?0xpwgP+qHTGyibuvWnRng0Xt/GvjUmiwqhO0KBuTCVo8wZb+ljDxVxGGgTRg?= =?us-ascii?Q?h4i97agz/hfPOXi0x1T0k9AyRmb/V323d/X8/LxGawAaDGoIHxCTgVMSaBF1?= =?us-ascii?Q?2oLejN4/46vs0YfrnpI33mix82jY9Rew+DpRRJjWhySPQhmMF4dtkarsd20W?= =?us-ascii?Q?qp7JK4b7g2pNUQvMkDk5IssHrWPB/vPBdHKvqFc+fQZK9GkQLpJ34som+NXB?= =?us-ascii?Q?i4X45KMYxmyXSER6nPcBnURfXqa8Pf87GNRWXWrL8XR8K9antG88zwlEaW0x?= =?us-ascii?Q?FDbx6x1DVJ9Bzb+WfXbxLz/hKTTvF3sl1Z2VqsYJY4Xuvtnw9zetN3gJPPDy?= =?us-ascii?Q?GZZJNpVR2W4zoWnyj4WfSoZ1gB5tEcyCRnE/L6pWCGoQ0SFV9Yw9EPshRFXH?= =?us-ascii?Q?4RBJSmdLUe1Pa1n/oRtFWfpa8E7VvVD4p8949l7A8sn+Ubp27gP+F09EX2TF?= =?us-ascii?Q?Gt4d57ZmcDHmu5ZKoDTZKDc2yJ9+UsginbGXIe2Nvtailc8fI/8FqUrIbuCK?= =?us-ascii?Q?cu4I5Ueozlq8uXWaEGyMOsmIFa9SFpB9SxFdRULg9mqSqpsCZHH28dudbQxY?= =?us-ascii?Q?YBEQ1SpUzzJeZgCQenM5THnnBRHNKsNXTZTCtWYz2MD+JWi6B+VL0PuLsUID?= =?us-ascii?Q?ChVIl1CRw74hdMmKoFy8Em+mEG5TJKDoFXw89gwNvxMAjr59O3T4kLhkvJYJ?= =?us-ascii?Q?uO2/PsqRbDB57Jk2fod50XtDNmwEWR6KQOSmCtTpDY0hh82RAyt+ONP7DTPg?= =?us-ascii?Q?bmAPdBo+rWqRS0Rmcq99BfLF+kmjY7IkZFG6Pxq67rxBoNqAzrlULDaazDb7?= =?us-ascii?Q?hRqP8EUWdM7V2VmMKCYGAzrGLzi78mmhVbi7pWN5wP30fWJkiTukZzHhSFf1?= =?us-ascii?Q?q3nOcyk0Ui0WDpM88lkEmIR1jVcV4lpuwpk3zYfhnXNNy/FOHwnj3qua8DJx?= =?us-ascii?Q?4VnwwsbZU5O/d1a1pXy7ypTs1EnA6/+ZaL02GVoUcSupLuTglk6ip/NdAVbC?= =?us-ascii?Q?JHCyUW8qjwxn0+w72YDAVQNoQXuMVURL8YMrKoD/3Q8mNB2WJtV+AJ1wFXMh?= =?us-ascii?Q?6SVoIB1KjEyHiSBKnWcbg2X5Po5QklwpFqCfjz6dsZDgAIdQyrXybdrplpt7?= =?us-ascii?Q?HIYTs5QreACftCrjY0I4drGHlR1FbQ49u0B758edBJq5e3ESQuTSPz7yUqGY?= =?us-ascii?Q?7MfVa1xO2qNhETjlvoZ9QtopbzFq9C6EEg+wwiYfMvfqhIGq0e5JNrz6ruaM?= =?us-ascii?Q?r4+YCozgm72BPIvARaBtISnsMQsKYMSP5UPR7iPcto4XnWzgSF4aYUea7vaH?= =?us-ascii?Q?ZXuC0s1L/BVz0PzALNwdyW17NdJ2FEKR2ht+MHCb38Wvcb7Wnw=3D=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)(1800799024)(82310400026)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2024 07:34:13.6586 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bd995e9b-9581-4327-943d-08dcffc7be5e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B06D.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8864 Content-Type: text/plain; charset="utf-8" The AMD Legacy I3C is having a problem with its IP, specifically with the push-pull and open-drain pull-up registers. These registers need to be manually programmed for every CCC submission to align with the duty cycle. Therefore, add a quirk to address this issue. Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K Reviewed-by: Jarkko Nikula --- drivers/i3c/master/dw-i3c-master.c | 29 ++++++++++++++++++++++++++++- drivers/i3c/master/dw-i3c-master.h | 1 + 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c= -master.c index dc701275485a..029f81729333 100644 --- a/drivers/i3c/master/dw-i3c-master.c +++ b/drivers/i3c/master/dw-i3c-master.c @@ -220,6 +220,14 @@ =20 #define XFER_TIMEOUT (msecs_to_jiffies(1000)) #define RPM_AUTOSUSPEND_TIMEOUT 1000 /* ms */ + +/* Timing values to configure 12.5MHz frequency */ +#define AMD_I3C_OD_TIMING 0x4C007C +#define AMD_I3C_PP_TIMING 0x8001A + +/* List of quirks */ +#define AMD_I3C_OD_PP_TIMING BIT(1) + struct dw_i3c_cmd { u32 cmd_lo; u32 cmd_hi; @@ -795,6 +803,12 @@ static int dw_i3c_ccc_get(struct dw_i3c_master *master= , struct i3c_ccc_cmd *ccc) return ret; } =20 +static void amd_configure_od_pp_quirk(struct dw_i3c_master *master) +{ + master->i3c_od_timing =3D AMD_I3C_OD_TIMING; + master->i3c_pp_timing =3D AMD_I3C_PP_TIMING; +} + static int dw_i3c_master_send_ccc_cmd(struct i3c_master_controller *m, struct i3c_ccc_cmd *ccc) { @@ -804,6 +818,13 @@ static int dw_i3c_master_send_ccc_cmd(struct i3c_maste= r_controller *m, if (ccc->id =3D=3D I3C_CCC_ENTDAA) return -EINVAL; =20 + /* AMD platform specific OD and PP timings */ + if (master->quirks & AMD_I3C_OD_PP_TIMING) { + amd_configure_od_pp_quirk(master); + writel(master->i3c_pp_timing, master->regs + SCL_I3C_PP_TIMING); + writel(master->i3c_od_timing, master->regs + SCL_I3C_OD_TIMING); + } + ret =3D pm_runtime_resume_and_get(master->dev); if (ret < 0) { dev_err(master->dev, @@ -1610,6 +1631,8 @@ int dw_i3c_common_probe(struct dw_i3c_master *master, dev_err(&pdev->dev, "Failed to get acpi device handle\n"); #endif =20 + master->quirks =3D (unsigned long)device_get_match_data(&pdev->dev); + INIT_WORK(&master->hj_work, dw_i3c_hj_work); ret =3D i3c_master_register(&master->base, &pdev->dev, &dw_mipi_i3c_ops, false); @@ -1683,6 +1706,10 @@ static void dw_i3c_master_restore_addrs(struct dw_i3= c_master *master) =20 static void dw_i3c_master_restore_timing_regs(struct dw_i3c_master *master) { + /* AMD platform specific OD and PP timings */ + if (master->quirks & AMD_I3C_OD_PP_TIMING) + amd_configure_od_pp_quirk(master); + writel(master->i3c_pp_timing, master->regs + SCL_I3C_PP_TIMING); writel(master->bus_free_timing, master->regs + BUS_FREE_TIMING); writel(master->i3c_od_timing, master->regs + SCL_I3C_OD_TIMING); @@ -1757,7 +1784,7 @@ static const struct of_device_id dw_i3c_master_of_mat= ch[] =3D { MODULE_DEVICE_TABLE(of, dw_i3c_master_of_match); =20 static const struct acpi_device_id amd_i3c_device_match[] =3D { - { "AMDI0015" }, + { "AMDI0015", AMD_I3C_OD_PP_TIMING }, { } }; MODULE_DEVICE_TABLE(acpi, amd_i3c_device_match); diff --git a/drivers/i3c/master/dw-i3c-master.h b/drivers/i3c/master/dw-i3c= -master.h index 219ff815d3a7..c5cb695c16ab 100644 --- a/drivers/i3c/master/dw-i3c-master.h +++ b/drivers/i3c/master/dw-i3c-master.h @@ -50,6 +50,7 @@ struct dw_i3c_master { u32 bus_free_timing; u32 i2c_fm_timing; u32 i2c_fmp_timing; + u32 quirks; /* * Per-device hardware data, used to manage the device address table * (DAT) --=20 2.34.1