From patchwork Thu Oct 17 15:03:25 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: 13840176 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 8F25FD374A2 for ; Thu, 17 Oct 2024 15:04:09 +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=mALFPuWoPjmZlSw5Dvep7QeQOruPn52dCii+Ly5KntQ=; b=F5QgpKUJByo3U5 Wqg5qwHZzbpcd345uJ18kBd8uM9tSYDpsqUMtUdIKwwiVbFhppy0lumm48cYU5HJvbXss0f3KSK/W NKPYnTme6axwph3EOo6jsB05NVXaBMARP9HH3qmMjHp6rN+E2NAqDFDk8cfjQIQQjQClqUAmwfiIr WhPO7sQrrlhKzBeniOvWkIqllTIn44LRgD4yBaurByB/Eh973cTbz6Hf3BaQ5HpwenHz3/ifwoCQU 5SK9Cy9JuNcZ4TrCDRNCqN/8m04BKXjn/8g/3qm/OMKc2wUJEPIjebUkACyuCm1D/eodWP1OApPmg VzQms7u+X+6psZy5NT1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1S2r-0000000FDGJ-1Grj; Thu, 17 Oct 2024 15:04:09 +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.98 #2 (Red Hat Linux)) id 1t1S2j-0000000FDBH-0iCy for linux-i3c@lists.infradead.org; Thu, 17 Oct 2024 15:04:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MeogcvnoRBLcZ4x7AGuVQBsv0Se4RngHGL8MF3MTVr6DYu7mKKqDGsQOoIIiTN+HbNcMmx2PiICGC1ZgfGv/ASigbaVm5JRDiMLB/DibSF2EaTw13e5FN13Ua2IsIi76MlcXv9tTXtzoLLr1v/nBYMPEQtdHa6j2UlZVM65vQDDJ4mJYkPrztsHLfKGk0jCyeXxfm29KYvsl/cHZr//gH0batudJZqpfSQGdehUB9jb5Nas1l/cG8es7uJMXo2FErr1wTkh5QQJMmF9TokR1qeM+3AzfTmNu7UP0ZFxQys33g0h/Uu51WbiperWdZ0Zl2ZgRQV3mTPC1E3Y6P8CsLQ== 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=KAS3D99/CLw8Z/tcryy8K8PwTVvnGGa6jU2y35kr1v2aTNYmXIY03EXGYuEtOdxowcC1e+lfbEyousaSLjSmWE+rWGHzs3LLccV1lIW0xBAkfQtPod8lE4MwzQtJkNBzRil+lRMVGWw/0X2cFUqszBYr4d/cKE2jmTdIfy9j63UQrqd0FwTgzGjHtBsyTbECgT6DJpjSy1tb1yGNsYvUtc5dlkY3G/3XJa6+XXIoGdRIgVGpDmG6zwCzlrxMYCx/MqwNXJ4aghFnwBaXfztjkHg0ui4gLcgpxsjzmug2SPD7BdMfcN4KIHYpsBWfaofy0Yl+4s5/7CU74CU/XgSrQA== 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=jZ8uG/ixv7TeFXNy7+14eJH907cLIQJdXJdxB9iuOACuskoXK89JrjxZOqI8kA9jH4slJ6TnJn0ErFZ5iEvu+Su5TAwU1XJNVHuvmeak6RzFGkRHlfsjFeSJICYTsqayynWV6sShhdTxxoAA1s0Dtc6fEUGb154U8sNuU8rUpbI= Received: from BLAPR03CA0138.namprd03.prod.outlook.com (2603:10b6:208:32e::23) by PH7PR12MB8121.namprd12.prod.outlook.com (2603:10b6:510:2b5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27; Thu, 17 Oct 2024 15:03:55 +0000 Received: from BN1PEPF00004688.namprd05.prod.outlook.com (2603:10b6:208:32e:cafe::76) by BLAPR03CA0138.outlook.office365.com (2603:10b6:208:32e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18 via Frontend Transport; Thu, 17 Oct 2024 15:03:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN1PEPF00004688.mail.protection.outlook.com (10.167.243.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8069.17 via Frontend Transport; Thu, 17 Oct 2024 15:03:55 +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; Thu, 17 Oct 2024 10:03:53 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K Subject: [PATCH 1/6] i3c: dw: Add support for AMDI0015 ACPI ID Date: Thu, 17 Oct 2024 20:33:25 +0530 Message-ID: <20241017150330.3035568-2-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241017150330.3035568-1-Shyam-sundar.S-k@amd.com> References: <20241017150330.3035568-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00004688:EE_|PH7PR12MB8121:EE_ X-MS-Office365-Filtering-Correlation-Id: aea2ad5c-0bd2-48cf-5384-08dceebcebcc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: om5+FwV3xyTJAzik/NUFlY1QFuaQqrACPMa76ydeYyIfnViD6jn9vWgLDoKod/eJvkcIAdvgROURnL6iB4lRThWGO6kHUuNUwUNqwNTT7yGQLyzHL2Nm6VkKH+NEskK3i52NhmlpT5Sqc30wpphKt3J5wpNRrbrad9MNC7n7OgPWz4QmyC3QHvSnUbQ6mrzVbrn4efBoM+5a6t9Tc8favPZZede2U30X1Ova0C52wBAGyzdglHt1wDRE0rkZkmkjU2Yho9YYWIVUWZoDjP+98/5779UaL7SeD8wI6nI+6BqDVNFusCpMtLHktHK4KUMPNdmF8uSkDIqKjzZyZjTJg5pA/M5pn/Q8cGDDWMYWV/9j0iFVHnhE9smdRk4WxAImNy87ynb5RnS4Y6TYkeBR0CMi9HLNRVSwavB2+ZgF9aiWmF4Nn2SSO4s3vOsAxpTemVt2eLIMGCqJBegYIxkPtv+k8EBrUk7mh1YgMZAG1wOWFLLTaBOonBKgLeaer1cJ/dKmisH19RmraRQE9+8YSLxMHg8ZgL21RGQVZDh19waWwhZqFhBcczuQxCF5A8gUsKLVaQlB15Tbo4YLKzG7OOycMkPMNf0FgalFx8CeGA+k3jCUF4LJtXwxXIn6OLwtRGYorKx1lYsNNW5gBE49DtK2ectXKYH6e0+x59fq4XY8asE+WaHht/jJy2IDExSsAMPFXAZ2DFUw7VZTL2BzSaqdCB5ESv9gXQNIOkV2umVC7HnTh1yS7o/UsNdxp8Mt2TumK1+2aWEKyAR4as/hn1C0F7OSVPa5ei/vtWsT5fqUL2WuyL/oPMAGdTuMA63xGJqFMtU8Tkrk9BkgcmvVxDSNekZnQgxqCHJu2pCFuBVAbBsrdV/N/vWjKU4cUNp3rDKfUfafUS/dgJD0Wqj63QIcJZ3TVl++DfTLpjBasyqgNME0X4NE/qITXKFXbvYL3VM/KAl2huUdKyG3wjPR2TipjRo1z9e+bf/CCkydoMaRKtJHJfmbJo0ilJTF9r74wdYFUj7C2M3tKImDUisJ7spuKHU66JdB5hiwgOpu3VWqRzYtPiSQ8GGPyWp+MJP6RznSX6nbmyL+Vdwy7EKXo7RQG+XRwjl1+bxXRE3vCsrt9Z0n7ILf8lBEeHoe06dMFA4/MysFATZzt+5saZSSqI1ElGECtbtdFzG+rBdGidomRDyGammoBNHorFzTPyxPyGTPgQACW2EYNA7KG4z3nOKfp9/RiLDR+dMCyF5jtSR4yyiYXKgVOs9KP3y3zFJeQCZ4KLGJuVFWLNruY57NVBKWoIxzmeF4fgbICGp4X5uK1AyIUZkZgudeIZEBygs8kd/auhfZoJiE7aP7wsDV+HdtunGJr5PCVjutx2fDmHlPkjy+4lpehirGkc3bx3eo5CtP0yIASrdB9SS29p3TFQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2024 15:03:55.5660 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aea2ad5c-0bd2-48cf-5384-08dceebcebcc 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: BN1PEPF00004688.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8121 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241017_080401_231751_FA09FEC3 X-CRM114-Status: GOOD ( 11.56 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org 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 --- 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_match[] = { }; MODULE_DEVICE_TABLE(of, dw_i3c_master_of_match); +static const struct acpi_device_id amd_i3c_device_match[] = { + { "AMDI0015" }, + { } +}; +MODULE_DEVICE_TABLE(acpi, amd_i3c_device_match); + static struct platform_driver dw_i3c_driver = { .probe = dw_i3c_probe, .remove_new = dw_i3c_remove, .driver = { .name = "dw-i3c-master", .of_match_table = dw_i3c_master_of_match, + .acpi_match_table = amd_i3c_device_match, .pm = &dw_i3c_pm_ops, }, }; From patchwork Thu Oct 17 15:03:26 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: 13840177 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 CEC37D374A6 for ; Thu, 17 Oct 2024 15:04:12 +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=W6Df9hWmrAQ08076ijMn5ZKHMzQjY+l8cvoxpRjtHRw=; b=VGv3xrWi/avEvt Rwh0uhsIQNldXLjgsx5XCEHcgMhlYfcqNiSQe/CmJpy+yjHyZ8VKhv8oOurs1VKbWUUnC5elSK2Su 7ARLseKvuaqobLPM0Fe5nPsu8pDpGsHHt8YAACTWsoBNd1qJT74Yu1nZXMvF14jxN4zRZqRRDPxcg 2SD7mnYM5Pev8FcPypdMKLLkZshwEjB0CZcpe4XP0paNzpJ8eJdWcLQLf5AWIXc3SZ7W9p4jlJJKk /BFcRGAP02TvRANG35lb1yzDAoj/eZIeARzdLbFn3fiNwe59lQPz4nrgEdHiL195HnLmWwLeqsmop A+iyD4p/7yJb8qt/XQwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1S2u-0000000FDHx-01N2; Thu, 17 Oct 2024 15:04:12 +0000 Received: from mail-dm6nam12on20620.outbound.protection.outlook.com ([2a01:111:f403:2417::620] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1S2n-0000000FDDX-3KOC for linux-i3c@lists.infradead.org; Thu, 17 Oct 2024 15:04:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=f2zAEH5g9iF/2TQZvLdZx8BkcKy0Cg4bUfwl/PEL30ecr94pHYawUJ7YEaAqQXcjWYlfVbU1Z5N/5XvaicQpdA5HCZEYdoARqPU53opUkV153ePovKycqw8lOycvw8lM0FdB+mGnlzy2Ke25Nrhh3amPwRcW9bJ95/c/ddI0U+AW/U+JiQRaNNBB/4OE04+9oceFrnhw5ShqHZ6trXIJP9aR1O0mQhAx/YV04T2JDZ2rLXOXREMDE2pGhiMc+25Gh5xfG6pnE9/9HyrF56thKigFk9OOnFXJR6lfAPzSZ38WN2bsksonM3xV3smUG/4xwnl7Nb14Uh8g1mzTZlrJ2g== 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=2eS3WcoEO94epiLm8nqRo+FQ7Vh0tmifhbEMUh1CaXA=; b=QyESInqCZ4pJ8tjjtgMZ99LweuKxWp8Jw77ZErmtX91ZRP1ntRQXz9QGz/+9b1xovWptmoR0sJ7nng42o8yApVwd9nctjrvJNtKMf12880CU4Fnw2GE9kox0S92IX7lqXV0weEL4+hznMBeLPDbvBGA5anHHGcuzGY2oy+xeF6FajLohkeOW8xlshPA2iRQJR7bT3dAUVEWzBf94V/rPKquWKj54x2AbXmUDKrSv66J516y/86oChPRkLpqbsbQ7lS0iaW41fRfc5AWirDPKmt0V1UfaGx/w6WyDDXjcQCpsmg30xzky22SyKBnaxY3YkBaid3KFSm5BENrWf3yW+A== 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=2eS3WcoEO94epiLm8nqRo+FQ7Vh0tmifhbEMUh1CaXA=; b=M7eu7Uf4t0HJEKDCZbeMpA6qz6RhJumCR6md4w6BX+LEl2cgxvRyNzuz6PdDIOyc1fnyXuPNsAa3pAfdVjw0xarheRoQ8r9zGnlcMWZmwIEc5lmrifoPpZJAKV9t1TqPEoHVPljSQXtJ1bBo5Y5BsNqf3EwusiWXfmhdhIvNqC8= Received: from BLAPR03CA0142.namprd03.prod.outlook.com (2603:10b6:208:32e::27) by CH3PR12MB9078.namprd12.prod.outlook.com (2603:10b6:610:196::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.20; Thu, 17 Oct 2024 15:03:58 +0000 Received: from BN1PEPF00004688.namprd05.prod.outlook.com (2603:10b6:208:32e:cafe::ce) by BLAPR03CA0142.outlook.office365.com (2603:10b6:208:32e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18 via Frontend Transport; Thu, 17 Oct 2024 15:03:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN1PEPF00004688.mail.protection.outlook.com (10.167.243.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8069.17 via Frontend Transport; Thu, 17 Oct 2024 15:03:58 +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; Thu, 17 Oct 2024 10:03:55 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K Subject: [PATCH 2/6] i3c: dw: Use IRQF_SHARED flag for dw-i3c-master Date: Thu, 17 Oct 2024 20:33:26 +0530 Message-ID: <20241017150330.3035568-3-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241017150330.3035568-1-Shyam-sundar.S-k@amd.com> References: <20241017150330.3035568-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00004688:EE_|CH3PR12MB9078:EE_ X-MS-Office365-Filtering-Correlation-Id: 77ebe8df-3885-4d95-53a9-08dceebced72 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: T6MXAQOMASExDiKhAlrjx9XSaBjkw5paqfDonJ8uwWZD4cs/SbLwwtQzMxFWnAwcBJr9nk/ijSWJSj43kzppdJ0fSfxT1g8Idc9EGEcDYGEE2nosOW0W9ZQDqfo1X9Po4q9unmFd2my4AVMqXMu9oQ1sfxv6l1oZqKPIandxhL2fW8IOy6c291U6W2zeS07rbA9gUHJ8jJOvjw47rV39CQe9a5KjnlGSHFc6/N/sIqiZEH9iZbMxsx19/dNyibZeAeDS0LOxspKtkVVErHy43hhDq8PyHnKKCPvDq0dpQt8JuirevoRrYkJO4FYift/NJXp161f2ySfKsJ4ScL2Cq1C/tX0eRiS1MG8+CYbFou708LYov700EhQtzaNvWaX0K9/W0xmj/iZOufnOLwm8JJ3zgLFbGuMa+vH/nqSvyHvflrx3Iikbt+ScwVrQojSfv7cTC+Or2BAZKuy13K248vBG6hbDgH/OnCHAeJylQK2f9B/k8LVu2RnnQy8NGdLR1y6D5Cq/Gp/Lx+30qnBLKhck7acNJ49lOKR8WuJ3RiMYpIQRbgtq4P2S1YaVYjPSb3dd/TFTJoUpEcoJqwFKFBgP2qnLph3pDVmR2EY3DxomRsTnBi8Jj64oJsDqIloz3KHD3qMQBZjrYEm3X4/0WsvqijM2Zmw63Tqhoiz8ElS3WYdYEdA0h2gPoZvHN2A4GR9KXGojxHymjQv/DB+6YMkpv3N1FDFKHl3xSahZ51XUi3XhSa+uQ4zW9vNTHOzw4TjTNjpdjsKXzIy4Asg5C+7gXD0fY1nS83h+GwAbR9bwyEnVfYWR6Q1JMzmB3XxRSfIfp38CcTK91tE0tVf1dtHF5UhG+R9hTX31PFqrsVSlD+zMtxNvDxzEv/A3Otyrpn7148HLEmTSXCHvuI/YH+SucoqsS91IZHsIyDCjIRqeny2yUehnN8armI5qtVqGs1z4fcpx7xSJxJ++qRY3H4OjD/MJad3BLWvB0m6yzqNOeVwFxf+DYIWcMd9IAuNDX1k7zAVtELqkG/Nuw/Wfo1dOOLD39CMVIqKBPTC9hHESpwi+ZJkOxvimDjf2jyJAbTfw+a7FSCnHhz7TnsGSFbG9gX9GIDpDS+Js+8PPqulf61RKG4sSN6+KJxdgIsdkniHQrlQs7ZJ/8B6WtWLssc6n4QltO2fMaLlmvl8dEaBVOZhO9L/CfyrK3D1EyFkxdNZZR+S56yd8RqlB8FvgVTjQ+q71jDP89HgerAYTsgkrvYqrXeHOTfwxmvLm/uabsNOR9GlwlYxjFm1vSbFjRJ63jXW/ZWESiHXN4dQx5ETWT13nMKREe+IQ1c7I09y3RLiabqSl29pQn6Lzi9jLZOLiAcbv3fjTwHRRn4kPy3MdzmH8oqgJtwl5KBh3fwmCS0XGXOH+vu8d24L7y6Cp4A== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(376014)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2024 15:03:58.3316 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 77ebe8df-3885-4d95-53a9-08dceebced72 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: BN1PEPF00004688.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9078 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241017_080405_859477_4AD9C58A X-CRM114-Status: UNSURE ( 9.98 ) X-CRM114-Notice: Please train this message. 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 On AMD platforms, the IRQ lines are shared between two instances of I3C. Add IRQF_SHARED flag during the interrupt registration process. Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/i3c/master/dw-i3c-master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c index 1a7c300b6d45..fd58a95ae1c3 100644 --- a/drivers/i3c/master/dw-i3c-master.c +++ b/drivers/i3c/master/dw-i3c-master.c @@ -1578,7 +1578,7 @@ int dw_i3c_common_probe(struct dw_i3c_master *master, writel(INTR_ALL, master->regs + INTR_STATUS); irq = platform_get_irq(pdev, 0); ret = devm_request_irq(&pdev->dev, irq, - dw_i3c_master_irq_handler, 0, + dw_i3c_master_irq_handler, IRQF_SHARED, dev_name(&pdev->dev), master); if (ret) goto err_assert_rst; From patchwork Thu Oct 17 15:03:27 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: 13840179 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 4D1B9D374A4 for ; Thu, 17 Oct 2024 15:04:17 +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=xYvS7pyQUcldhrJ8Cl11wguf/MM7njZDAmYTdvzR/qU=; b=SEDMRaZ6K4u/NB ayPDug5w2+5m3XYjzOGyBdt3gbrIhOopYpVdzdEXdiKCtsUJuYWH9LUgZt3XRN8ubDanbQTDpUsK0 JEWXKPE7LVBP2gKvo5frkr6MmEJkSy4GhjweFKRrNVHR/WHvU+F2Ye6y+jgzb2N6XbG2zOa/nzJxY g9dc8MpEiGp/BR9rHkl25p6FGevwDVETTjPInHZTOweWsSr7pScUpHPF2biIovuwNb9x1PhMQr8bz 1OnWDQHPt3FXnxQHGgyTfX6Vgehu0sDx2XVxGjMbyGrhkHAgD9/0w/WZP5m7b7ojdAxwcO0q3M2mm ARBvHDS+/E4V5hu5P68g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1S2z-0000000FDKl-01e3; Thu, 17 Oct 2024 15:04:17 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1S2x-0000000FDJI-2F21 for linux-i3c@bombadil.infradead.org; Thu, 17 Oct 2024 15:04:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=fVBjuBGrxHvcx1b1cr3bkjVTxT31oAUSYIWliWUFSsk=; b=LKAzkFjXi+nAf8uABYIs4uPiIJ XgYUGArsvu9IVQ7upOlO5uRk3d1OfX+Dseh07vl/qr1Ni8JBcx1Pj/sv9BSJoNPIwdNAMreaYJO1Y /2jXwaczzzAMSzzZdgi7pEz8jWMPsvrOJwAjbYEMgRK03Kfylq3+1y1iQ4668jb1VjZBk5hTh0HW+ 5iBS6RUHHTegJ0sDE1+v3CIeySPcOU+WL11RJ428itGu2WzokW3Wxw597tyl/3OZ41gJHpgCsJ6Lh oj/k0/0Ol1khFRBOQZA63Icvh01MR3ZdLApdaQ7rox3rvTPvJt0qaLojL1N+Gwf+gJn11eDV33o2k L3gslWRw==; Received: from mail-dm3nam02on20613.outbound.protection.outlook.com ([2a01:111:f403:2405::613] helo=NAM02-DM3-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1S2s-000000078JZ-1ECd for linux-i3c@lists.infradead.org; Thu, 17 Oct 2024 15:04:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ugme9+4fIvwis8eWcV2zzD/690LKg2tNvGXVZYsILWI4fJXJBnKYilqGzqM9aQjAzVAFpOqMlhbzUB7twgMsZAaqgRORR5uzPVxnI92Fu58Dkf1/jzAXq9y7Zq5chTnw7M3F9Y7KMAp79P0TfPHjp1PRtg3Fwy7zdE4dB+kiuWZxiiWg6KBebSkXyLEC7ByY0VMnDJMl21bPPgHUDt07RU7tvRsNa6QEZ/rnhYTXMBM8kqT5dBZwkdZsQPvx5QRJQUDMVhj69y39NJoxWydwRGkBzB8wnFI7eO3d7vZHSAmAgzcl01lTblah3mVjVfz7uUVIexPo3NyMLMzUkTebfw== 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=fVBjuBGrxHvcx1b1cr3bkjVTxT31oAUSYIWliWUFSsk=; b=FB4RlRa4sT6/euQJ8QAg2ba/RbLrpx/TjCkC3kD4JiFQL2tA6DTBt+0v1gpgGXtacbbTzUHvLqfp1E2eVm5LWOgdG9tAlgYMHWwP2J0DuJDKk/FBcjm18lM1joooc1D2tSAQTKFrpbOlS0P5JAsrdYkuYClT6iZ2t91dl7ccMyVOHkFmdpaZ1pl6ylNzlFy4lKM5/eIof1BvSL6MFJ0v8yeff+/2vD+19uwSMZzU2q8LrzIyWPb9udI1oxDijivZ3DBkZGlxyY3lwuC1qWmGWTWdMRCLt1n6MdYacg9XOVO6qc2fk3q7ghhXQpVoK07398cj5A8VgtkUwAqlao9QHQ== 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=fVBjuBGrxHvcx1b1cr3bkjVTxT31oAUSYIWliWUFSsk=; b=0WkSF/yjDb7gHfwQ3wi0Z4n5s5D4Ns+qO/BTgA2HMf0AyXWMPQq1RgtGHdmb6T9S6h0U7IglxCGduDUAhf+cGeysMFwlry+vIO0RuTOygCg3qY3F0wgJdGCowjXK/Y8RC3AYirK1sFMtOcZTLNa74HxKPsGKgI92TYZHDzQLq3E= Received: from BN9PR03CA0500.namprd03.prod.outlook.com (2603:10b6:408:130::25) by CYYPR12MB8856.namprd12.prod.outlook.com (2603:10b6:930:c0::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.21; Thu, 17 Oct 2024 15:04:01 +0000 Received: from BN1PEPF0000468E.namprd05.prod.outlook.com (2603:10b6:408:130:cafe::1c) by BN9PR03CA0500.outlook.office365.com (2603:10b6:408:130::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.19 via Frontend Transport; Thu, 17 Oct 2024 15:04:00 +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 BN1PEPF0000468E.mail.protection.outlook.com (10.167.243.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8069.17 via Frontend Transport; Thu, 17 Oct 2024 15:04:00 +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; Thu, 17 Oct 2024 10:03:58 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K Subject: [PATCH 3/6] i3c: master: Add ACPI support to i3c subsystem Date: Thu, 17 Oct 2024 20:33:27 +0530 Message-ID: <20241017150330.3035568-4-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241017150330.3035568-1-Shyam-sundar.S-k@amd.com> References: <20241017150330.3035568-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF0000468E:EE_|CYYPR12MB8856:EE_ X-MS-Office365-Filtering-Correlation-Id: 6c1c2469-d2ad-4739-8024-08dceebceec9 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: EduaW7kp8q4qcKoU2hjezDXB0/F2YQcqil8kXq3hHZvgsdl5IQTe8PpYSQMGPNggDcQ18QHmHoU3tl4xKjLDxR+kuQ9Bb7iGH6JQHp8dBLICnxAdFPa8eWCDIhPbW9kx1xaQoUKQNmxBxQR63FuVYzZbrIpbqfTrSjtJx11fF5Zejv92pLpaTU37oU1t3erPG6/nME02w2wrP6m/fb91L/atozgfilP7s9I6S8DNGXHzh6cYasTEQK4engmfsAcNmQWx9m2OQNFxSUTjK1y3KBpnER7kWDpfIeoXLOafG/mpMuVxKGsU5brkIi2w9jim5JZ2nZw/dQ8hLWfQU/YtMNSZmileTCpAyunXGlV+CirkGd0IxavdcxghyRvnnX3W+BasYmdnJCB0s+mp0x2eF6C6F6DPts8TsPgI99CGPrQrlF96MvREll9AOnEfF3dUGweuflJcUOuX00Pk69+baMQBvAx3l/DHUWEG9hn6coAc4ymXNk+xUAl5AoM+RRG0PiObrRF1poiROgTF25qQGgCYOQlwRdYd61f+ofK6rrf2I42omdSP2z/mglR5xkAjjb0HUHgoXvSmtP9qVqS2cLb374hdcwG9X9ByqRnEdCR2/TwJeI81xFTEL0kccoJVV4bF+06auAZANliKn7iBdGfIGJac28O6cBpfgwmtAgLM99OG2o0sB8lLOA9XFmHKHysKPZ30tX3flAhPRzgK3QIcMeulBHCSVoZvxXfmI1z2D1enJGwMhrrAOQ5igQmRYOqzyojLLw2dvfNKJLYJ9kk0JU8X0M6rvy9wSDVK1wklSdn3HPosLZYRAZ9F+55OcUKdOahgGXwMEEygFzzjPfWLtgbQh/Nw/KbRKGa2D73JdbAY66VyWbO8+N5/MlbMSiHaqZ3i33B1Rba2BEplQUr1YtD5bjYleaAMmCclqfAdtouipUSAM9mEOPi1K4wiNstolRyWW0eWl1C+q/fxCTEBDryKFaWY+rAamDZ0Ino0tQDbOwtD3jSK5AGvIzoG4CKcCRbUDzCAMDERqYY6tBlH6fTiZChoVSQAwKI9VHG2VskeP5K0Zyg5WXhabnOnTmLIMUe1un0BRDmoCbjkZ12PDv8gPcpAkNfRCKJVnbRLDvV02ohYzmSjokVKAOsYvBioH2uJuiAZFYmogey39Ly8DCH55ZbxR9bNnp8n9hu0Lsj/ajcT3r+XgSSMDRI+l1We3ZL7kFjfUJOQqKnM21TNOunXJ8Oghv2+IcqfgVWwx7gLV+0GKUGtNYoP3eQ+k6AaS5KAddMlE2i0eSVI7hLGbilT4pUYBNyCOcVjG+R6vFczQ95qoxTy+iJD/nGZDCGacrjZemjJ/qw+NQp/+3Bnuzo/wJpaPilUye2aKp5luDF4Q38OC/cPVwMpG5o91FenoX2kTTsgaObpf71Qpg== 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: 17 Oct 2024 15:04:00.6431 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c1c2469-d2ad-4739-8024-08dceebceec9 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: BN1PEPF0000468E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8856 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241017_160410_631392_51FDF4DF X-CRM114-Status: GOOD ( 19.76 ) 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 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 --- drivers/i3c/internals.h | 2 + drivers/i3c/master.c | 80 ++++++++++++++++++++++++++++++ drivers/i3c/master/dw-i3c-master.c | 5 ++ include/linux/i3c/master.h | 1 + 4 files changed, 88 insertions(+) diff --git a/drivers/i3c/internals.h b/drivers/i3c/internals.h index 433f6088b7ce..d2d6c69b19dd 100644 --- a/drivers/i3c/internals.h +++ b/drivers/i3c/internals.h @@ -10,6 +10,8 @@ #include +#define AMD_I3C_GET_SLAVE_ADDR 0x30 + void i3c_bus_normaluse_lock(struct i3c_bus *bus); void i3c_bus_normaluse_unlock(struct i3c_bus *bus); diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 6f3eb710a75d..20b83ca52d31 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -2251,6 +2251,80 @@ static int of_i3c_master_add_dev(struct i3c_master_controller *master, return ret; } +static int i3c_acpi_configure_master(struct i3c_master_controller *master) +{ + struct acpi_buffer buf = {ACPI_ALLOCATE_BUFFER, NULL}; + enum i3c_addr_slot_status addrstatus; + struct i3c_dev_boardinfo *boardinfo; + struct device *dev = &master->dev; + struct fwnode_handle *fwnode; + struct acpi_device *adev; + u32 slv_addr, num_dev; + acpi_status status; + u64 val; + + status = 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(status)); + return -ENODEV; + } + + num_dev = 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 = to_acpi_device_node(fwnode); + if (!adev) + return -ENODEV; + + status = 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 = val >> AMD_I3C_GET_SLAVE_ADDR; + + boardinfo = devm_kzalloc(dev, sizeof(*boardinfo), GFP_KERNEL); + if (!boardinfo) + return -ENOMEM; + + if (slv_addr) { + if (slv_addr > I3C_MAX_ADDR) + return -EINVAL; + + addrstatus = i3c_bus_get_addr_slot_status(&master->bus, slv_addr); + if (addrstatus != I3C_ADDR_SLOT_FREE) + return -EINVAL; + } + + boardinfo->static_addr = slv_addr; + if (boardinfo->static_addr > I3C_MAX_ADDR) + return -EINVAL; + + addrstatus = i3c_bus_get_addr_slot_status(&master->bus, boardinfo->static_addr); + if (addrstatus != I3C_ADDR_SLOT_FREE) + return -EINVAL; + + boardinfo->pid = (val & GENMASK(47, 0)); + 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 slaves + * during device discovery. Therefore, AMD BIOS will populate same initial + * dynamic address as the static address. + */ + boardinfo->init_dyn_addr = boardinfo->static_addr; + list_add_tail(&boardinfo->node, &master->boardinfo.i3c); + } + + return 0; +} + static int of_populate_i3c_bus(struct i3c_master_controller *master) { struct device *dev = &master->dev; @@ -2771,6 +2845,12 @@ int i3c_master_register(struct i3c_master_controller *master, master->dev.coherent_dma_mask = parent->coherent_dma_mask; master->dev.dma_parms = parent->dma_parms; + if (has_acpi_companion(master->dev.parent)) { + ret = i3c_acpi_configure_master(master); + if (ret < 0) + return ret; + } + ret = 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 fd58a95ae1c3..8d4583bc2113 100644 --- a/drivers/i3c/master/dw-i3c-master.c +++ b/drivers/i3c/master/dw-i3c-master.c @@ -1602,6 +1602,11 @@ int dw_i3c_common_probe(struct dw_i3c_master *master, master->maxdevs = ret >> 16; master->free_pos = GENMASK(master->maxdevs - 1, 0); + ACPI_COMPANION_SET(&master->base.dev, ACPI_COMPANION(&pdev->dev)); + master->base.ahandle = acpi_device_handle(ACPI_COMPANION(&pdev->dev)); + if (!master->base.ahandle) + dev_err(&pdev->dev, "Failed to get acpi device handle\n"); + INIT_WORK(&master->hj_work, dw_i3c_hj_work); ret = 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; }; /** From patchwork Thu Oct 17 15:03:28 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: 13840178 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 EAF86D374A2 for ; Thu, 17 Oct 2024 15:04:17 +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=YAWQEYVrVz9XQB9ErqVC7dDvCehGJOmwlLKK7jRYOC8=; b=DOGdXA7G1xsrCC FdpmdAVS/zv8Qte6mzGey5Og5I+CyhHWshsyHmOCmk5F2CdciBvyFe4LHKc9bQNlUR/+Xl3B7hCCp kcKPLg4lxXg6sJO19+tDJHaIOglhADtAvw/5o+D/WqLhfDSrNDJPeRnw3Rd5RfTWgZHamhS1X7Zm5 dO+6PPTAbiSOrwvbZF1ig01Kc3TEDfG1SxxepaCDoL6CWQKCmGO0ZEiFsB2t7TEKmh2GNsRANXVA1 M3gnrmtUFI37+rrYRt5uJByij4641DbMjysyYP8qfxXjpxoIEg9r4BNYzJmpbNsT+vnwpjDlPfKmh Wy86d8tjqSQF6KQZrfUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1S2z-0000000FDLO-1rjU; Thu, 17 Oct 2024 15:04:17 +0000 Received: from mail-dm6nam11on2060e.outbound.protection.outlook.com ([2a01:111:f403:2415::60e] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1S2s-0000000FDGG-1BPI for linux-i3c@lists.infradead.org; Thu, 17 Oct 2024 15:04:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OZA3I1JhwuPUPU/zMvSs8twdj2Dj+y/HMHPo4oBfrs510gSnIQuSFXvhbm6ZOqG7DL9FIQomELM0SZ+RW+Oya3OZ/S9dUo7EC8dAA7xs6syWIj8VzS1QMxj8/mC0Aaq6bVjiXE/TORfwPX4orvjFDz0c3KjqFHn6FtPyAjOLxmGoD+zbs+eDe06t+G4cJjzP1gNSuMb4WuWGr5zIt5vAgR/Kj4P5PnXCLSFIBOAT5gy7a0QGPNg6tgs/KecbofjgUtC8Hw4qa9KI5yQRWOlXMlQPmoyzDC6ZmkCPSw9OnpVDYhsndIj5cCoqkb52i3NZeHGe845rSq6k8pK8wxjgIQ== 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=tEuBjKftWnG8/lTH/XY+Pm302D7Z6uUrMXLct9A+m+8=; b=F7A5WC+Q1rZGpHYJjyKzZOrqSM330yD+o+KgbWyB+tDJaJa374UpS/JFpGnnA6BSpTFweBWgJZ4ufWyOicBMA/U7tm0Di3+Mc+tch9aP4KWarLZXhVK1WAFCVmaluwMTuu5S6Fu0RWKVqrePscqQ9Z9h1+5Ia8Vn5ejhqO3PHGBCc0a3yw+I80F8IIFqG+TieQWn/oUCxjIVfh/NjtbwFGqXM16LFV4EKJhb/av8RepEES2HzU38PIrnb0qQFxwR/F6gKOZQFneNweOMPcag8JhE60wYHa4CJ7b8N35yo1gxCXnbtIfGEbAtiNXZWcvIhl24iTGPB/ZS5PpWAeGv0w== 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=tEuBjKftWnG8/lTH/XY+Pm302D7Z6uUrMXLct9A+m+8=; b=ySzmmNCgrVomr21I4MyIJSm2gNHCZtqheoE5KmtWEywPWAxkdMmivQlVRqj2hko94CPS82WywRmb6eQUY0+wIcRR/RzKWG353eJaoWIfRNN/xbrnxms4+lvkxupbdDHsRu/x10bZecDjyAcdmdPSuXy9HppnaafHgAGxR2w91us= Received: from BN9PR03CA0126.namprd03.prod.outlook.com (2603:10b6:408:fe::11) by SA1PR12MB6798.namprd12.prod.outlook.com (2603:10b6:806:25a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18; Thu, 17 Oct 2024 15:04:03 +0000 Received: from BN1PEPF0000468A.namprd05.prod.outlook.com (2603:10b6:408:fe:cafe::88) by BN9PR03CA0126.outlook.office365.com (2603:10b6:408:fe::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26 via Frontend Transport; Thu, 17 Oct 2024 15:04:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN1PEPF0000468A.mail.protection.outlook.com (10.167.243.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8069.17 via Frontend Transport; Thu, 17 Oct 2024 15:04:02 +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; Thu, 17 Oct 2024 10:04:00 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K Subject: [PATCH 4/6] i3c: master: Add a routine to include the I3C SPD device Date: Thu, 17 Oct 2024 20:33:28 +0530 Message-ID: <20241017150330.3035568-5-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241017150330.3035568-1-Shyam-sundar.S-k@amd.com> References: <20241017150330.3035568-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF0000468A:EE_|SA1PR12MB6798:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d48f2a7-1cc8-4e10-b3fa-08dceebcf02f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: oEUOV3/I2WGq/s97pS5yDSBBysWjQsb9H3LDVwy8mOQHMSuUhH2QIZFl09//P6m1nUSSLQ4G1vxE6WebqweCl8Sm9yNmtHi21CqW2KIZVSEMpHshmD9J3Cqswol3JAQPGfuCqlOPtmjcg/deMN2l4IjPDLlwkCcWvai8FFpbGoPYo+Q9kAz58G41yiCr6yKiAfVymjxCiIfJwRNd2Si5oPIZ9LrEBLeohwUkR1peRIouJexIwhiPV7BPHPVwQwrTSMeT1Jsmsrv/ME3dLxSjr59yBPAsAy/cebfzLmLA94cdSfxuzULBKGTQQStpV0Cp1BiOjWRppK4ADlqLcH5y6U1D+i53lypiAULlTqqCoc6oho7ML3LtM1rIc2qN8jM120iDgJanrgfnva6/+FA8SoGl8Zl1eay4M1RbHn/Qs+s5tbMJxhZc2ur0N1iE+09bxUR0jE9fKOz+8FkcuGKFuWTeQWfc7JQk/YpqxjkQTEZgD+sA/SNvpIfeGJsTI7Y4PBLakCRh/fm0BowwLqQhVkPVj/uVMlg/PJ4HSePSM1AMsY3TbHSEQboMnx/pUTyS6icNPeUPiiqOuLYc01MLFhddnsp/0tb4q3KP7XXMflbZvGlK0oKrDf/6maobCzM4Ow/okbXfCuVjGhPi/tBvp8eVurdVQJqOv4eRGmL7XlW3aQ4tgSFsSiHsRXDDCf2fXed3UEK6HiXpVMB4AIfQMugS+he/5GKp4g8+q2TvtLzFn0oSkT2KVmC8n8YlRxHhCn7nhD1bG4byCNYCMxYle6gzOR7qgfG8CkRuJT8Ttz/McjWQdZanGImQrK6NR6duGTEtZ2jDdR4xeRvqG4tyYkbHfXbOnlv4yKL+QveUGegOBdToFfuNo7KaNvZwU6xjj1/Y9Dx5MSxt8JYysNy4vQI2A1m6yjvKwrKwJg72tqtz55uC78Pgrg74cHHGBRZR+OXlkvZj3N2omLVS/H92V8Fec4jSwkl0JyvdFHWRTBir3LL05vlSBMFrQ/rj/tV8oQ8LkY1n7Ye/Yvd3500KKboCvaHrcJrXI8Qcc9KbEBrnYD7lNd6FzTMwGJvZS95zDV+xuVf4ConhbmXCOaxBBx9mwYKJrKvPtXkm+aDEKnQwcSyiZx8XrHnFE4A71yBEgsIk/P5lbbdWN687Tiaz2Mm8t0mj+03DYIS99CtiJMytVMliz8uWk/LWMiEp/5lpSfB+kl7clbebkHwG24aS5Mj8bSl0EGxOBkyuRXxYjzuHY6l184eJV8I1vdB3+kCurZYJhu7TuDetUfhKxCxvMiMhTsC+9MueZNyX5YT5IHtktmnlgvdFuFxSCldqAKRd3EFoZKLauRHsZo1FTKdFs4bDVJZO3ruDEOmWnDxM3LhWUmiugWOkpEUFvm54FqggBD20MHsSBXA5Ej1UQsVIgQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700013)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2024 15:04:02.9906 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d48f2a7-1cc8-4e10-b3fa-08dceebcf02f 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: BN1PEPF0000468A.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6798 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241017_080410_346420_0C62E261 X-CRM114-Status: GOOD ( 11.70 ) 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 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 | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 20b83ca52d31..4f149519170e 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -1657,6 +1657,45 @@ i3c_master_register_new_i3c_devs(struct i3c_master_controller *master) } } +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 = { + .static_addr = boardinfo->static_addr, + }; + + ret = i3c_bus_get_addr_slot_status(&master->bus, boardinfo->static_addr); + if (ret != I3C_ADDR_SLOT_FREE) + return -EBUSY; + + i3cdev = i3c_master_alloc_i3c_dev(master, &info); + if (IS_ERR(i3cdev)) + return -ENOMEM; + + i3cdev->boardinfo = boardinfo; + ret = i3c_master_attach_i3c_dev(master, i3cdev); + if (ret) + goto err_free_dev; + + i3cdev->info.pid = i3cdev->boardinfo->pid; + i3cdev->info.dyn_addr = 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 @@ -1868,6 +1907,8 @@ static int i3c_master_bus_init(struct i3c_master_controller *master) goto err_bus_cleanup; } + i3c_master_add_spd_dev(master, i3cboardinfo); + if (master->ops->set_speed) { ret = master->ops->set_speed(master, I3C_OPEN_DRAIN_SLOW_SPEED); if (ret) From patchwork Thu Oct 17 15:03:29 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: 13840181 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 68A7AD374A8 for ; Thu, 17 Oct 2024 15:04:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZXUce/ZJyXzl993eNmHsMHPebBpB0H/OAuabmuVE8w4=; b=uWGx3ih6X9L05n 90Zkz0D3xHyGo/9GaCbLUtjWc6cp64EDpr1YYyGS53tQO1EIi1FatP/Y7BOx2wjwb8kV72AAr8hZ3 /NRKpiYh/+L3a/depK0cQdS5zlF1X5vvCjFcQEbvPPntWhQbIhe3wtygMcA8TB6WbLkOP+9hQuVaP 125nhSX06Di31xdRWrw949kZ2hen52gmpsoerKBxspT4Pp+5wyUKmwuiX9aqZQk3azzPT/OmM7OoL pjsi4jtwDAN8UgRHtNZv/ixiK+88ztJGfAsJCrWpMqt4+Hk8mZA112UKZArVJx7dW7VdaDQmEh3BI f4h+O9tz+TbgtHlRN9HQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1S30-0000000FDM6-03gg; Thu, 17 Oct 2024 15:04:18 +0000 Received: from mail-bn8nam12on20600.outbound.protection.outlook.com ([2a01:111:f403:2418::600] helo=NAM12-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1S2t-0000000FDGb-0QnG for linux-i3c@lists.infradead.org; Thu, 17 Oct 2024 15:04:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=X8Af2WQgDXL48NniQnHU4Spc9TviFiE1PGsZpCJPqhjzufxJursFVi8Lf/sfenzalHKJui2w8ThKxVQEeU+/ed1Oqg8IAMK7R7pUsIzx7Q9EJZtd/Kg01ZToOTdyQJZd3a8cKaX1fwLD1d9TXwpoHaEZNKDAq5+DX5TPMRX38k4v4AbaLvOS50r5+/rgPdNHK64Bp0eBdu+gqAttqE65T1KrSkclplgsezy3dNRw0CUXbgqhkwY1G5snr4xso5JVcGYL2zEjHIgX9s8DDeEjqCIW5Y8eDJvhF/e4BnXsF36wnb5gXORPVwMiKrSLvjE8tEMW2Sg7EoH1dM8vBnEYUQ== 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=6JP+lLh+VBj7U/HVW4Zwu26Phb/E8s9kqAACnP2rIZ4=; b=i7dV/6ylfMkeAKDEVD8lzE+bsh209mFXriYXclAEa1rWvXAK0OEhNWFV67epkXWs5DTt8keEKUhg/D1XfHhUQ6khgQcbmTHcRWTcGpAXbe53r2IPyfmVHumAbJpd1BURvlgZlEuiOcX1quPD6LNNcf14poqSxrDU86qyHSAojG2Fe79Fgc2vXpcci5J2Ll01O2zjkh4AohbpY7YiA3tbkNRPevcMK8mkwC0nOUerEp6W2yvgRA9qXS/Uu04nBaiikqASXb6SsI2W4ZYVZwWOo7MQld+bGme9Vf/2a+kBSTAf2SYrLVIdl2ttEx80YsZaT6iooasWAopu0fIyP/kSEA== 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=6JP+lLh+VBj7U/HVW4Zwu26Phb/E8s9kqAACnP2rIZ4=; b=jEOk9lmlvW5fXwQ8nCGWDA0DcHlt2RbYYxvfhjtpBoi/Vcqb28TThohoQhiM0w52HnxpIgJ2S6DFUyuX6VwygnzJEAwoVYnmAOab1XHpSpDiyYdpyyU60KnJcrRsY818cOyKFV1BXBmfEwhCu5M+jpSY+Z1R44ZTqEA3v12mNoI= Received: from BN0PR04CA0145.namprd04.prod.outlook.com (2603:10b6:408:ed::30) by SJ0PR12MB8091.namprd12.prod.outlook.com (2603:10b6:a03:4d5::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18; Thu, 17 Oct 2024 15:04:05 +0000 Received: from BN1PEPF0000468A.namprd05.prod.outlook.com (2603:10b6:408:ed:cafe::f0) by BN0PR04CA0145.outlook.office365.com (2603:10b6:408:ed::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.19 via Frontend Transport; Thu, 17 Oct 2024 15:04: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 BN1PEPF0000468A.mail.protection.outlook.com (10.167.243.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8069.17 via Frontend Transport; Thu, 17 Oct 2024 15:04:05 +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; Thu, 17 Oct 2024 10:04:02 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K Subject: [PATCH 5/6] i3c: master: Add support for SETAASA CCC Date: Thu, 17 Oct 2024 20:33:29 +0530 Message-ID: <20241017150330.3035568-6-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241017150330.3035568-1-Shyam-sundar.S-k@amd.com> References: <20241017150330.3035568-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF0000468A:EE_|SJ0PR12MB8091:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ae3b502-e9ba-4fd0-f133-08dceebcf1b1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: NmnhdIF9AKr5Qs37HaKJvykawizInI3htbjFDTjFmjSvbbUmiEso1bhAzN1Xg7rg1JsYPqshsC/RIx0yXEYpm/9MZKJZVxR1JIFcJB54FlHSDQL9XtAiVg5/AXk1h/tpTRcXPiz3m4fjGhb3X2uWtNWRR+MNHfgPs9QWPTYgoDCcDYoay1RBJwo4upBkt90geerZD6tIVo5DYk93EYEwP77oXJgti903PFXDWFIsfR1Wk3mbo6Wcrd4rXqZ/mmZfmQCGCKdB7pLNu0mY8nFXR9dOLZ6rUwHfBvaGefINiyAj+30naNDo7+jD82JixG0/QTCj5+jHvQpMCXVT5EBhwYNXi9QODuZq/F58hFgQZKMlIX5cuMWxfKRPFw8C7Au/KdCealYhnjNZRFlMGCShMPSh3ZNonHEKZr5Rirs7uM1awrCn1VA1XvuMz4Ksf0x3Pn0VzHB/os1Lhrunphpg2WC6uvKHoc2AFjyFfkWFfRfWCD+bFTUNsWG0Akp3Eg18UmLKd9pxcZwczC69bqlMGidcwsxFFlMEcDOvOTOqqe17tfdwnJcv/CXkGHFaRiAcE0eg91F1kzeOayIcWG68ibeVqOJBhGzCkFE0YKO2M9PDXdoK5D84hJqrWLrw9EcBZ9tNx9TGg1WFGhHAaV8IakiBfPcoziNbUAQKSusHP6rLfyh3Ck5ckCLrbszKFSahxjuilwEhgxNgJLOaDdg+9QaEfBwXphghaO0WjmcRCpkIihU1MtruAC7zAJNjUXOqCGOxfwELxtu0THx87t6JDx018/pT8v4b3z4Ytjyj2FBpZ1JXZmKNB7AhuclCqiWvG+wkyc06HT6H/hyGq+kjWEAJm8X3DblTld01z+YRbRnzmL1oVZwmCGYdeDHh7nl98oW0H8EJ229EHYLqkZnLuV6i6O4sKlKIBKLhU+YUf+eXw36aDE28nE+zgn6KqfzAAJ+C51muF5zO0aOvjf52ogSzOjgIVOAaUJhySdwRslmCSSVA2os3SFOOFkC6ykIEMzr4OnpBkXReuUjur+/mcj6RyvTgr9LfoHkMrE8g2yRBjHOOuC3u5KvY2nmiQL3mtezpMTgO3dzeTzTWXqMt4M0ccmEnfOJefBO29YD4CYEPynWkVFIsiRW+sFKuIMV9jlAwNjHXYm0bFu2V4gcO77CP+5bP91urHWM4TzT7O3sKp5Up9Nj39J3GlZGKdAUNzjd+3sdxH7IxrJDoHTjbaUGXYEHyiRmePgHVbXaSiEDH33M/RtFxKlIzdoiujbAzKyxViCfaM8f0LUcXFMpJO0lNh4KU/eF/d1RqfqDI3d9PrQv1Rm3p8RwMHhIxiSCC6jcUK7qJ/9tQLj3Ko8S7IODve6NNAtnH179ovX+JzQE= 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)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2024 15:04:05.5063 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ae3b502-e9ba-4fd0-f133-08dceebcf1b1 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: BN1PEPF0000468A.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB8091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241017_080411_178569_B697B933 X-CRM114-Status: GOOD ( 16.72 ) 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 I3C devices like DIMMs over SPD use SETAASA 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[1], 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] 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 4f149519170e..0fe3e315d6cb 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -1657,6 +1657,21 @@ i3c_master_register_new_i3c_devs(struct i3c_master_controller *master) } } +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 = 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 = i3cdev->boardinfo->pid; i3cdev->info.dyn_addr = i3cdev->boardinfo->init_dyn_addr; + ret = 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_controller *master) goto err_bus_cleanup; } - i3c_master_add_spd_dev(master, i3cboardinfo); + /* + * If the I3C slave on the bus is SPD device, then do not follow the regular + * DAA process. Also, as per SPD spec SETAASA is required for the bus discovery + * and sending RSTDAA and DISEC is considered as illegal. So skip the entire process + * if the jdec_spd flag has been identified from the BIOS. + */ + if (master->jdec_spd) + return i3c_master_add_spd_dev(master, i3cboardinfo); if (master->ops->set_speed) { ret = master->ops->set_speed(master, I3C_OPEN_DRAIN_SLOW_SPEED); @@ -2310,6 +2336,10 @@ static int i3c_acpi_configure_master(struct i3c_master_controller *master) return -ENODEV; } + status = acpi_evaluate_object(master->ahandle, "_STR", NULL, NULL); + if (ACPI_SUCCESS(status)) + master->jdec_spd = true; + num_dev = 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 8d4583bc2113..8f452976dd7c 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_master_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) /* 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; From patchwork Thu Oct 17 15:03:30 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: 13840180 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 970E5D374A5 for ; Thu, 17 Oct 2024 15:04:20 +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=98E2GTW5ivmEaqRV1wwc71Ze5y6MoTCXdGAM9M5a8TE=; b=WBAhfpo1yzvbcm rvMen86zfucjQQ7DAcqmL5YB5r8oGdspmODhTRa8kGCuxbUZQQd26/As6QIUqGfQMxPMntnHnyuQy YsjYlZdIKhczchmxB6HX8cdwE+HVpKO5WpdkouqDwsdPS0n/cl/84lAfLiPgJIdsxU8o+r2egRx2s dhalfmbL5IwAhQg3VQJcGeT4qdS6UcnSLQnCyKz10COr8wUPOCCrloCHKtGn6cBZM3HgOOwNM7VcK b9hVH2b4/AvKm0SZDf0VDXWkWT5Cf12ZodB+eg1hJ6EdnpFMWYQtEtAjf77J4BxEFbJRXsVlvWe+W m0jxTtpuTJmEeGYiEVig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1S32-0000000FDNI-1Q99; Thu, 17 Oct 2024 15:04:20 +0000 Received: from mail-dm6nam11on20624.outbound.protection.outlook.com ([2a01:111:f403:2415::624] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1S2x-0000000FDJ6-0jr7 for linux-i3c@lists.infradead.org; Thu, 17 Oct 2024 15:04:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mPHR358Now3TEXQQMg9rVfzu4nAm2J5/Xmzk9Yb6VJ8EahKRyUsh5PqXaikWh1B1XF7K7DjJGt7BJSev1pA44uIFawutT0prqvXmRcvENZfFXcelb9dRoMG2SjYhDQO09tTyN6z6cTtcr33tkzL7ABiVPMp99MH4nXEn/rG/SIF8dAbeS+y/uNInLEpdDVu0GK8PwjuWuCIjK+5DAIehfzyF/GOzAZms7Bg+KvkoXA+tgqs08ceyFzuckQjnZPsVCA85wDf+FqSYeewBwPWhRXZC7/7tDtFwmJHsg+N3oOMAG9td5X+POOFUE0NWqwdizgnoSW8sXiajjp5infD+3Q== 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=1S/FySrZ3Q9Ro3xJrm8Fehq4iMVq9FScAh8YpSTJngs=; b=bXXYfRTIJitsAiCd7L+VidvlB/z9TewTtgquNf9aLhVc00bATJnE5gF9ofoz3wqMA562YFdgnd56Xae132yBet5MGWVhgHrtYS4LA6Ssj/l2VEQqojRhTq6kGYcHslOsLHXuNA47fuqtyZd4se4C0jU9HLLaQYOTJ8bdHmFsConBGyZIXarVUOVCDhls8yEIs+kWHXBPknm8hzSlCdfHmlgvAruBpBih5zf+rPjM0D8AylH0lCsReUMGxp5cqotFkqY4tEXoFEariC1twWb1dy0azYRmK27UNLFJK2ZGt8Lfk5gC2o6yoKxKEEuoVTfX5gJbFsd2xl5PX445LvrWPQ== 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=1S/FySrZ3Q9Ro3xJrm8Fehq4iMVq9FScAh8YpSTJngs=; b=jYFU0FANwRmMXftd24x9096bwPwPq7p5y3cFhsrK+1pEOZ0xH24PYXYOCtWJcBb2uCu8w5lXiAJW+0+HO4gQjt/xIKvny+TA6L3SOdC1Ck3GWAGkzAy421CWjg1kKyztP3lousO66q8PU5LrDY9yE0hRsPCGI3rJIbp8bBmyxj0= Received: from BN0PR04CA0150.namprd04.prod.outlook.com (2603:10b6:408:ed::35) by BL3PR12MB6596.namprd12.prod.outlook.com (2603:10b6:208:38f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18; Thu, 17 Oct 2024 15:04:09 +0000 Received: from BN1PEPF0000468A.namprd05.prod.outlook.com (2603:10b6:408:ed:cafe::15) by BN0PR04CA0150.outlook.office365.com (2603:10b6:408:ed::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.19 via Frontend Transport; Thu, 17 Oct 2024 15:04: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 BN1PEPF0000468A.mail.protection.outlook.com (10.167.243.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8069.17 via Frontend Transport; Thu, 17 Oct 2024 15:04: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; Thu, 17 Oct 2024 10:04:05 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K Subject: [PATCH 6/6] i3c: dw: Add quirk to address OD/PP timing issue on AMD platform Date: Thu, 17 Oct 2024 20:33:30 +0530 Message-ID: <20241017150330.3035568-7-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241017150330.3035568-1-Shyam-sundar.S-k@amd.com> References: <20241017150330.3035568-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF0000468A:EE_|BL3PR12MB6596:EE_ X-MS-Office365-Filtering-Correlation-Id: d0e13d5f-dbf4-480c-c666-08dceebcf3ad X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: 06n//8K5+T1SQk00uI3+3jM5R7AO9cC2C13dn2B6zq1xYBgydrS9HeWlJBVQ6/I6fPw9aFOOeaoQ+nYuIk25xY2wGrwzogULqFC6YLqdiyVgMZtMA5Yhf2w6N3nfGzc6tksCnKohXS5eRoeKJFCfuiOJ0Nat3s61jCJaBXex43yw9mLwzKNR99WAT848QnsPqZIfqkACax4TxTQSDBMAHCp1zuopaMkRJmpEZyQPjGV7we4P37OGpAvU6IVaE5D6t2iWUeuDegi1WtJyGzj4OPZ99i3BIEvPDzfgwniPEh2AYFNYl/gTbN0WHiKxe5MdqsQ81uqpoLl34N2X02uA2FXoyZ9VkMbj2SbURv7FKVUT58I8LPylLPcFiagi++DeUd0crhvhm6qxd1Yjt8Zu1/et15DYTaTPZwmyVsjhnRVoC3qkmSjo7lX14UsdYeMZNc/9ZhiM+ZL/0G3gTFMUN5WLWMp5izhbfQdrF9EUCbsXm42/hrpUMhBO5w2L20QSZq5fU5pwOQc6Zb/DmUpOntcjN3KhtI4Uy6mSqEoQv6nQ/Zc4VV5nAGg+v5cLjxmmtH8VM0ETx0Nr+tUqxe4UZNpBiYJOLzPJH1Aj2Q5u46ScgJmx0Le07yuEXv/26OQkiUjoQr0yYDVvDN4Q430yTKspkXlGTTGnop8rMFyOImFJ4bEksoDqRqnqyqpbVpHBTtW4w0xr30v60TeXAeC6Lj+L1Q7ZK53fX082/h/PtZ1+IwtbeGcAy39Z2TLzXYpnizJxtN40HKhWn4n3JGmmFR3Pd1t6LlKCGHVBoGq7IQNn31XwTBA7XKIOd2pYzdRAGUwO0eNl7Zx0mZ6v0SEsRMOmB2QoxWETx0qt4SkoBnahxFiybIeEFTx0WvUcogHgBIqMiVG+dtacAgfCYraArt8II6GK+x6+To52qgBTEWS59894fGL8duuabnCqLWw6m/9I8VxlZxSM7FFd1INT07eImYstEpr2W2wHKmI+Z0B8G7bTvE849aiPjyiVZTjLQhjhwP4rr6eUgm5Ox2lT7Gzz8WTZJayvt19/lCaWdEdgj/vvhHl4lY1qmwSuSz+CcotypBUDWsNHUong+GgK/+T31QYYrfZ33gLraL7zcWKztUBmFb4g98UTQglbc8to4rR21sj49xzM8Au4ckvSOwlA+zELGKKdCjq92W+CPqW3eiXDO1GJMbM+0jSyYvnGDOENwRZmFEjT5yUiU3p9PR+DByIl0rwAdyoKhPqlOQavsvPzT1COKayB/UbmddYyTbItXYCM6CixkVVsvJadJJKHGEGLdeDDkpoT238ONQJMIjFxRVAXm2A+ZQJ95cAjUq/40bbM1gYHDIWk91gllPCMtDIq3HNvx/pkAlyyWrCRLKTGbyLIUsQVDULw9Fl0oDBk+r9gk7KtI736G8h5Jg== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700013)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2024 15:04:08.8344 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0e13d5f-dbf4-480c-c666-08dceebcf3ad 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: BN1PEPF0000468A.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6596 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241017_080415_246686_443AD949 X-CRM114-Status: GOOD ( 17.28 ) 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 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 --- 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 8f452976dd7c..8500b0d0dcf3 100644 --- a/drivers/i3c/master/dw-i3c-master.c +++ b/drivers/i3c/master/dw-i3c-master.c @@ -220,6 +220,14 @@ #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; } +static void amd_configure_od_pp_quirk(struct dw_i3c_master *master) +{ + master->i3c_od_timing = AMD_I3C_OD_TIMING; + master->i3c_pp_timing = 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_master_controller *m, if (ccc->id == I3C_CCC_ENTDAA) return -EINVAL; + /* 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 = pm_runtime_resume_and_get(master->dev); if (ret < 0) { dev_err(master->dev, @@ -1608,6 +1629,8 @@ int dw_i3c_common_probe(struct dw_i3c_master *master, if (!master->base.ahandle) dev_err(&pdev->dev, "Failed to get acpi device handle\n"); + master->quirks = (unsigned long)device_get_match_data(&pdev->dev); + INIT_WORK(&master->hj_work, dw_i3c_hj_work); ret = i3c_master_register(&master->base, &pdev->dev, &dw_mipi_i3c_ops, false); @@ -1681,6 +1704,10 @@ static void dw_i3c_master_restore_addrs(struct dw_i3c_master *master) 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); @@ -1755,7 +1782,7 @@ static const struct of_device_id dw_i3c_master_of_match[] = { MODULE_DEVICE_TABLE(of, dw_i3c_master_of_match); static const struct acpi_device_id amd_i3c_device_match[] = { - { "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)