From patchwork Wed Sep 11 11:53:59 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: 827553 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2062.outbound.protection.outlook.com [40.107.237.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 C5EAA1865E2 for ; Wed, 11 Sep 2024 11:54:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726055690; cv=fail; b=dLWDXxEiTG6/FdwmVN4EgQi28xkoLvlCTtcEKQpA2z3cKGUTie1DHfhloMF0O/A9sVN732xCFxkZWh6ocZHIHLFGI6X2xnm3mjZQbu/XOn5bbZra9dmpD1+b0dvci3qPhGY6Tkd0L4EXhQADZfkAd6qhGfudFg+mPQgUvs7WWaA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726055690; c=relaxed/simple; bh=HUMGZbNFlrGGDk76q03T5dP5T1tmxDdKKSUauMjFuyk=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=NNgAB8q5WuIyVCDsL/vwc26dhpdRwJo3RDi98J9KISGz5EIXAKJpf9hBT6Ijp7k9LYZVwGDrOXaEAxNBf5H3NiBhiJnbrB9vmBOO06XpMSfAEoTIKqPIsSR8egu5uIph+umFzmemlACdEqVbQv1FyRynRZOew/i2iotEjxnu9Pg= 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=TWOi911u; arc=fail smtp.client-ip=40.107.237.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="TWOi911u" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YbO7ziwsnk8LrCPrL3M+Vusrm+NLc8yv30NZsm8+kvwyKGvjRncqq98tx1tSbzoWJjvq4492xMdViTc5mvx4rX/z7o3hUSt492okugdjvvPeItS7lTvND3OrmrPA2fcwAYd+7D1UygndRKx/umowndoADhJeIpfHdZ0TwuMSCkuuGNUFLzI3AgwjHSnHZ+TU6rmMgU8aUTBEavyLIx5GSbGPqW5dwzAT8vDNrxbEQT6T8i5oO8IFanlxX2Cf/GJ0XJLsK8Zx14wypxFPYiR14vgEK0YGx284q9dCiPrJX7CKkMo+grOnJR4WQOsmIYWe4lHvm0Y51zw3xo35pVXjWg== 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=EfCMs2OWerD5mULAPc7t1wTXiyxqLYFLWRBtR6ECoQE=; b=I+nNcSv8pBb2Ihi5Jbs/cl0f/Yisfq46TYl/+YgnJDo648rzgYcAFgSduPxThH8g+HDcfM1SOzKqQYgmSD/bh3saXFWBYZvVnSPBQ541XPKZGrfaB32MpuAUDxZ8Yw3JYdHGer9tbPDWWH9ryAdEJI9C1fXeaFUHNa03c18G/rmE76jNo3i55d48w5BOMFPopypi8jHd1cDa8QwvM95IYSGPUNsXef6gE1mnSH7w6s8Sa8j+0JSEx+11JH5L/EckKeS7gDBcmhtaQoDym/ACRDxhJxV/Sgu4z2osQV8Pj2RTrAQGdkRXx6ct9mwHAfp7sUShGkQ+gyGPpumFdMD/Ow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.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=EfCMs2OWerD5mULAPc7t1wTXiyxqLYFLWRBtR6ECoQE=; b=TWOi911us1jAewsrREpJBM6Pb7IHBCkSSe6mcFM2PrLZjmM3BgVdEc6Ibjwf4Y6XQwS5r9v/W0gRg1qv3oyFMc6M9wP+wAwsaGxL2rBh6tP5ZgN2QBg0pl2XWOS5qMU+AKFI4zyJXs4Vu6XelmxiNNB8xaC8ODoq5j0XM7kpq4k= Received: from BY3PR05CA0047.namprd05.prod.outlook.com (2603:10b6:a03:39b::22) by MW6PR12MB8708.namprd12.prod.outlook.com (2603:10b6:303:242::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.20; Wed, 11 Sep 2024 11:54:43 +0000 Received: from CO1PEPF000066E7.namprd05.prod.outlook.com (2603:10b6:a03:39b:cafe::3c) by BY3PR05CA0047.outlook.office365.com (2603:10b6:a03:39b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.23 via Frontend Transport; Wed, 11 Sep 2024 11:54:43 +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 CO1PEPF000066E7.mail.protection.outlook.com (10.167.249.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Wed, 11 Sep 2024 11:54:42 +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; Wed, 11 Sep 2024 06:54:40 -0500 From: Shyam Sundar S K To: Jean Delvare , Andi Shyti CC: , , Shyam Sundar S K Subject: [PATCH v4 0/8] Introduce initial AMD ASF Controller driver support Date: Wed, 11 Sep 2024 17:23:59 +0530 Message-ID: <20240911115407.1090046-1-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: CO1PEPF000066E7:EE_|MW6PR12MB8708:EE_ X-MS-Office365-Filtering-Correlation-Id: 47afafca-7548-473c-6850-08dcd258862b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: RrnGxT0DgzJ22X3hcJVQTi55eHm3KBPU81A3gw0rRL6zLVjY02Kw8KEViW+vLwnbq9In86kPiBiNRfKBlV9kb/jr2yKz1nN2mGChFETY1W25sEtR+SAi4L/aLi75wSbfeTCSwdut9OO43BmFPercGqnskoHJRNOGdvlXMyO+e6XX846biQXdyMZ8Xe3Rqjxf9yD02nWTywUACiZpFi9ykmcly0TJS1z3DR4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R8SI44APQmB4RZoVU3kRcWe1FJFIEzYYhbBySVzO7251IjvUtjWWJwfLRxqnWDP1z1UzsbuATirkU0MSm9lBQAWiEuQcqVnFjJWcnJCm/zBPAvKf7Nocy6xWUUhovKq7CM6irNhoy7tckwS8IFVXixxV0Jl60uZy9vD 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)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2024 11:54:42.7839 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 47afafca-7548-473c-6850-08dcd258862b 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: CO1PEPF000066E7.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8708 The AMD ASF (Alert Standard Format) function block is essentially an SMBus controller with built-in ASF functionality. It features two pins SCL1 and SDA1 that facilitate communication with other SMBus devices. This dual capability allows the ASF controller to issue generic SMBus packets and communicate with the DASH controller using MCTP over ASF. Additionally, the ASF controller supports remote commands defined by the ASF specification, such as shutdown, reset, power-up, and power-down, without requiring any software interaction. The concept is to enable a remote system to communicate with the target system over the network. The local network controller, such as an Ethernet MAC, receives remote packets and relays the commands to the FCH (Fusion Controller Hub) through the ASF. Examples of these commands include shutdown and reset. Since ASF uses the SMBus protocol, this controller can be configured as a secondary SMBus controller. This series of updates focuses on extending the i2c-piix4 driver to support the ASF driver by exporting several functions from the i2c-piix4 driver, allowing the AMD ASF driver to leverage existing functionalities. Additionally, this change incorporates core ASF functionality, including ACPI integration and the implementation of i2c_algorithm callbacks for ASF operations. v4: ---- - Carve out a separate _HID driver for ASF - Export i2c_piix4 driver functions as library - Make function signature changes within i2c-pixx4 driver - Use dev_err_probe() in probe() - Address other remarks from Andy. v3: ---- - Fix LKP reported issue by adding 'depends on X86' - Drop callback when using acpi_dev_get_resources() - Address other remarks from Andy on v2. v2: ---- - Change function signature from u8 to enum - Use default case in switch - Use acpi_dev_get_resources() and drop devm_kzalloc() usage - Fix LKP reported issues - Address other minor remarks from Andy and Andi Shyti Shyam Sundar S K (8): i2c: piix4: Change the signature of piix4_transaction function i2c: piix4: Move i2c_piix4 macros and structures to common header i2c: piix4: Export i2c_piix4 driver functions as library i2c: amd-asf: Add ACPI support for AMD ASF Controller i2c: amd-asf: Add i2c_algorithm operations to support AMD ASF with SMBus i2c: amd-asf: Add routine to handle the ASF slave process i2c: amd-asf: Clear remote IRR bit to get successive interrupt MAINTAINERS: Add AMD ASF driver entry MAINTAINERS | 8 +- drivers/i2c/busses/Kconfig | 17 ++ drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-amd-asf-plat.c | 398 ++++++++++++++++++++++++++ drivers/i2c/busses/i2c-piix4.c | 54 ++-- drivers/i2c/busses/i2c-piix4.h | 45 +++ 6 files changed, 489 insertions(+), 34 deletions(-) create mode 100644 drivers/i2c/busses/i2c-amd-asf-plat.c create mode 100644 drivers/i2c/busses/i2c-piix4.h