From patchwork Wed Oct 23 05:51:13 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: 13846482 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 89F2AD2E016 for ; Wed, 23 Oct 2024 05:52:45 +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=GLLEV1TkqBFIK0 w9cimyAu03T3KeOsa6eiWEm5UjojcUwqK8eE6bDn432RXJRW4rf4uWypF9bXrfnz6fcqIzgrvkKW6 dzxeircHGCIDOzC/ro/DE6OomBf9dpIRmXRgsIdYkx8u0YJSliaJqYBTU0vd/pPBMrph80AAWkjc8 4rHNTJQNR0085tv4SF0B9jC0v81dsbeJwiT+ZJbJxWZ4gYJwUCJCEhdis7NoLXS0IV9XiJav9M8AH R61Pyd2KSwEB3tZAeDduFNHB5oGx/G+05K5Kf/sBj9yK25XxdghNxQUi5neTaiVZpfu8tGzbZVcmh /RVM7wj/pfDtgJhW/XSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3UIX-0000000D7At-02II; Wed, 23 Oct 2024 05:52:45 +0000 Received: from mail-dm6nam10on20607.outbound.protection.outlook.com ([2a01:111:f403:2413::607] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3UHq-0000000D6xB-0NMs for linux-i3c@lists.infradead.org; Wed, 23 Oct 2024 05:52:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cYqVAtKJVqkH3JBxJln1Xg15yb2biR4TWhgkugimR0Eg/0kHrNpej7FLda5xkEAig2o4kbEicT08v8ChuL8Z7sQZ10nuivC61DPw3UxLKSJoPAcJnSIVBymd5jTmyuvBOsE/200kARTXzaaNZty1+MjgodWEdcQZW1wSLiIKllgiCWw0B58JICZxCxjV/JmNiNw3jbj79sEShw2nUbKnKQn86mOYOvgfqTRpEnb7Y1CIkeeyM0uE21uuBJzgG64pVdP47OeX46RrbrVR+WsStpjRN4nXqTrjrxaEn6v0Tsd02wqGwWsLuI/z3Peslkbl1dEK2AgkqaS05EW280dK1A== 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=l0P5lSRThFPgPKVEzrtKZzJg/cls+Rz2HbCoXBpjxPjWqh9tfhFN1lIPErP7XOjW5Z5rdmSB3Hvoi8dWRWZuapavWZaOGj+fpqcSpuVarhjtXE6YM1Z/E1et6wrZaC/3ep4vzwxUamnZhlazEw4Jric/E+ShLFDGO03x53mto1uYbcGGncgiLRMUnpRSgiDIG+u4PJXSKSPviIY+IYP2NuXkNg8vbCyXf/aHYxg/hShKWFV2JY/u407FrXBrL0+FedgJwO2fHkMFYP5nJLaFlMS4eOi+5Ili3V+2pkqUfYdHmVxI2UCLJiLvcFrtqiyu/E+aHOGYRYOeWXrkmfOMSA== 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=rtRCJtYFva9C3gqZPzA9PtURbmmwc28pZRXizmejamzdnEwFVfQhkZku7kFAVnASQFA4IDR6kyxLA7z4cmsLtX0iAQyyoQoJT1KQpsMf/dF1cxDs4mh1yBg+xX5lR5eykVTCbY5x6VHKgUrIH5uhPzT5IT/fsSaRrYM6qf1qgyE= Received: from PH8PR22CA0014.namprd22.prod.outlook.com (2603:10b6:510:2d1::29) by PH0PR12MB8128.namprd12.prod.outlook.com (2603:10b6:510:294::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Wed, 23 Oct 2024 05:51:51 +0000 Received: from CY4PEPF0000E9D8.namprd05.prod.outlook.com (2603:10b6:510:2d1:cafe::ce) by PH8PR22CA0014.outlook.office365.com (2603:10b6:510:2d1::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.17 via Frontend Transport; Wed, 23 Oct 2024 05:51:51 +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 CY4PEPF0000E9D8.mail.protection.outlook.com (10.167.241.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8093.14 via Frontend Transport; Wed, 23 Oct 2024 05:51:50 +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; Wed, 23 Oct 2024 00:51:48 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K Subject: [PATCH v2 1/6] i3c: dw: Add support for AMDI0015 ACPI ID Date: Wed, 23 Oct 2024 11:21:13 +0530 Message-ID: <20241023055118.1400286-2-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241023055118.1400286-1-Shyam-sundar.S-k@amd.com> References: <20241023055118.1400286-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D8:EE_|PH0PR12MB8128:EE_ X-MS-Office365-Filtering-Correlation-Id: e64a0c13-c095-48da-591d-08dcf326ca77 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: ODi72jCa5UKdy+XLQ6pDxrpmDgRQR7kI1dIB7GZtuK4WtdrJO9G86H6p73nmH8c9+xwykrUW82YgAgIw0jTp6MIzqDvgZWenTLDE5z+Mbx0DcH7xMTdFioXWRkHxzxgyIkvMOn7D7XkIOfVthn9odQ6mabrd5X0JLSgUQ8iLlOTokXZDLCVXmLFh4QwfvRrgL0p8jNFkgXSKFi89F/7033FSjC/lbxV4W5GfY0EA3/4Mp/ciesDw4225LSIhtHBFOmGUu5UGAQXkcgw//020VtG87rDryPuU5u0BImIKk3tFiNiBfP7PXBZr0sfK64qiAdeCGEDPUe0wsaIifvcQfiGCAny6fzvpkSwdfZkerXLIC3l79nppm6TvMo5iv6EmHt1DsjuQKDzoBEtMCdPwlf8OUwqN6xPT2x7alK3omuXEebW4bvi2LSZf4a06x2QLZ9+J2R3Cg1aJPfxSRoPxFkGxE68979XY8PM8XzeXOZpkz/HE/YcgJm3M+BNnh7AC3zIsTHvc6KfJRzCO1TXLQRVaJJKSrRQ2SG9viABQgoTxsWfv1P6bOzZCoEAr3WdQflFLzBRkVsH7oIgqPGttKJUcj1ZEvaYQcHJgyVgoAJj66ydvn3aG4l/QPsS7xY4PnbrxXndVFqixJ/qpHMf3WG4MATFVMlAfv/YjnowstH2eCoGnk9WLsKLqDGZkstqSFFugO74F/4I85qsdZO3f1MJzXtYfEUJQ+ruHtiX1qRTvk/E/9L//4UFKFTvFTC1QTD0NuHwmVrO3N4G1cZa8bGnWJnxU0iGU1z84ptWonDZjYPy0HBt7AFtjrgNhPaq+r0r+LrFL6YVcXD9I0qZDqu8eQUUQS4YQ+tSwOUxZVlA5Ha2h9duVs0kfEXiN9T5i4z6wm22CqUJ0Vkc3Xp7IlPXxJ9kMrnUfsb6IEMu8Ou1So8obSXMwUxA1JM101emuMMG0FTy6vNs7t5sGWYcmT9g8iAWlc0+URagSUo9Hn4aitvMQeFKr9+O8T4aapPDb9RUqGG2k5aYbZfmzq1wQ9/c+ivOhN1dOQ+lzYrMQ2t1ZlIOORMD5ReEM5tKmDmSuLuKRfqcz8hgTPW4Zp6AwfCruljQ3fKfOFM0/f290e7XvloBYP0WQigMPy1uQ9+uSW5WlK4CnBoaAqpNz/GSbQynwU2lhPG5fvfEbADixKTWShUp8kCKsjykwUUujGl9pBVtTb8HUk7oNSXCNQYEeHzSTJv8p686ScRVEbIkO2ts4LMQVdRGy6iQVTK7B7UHZrXxT1RmC277Y2hJqT+Rw0Lul/Ywm5yYTQj45AQ+W/p4E1KC8g/qNHc+/Ls+bjEheIyTYOJGRVZ9XUQE+KFAJc9ddMMPt7fERaLrWvXURGNr4Npwtyi0gxa2bVetMjRTvWVA6qcDI3wpSCtLr7YdOPg== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2024 05:51:50.9175 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e64a0c13-c095-48da-591d-08dcf326ca77 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: CY4PEPF0000E9D8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8128 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241022_225202_153617_B230CAD0 X-CRM114-Status: GOOD ( 12.05 ) 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 Wed Oct 23 05:51:14 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: 13846483 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 68A95D2E019 for ; Wed, 23 Oct 2024 05:52:46 +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=eUma2Em6O7aCfU Z0XjDtUEEDJVZIDCOdTL1pS4CPwtJSjVu2X/wx9I9/pZ5MbPW9SD3QBVgfB9P6VGDrAWRLRaB5pF9 4PUtc03mq6RWh1bFou1L9VlhkZq37m42iLGLH1LxZbovOSFdWnLuQA2uY+g5ys0ooNb4I5/5uoigO W9y59V+caS2ipAqSSUWiK+2w2D/eiuNUa1M1eA0Oy/Dpu3oHmGYKYgCsM1yzHxg+Q89UhG+R5nOz8 CeXNdaaKrFq2AA5xzDcvvQ47WrultQ4g/T8T4jvdy59fR/oie5XhGvhRIhenuadNLB9+93heltB4j 8CySj8fifFwruGmspr+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3UIX-0000000D7Bf-3qdp; Wed, 23 Oct 2024 05:52:45 +0000 Received: from mail-mw2nam10on20615.outbound.protection.outlook.com ([2a01:111:f403:2412::615] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3UHr-0000000D6xI-3x9H for linux-i3c@lists.infradead.org; Wed, 23 Oct 2024 05:52:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IOo1Xcztk6kuubV+2zQdcfPGWTrQw0tKW4MJIidI5VmgHUqJ83kTrrQPpPFvMelFL1tVMusu++WcKaj1w7UJEyxexjuus+7BGlP6S47O6zTobXq8WUVRqEotfxAfg+MJ69/oSLYyRxWZowzD0l7/wfqZftK1Y6Ln2xPnd2FuwJd/b4TvmGzbYfyfHmlUc2X5V5TcMPbIhVsEgKCiEKEyh+McLy0iZ/Bw76y9t+M1itjZ9ql9rBFnSktn0MVHKh9O0gdyLl4krFXmRa4VYUcRA0crUBywRwGGKl6dSKea8XomALlN3zqy6rWwKWnGeXBvi7oHkdCo+GFBHkwAcP/Yow== 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=iTMAPc5hNXlEpOUunUhuL/qUSeWN/yFbo8GRmHIkwJ8TYXGHKcmfO8Mc2jAEjvakV3qUPR0BeL+0H5qn7wFU36gBGRjeLlmuXszlKXhS0fPNAOXogjApOFR1GGokRf5uMwrQJniNhgcLCTVQDDzcjChw7+Y2inXsn+0S2WJrsKmCxVJGEMBfXkqzt4CeE/F446WSCm7b6qREB4ai+8VCD+hjOwLSheRl9NMBuqgkxq6Aw6GHt5gaDjZbKD1VIkEm5qzw2KgxoPA/rp9vOIH9leCxSsz0rs8LV0C5SYzqZhnj9n4ejcQA4cUArC9CeXPaFDxyJ9ArGzkRY9Mg69IDHA== 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=E5jpzhWiBPl7xSmWfra33yufoQx1kp5eWvYr+/fo0PQqj9v3F0uE6G1r985TmyCCaEt0FjUbcHtyIZEf0prkpXM7QDiRdGvDQzsGnfpzyy5V1SmFC6K+aiTO/JGUygilyM/8ecwYH19SMFSHrLzjddHWKyvd1k70Gin54zTlf2w= Received: from DS7PR03CA0236.namprd03.prod.outlook.com (2603:10b6:5:3ba::31) by CY8PR12MB8196.namprd12.prod.outlook.com (2603:10b6:930:78::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Wed, 23 Oct 2024 05:51:54 +0000 Received: from CY4PEPF0000E9DC.namprd05.prod.outlook.com (2603:10b6:5:3ba:cafe::e8) by DS7PR03CA0236.outlook.office365.com (2603:10b6:5:3ba::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16 via Frontend Transport; Wed, 23 Oct 2024 05:51:54 +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 CY4PEPF0000E9DC.mail.protection.outlook.com (10.167.241.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8093.14 via Frontend Transport; Wed, 23 Oct 2024 05:51:53 +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; Wed, 23 Oct 2024 00:51:50 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K Subject: [PATCH v2 2/6] i3c: dw: Use IRQF_SHARED flag for dw-i3c-master Date: Wed, 23 Oct 2024 11:21:14 +0530 Message-ID: <20241023055118.1400286-3-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241023055118.1400286-1-Shyam-sundar.S-k@amd.com> References: <20241023055118.1400286-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9DC:EE_|CY8PR12MB8196:EE_ X-MS-Office365-Filtering-Correlation-Id: 3eabae4b-8b96-4832-ebf7-08dcf326cc24 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: o4zBTDn9V6AOAGqJt5fWpgwW66QD3ZuyIJhRFQLeypSXLUEgZTrOHbBxgIQvi8G3/PlLzULOe7HfybhLPy/kmkexbqeGr9zfkqyXW7Azedesuu23vs3rkQkXHzUA5KngEqATzb3MNbE5WXk8aeP4tus/nbCdmz39e/rioy8uBZb/0JAL9pD8Aqwgm+fyc91OtnTcWtaQ+aePGJECaevAf7ygJwjGF8JLJjtYdtKGVCKM97I3xgnx4VonuQ0A40bcCwQ5qwIdzBl2qbyBxFZxM5+hSLsVbJqellXOXqIDBt2zPP0ngG72oV+QEAmJr7/Rl7Wsz3OOarCB37JpyO6OqlsY1qW1rQDOSUrEULQLJ8vIoUPnARTZj6ghpcfogRmeBqGDdsaBHy0UZqMChIC6bGM0463Bc5MllC4ReRrDWaa0Zm6hAhRTWQfiDMzeQhnqpyiYkxdj0x8bmHLssCb9soTru1f9s6hw/h0S7NrcOkYr6haG2aCHzoYNFKNEN7KUsAjTyiEpV1TblrkQgISjXzHvKuUlJ5lIq0UiZICxmDRr38/omvp4JXAzZcm4iKtJWRmbDYKV5qTDA9GU6ilWvV+2dzn3HZNklj/NDXNaLhc6hmSHebrc64w0IQZvelzcn9lCah8Xid9i2sLwmhMzmsq4j1EEWLW0FwlSTTaSVyyeY6aqW55ZV8ONOsnuwcsE1gJdodul6KIrBfQWyZ5TrDKmILsiPAm5tFOA0UjgXH54819GTa1kx66SHydn6Ur4+AmHgiDIAL4Gi10AHbtgWqHyNOpflJO7dGqYIX/GwW1aR5nx+r1ou9t9fc8z+4xDfaQ6nSYEZz7Nl7AyGYosJAQtX8Jz7kz7G6LAgeblg4TUWRD8Z1qhi1wyCvaNVtRzuce3LnTlRCigRADqwgDJ49WTD8iPynAinqv4O7e6EwjGxiXRtzY+lfB2B1x+Fsh3qNyLTsn8MVaPHBod1VT461TDePufJqHsuVxbHncHLeaX6Ad8WYk5BOerlKdP4QL57Uhb8V2+VBp7Bm4+jCbZQKMTavnWLaWVowOCAi6+jv/lzzs6aijth1K6TSTecna+rVEfnX+AQfirieE1++M5+SzeU3IbCmX/5BlADVzZ92GAGri2RCMN2FK8viyq/iizZPmFCjqLdZE7IJM+9hP2SsL+ogq1/I1vtJw2w9/y58elY1E/mb27KjcorXyuRGZ+dZRT8X1yi+JHTPPdjfhEc9upy+XpRbIrp+qJJZggGuNnQOJsi6t5zmWjqJuIv9969tnbGwsT2kpB0Z+QYFQ8IRy3FLNxsgDycRp8DheSpqfZYWkfWg9x6n0m0HXjHQXO38gz54uLn7eVgCHlzOdsbIblyuXh3tQj4pnnlF/wmvVm0y3L67aG3rUrewH8smOLzByaTjtCnfIy5gZGof6W0w== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2024 05:51:53.7327 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3eabae4b-8b96-4832-ebf7-08dcf326cc24 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: CY4PEPF0000E9DC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8196 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241022_225204_010583_DC6CB896 X-CRM114-Status: GOOD ( 10.68 ) 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 Wed Oct 23 05:51:15 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: 13846485 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 A927CD2E018 for ; Wed, 23 Oct 2024 05:52:45 +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=Gr7FVOTdeW1hpiUHWm8GTNZZAEbA5krsJ34OyfWlfxc=; b=R1CCmeqv4ctkO/ QjwBzURIuZND8QOujX14LfzDBUp56flfhxwDi1ldfHuy2FyHts8ER15grnPYB3jIy59h/Lr6IKvT2 V+MPUduENnvph0wKQuWPPD62PnP3SuOGGf6JKCPTFy4m+dhUBN9XeAq6Slt6WtMZzhfNMDTAQ5SPU L1R62J4btgpLn5zHS4bmSpBUg5dTFOCs+Ct6e4B1qVo5pUUFvmE+roqo1DXniqHC8S0JF0fpHRrgX Ef+HJwiqSI9ppgUlwIrq3/us/27A03z6ll/W3HmXGk+BiTWGZsYH6bljH4shbJcO8z3Uj9kKbkMmZ G4zqIsTCiSemUHxjVT/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3UIX-0000000D7B2-1LHJ; Wed, 23 Oct 2024 05:52:45 +0000 Received: from mail-dm6nam12on20615.outbound.protection.outlook.com ([2a01:111:f403:2417::615] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3UHq-0000000D6xC-1kv7 for linux-i3c@lists.infradead.org; Wed, 23 Oct 2024 05:52:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=c34Kzf7UEUW87klXYEL8R9jFrNp11A41Z6uZHvmrbtUSsndHMjb+egE9yqS4wPOPOJybpAhQlHM6ot64hexw66b/P0ncoEwjPijKBy4dXiXzxFExBQ5JOVJ6h15oo2vATNS+USLnVoUUq4yvzUL1a2AHwNu5egTEFUUsenqECLqsi4CqKV1kkFFJnWrwYAsPH2zBvdox7TN6OqBkhavptaNVMvucxlKGzKuXS8Hs8d7k1Tqit4a4gQDwqwPY30J0Igln7yENfh5k+PSPxRVPIA86p2bKEUJSRaCJmNxSMDCUiJ5PWce60yposYzirGtCJ1Yp+fN3Zq5N1EWg6rH/xg== 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=UWL2WcCe7iZUOWOu5UAIApA6N3zRB+R9zcGr2OEi7Eg=; b=Ftw9v1UyzOOI7gIiEq2TU0vnHSkXjursWum01JW+ITCV32EBmDlM/5Nl5wTwZEBt0kp05WrrBuTUh31Y/XmUOmUAQFRav8FUnbZWeCdk8oS7hAdNPztWcIRBzCe1S6XkzjTNtyi1HkXATzFFZ/an0R3rVvwurud7zLn0etyvAoTlWpTziGOZRdJR314zSUlB5IjVYfmblsWm+rOsi78hQ0RcNm+xiG+97TmA1ItlbFXHq1OTX9Rv8QkXIrQLqMqXU9R3T62/1rrhTC0jCI7EKBLm4k6E2DjV/PKV5cBDfUyFdOOrXakt+aPzmVP1HpKjXb7EwQsqF8lYCp+AQVmK1Q== 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=UWL2WcCe7iZUOWOu5UAIApA6N3zRB+R9zcGr2OEi7Eg=; b=IOpiuPohMfRTwgpOIX6B69w52rw8vQIThF46nYm4K/rARZq2kzdTL0epGKTkHp8d14Zq9vD4Z6pC1ZPHZVEKaQ5qFWiTyaRM8xPZMIlTgENaAwVoyG8a+2IQYcf3QCRCTXhu3yirvV4pXW41V06qQV7vF7cWUaxXuIJBWOYpnqk= Received: from DS7PR03CA0217.namprd03.prod.outlook.com (2603:10b6:5:3ba::12) by CY8PR12MB7684.namprd12.prod.outlook.com (2603:10b6:930:87::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Wed, 23 Oct 2024 05:51:55 +0000 Received: from CY4PEPF0000E9DC.namprd05.prod.outlook.com (2603:10b6:5:3ba:cafe::37) by DS7PR03CA0217.outlook.office365.com (2603:10b6:5:3ba::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.17 via Frontend Transport; Wed, 23 Oct 2024 05:51: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 CY4PEPF0000E9DC.mail.protection.outlook.com (10.167.241.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8093.14 via Frontend Transport; Wed, 23 Oct 2024 05:51: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; Wed, 23 Oct 2024 00:51:52 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K Subject: [PATCH v2 3/6] i3c: master: Add ACPI support to i3c subsystem Date: Wed, 23 Oct 2024 11:21:15 +0530 Message-ID: <20241023055118.1400286-4-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241023055118.1400286-1-Shyam-sundar.S-k@amd.com> References: <20241023055118.1400286-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9DC:EE_|CY8PR12MB7684:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b217cab-f281-45b8-a367-08dcf326cd40 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: WuXUogQjzylRdwzYpOUre+tFVDFgOQvMm2Op69hvNRnDKTDj27gmipXUaBhtaqVBdQVyJtigS8ahVozgVc9Nydld4eGyESqPoUImxlMw8pqU+YTn5xQAmEfy1q1Pt1ulHUw3mM20ij8XA128wtyIy+PuslGWZaiPvtJUdMdAUsSjg5bNwjelSRC1I3baKUQN+F8JiEpzOX0grJWjKPv8hpRXTB4drD8BefTEy19LmrGnZ/Y/03EplpNCyksl/7t4RYZjI0Ii0qVCWltOSR2AyerSua2pcons2MNRSgWcimAjgMBW5BqGXddalfqgFJbPVOoADTHwxCLxDM4KO4/+bg6GR2Y5yDhzmsEgOH12tuEuf5X4BxCVVby86Hwp15us9k3LdLnhuGIEHmMxm8TkYRcvn30uygR9SekxbdNMlW5vpumF9B46yCfCapyk5beAG5c7crxkDVQVFqYBEEdHgiB4laJPjp14wbsmin6OHqVb8xRKFkv7hXAEGwug2klCdvLexkBPVp6zTKa7Bk//loyR+hlzBYyR0HJ/Q3WswsziUIkFIrJzWnQrQ8BF8ip0gVQJgu2zt0aKm5cJiuRnbkBX5vFshAkVmmoY4WUjOaWh5UXY+L+xdQFkHskOtK2aTm7JvXgUIQgXWcVUevOfWA7Jk7MtelrPXdJ0aGEaho0/jh2LoSG5TjJ0XOwYQ/r3wS6u41CZqi3tRvUjlnKl/VgV+87yiCH2pyXzV/ZAcSUiLxQY8xznHx8NdAwC5bJpZXgTYYswcKAFVuqJmDb1dvGa14Z8V05cyylff4wZivoSM1c/kUEYc0jSRTyAxD3lDuRRnscibVCVjrTc1TICNkViyhxoMuAkiP0/1EiP6pHui4DsNpLQcUtaxra23oLIzVK1wP9EA6HnzFSAuSvjgEqkK3KxfHto8JUGoiYB5pCInxxCHi+hHlXt9QdWoVuhaLPDpdQXiWczCOofneTIawqGk46gAARxbSZ9Rej55OzfNTBEHOhb8g0r9glQTvi5qviJ0TbW/QpvLKGMqbdiQP+jqsMHSZOvj4A9cW+31g3kLDVfkIjDDIFuDs2bPwunqlnBgpEFJ72AeSkpO6vZJoBrNZfKouIXgttoMwkACX/sK0pz3MX0mZtgr/MDsxL8ZBQxpigXkmgPPeNtNx//0xnYhfc8zqG0wpZaOnqoQzlvwapopSEqd/ctk8BgGdLX0LPUIScPWbBhTllKP4k93UYgHtlCd9Kf2FKgpr/mgbtGzHFghRliDAzDJ0NP9z4wh8R2tJmfVGICtyvZWccwR5VJGB3rfsNIBKH54nzkcdeMhSkEtT6SiEl1eJmm2k0xCYn3MszlsTPj0pj1wdVYqtYWCOxQ0D2m6uqgFAkaQAi+WVi4QKm6JlVuY1vFvwgjJyWf6EBwc58Oa4LFxvvFxQ== 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: 23 Oct 2024 05:51:55.5921 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1b217cab-f281-45b8-a367-08dcf326cd40 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: CY4PEPF0000E9DC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7684 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241022_225202_716650_CD67EECA X-CRM114-Status: GOOD ( 20.73 ) 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 | 84 ++++++++++++++++++++++++++++++ drivers/i3c/master/dw-i3c-master.c | 7 +++ include/linux/i3c/master.h | 1 + 4 files changed, 94 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..7d23c32e1c0f 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_controller *master, return ret; } +#if IS_ENABLED(CONFIG_ACPI) +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; +} +#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 = &master->dev; @@ -2771,6 +2849,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..f683e2a398ad 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 = ret >> 16; master->free_pos = GENMASK(master->maxdevs - 1, 0); +#if IS_ENABLED(CONFIG_ACPI) + 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"); +#endif + 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 Wed Oct 23 05:51:16 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: 13846484 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 460F7D2E015 for ; Wed, 23 Oct 2024 05:52:47 +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=YKpdDjxuyWf0H5gLxrV+ENbFwOlx0guWCJ/8sHpfLno=; b=p+PjSDIILW4BZS 4e7oUfcewN6HSJcVp90T2xuDMULAwGOnq0QFUT5jkbliR37nZZ5m+uEJIa5wQbDiEqcY6VuLRYBDC pEx/nmcwJhtSxGgaPwrEmaowu5S8Hj5kEqQjMxepIC6quuXgF1wZ7ivjrDyW9YQcZjLOTUOxVhFvJ LU6JwvM5qyOo+XgOUambTvG/0CEik199HKEslZHh2wqYbTAkEi96jz5Scc5glTv9R4lADgX46jkAA LDKrzCoAd/WjG63joSKIS5ELIWh08SdxUNvPu7arP2rmPB4RPJkJJ4KZDgpUdj0GOwjpWNTvmDJJe nKLNveDDRybFi182Q80g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3UIY-0000000D7Co-36S4; Wed, 23 Oct 2024 05:52:46 +0000 Received: from mail-bn8nam11on20626.outbound.protection.outlook.com ([2a01:111:f403:2414::626] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3UHu-0000000D6zX-237c for linux-i3c@lists.infradead.org; Wed, 23 Oct 2024 05:52:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MiJnQUe8ZkTTc3sXFfptH94dqw2u8YhRT8BcDjUjRbad5Cky/5G2l2uoBsMGmkDKZ1XS1mvmha+qiUfGyJtX1KFaQKBC5iKzmVfFJxHmFmd/ZpnwHcCriaJ3inmAnjrYE/lMP8cn9UpD9NeiBUkMTyC9dk0S+XCDOudCF1yCfx6nt3phu/+8dFA8z/G5HwAAqNitK2cmztJQk7R/lg25mAlMhVbGl6yLU17GGwENOWycZTfwtsW0e++BeReCEDS+sPci0LCygs+OPEWi0je1pEPb54CGsk7kxo/8XfotBQNeVngRdjC1WtIegOUhQAyINQscm/rKib8spssYOXDOjw== 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=NPKmfR8IgTnu9YrzTYscpfFxxJTFU8XcLvkTAzCt77k=; b=at7sepv9w0QrXbFVgCwdGBKZwiQ0kKzxORZNYya7Be4e0r754LkpbECSHcUv6kNp1Z6CorAyA0As+nWqUodoCkIWQlU1AGGeS2MnaqvAx8L6MYkNtYiSQfwJMEpWFBeAFadtQ5VOsz/FEKxnHoYL+5kzDuKzWsHuF6emulx40R6S79qlPr/rZwabx7eyrEse4M3jvweZhagNCW+ku72807ZUEwbCb8k5kyA8boojUlTceGNaaREgh4HiUIFCKQYy9et/ixAbTtZsjFz9q+EHssW2zVtCB0nukHy2uAoslbtrN22Um4U9SRNl0/2O3ke3tG6OzmeVmOaZrQfOfTBQig== 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=NPKmfR8IgTnu9YrzTYscpfFxxJTFU8XcLvkTAzCt77k=; b=smblkJcb0MUIcYXsqIV9K3XgdS+SliPnnztDUZdER/Ik5tfxaCaF/hUDPZk5h8+3G+Jdj2kg+A1Iq8WByAmKb3+5j+oRWIkAWgcAcjYOlnXfJzk8jHR9IfxWwfDWSibeDpCoKVACIFZ0kVUk7xMYQzOm9mqsNR8CDH9BC6kCfoE= Received: from PH8PR22CA0021.namprd22.prod.outlook.com (2603:10b6:510:2d1::7) by DM4PR12MB6374.namprd12.prod.outlook.com (2603:10b6:8:a3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.18; Wed, 23 Oct 2024 05:51:58 +0000 Received: from CY4PEPF0000E9D8.namprd05.prod.outlook.com (2603:10b6:510:2d1:cafe::4b) by PH8PR22CA0021.outlook.office365.com (2603:10b6:510:2d1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29 via Frontend Transport; Wed, 23 Oct 2024 05:51: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 CY4PEPF0000E9D8.mail.protection.outlook.com (10.167.241.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8093.14 via Frontend Transport; Wed, 23 Oct 2024 05:51:57 +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; Wed, 23 Oct 2024 00:51:55 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K Subject: [PATCH v2 4/6] i3c: master: Add a routine to include the I3C SPD device Date: Wed, 23 Oct 2024 11:21:16 +0530 Message-ID: <20241023055118.1400286-5-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241023055118.1400286-1-Shyam-sundar.S-k@amd.com> References: <20241023055118.1400286-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D8:EE_|DM4PR12MB6374:EE_ X-MS-Office365-Filtering-Correlation-Id: ae84aab0-8cc4-47b5-b1d4-08dcf326ce9e 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: mincNspPLvgo5kQb0mKnn6ieGy0pv5AkNxH3gQiXG64iDHlXjxlSV1XAZRk1VgvE7qdmAmkZSeOKp0QU6JPflxbMHET7g4yrMTUHhWSSPPR3hOlfKC45VOnk9Ptd1r23P+cTDrPgBqW1uvugh6uZVo2TBikfZDtJXb1gjbmO87MPzdGUinHcrBVNmK94MafFBa3P4NtYc8CM7H66FcV0SArKXhtPB3FhisA+KgCCNcDS10FP/3xfbu2c+6JIy50V5T3XdDEVKMCwlUr/Tjskr58bpNj9D9uAoT8fF1RrhM5t+hGef5rYIwwSyoLKOgj8Q5hEILVgMDc/2miS1ee/Tpa1KuU6Yc5ctQg2CPd+YLD9OyCdQxSuarqz3uz+uUoNkZfp89C9WGzyEL5OabFQK8CVM8bk/uhQ/eWz92/BsXCxdKORFMijXBN629kgh8VT2EA/cu6EY8w27TBAFiZcePCG48ul3S9YnzvxWTmRyZRMA6aZWKbIhl2fjHXZBhEIG/n4dHXo+LGDRv5z8h6wclMr0sX/eTLd5t+2KCKue5DG6xFYcuyQf1y15ok0f7Rn7lufqTrl/mmATvPUx9FmsM6fXTJ+0wL0cOE+rZlH8ZdCONvNQmSivXkto6WNb4nvOwTOEqBF5hr9KEVVwsEHdQEYPWzPHZ0CtUudeTSwMiydUDzAOtofnH7x9+Zmj09rqPG0kwT9evmjLDGzHo2UgS1dlqvgTJC7jQHN0QHIslXwPXyvOm/EZjG0Ye09R2G5qvJoG57io/zfV1MldwbO+NpYMRL0TalYiTcUTeAGsbKSAJiyrBPrWgBOzmCiRAUyBCh+JkaAeeURL/PCeqJvRBIvvaO9vkSbiJcjoV73acX3NS9rSpHB01dzFHMhAOvFnt/k3FrvUU4ywWoPmp+LMXggA2AYQ1PjSO+6ILgy5DFqlm8EYWNNgQqrWJMF50OB5/XtoN28jxZoxghuqhSYXgkBf+QfBDPfocyeYuWoe/IGyjDe7IkqNsHZ3xOhjuRdqWjPUWIvkakY5V22jOQPdCkWQjH6Ng3nbKNyggfkzw1Ud/hZaF8RfK1uxFgZtaR6u2soSiRso/EWShyvsj1uPq2jqppeiHF5bwOAcwG+cwOiCxLTFvwmy1Tf8aWogG0a4TcHxo9K77hqJZIiJFjodNNB7uyORp02Z7nkz/fKFR27zqdeZDBEHUd9Zbpi7QDf34kOw/4SM4+xIAyP7wwh6Gu1BUs8oGD7Ee6QZpbWeR2fi8YRsWLH4Tttcd7tPU/Y7wzrocvqCDS0SYAu/QDfWz/Xlw5aRecP2GM63jHFzqOtXBLsp1b3sK7MWcUMYd89FwNPch8erhWzVpnX71kGGlgQs4RUfsRbLwPv5SCaKx38o33bznz/EJg1dqpmFo+tce/Vn1XM8ODZwXcmBmu0Hw== 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: 23 Oct 2024 05:51:57.8706 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae84aab0-8cc4-47b5-b1d4-08dcf326ce9e 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: CY4PEPF0000E9D8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6374 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241022_225206_560655_A63BA2EA X-CRM114-Status: GOOD ( 13.82 ) 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 | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 7d23c32e1c0f..ba6f17cb8aa6 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 @@ -1814,7 +1853,7 @@ static int i3c_master_bus_init(struct i3c_master_controller *master) { enum i3c_addr_slot_status status; struct i2c_dev_boardinfo *i2cboardinfo; - struct i3c_dev_boardinfo *i3cboardinfo; + struct i3c_dev_boardinfo *i3cboardinfo = NULL; struct i2c_dev_desc *i2cdev; int ret; @@ -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 Wed Oct 23 05:51:17 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: 13846487 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 B2A9DD2E01A for ; Wed, 23 Oct 2024 05:52:47 +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=3isLz7MqROlG4SZ0tXp84UgMRiN9qDKdEc15gMvVHq0=; b=Jd/ZM+VqmC8c4u OfOG7Ta+7+UOrjfeYvg3Cu1+lNCBNWZw73ANLpGAc3gYibM7ff/z/lE3rBT3lYno1PBa0iy47EBFd 5e4cst3g5sxRKxEfy7ulE6X4b6Jxklqg/UXcz58p/ppRzYNEWhuhQ9HauWfNINmW5LBCCgwT4sv7s 442xXMdDuN6FVgONKzjHh/HAJHIVAhDxDS3myr4MA6lKoRRjcjoVRasklP9ggC5abnk8Uzr3nUcOj QQ2BAYor+h8AS+KrLTG9guKBlSL2cKx22FWG3EGkVxzhLVeRw9LccXhOM9SdRs0Fa2GXED02vmPqf 2WL5BFJtbW2nLvTrLqjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3UIZ-0000000D7DM-1NoH; Wed, 23 Oct 2024 05:52:47 +0000 Received: from mail-mw2nam12on20601.outbound.protection.outlook.com ([2a01:111:f403:200a::601] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3UHu-0000000D704-34Cp for linux-i3c@lists.infradead.org; Wed, 23 Oct 2024 05:52:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=W3iokkdk5kbZ/+WoBdc4CGWLAIyKRomj0rVe/98sQBgwJhtwQWEjYa40iAiprvCMfg4TPXWJP6djDgV969nPfsDxJAe9uevnEQQ5Q0IVZs7RhkkCcRJ6LTPIYyAwWCePDk6JOMCfQQU6Zebg9Rscbp3whNFFztcMvJGbwozSnGAI5zTjqTD+Y1m0B3shMKPysi3+0xb6Sj5flClrT0NfNSCtvJjrXnutultpvQe/PzsUyuW3q5ltuBSyKIlEJRWe1GCgFzI9wyNbIAZMBt2r4ebddGLuWLAP2otnH/v4fAHzMs9GTsm1JxmpWjUOaURWq4HhenPesZJJaD/t8BqJWQ== 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=qMkF1sZQBYelH7y8Q/FMo+sKp9l4Kok+UrdyQTkkKc8=; b=v4l1Mc2oR2tAKUTFTTQtpy52GzcgjtLRY3eoVuhWKg/3PWEzZVSgaxSafLa+s3hQveqeeR3n7YHgwC06WfYEih4AMBVcGgWfBL+gqY7pG9u2AqBO+PXmW1YC7oYrhlVdCLXdvdCI4TborLu08rnXljYlJroZR8memHH+Tpeg9g+LE7wEnaCbbCtSD7qHr+5SivWtoW80prSljK+a400juCFMrlyA+D4lh++iv1FnWvn/0eBy8TOVSZsOV1WevIBCOI3EtOiBDE1Aeehr/KHiFD/tZ1G6fh1frx4eGsbiW6gFztO6jhYZD5FSOlat4LfTEXHyRsCCptHlcKKEHVf1uQ== 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=qMkF1sZQBYelH7y8Q/FMo+sKp9l4Kok+UrdyQTkkKc8=; b=Bm1d+ngX7DA4htau4nSXitf5D5wcKGnKORadttaxXXqys1kLxeWLKURKSavp89rWYPSAldMc6rXmY1cX/HMBObMP35UZJYckAU49l7fYZc36w/4+/S77My9l18qVcsuHDogRR7E6XgvOFAUIu5wUvy2jEj66bFgqWYZf7ODTs0g= Received: from DS7P220CA0068.NAMP220.PROD.OUTLOOK.COM (2603:10b6:8:224::23) by SJ2PR12MB7822.namprd12.prod.outlook.com (2603:10b6:a03:4ca::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.27; Wed, 23 Oct 2024 05:52:01 +0000 Received: from CY4PEPF0000E9DA.namprd05.prod.outlook.com (2603:10b6:8:224:cafe::93) by DS7P220CA0068.outlook.office365.com (2603:10b6:8:224::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16 via Frontend Transport; Wed, 23 Oct 2024 05:52:01 +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 CY4PEPF0000E9DA.mail.protection.outlook.com (10.167.241.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8093.14 via Frontend Transport; Wed, 23 Oct 2024 05:52: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; Wed, 23 Oct 2024 00:51:57 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K Subject: [PATCH v2 5/6] i3c: master: Add support for SETAASA CCC Date: Wed, 23 Oct 2024 11:21:17 +0530 Message-ID: <20241023055118.1400286-6-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241023055118.1400286-1-Shyam-sundar.S-k@amd.com> References: <20241023055118.1400286-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9DA:EE_|SJ2PR12MB7822:EE_ X-MS-Office365-Filtering-Correlation-Id: 1cc4cf09-483f-444f-3ec9-08dcf326cfeb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: uiNh80Chn8Fu+ilDmJdWCiNlUAC3LxXxb1dcjFLsjRgMw2s0gt5fXJAjw9+jGrCG+Nif38PA14d+0TkGZ1TSK//b2iy/VZYKp8858G9bmxDUk9Q8v72TnoMjkM9jLTajIp5xlrUdMKoi6t+L9bPi0DEMZgbikJPI+FIW73f7RPY/9ucK00Qz8R70czDanxGWGocl6yCjqJG5iNv4LY5dey05V4YIZbD2McMKMiYDHrYdOY0LysyZX0XPaHyc5uHn31oizGXsi+G5sgnaO3/gTLevnvitQEwvdoRo/xXiEQUNie9vtpMzSuR44XuNd3MVIXF7Ze4/IS+2Mr82B75TT+hkUWRGp+MvVaZluNQ7+TIAWtmQyd+jiLLfxe7uGD5BLYj/KFI0XhF9mmZJFOUFWlBPJUStJ0ChiIyCixnihF0plUclv3crQHafQ9xO4wLOEYJp2YqcTu5qZIvT7k7mn/R6Ihk0cHLJMJbbiVAmAbE1gyi/ovQGOjvx6Vw2W6TLdFQGodoFCH6SRMEntk3b6TOaoTrKkD5JXG1vqmCd+RfVudA4/HyCvN37N3r5UMjGECCvF8Jhn8SAncXZ3JLdvB9OMXJSeW0tfoRVaplPCy+/6ROx8BIvC7fM7rzXsQ4uy2D/kzYIoMzcXtydkqnZVuyn0vnnAgJ0JXLNA6v5LJvI8WscQZoMnqRiHsT6YvJdh3hfmdoMTyDXOU4DUUY8sjTEpnBrmGahyDw4za1BTzOHN4wXW6LvPI7NBeEn5yJRdk7USHREpCMc5adW/1d1cVuTpl/qeS2qVudiCWhJwI8h//BRExZ6oM6rgNSKpDpqafYdUOiqDdOntsvA9QMX9Vxh0wuvWuzYRNyXvMQl0QYCa+A12WHPCLHGPNF77tTuQ/NmAlyHdaIOQ08BmpwLGNtEY0O2dcPCeuaHeG1EdrWdk77bQs/iC0UgwA1zNY2wNNWseQzzQeYQFF+g17Abkqbxvxmxm3AWt8X2FbZYOgJSxVVPxPMmbmnD+NwrfjJv0lZ1oLsdgKNoSGaKr3i4WaaX/eG58wsWbIZuKBM2d7nvNIWwLol2LrgLjbRskkre/S7Cq6tlZB9YzSLUG9VhDTzm7rrY6jFASLKWvWjxYNclLn5/gCTccj2k4AxIQhXh3WCKRneftNpZ0VqiYZwV7VvaoAZPdO+awtS91W28IRUkVUL10MLg/7WS52EZMhAx1mltVnCX99rQPAYepZb8VUzv1+xptfEKDOLaOx4PfHVxEdQeauOrgeQk+sn5FXPJFXBYdZtLOIjE90OXE3eBy2ZA8fTbeMP7xr8k9JqwGw5Vnhky1/qttLK0QVcnzYCoJizTutMjabnPg466qAkrtWyzsR4tYEk8oq7a0E8iqyQ= 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)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2024 05:52:00.0500 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1cc4cf09-483f-444f-3ec9-08dcf326cfeb 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: CY4PEPF0000E9DA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7822 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241022_225206_835130_B0A2BA44 X-CRM114-Status: GOOD ( 17.50 ) 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 ba6f17cb8aa6..1596efd6d82a 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); @@ -2311,6 +2337,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 f683e2a398ad..90a43209e55e 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 Wed Oct 23 05:51:18 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: 13846486 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 68E90D2E01B for ; Wed, 23 Oct 2024 05:52:48 +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=pH1t6TUdHVCix4Fi7IxExeRlClyHu/Bl1zEaxUd9T/Y=; b=3orktgDwyYfEOk Igx3ZAMOIssL+Jxza9lsDsyWxCtmS0g0g89PrfXqRWZ4GkAIpN23N4uyv4327yOzbgp8mjHdcLP8k DHhJ4KW2eFFVZN+v0t37sx7u3P9AqZgFnsANiHk4AkMYwn9L1E0DeGOFcCekj/DgdO5TB3Et79Ehi YbgNoqaZAGv/U/urj6fuMRYvfm/QEPNRG+HxaRw7hddtFmERtbxdssX8yaIIhys8BSo69WovRRwKI 20+nTaJK8EISm5ree0A8ZQz+sCI80o6YlpOzL9k0wrPfvtsskcWyYD+Ghn88c3DVY2ZjLSllC2dBj Crv0pVe+afTgSncClRRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3UIa-0000000D7Dx-0KDo; Wed, 23 Oct 2024 05:52:48 +0000 Received: from mail-mw2nam12on20613.outbound.protection.outlook.com ([2a01:111:f403:200a::613] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3UHw-0000000D71E-1yyU for linux-i3c@lists.infradead.org; Wed, 23 Oct 2024 05:52:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CrHiunWdaewHreXvhIkJH06YAlv3xft8t8RcIxePBaB7Wpd+p7IpVke6sEMebKvnnhqcrLbH3Ib0dvLgBpP3OrScOL3Mkx54xitoswnqI1/Y1vewm+YO0QvxzG26icfpUfmJO0REtR8yxjudIfBGZVAhXx3jkAmt/idnyg75uuG2ZWiIj+wSo5NiziEm6RLfAF/hHPgkmnH5Vs8S9rbK9hbp3/vYjmZwCdV1VrB3bMKpnatzKbG12eiLikbem5W3tlAsUGU2BvUAOq8yeIyW9D9+Bk5CNfBTaaseHsfPUva3ltIqTHW/r/JtWnnfeJf6NSQobNOOt6CIJ/2ceAjIFg== 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=Ay3itgHMYpEMOPmDr2yuhGrGo3KOsbxjohAcL05yeFs=; b=ppeN9iPYhID9t11lo2yZOqaVz4LILuWOUj8Z6PKeZQEx3RY5/ZZ8s4x5beScEF1SEr6PzGzoCn1JuAqdMUNcEbyAjHibExf41CP+/fH7CL3JjlaX95E+5pnxfddhnusGwmjOwzeZn8UqRu8xksPaTiqjYL5Zhn05rHTgZ/bE7kkolz9FymYMLRXRqJMW87vFTfOsB/zzPC3eY+2IBdiqhHOUNoCBWbEs52dxEnh+7VqcpED4s5UlUzjflgFJWv4JuT4V4gyLdJXJt5WmJyeFoJsQeO5yBZcS2JFLwb4XMe0BwIRcbgzrcahHaiSMcgbHj3dU+zXERoZ3bIED2TIWoQ== 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=Ay3itgHMYpEMOPmDr2yuhGrGo3KOsbxjohAcL05yeFs=; b=GQEKvGAdBJBhO3KKSrmW5LhnmVrVI3alNuwYhg4jU0VdaVJoPO8ePIf+fBiTcY4vt6lnNmdmSFYhEj8vuLsq09Qiqa/BJ40Brap5A/vEGvi2rirxy1KQwC7GYxVwp4sJKW5eQ/A2LW9sRVlMVDpt6iYUio/Z9otMfn/stYymJ6c= Received: from DS7P220CA0057.NAMP220.PROD.OUTLOOK.COM (2603:10b6:8:224::9) by MW3PR12MB4396.namprd12.prod.outlook.com (2603:10b6:303:59::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Wed, 23 Oct 2024 05:52:04 +0000 Received: from CY4PEPF0000E9DA.namprd05.prod.outlook.com (2603:10b6:8:224:cafe::63) by DS7P220CA0057.outlook.office365.com (2603:10b6:8:224::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.17 via Frontend Transport; Wed, 23 Oct 2024 05:52: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 CY4PEPF0000E9DA.mail.protection.outlook.com (10.167.241.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8093.14 via Frontend Transport; Wed, 23 Oct 2024 05:52:03 +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; Wed, 23 Oct 2024 00:51:59 -0500 From: Shyam Sundar S K To: Alexandre Belloni , Jarkko Nikula CC: , , , Shyam Sundar S K Subject: [PATCH v2 6/6] i3c: dw: Add quirk to address OD/PP timing issue on AMD platform Date: Wed, 23 Oct 2024 11:21:18 +0530 Message-ID: <20241023055118.1400286-7-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241023055118.1400286-1-Shyam-sundar.S-k@amd.com> References: <20241023055118.1400286-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9DA:EE_|MW3PR12MB4396:EE_ X-MS-Office365-Filtering-Correlation-Id: 79b892f9-7bd3-47a4-d852-08dcf326d1eb 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: HdWXeD4wQXXJktrLz+wGT3YpO0DMY8K7JPwDOFQQ0XFnFx9wNLDw8S0mopi/F6aHbJEhHtmB4i3S9/Dp+kO3bybYAKzvRG3UOKB4NnegAp/PtpI2gxcOeBGbkhkqx/Sxiw8TmbvdRhtbxqBAGLLnn5FEpykP9AiZ/0z4T1DXCvRMPWkpPfqybParAzx4cjbHW2KuptaPWylzeCj8nPV0rgfotOHTbSTflfTwNaPzV1sN7my8BM+UAjB5ZMOz5UZTlCpO+z/o6NxXGpjSS5efMc0swzTNaILGKxvMlQ487iLsmG7cZrZMKmKXtUMbTsphc5dbDCxPjTXT/LJexQq70RmS6wxapvZPdZQIWLBRgFAdwcBk+paeuQWleUC95gQERCjihHIBuSMObKdPkaY5+p/jZ02ypJENif2zTjYRZalOLLWvohrIvnQlJ5JbykERn2Jy5tMpMeZqzZpAR1D9oCy1YO15pKEQdMwKqG7+VgYSy6o+mEMOjQ6ZwRz8eygUAVUhJCZwn0L0YFrv4IQbB8vLXTYzlTMVpIAn43+BbsA6SxznkJj1CxwxmEKtu2Ad0Ce65rulL+rV2b/3eYlvopVUQkzkpeUIe14LHGqMsL/WBEfzd/b++CKOFk1eZtFt/gkE1QeJ6Uu5AZeeNB/EYIEYn1sJheizGNU1d65/wK+UWy0OIIYDcHNIQMzBZMU7xIEL1V09a5yDmTDxKXNOxmb973Q0MO+P1cUDe2c6hcMes3kxOkVmqaGyE2FI1FgHl0XKoma+hnbgfYcl1WQtyHe0EMtORB4XFNzrP9gBB57zshYtYluasV6ZYzW9fY+JypY+HVUqemrVCElmYaodx4uWk9j9PuxqnB630MPIZDxsx9Fl2OCiMEwE5sLhK5GnDOZj0F2+oBPD+VwKwQMyeOGhS2/Kj0CRBXEgBfTbWyoZF7XiD9DJMS6VpCwAegxLi1C0XKPkfwFCOUsab00g9sls0GYhVJ3Emdz+2cmHNbhsIOtT2Ik4UTuqFaAu8MTx6jJw9ATxc394/sgrbAo1Y+xTMZOQFgSCY8hCWN9VAeNHYY5TQqQLLXdBb0tGHb0PPM0RcDaHJCXbkO5QrabomqoeRUZ1i+b5ir8+XuTWUPfyW9W5Ui6YG7wHo6xayRSNXB4E3nsAz6YI+nVoYLwFhpDh4hKTZC9j+iHVozF19Sq5kEEqcor0WbJr7YiO1vVi/6Xwb/InzuLQmk8lCXBjX93y8osTJac0PzUO0IXdvpFyuJL+7jf08z53HI4uOnT3VSnjPCS+ZD6dxYtgAIPT/en3RWM1FY4hhLlLX3f3Ky6GuPQkmdWfzblRfGZQW/REB7h4sb3wKDvpAMB0LGvM7RQkNS7sNPWQmnphHoujWjmPXUJojv0/EkcLSChWmUbPM+hYvif0snBVvhjU6BNNBw== 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: 23 Oct 2024 05:52:03.4094 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 79b892f9-7bd3-47a4-d852-08dcf326d1eb 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: CY4PEPF0000E9DA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4396 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241022_225208_579862_5F25657F X-CRM114-Status: GOOD ( 17.89 ) 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 90a43209e55e..226c9946c4b7 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, @@ -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 + 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); @@ -1683,6 +1706,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); @@ -1757,7 +1784,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)