From patchwork Tue Oct 29 15:54:33 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: 13855122 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2072.outbound.protection.outlook.com [40.107.243.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09854802 for ; Tue, 29 Oct 2024 15:55:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730217323; cv=fail; b=hsLin2DNCxA4dl/UBwmvCxdUcb8pWrYcsKmdK7OyMupyhFY4e0my7EV8Mwlb1xnrroerylxeiuZyEeyUhXBriUuTFJ6/fHdFcFHBqCDOZK8OtKxlOZd0dBAwdowWu8gQNzOTAfW1bVbh0XUR2KT8oJsnsmjb+9LGhDPUwRsHS9g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730217323; c=relaxed/simple; bh=FXxWys5x8lTzO/pQ9HwBEheyS/1hDRR0Rc6bikv59e4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BoB9wK2CMBPbgpisAV/j5dYqoclpPEzofwfCmai2pUDj/tx6CXsahaFrtsmFDJPFZhr1prS0tP0407GMEXyeIV8RVgUVnmiVWigQx8rtLmsOWjMi2L7wcz0gYjVbt4y/nt7VJP4j//h+ssBesy5oxtHdscJSC2UJbIDkly20bYI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=iAvyNcw3; arc=fail smtp.client-ip=40.107.243.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="iAvyNcw3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZZ40QTs3m0GHnsvsQs3HHkwFleDA7l+vdhqfue2+ly+NePHtfYqg+NqLVJLp2kbYTdAQxDmLcqTtal2LBFLqGZZ8hOlPI/XkgcPChbV2NMbA6OefrcELPfYP97FyiGyNhO9PFSezsSslJM/4yxQoPU9BgnGkQxP+asph3YH+lfPv6gN2OTwheC2s4K5dhMwnR5XtpTYW7g0yh2VFG5Bjw6dKimu9hkF2hDUD7P4mgk8Fx9BPEmApiz8AC7AjVqt+cDyD+KoE157p7uTINwMqsoheI9eVeHSFrB+3cwhsxiUHOqoAg1Y+89Jj23N2KwmW1AuJ43sCAdiRwB6FYiestg== 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=8HoVtWk96I+dFihLzuCaX6Kk2V+RdxKiCQbGWTB2q4I=; b=u03I56XiJjtnkpAJB/8bC5Tqh8MVvb5jriq/bpMzxiStgtSqvocg5Qr4OWGBq84DTZnPp+nTpnlKLTfaj1phCYZ7s1IJ8Zb+lxUr7BsSK+xh86Rd4SUD8p8FKVngrLf3OK2gKArB6dh5wSJENiLnShQp9g0HPqWxxD4PEgtvol3p4d05A9ccQQKwHytQ8IijkPPwVnCB7XmjYloa0W+8vxrF75r2izuJQsIaAIM8nrCyNEvCNtMsaUeMXV3Wo3O/hhDwRFldCeftbQPxCCsdgJbVPuxHR3+iPi/3wbWE0LAsCv0jy1EWrSecnU1CZjqQKY4vcUT34S83DSl1BCIc7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=8HoVtWk96I+dFihLzuCaX6Kk2V+RdxKiCQbGWTB2q4I=; b=iAvyNcw39S6SPwlZs5Hw9DN8S1W9QoVbbEnLz3ItkLdUgV9Fr0zSRAU+uYLTJ5j9KwA4MB5VqCwBusexSELZ8HGSMaKCLSb5Y97MPEaewx8UfyttY8pcAAE1NG9cyi+dUz7U/T0OqEGgYUD8XNm/0yaT2wWseGueV4PRWt1r0Yo= Received: from CY5PR15CA0150.namprd15.prod.outlook.com (2603:10b6:930:67::9) by SJ0PR12MB6880.namprd12.prod.outlook.com (2603:10b6:a03:485::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.23; Tue, 29 Oct 2024 15:55:14 +0000 Received: from CY4PEPF0000EE3F.namprd03.prod.outlook.com (2603:10b6:930:67:cafe::c) by CY5PR15CA0150.outlook.office365.com (2603:10b6:930:67::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.17 via Frontend Transport; Tue, 29 Oct 2024 15:55:13 +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 CY4PEPF0000EE3F.mail.protection.outlook.com (10.167.242.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8114.16 via Frontend Transport; Tue, 29 Oct 2024 15:55:13 +0000 Received: from airavat.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 29 Oct 2024 10:55:06 -0500 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v2 1/8] platform/x86/amd/pmc: Move STB functionality to a new file for better code organization Date: Tue, 29 Oct 2024 21:24:33 +0530 Message-ID: <20241029155440.3499273-2-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241029155440.3499273-1-Shyam-sundar.S-k@amd.com> References: <20241029155440.3499273-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3F:EE_|SJ0PR12MB6880:EE_ X-MS-Office365-Filtering-Correlation-Id: cfad00b9-835d-4344-433e-08dcf832137b 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: 85NZUhpnJexiVgzW/Wjl9SWtDzRPbFAhEPV8F/gg+dtdAR90kw5nHIo/hvEPD8CH1bjbP56k3UQc3UaWLlrRoge4ZgI3BDFf8eMbPZrU394Vqf5+ChUJsyFo7kaykHXUR9J6cZ2mT2B1l+OgDRElWPiC5P/MBvEkfmgilV3ttP3NPrZhQLfVtnmEwxKxzD9ROAV8V7//y4NkM3olm10b+f1j5xnQXetE3hyJOYSgsxvCLJMpJtzlli5gah7CZDTywW8CaFsNFeL/OxOVxuiQEtom/6ibEscHk00/qYFOJv2JR8qjOo4kjg3iL4H9lxMg1VJfIbSLW3tRJxDJrqza/GwO2GhocK3Ye7tcXolDDpXrPx9ccHN5ZGRirOWQlODIAAFUrmc+J8b2gAWszw6SuNL8T47AtdHKp9ub2Vn+ps/CpgRTmT+KVPv88a/xrAGe5u/Q7osIf6Bxo9Bf/7mxk+swCoH4v1B5sSVpeSPnUlQNpWn+zyNAz9lxcGidZJaLMI5RG2pj+lL/Qqzq64oWXYVClWaPTsSKj17m/ux/XLu+GDXscRqb9Adtr0uo+PXvgiUej18VVATkrxD0zYDdSFthNNlDz5Bj2XEATNVnudcAPZuAUPDOhtXkaqWWeecVj+PClISV7M6bBgqAHJHaKGY0EyVcAii9tI+rDN6ADHe+Nv/11IjvODQ1x4hxCrAS+cq7aRHt9DB7IYEoWQL9TfHxJ1BnTmdylYR/1YoWxuzdZepG5jikiKh1ug9uXkh9kdXgwmVTo45/b1n91AcSvClDAZ6td0MMWkS/LDZSM2KFeyEbCS9XBJP6EwKJWzEO4kv9dH5aYkT9H7x7YZOsew/flglI+69gVCs8kiXJUMg5o3XkKfZR9nGzztByBlA6anvZIiNh5hMdQ1Qz4s9qYb1R6+ny6/n5LhoYIgsZmi8Ds71u1Op+BLxugqU8bkBLeaHvB6zsJnoUUHp+7Q9xppV53f6zu6bQt5Duj8Os3zRIi7y18CDpDPEmRptoJac7SE8+MbGwFkdMKUNUxF+ALz90P23NMtUWoOTM1mXkKs+yeJEyCFO/5dSuvtbEQOwrX25rNWa5hU/2173I/K9bAAnQFjYGoY+kZm8tg+qDYxkqtBPtSnE7hYrmBvgjK44Ks47QX72E0uKQDbs0Palr0X7jS4PAgvVlyF1nIbK1JioLocPJT3WkDsAk8P6ffbTVxc+DvVXVGtUFbA1OZ7dzRceTCNdZb1yIfNXMfOnUnqI6wSKbZUmdroOEavWATjHAB6O89QWUp4fdGQmjc4VgMOgmQXlVTSp0FIxL3p6RGD3MxZ0zzdIlCCiA6XB3sfId44FTkqoo1EY2ZaQLnCuTmj1bNzlF28JDqxJQk108NbK/VbtITf0sXkJ4RIHLlp46yqeRXphUNCFURIplNgyX7A== 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: 29 Oct 2024 15:55:13.7260 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cfad00b9-835d-4344-433e-08dcf832137b 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: CY4PEPF0000EE3F.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6880 As the SoC evolves with each generation, the dynamics between the PMC and STB layers within the PMC driver are becoming increasingly complex, making it challenging to manage both in a single file and maintain code readability. Additionally, during silicon bringup, the PMC functionality is often enabled first, with STB functionality added later. This can lead to missed updates in the driver, potentially causing issues. To address these challenges, it's beneficial to move all STB-related changes to a separate file. This approach will better accommodate newer SoCs, provide improved flexibility for desktop variants, and facilitate the collection of additional debug information through STB mechanisms. Reviewed-by: Mario Limonciello Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmc/Makefile | 2 +- drivers/platform/x86/amd/pmc/mp1_stb.c | 295 +++++++++++++++++++++++++ drivers/platform/x86/amd/pmc/pmc.c | 289 +----------------------- drivers/platform/x86/amd/pmc/pmc.h | 9 + 4 files changed, 310 insertions(+), 285 deletions(-) create mode 100644 drivers/platform/x86/amd/pmc/mp1_stb.c diff --git a/drivers/platform/x86/amd/pmc/Makefile b/drivers/platform/x86/amd/pmc/Makefile index f1d9ab19d24c..255d94ddf999 100644 --- a/drivers/platform/x86/amd/pmc/Makefile +++ b/drivers/platform/x86/amd/pmc/Makefile @@ -4,6 +4,6 @@ # AMD Power Management Controller Driver # -amd-pmc-objs := pmc.o pmc-quirks.o +amd-pmc-objs := pmc.o pmc-quirks.o mp1_stb.o obj-$(CONFIG_AMD_PMC) += amd-pmc.o amd-pmc-$(CONFIG_AMD_MP2_STB) += mp2_stb.o diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c new file mode 100644 index 000000000000..9a34dd94982c --- /dev/null +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -0,0 +1,295 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * AMD MP1 Smart Trace Buffer (STB) Layer + * + * Copyright (c) 2024, Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * Authors: Shyam Sundar S K + * Sanket Goswami + */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#include +#include +#include + +#include "pmc.h" + +/* STB Spill to DRAM Parameters */ +#define S2D_TELEMETRY_BYTES_MAX 0x100000U +#define S2D_RSVD_RAM_SPACE 0x100000 +#define S2D_TELEMETRY_DRAMBYTES_MAX 0x1000000 + +/* STB Registers */ +#define AMD_PMC_STB_PMI_0 0x03E30600 +#define AMD_PMC_STB_DUMMY_PC 0xC6000007 + +/* STB Spill to DRAM Message Definition */ +#define STB_FORCE_FLUSH_DATA 0xCF +#define FIFO_SIZE 4096 + +static bool enable_stb; +module_param(enable_stb, bool, 0644); +MODULE_PARM_DESC(enable_stb, "Enable the STB debug mechanism"); + +static bool dump_custom_stb; +module_param(dump_custom_stb, bool, 0644); +MODULE_PARM_DESC(dump_custom_stb, "Enable to dump full STB buffer"); + +enum s2d_arg { + S2D_TELEMETRY_SIZE = 0x01, + S2D_PHYS_ADDR_LOW, + S2D_PHYS_ADDR_HIGH, + S2D_NUM_SAMPLES, + S2D_DRAM_SIZE, +}; + +struct amd_pmc_stb_v2_data { + size_t size; + u8 data[] __counted_by(size); +}; + +int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data) +{ + int err; + + err = amd_smn_write(0, AMD_PMC_STB_PMI_0, data); + if (err) { + dev_err(dev->dev, "failed to write data in stb: 0x%X\n", AMD_PMC_STB_PMI_0); + return pcibios_err_to_errno(err); + } + + return 0; +} + +static int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf) +{ + int i, err; + + for (i = 0; i < FIFO_SIZE; i++) { + err = amd_smn_read(0, AMD_PMC_STB_PMI_0, buf++); + if (err) { + dev_err(dev->dev, "error reading data from stb: 0x%X\n", + AMD_PMC_STB_PMI_0); + return pcibios_err_to_errno(err); + } + } + + return 0; +} + +static int amd_pmc_stb_debugfs_open(struct inode *inode, struct file *filp) +{ + struct amd_pmc_dev *dev = filp->f_inode->i_private; + u32 size = FIFO_SIZE * sizeof(u32); + u32 *buf; + int rc; + + buf = kzalloc(size, GFP_KERNEL); + if (!buf) + return -ENOMEM; + + rc = amd_pmc_read_stb(dev, buf); + if (rc) { + kfree(buf); + return rc; + } + + filp->private_data = buf; + return rc; +} + +static ssize_t amd_pmc_stb_debugfs_read(struct file *filp, char __user *buf, size_t size, + loff_t *pos) +{ + if (!filp->private_data) + return -EINVAL; + + return simple_read_from_buffer(buf, size, pos, filp->private_data, + FIFO_SIZE * sizeof(u32)); +} + +static int amd_pmc_stb_debugfs_release(struct inode *inode, struct file *filp) +{ + kfree(filp->private_data); + return 0; +} + +static const struct file_operations amd_pmc_stb_debugfs_fops = { + .owner = THIS_MODULE, + .open = amd_pmc_stb_debugfs_open, + .read = amd_pmc_stb_debugfs_read, + .release = amd_pmc_stb_debugfs_release, +}; + +/* Enhanced STB Firmware Reporting Mechanism */ +static int amd_pmc_stb_handle_efr(struct file *filp) +{ + struct amd_pmc_dev *dev = filp->f_inode->i_private; + struct amd_pmc_stb_v2_data *stb_data_arr; + u32 fsize; + + fsize = dev->dram_size - S2D_RSVD_RAM_SPACE; + stb_data_arr = kmalloc(struct_size(stb_data_arr, data, fsize), GFP_KERNEL); + if (!stb_data_arr) + return -ENOMEM; + + stb_data_arr->size = fsize; + memcpy_fromio(stb_data_arr->data, dev->stb_virt_addr, fsize); + filp->private_data = stb_data_arr; + + return 0; +} + +static int amd_pmc_stb_debugfs_open_v2(struct inode *inode, struct file *filp) +{ + struct amd_pmc_dev *dev = filp->f_inode->i_private; + u32 fsize, num_samples, val, stb_rdptr_offset = 0; + struct amd_pmc_stb_v2_data *stb_data_arr; + int ret; + + /* Write dummy postcode while reading the STB buffer */ + ret = amd_pmc_write_stb(dev, AMD_PMC_STB_DUMMY_PC); + if (ret) + dev_err(dev->dev, "error writing to STB: %d\n", ret); + + /* Spill to DRAM num_samples uses separate SMU message port */ + dev->msg_port = 1; + + ret = amd_pmc_send_cmd(dev, 0, &val, STB_FORCE_FLUSH_DATA, 1); + if (ret) + dev_dbg_once(dev->dev, "S2D force flush not supported: %d\n", ret); + + /* + * We have a custom stb size and the PMFW is supposed to give + * the enhanced dram size. Note that we land here only for the + * platforms that support enhanced dram size reporting. + */ + if (dump_custom_stb) + return amd_pmc_stb_handle_efr(filp); + + /* Get the num_samples to calculate the last push location */ + ret = amd_pmc_send_cmd(dev, S2D_NUM_SAMPLES, &num_samples, dev->s2d_msg_id, true); + /* Clear msg_port for other SMU operation */ + dev->msg_port = 0; + if (ret) { + dev_err(dev->dev, "error: S2D_NUM_SAMPLES not supported : %d\n", ret); + return ret; + } + + fsize = min(num_samples, S2D_TELEMETRY_BYTES_MAX); + stb_data_arr = kmalloc(struct_size(stb_data_arr, data, fsize), GFP_KERNEL); + if (!stb_data_arr) + return -ENOMEM; + + stb_data_arr->size = fsize; + + /* + * Start capturing data from the last push location. + * This is for general cases, where the stb limits + * are meant for standard usage. + */ + if (num_samples > S2D_TELEMETRY_BYTES_MAX) { + /* First read oldest data starting 1 behind last write till end of ringbuffer */ + stb_rdptr_offset = num_samples % S2D_TELEMETRY_BYTES_MAX; + fsize = S2D_TELEMETRY_BYTES_MAX - stb_rdptr_offset; + + memcpy_fromio(stb_data_arr->data, dev->stb_virt_addr + stb_rdptr_offset, fsize); + /* Second copy the newer samples from offset 0 - last write */ + memcpy_fromio(stb_data_arr->data + fsize, dev->stb_virt_addr, stb_rdptr_offset); + } else { + memcpy_fromio(stb_data_arr->data, dev->stb_virt_addr, fsize); + } + + filp->private_data = stb_data_arr; + + return 0; +} + +static ssize_t amd_pmc_stb_debugfs_read_v2(struct file *filp, char __user *buf, size_t size, + loff_t *pos) +{ + struct amd_pmc_stb_v2_data *data = filp->private_data; + + return simple_read_from_buffer(buf, size, pos, data->data, data->size); +} + +static int amd_pmc_stb_debugfs_release_v2(struct inode *inode, struct file *filp) +{ + kfree(filp->private_data); + return 0; +} + +static const struct file_operations amd_pmc_stb_debugfs_fops_v2 = { + .owner = THIS_MODULE, + .open = amd_pmc_stb_debugfs_open_v2, + .read = amd_pmc_stb_debugfs_read_v2, + .release = amd_pmc_stb_debugfs_release_v2, +}; + +static bool amd_pmc_is_stb_supported(struct amd_pmc_dev *dev) +{ + switch (dev->cpu_id) { + case AMD_CPU_ID_YC: + case AMD_CPU_ID_CB: + dev->s2d_msg_id = 0xBE; + return true; + case AMD_CPU_ID_PS: + dev->s2d_msg_id = 0x85; + return true; + case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: + case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: + dev->s2d_msg_id = 0xDE; + return true; + default: + return false; + } +} + +int amd_pmc_s2d_init(struct amd_pmc_dev *dev) +{ + u32 phys_addr_low, phys_addr_hi; + u64 stb_phys_addr; + u32 size = 0; + int ret; + + if (!enable_stb) + return 0; + + if (amd_pmc_is_stb_supported(dev)) + debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, + &amd_pmc_stb_debugfs_fops_v2); + else + debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, + &amd_pmc_stb_debugfs_fops); + + /* Spill to DRAM feature uses separate SMU message port */ + dev->msg_port = 1; + + amd_pmc_send_cmd(dev, S2D_TELEMETRY_SIZE, &size, dev->s2d_msg_id, true); + if (size != S2D_TELEMETRY_BYTES_MAX) + return -EIO; + + /* Get DRAM size */ + ret = amd_pmc_send_cmd(dev, S2D_DRAM_SIZE, &dev->dram_size, dev->s2d_msg_id, true); + if (ret || !dev->dram_size) + dev->dram_size = S2D_TELEMETRY_DRAMBYTES_MAX; + + /* Get STB DRAM address */ + amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_LOW, &phys_addr_low, dev->s2d_msg_id, true); + amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_HIGH, &phys_addr_hi, dev->s2d_msg_id, true); + + stb_phys_addr = ((u64)phys_addr_hi << 32 | phys_addr_low); + + /* Clear msg_port for other SMU operation */ + dev->msg_port = 0; + + dev->stb_virt_addr = devm_ioremap(dev->dev, stb_phys_addr, dev->dram_size); + if (!dev->stb_virt_addr) + return -ENOMEM; + + return 0; +} diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index bbb8edb62e00..a977ff1e52b5 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -44,20 +44,6 @@ #define AMD_PMC_STB_S2IDLE_PREPARE 0xC6000001 #define AMD_PMC_STB_S2IDLE_RESTORE 0xC6000002 #define AMD_PMC_STB_S2IDLE_CHECK 0xC6000003 -#define AMD_PMC_STB_DUMMY_PC 0xC6000007 - -/* STB S2D(Spill to DRAM) has different message port offset */ -#define AMD_S2D_REGISTER_MESSAGE 0xA20 -#define AMD_S2D_REGISTER_RESPONSE 0xA80 -#define AMD_S2D_REGISTER_ARGUMENT 0xA88 - -/* STB Spill to DRAM Parameters */ -#define S2D_TELEMETRY_BYTES_MAX 0x100000U -#define S2D_RSVD_RAM_SPACE 0x100000 -#define S2D_TELEMETRY_DRAMBYTES_MAX 0x1000000 - -/* STB Spill to DRAM Message Definition */ -#define STB_FORCE_FLUSH_DATA 0xCF /* Base address of SMU for mapping physical address to virtual address */ #define AMD_PMC_MAPPING_SIZE 0x01000 @@ -97,7 +83,6 @@ #define DELAY_MIN_US 2000 #define DELAY_MAX_US 3000 -#define FIFO_SIZE 4096 enum amd_pmc_def { MSG_TEST = 0x01, @@ -105,19 +90,6 @@ enum amd_pmc_def { MSG_OS_HINT_RN, }; -enum s2d_arg { - S2D_TELEMETRY_SIZE = 0x01, - S2D_PHYS_ADDR_LOW, - S2D_PHYS_ADDR_HIGH, - S2D_NUM_SAMPLES, - S2D_DRAM_SIZE, -}; - -struct amd_pmc_stb_v2_data { - size_t size; - u8 data[] __counted_by(size); -}; - struct amd_pmc_bit_map { const char *name; u32 bit_mask; @@ -149,22 +121,11 @@ static const struct amd_pmc_bit_map soc15_ip_blk[] = { {} }; -static bool enable_stb; -module_param(enable_stb, bool, 0644); -MODULE_PARM_DESC(enable_stb, "Enable the STB debug mechanism"); - static bool disable_workarounds; module_param(disable_workarounds, bool, 0644); MODULE_PARM_DESC(disable_workarounds, "Disable workarounds for platform bugs"); -static bool dump_custom_stb; -module_param(dump_custom_stb, bool, 0644); -MODULE_PARM_DESC(dump_custom_stb, "Enable to dump full STB buffer"); - static struct amd_pmc_dev pmc; -static int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret); -static int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf); -static int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data); static inline u32 amd_pmc_reg_read(struct amd_pmc_dev *dev, int reg_offset) { @@ -193,155 +154,6 @@ struct smu_metrics { u64 timecondition_notmet_totaltime[32]; } __packed; -static int amd_pmc_stb_debugfs_open(struct inode *inode, struct file *filp) -{ - struct amd_pmc_dev *dev = filp->f_inode->i_private; - u32 size = FIFO_SIZE * sizeof(u32); - u32 *buf; - int rc; - - buf = kzalloc(size, GFP_KERNEL); - if (!buf) - return -ENOMEM; - - rc = amd_pmc_read_stb(dev, buf); - if (rc) { - kfree(buf); - return rc; - } - - filp->private_data = buf; - return rc; -} - -static ssize_t amd_pmc_stb_debugfs_read(struct file *filp, char __user *buf, size_t size, - loff_t *pos) -{ - if (!filp->private_data) - return -EINVAL; - - return simple_read_from_buffer(buf, size, pos, filp->private_data, - FIFO_SIZE * sizeof(u32)); -} - -static int amd_pmc_stb_debugfs_release(struct inode *inode, struct file *filp) -{ - kfree(filp->private_data); - return 0; -} - -static const struct file_operations amd_pmc_stb_debugfs_fops = { - .owner = THIS_MODULE, - .open = amd_pmc_stb_debugfs_open, - .read = amd_pmc_stb_debugfs_read, - .release = amd_pmc_stb_debugfs_release, -}; - -/* Enhanced STB Firmware Reporting Mechanism */ -static int amd_pmc_stb_handle_efr(struct file *filp) -{ - struct amd_pmc_dev *dev = filp->f_inode->i_private; - struct amd_pmc_stb_v2_data *stb_data_arr; - u32 fsize; - - fsize = dev->dram_size - S2D_RSVD_RAM_SPACE; - stb_data_arr = kmalloc(struct_size(stb_data_arr, data, fsize), GFP_KERNEL); - if (!stb_data_arr) - return -ENOMEM; - - stb_data_arr->size = fsize; - memcpy_fromio(stb_data_arr->data, dev->stb_virt_addr, fsize); - filp->private_data = stb_data_arr; - - return 0; -} - -static int amd_pmc_stb_debugfs_open_v2(struct inode *inode, struct file *filp) -{ - struct amd_pmc_dev *dev = filp->f_inode->i_private; - u32 fsize, num_samples, val, stb_rdptr_offset = 0; - struct amd_pmc_stb_v2_data *stb_data_arr; - int ret; - - /* Write dummy postcode while reading the STB buffer */ - ret = amd_pmc_write_stb(dev, AMD_PMC_STB_DUMMY_PC); - if (ret) - dev_err(dev->dev, "error writing to STB: %d\n", ret); - - /* Spill to DRAM num_samples uses separate SMU message port */ - dev->msg_port = 1; - - ret = amd_pmc_send_cmd(dev, 0, &val, STB_FORCE_FLUSH_DATA, 1); - if (ret) - dev_dbg_once(dev->dev, "S2D force flush not supported: %d\n", ret); - - /* - * We have a custom stb size and the PMFW is supposed to give - * the enhanced dram size. Note that we land here only for the - * platforms that support enhanced dram size reporting. - */ - if (dump_custom_stb) - return amd_pmc_stb_handle_efr(filp); - - /* Get the num_samples to calculate the last push location */ - ret = amd_pmc_send_cmd(dev, S2D_NUM_SAMPLES, &num_samples, dev->s2d_msg_id, true); - /* Clear msg_port for other SMU operation */ - dev->msg_port = 0; - if (ret) { - dev_err(dev->dev, "error: S2D_NUM_SAMPLES not supported : %d\n", ret); - return ret; - } - - fsize = min(num_samples, S2D_TELEMETRY_BYTES_MAX); - stb_data_arr = kmalloc(struct_size(stb_data_arr, data, fsize), GFP_KERNEL); - if (!stb_data_arr) - return -ENOMEM; - - stb_data_arr->size = fsize; - - /* - * Start capturing data from the last push location. - * This is for general cases, where the stb limits - * are meant for standard usage. - */ - if (num_samples > S2D_TELEMETRY_BYTES_MAX) { - /* First read oldest data starting 1 behind last write till end of ringbuffer */ - stb_rdptr_offset = num_samples % S2D_TELEMETRY_BYTES_MAX; - fsize = S2D_TELEMETRY_BYTES_MAX - stb_rdptr_offset; - - memcpy_fromio(stb_data_arr->data, dev->stb_virt_addr + stb_rdptr_offset, fsize); - /* Second copy the newer samples from offset 0 - last write */ - memcpy_fromio(stb_data_arr->data + fsize, dev->stb_virt_addr, stb_rdptr_offset); - } else { - memcpy_fromio(stb_data_arr->data, dev->stb_virt_addr, fsize); - } - - filp->private_data = stb_data_arr; - - return 0; -} - -static ssize_t amd_pmc_stb_debugfs_read_v2(struct file *filp, char __user *buf, size_t size, - loff_t *pos) -{ - struct amd_pmc_stb_v2_data *data = filp->private_data; - - return simple_read_from_buffer(buf, size, pos, data->data, data->size); -} - -static int amd_pmc_stb_debugfs_release_v2(struct inode *inode, struct file *filp) -{ - kfree(filp->private_data); - return 0; -} - -static const struct file_operations amd_pmc_stb_debugfs_fops_v2 = { - .owner = THIS_MODULE, - .open = amd_pmc_stb_debugfs_open_v2, - .read = amd_pmc_stb_debugfs_read_v2, - .release = amd_pmc_stb_debugfs_release_v2, -}; - static void amd_pmc_get_ip_info(struct amd_pmc_dev *dev) { switch (dev->cpu_id) { @@ -350,18 +162,15 @@ static void amd_pmc_get_ip_info(struct amd_pmc_dev *dev) case AMD_CPU_ID_YC: case AMD_CPU_ID_CB: dev->num_ips = 12; - dev->s2d_msg_id = 0xBE; dev->smu_msg = 0x538; break; case AMD_CPU_ID_PS: dev->num_ips = 21; - dev->s2d_msg_id = 0x85; dev->smu_msg = 0x538; break; case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: dev->num_ips = 22; - dev->s2d_msg_id = 0xDE; dev->smu_msg = 0x938; break; } @@ -625,20 +434,6 @@ static void amd_pmc_dbgfs_unregister(struct amd_pmc_dev *dev) debugfs_remove_recursive(dev->dbgfs_dir); } -static bool amd_pmc_is_stb_supported(struct amd_pmc_dev *dev) -{ - switch (dev->cpu_id) { - case AMD_CPU_ID_YC: - case AMD_CPU_ID_CB: - case AMD_CPU_ID_PS: - case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: - case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: - return true; - default: - return false; - } -} - static void amd_pmc_dbgfs_register(struct amd_pmc_dev *dev) { dev->dbgfs_dir = debugfs_create_dir("amd_pmc", NULL); @@ -648,15 +443,6 @@ static void amd_pmc_dbgfs_register(struct amd_pmc_dev *dev) &s0ix_stats_fops); debugfs_create_file("amd_pmc_idlemask", 0644, dev->dbgfs_dir, dev, &amd_pmc_idlemask_fops); - /* Enable STB only when the module_param is set */ - if (enable_stb) { - if (amd_pmc_is_stb_supported(dev)) - debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, - &amd_pmc_stb_debugfs_fops_v2); - else - debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, - &amd_pmc_stb_debugfs_fops); - } } static void amd_pmc_dump_registers(struct amd_pmc_dev *dev) @@ -683,7 +469,7 @@ static void amd_pmc_dump_registers(struct amd_pmc_dev *dev) dev_dbg(dev->dev, "AMD_%s_REGISTER_MESSAGE:%x\n", dev->msg_port ? "S2D" : "PMC", value); } -static int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret) +int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret) { int rc; u32 val, message, argument, response; @@ -975,69 +761,6 @@ static const struct pci_device_id pmc_pci_ids[] = { { } }; -static int amd_pmc_s2d_init(struct amd_pmc_dev *dev) -{ - u32 phys_addr_low, phys_addr_hi; - u64 stb_phys_addr; - u32 size = 0; - int ret; - - /* Spill to DRAM feature uses separate SMU message port */ - dev->msg_port = 1; - - amd_pmc_send_cmd(dev, S2D_TELEMETRY_SIZE, &size, dev->s2d_msg_id, true); - if (size != S2D_TELEMETRY_BYTES_MAX) - return -EIO; - - /* Get DRAM size */ - ret = amd_pmc_send_cmd(dev, S2D_DRAM_SIZE, &dev->dram_size, dev->s2d_msg_id, true); - if (ret || !dev->dram_size) - dev->dram_size = S2D_TELEMETRY_DRAMBYTES_MAX; - - /* Get STB DRAM address */ - amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_LOW, &phys_addr_low, dev->s2d_msg_id, true); - amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_HIGH, &phys_addr_hi, dev->s2d_msg_id, true); - - stb_phys_addr = ((u64)phys_addr_hi << 32 | phys_addr_low); - - /* Clear msg_port for other SMU operation */ - dev->msg_port = 0; - - dev->stb_virt_addr = devm_ioremap(dev->dev, stb_phys_addr, dev->dram_size); - if (!dev->stb_virt_addr) - return -ENOMEM; - - return 0; -} - -static int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data) -{ - int err; - - err = amd_smn_write(0, AMD_PMC_STB_PMI_0, data); - if (err) { - dev_err(dev->dev, "failed to write data in stb: 0x%X\n", AMD_PMC_STB_PMI_0); - return pcibios_err_to_errno(err); - } - - return 0; -} - -static int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf) -{ - int i, err; - - for (i = 0; i < FIFO_SIZE; i++) { - err = amd_smn_read(0, AMD_PMC_STB_PMI_0, buf++); - if (err) { - dev_err(dev->dev, "error reading data from stb: 0x%X\n", AMD_PMC_STB_PMI_0); - return pcibios_err_to_errno(err); - } - } - - return 0; -} - static int amd_pmc_probe(struct platform_device *pdev) { struct amd_pmc_dev *dev = &pmc; @@ -1095,12 +818,6 @@ static int amd_pmc_probe(struct platform_device *pdev) /* Get num of IP blocks within the SoC */ amd_pmc_get_ip_info(dev); - if (enable_stb && amd_pmc_is_stb_supported(dev)) { - err = amd_pmc_s2d_init(dev); - if (err) - goto err_pci_dev_put; - } - platform_set_drvdata(pdev, dev); if (IS_ENABLED(CONFIG_SUSPEND)) { err = acpi_register_lps0_dev(&amd_pmc_s2idle_dev_ops); @@ -1111,6 +828,10 @@ static int amd_pmc_probe(struct platform_device *pdev) } amd_pmc_dbgfs_register(dev); + err = amd_pmc_s2d_init(dev); + if (err) + goto err_pci_dev_put; + if (IS_ENABLED(CONFIG_AMD_MP2_STB)) amd_mp2_stb_init(dev); pm_report_max_hw_sleep(U64_MAX); diff --git a/drivers/platform/x86/amd/pmc/pmc.h b/drivers/platform/x86/amd/pmc/pmc.h index f1166d15c856..07fcb13a4136 100644 --- a/drivers/platform/x86/amd/pmc/pmc.h +++ b/drivers/platform/x86/amd/pmc/pmc.h @@ -70,4 +70,13 @@ void amd_mp2_stb_deinit(struct amd_pmc_dev *dev); #define PCI_DEVICE_ID_AMD_1AH_M60H_ROOT 0x1122 #define PCI_DEVICE_ID_AMD_MP2_STB 0x172c +/* STB S2D(Spill to DRAM) has different message port offset */ +#define AMD_S2D_REGISTER_MESSAGE 0xA20 +#define AMD_S2D_REGISTER_RESPONSE 0xA80 +#define AMD_S2D_REGISTER_ARGUMENT 0xA88 + +int amd_pmc_s2d_init(struct amd_pmc_dev *dev); +int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data); +int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret); + #endif /* PMC_H */ From patchwork Tue Oct 29 15:54:34 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: 13855121 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2041.outbound.protection.outlook.com [40.107.220.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CB30194C6E for ; Tue, 29 Oct 2024 15:55:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730217320; cv=fail; b=cdoSbT8PYBJ6Vu5BlBSXe1T+aGsnMtViUX7XIgSKdvyJWONaP9UzyDoJl3DGYZo0HWZ0fgQJSXt8y1Ri55wW29uOTxQjs+9ml1IogIW0f4lxhypMMmvPPR2hzGZOvkGI5xIYO+1fgn1X+ygOpmoivBYmYxOqLNGKbn30B+TXC8I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730217320; c=relaxed/simple; bh=YOTaSyS62y2PNyuPVHhgJAPG0dYYDPg0Gmjw6w+Qi+U=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TRXyA1kcLk2jr9rUufIXERHHkycNOSUA2QMeSuXUYGLVEVb5eJUQA1OyN8xMmezgyudu4wJTNaWq4avGJ9kCgSL+UCtjSSlSPyWT/pMp4CrM7JQNBDikYyM3UKucploGUD3PDgUYhMfb6GfvSEgR9O45yetTrLGO/O8xvyfClXA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=3MD6X448; arc=fail smtp.client-ip=40.107.220.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="3MD6X448" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DsetqQXDYdLGskC3HwfjgB2u+VBCaJkDMlG241vq648eu+FxUYHX+LflQhipjMFur3NZD0skPJQfxDt+6xYuqKysQKj2dGKeU5+ORKctxUsVyKOC/CnDIHtT9TezT5JyWPkb+JaosQFU+WJ20raJgpGGPaX7Pp9egbYkO2edWPavK76UGmSMgZNl15uJnu+QabOKH86kVflz+izvzAoH0ayQmlk/QOMZJxb/gy5pHdUAJmiZp0bRLXiFHVRnfmsVBSlXyHLJOrIgZGq1AO6CnHL/Kn6JaUOOsnnk0QPw/GyZVqqhpMdlTAjfN9rBOYUCYB/XKF6rQ/lzSUSu84WOCA== 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=L7pe28tDkNsrLwdBY0hNDL6zl8H4fBfj77d3WRhFc4U=; b=DOSZ5RwPYqbEpzlEhP2bgLg+7vKbxtIhgYfE7NupvJPJe/Wg0nK20yAejxRFwAHI0hvqBhwIcfpnJXRjKqzED8KHtwtf0xR5hLX1zjDNfCC99dOlsviWsX9+y+rSxYx+ysZx37cy0Sjw8kDoHAayogshAXomz/N5ehB5xjI5C/wtvcoEE8gtzoLvsfeDShFG8vSqRaLspH0E4pXhjkE5ObH0oFAlZvSZkCAo4PXctUlvdxAVXDYPI7RfNzgSbA9QOA2BX6NHPVSUoCmy/pQ2i5wJJZs5FvwMyRm8ZJm+vlaeMlVLW8B/8EFO/MbiE4Mt6wGnw1SKwhvC7rxkQONolw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=L7pe28tDkNsrLwdBY0hNDL6zl8H4fBfj77d3WRhFc4U=; b=3MD6X4481P+EAO1mmy8sk6B9wR4RFSMY4+JCBSp8zdO5542t0nElz61XJNZRXELnSunTZDMQ7XGD7YrZI/5tFQ43FW03uhnF5EF12EHndBi6aI7tHgpwkLnjJikq/s65URpNd09fUZd5G/ixx4sOHnvh7yHpuBlZbQjkSc0NFDY= Received: from CY5PR15CA0160.namprd15.prod.outlook.com (2603:10b6:930:67::28) by SA1PR12MB6896.namprd12.prod.outlook.com (2603:10b6:806:24f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.24; Tue, 29 Oct 2024 15:55:15 +0000 Received: from CY4PEPF0000EE3F.namprd03.prod.outlook.com (2603:10b6:930:67:cafe::ba) by CY5PR15CA0160.outlook.office365.com (2603:10b6:930:67::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.17 via Frontend Transport; Tue, 29 Oct 2024 15:55:15 +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 CY4PEPF0000EE3F.mail.protection.outlook.com (10.167.242.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8114.16 via Frontend Transport; Tue, 29 Oct 2024 15:55:14 +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; Tue, 29 Oct 2024 10:55:09 -0500 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v2 2/8] platform/x86/amd/pmc: Update function names to align with new STB file Date: Tue, 29 Oct 2024 21:24:34 +0530 Message-ID: <20241029155440.3499273-3-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241029155440.3499273-1-Shyam-sundar.S-k@amd.com> References: <20241029155440.3499273-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3F:EE_|SA1PR12MB6896:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c11ecd1-7e9c-44de-26c6-08dcf8321441 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014; X-Microsoft-Antispam-Message-Info: d84p1XU3BPNYyFjQwsl5Ez+guvlbg7KSUZK3SOwaFT64aRWB3qB3zRsdH79CUlFM8VRyc3TT5UkFyGCOOWY91ctS24LaoiEyYvbMMfsvOUHml0mQCxWFGlIyBZcgyKJcDcTihRyjdRC2eIPWvyYV7Q1Ifmn4QNGC3heviamsWC6FMoi9nhl/YFHpSwmofEzlECLf36oJcHwSkmLStpB1Q6hk9LbEUgu8eDfYOVG/kDkTP3zBrfxKyrdVBpm/pOa/sLSDNiF9dBjQux7/ZTdDgl74taKEC9GsLJ8/LCBUOCPXdF2RVeJdfS4Hs/Bobro/YWT34IJKbiyw6J3wJYyIkdbXNFs4NzMdnn0Js+689qzVDvsy9mTWRrc56zBfhrEuZbUtQrn1sP5znad7W5+ErUFaIzr/dtkjAno28PJCDE+AbtawyHJUHWTpvZjqo4q26FaEBfOxAX40ypLNpzR9yZ7euVukPSIezI51IZsRDXYL1G3GyqJFiyC2sjgQXAcw2+XLZcFll/mawaMa45D/ZSW4hGfX/QJyesTyzUa6nxJ7xhg8zyzibgc8YEmjBWyWueaKjqF/f9+sXdUbcx0qT1KVz9EXcxeSxwlGXeDFAzRb4dVWq0wrDZ5/BUCor4acSQA7TM8jRFpE9ShwDGv9mxzoa+efF7eyiYD2PduBblY0crOeYtQZzustmGIVcwDrQVUMBgldN2NJzcO+7HFOG1Doez3nyeAEDQG0PH/NqYsTAXJVlWoWTrTREwed2AJKgrPqinvV1JmAcNt2gTo56Bs8RIQkAqB+j083nX8hFjZZO0S/GfeHkFTcBH3ofUGFgkePGVJue9xd7jF0B4SM6rU5ukdjF3joQKogiw3SB0/8Ju2cAGM7Ap2awvuIFEzyv/Cp753lOo9Zo7X93Lb4Lg4Sk0mldux9BUygkBEBdNvpBcH43LykY/ujNbXk4b+T1vQjMt15Kv+1rx52TrlTpvJx3Yav7qcHbw+exv/92hko4CJGk5mJtPVp021VgBHEvqXMwXN4cYODsQPO3iLOGRVVMaXregp5cvs6VUKaw3wKHZGNJ1uwFY32OYllCeL+wK+qMC1KxOn+bhl/LFQxgRA8EVGczelgRX7Dhn6n52f6yGbd0GUbwGvOAnho226d/tUCSOg26P0uRPMoA0aKebB/CX1Bo6rZrB6f5GJSG/0Zdf2bvWYOsinuk2xid97nDjTSJSjUvRNmy0tjvh2BZIVJMJ9DUz67sSVgGWShZAB/KZLdN5S/d978hefi0gNo+RK5rE0QXzqYNt2CnBjhwCOGdCvSzrvRRiNsNn4JAHHUt5Jj3ZEdohwQifR1QCBdBBQIex+j4Yt+dM32RTlgWS898x0NN1pA2lY9kHLXojLM9DVNvVcRRXqiniToV/lxwvBg3XGPJrWS8hw2Rgg18Q== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 15:55:14.9760 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8c11ecd1-7e9c-44de-26c6-08dcf8321441 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: CY4PEPF0000EE3F.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6896 With STB now in a separate file, update the function names to match the correct naming schema by removing the _pmc_ prefix where needed. Reviewed-by: Mario Limonciello Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmc/mp1_stb.c | 61 +++++++++++++------------- drivers/platform/x86/amd/pmc/pmc.c | 8 ++-- drivers/platform/x86/amd/pmc/pmc.h | 4 +- 3 files changed, 36 insertions(+), 37 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c index 9a34dd94982c..5efec020ecac 100644 --- a/drivers/platform/x86/amd/pmc/mp1_stb.c +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -47,12 +47,12 @@ enum s2d_arg { S2D_DRAM_SIZE, }; -struct amd_pmc_stb_v2_data { +struct amd_stb_v2_data { size_t size; u8 data[] __counted_by(size); }; -int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data) +int amd_write_stb(struct amd_pmc_dev *dev, u32 data) { int err; @@ -65,7 +65,7 @@ int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data) return 0; } -static int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf) +static int amd_read_stb(struct amd_pmc_dev *dev, u32 *buf) { int i, err; @@ -81,7 +81,7 @@ static int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf) return 0; } -static int amd_pmc_stb_debugfs_open(struct inode *inode, struct file *filp) +static int amd_stb_debugfs_open(struct inode *inode, struct file *filp) { struct amd_pmc_dev *dev = filp->f_inode->i_private; u32 size = FIFO_SIZE * sizeof(u32); @@ -92,7 +92,7 @@ static int amd_pmc_stb_debugfs_open(struct inode *inode, struct file *filp) if (!buf) return -ENOMEM; - rc = amd_pmc_read_stb(dev, buf); + rc = amd_read_stb(dev, buf); if (rc) { kfree(buf); return rc; @@ -102,8 +102,7 @@ static int amd_pmc_stb_debugfs_open(struct inode *inode, struct file *filp) return rc; } -static ssize_t amd_pmc_stb_debugfs_read(struct file *filp, char __user *buf, size_t size, - loff_t *pos) +static ssize_t amd_stb_debugfs_read(struct file *filp, char __user *buf, size_t size, loff_t *pos) { if (!filp->private_data) return -EINVAL; @@ -112,24 +111,24 @@ static ssize_t amd_pmc_stb_debugfs_read(struct file *filp, char __user *buf, siz FIFO_SIZE * sizeof(u32)); } -static int amd_pmc_stb_debugfs_release(struct inode *inode, struct file *filp) +static int amd_stb_debugfs_release(struct inode *inode, struct file *filp) { kfree(filp->private_data); return 0; } -static const struct file_operations amd_pmc_stb_debugfs_fops = { +static const struct file_operations amd_stb_debugfs_fops = { .owner = THIS_MODULE, - .open = amd_pmc_stb_debugfs_open, - .read = amd_pmc_stb_debugfs_read, - .release = amd_pmc_stb_debugfs_release, + .open = amd_stb_debugfs_open, + .read = amd_stb_debugfs_read, + .release = amd_stb_debugfs_release, }; /* Enhanced STB Firmware Reporting Mechanism */ -static int amd_pmc_stb_handle_efr(struct file *filp) +static int amd_stb_handle_efr(struct file *filp) { struct amd_pmc_dev *dev = filp->f_inode->i_private; - struct amd_pmc_stb_v2_data *stb_data_arr; + struct amd_stb_v2_data *stb_data_arr; u32 fsize; fsize = dev->dram_size - S2D_RSVD_RAM_SPACE; @@ -144,15 +143,15 @@ static int amd_pmc_stb_handle_efr(struct file *filp) return 0; } -static int amd_pmc_stb_debugfs_open_v2(struct inode *inode, struct file *filp) +static int amd_stb_debugfs_open_v2(struct inode *inode, struct file *filp) { struct amd_pmc_dev *dev = filp->f_inode->i_private; u32 fsize, num_samples, val, stb_rdptr_offset = 0; - struct amd_pmc_stb_v2_data *stb_data_arr; + struct amd_stb_v2_data *stb_data_arr; int ret; /* Write dummy postcode while reading the STB buffer */ - ret = amd_pmc_write_stb(dev, AMD_PMC_STB_DUMMY_PC); + ret = amd_write_stb(dev, AMD_PMC_STB_DUMMY_PC); if (ret) dev_err(dev->dev, "error writing to STB: %d\n", ret); @@ -169,7 +168,7 @@ static int amd_pmc_stb_debugfs_open_v2(struct inode *inode, struct file *filp) * platforms that support enhanced dram size reporting. */ if (dump_custom_stb) - return amd_pmc_stb_handle_efr(filp); + return amd_stb_handle_efr(filp); /* Get the num_samples to calculate the last push location */ ret = amd_pmc_send_cmd(dev, S2D_NUM_SAMPLES, &num_samples, dev->s2d_msg_id, true); @@ -209,28 +208,28 @@ static int amd_pmc_stb_debugfs_open_v2(struct inode *inode, struct file *filp) return 0; } -static ssize_t amd_pmc_stb_debugfs_read_v2(struct file *filp, char __user *buf, size_t size, - loff_t *pos) +static ssize_t amd_stb_debugfs_read_v2(struct file *filp, char __user *buf, size_t size, + loff_t *pos) { - struct amd_pmc_stb_v2_data *data = filp->private_data; + struct amd_stb_v2_data *data = filp->private_data; return simple_read_from_buffer(buf, size, pos, data->data, data->size); } -static int amd_pmc_stb_debugfs_release_v2(struct inode *inode, struct file *filp) +static int amd_stb_debugfs_release_v2(struct inode *inode, struct file *filp) { kfree(filp->private_data); return 0; } -static const struct file_operations amd_pmc_stb_debugfs_fops_v2 = { +static const struct file_operations amd_stb_debugfs_fops_v2 = { .owner = THIS_MODULE, - .open = amd_pmc_stb_debugfs_open_v2, - .read = amd_pmc_stb_debugfs_read_v2, - .release = amd_pmc_stb_debugfs_release_v2, + .open = amd_stb_debugfs_open_v2, + .read = amd_stb_debugfs_read_v2, + .release = amd_stb_debugfs_release_v2, }; -static bool amd_pmc_is_stb_supported(struct amd_pmc_dev *dev) +static bool amd_is_stb_supported(struct amd_pmc_dev *dev) { switch (dev->cpu_id) { case AMD_CPU_ID_YC: @@ -249,7 +248,7 @@ static bool amd_pmc_is_stb_supported(struct amd_pmc_dev *dev) } } -int amd_pmc_s2d_init(struct amd_pmc_dev *dev) +int amd_s2d_init(struct amd_pmc_dev *dev) { u32 phys_addr_low, phys_addr_hi; u64 stb_phys_addr; @@ -259,12 +258,12 @@ int amd_pmc_s2d_init(struct amd_pmc_dev *dev) if (!enable_stb) return 0; - if (amd_pmc_is_stb_supported(dev)) + if (amd_is_stb_supported(dev)) debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, - &amd_pmc_stb_debugfs_fops_v2); + &amd_stb_debugfs_fops_v2); else debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, - &amd_pmc_stb_debugfs_fops); + &amd_stb_debugfs_fops); /* Spill to DRAM feature uses separate SMU message port */ dev->msg_port = 1; diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index a977ff1e52b5..8e7c87505327 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -667,7 +667,7 @@ static void amd_pmc_s2idle_prepare(void) return; } - rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_S2IDLE_PREPARE); + rc = amd_write_stb(pdev, AMD_PMC_STB_S2IDLE_PREPARE); if (rc) dev_err(pdev->dev, "error writing to STB: %d\n", rc); } @@ -686,7 +686,7 @@ static void amd_pmc_s2idle_check(void) /* Dump the IdleMask before we add to the STB */ amd_pmc_idlemask_read(pdev, pdev->dev, NULL); - rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_S2IDLE_CHECK); + rc = amd_write_stb(pdev, AMD_PMC_STB_S2IDLE_CHECK); if (rc) dev_err(pdev->dev, "error writing to STB: %d\n", rc); } @@ -713,7 +713,7 @@ static void amd_pmc_s2idle_restore(void) /* Let SMU know that we are looking for stats */ amd_pmc_dump_data(pdev); - rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_S2IDLE_RESTORE); + rc = amd_write_stb(pdev, AMD_PMC_STB_S2IDLE_RESTORE); if (rc) dev_err(pdev->dev, "error writing to STB: %d\n", rc); @@ -828,7 +828,7 @@ static int amd_pmc_probe(struct platform_device *pdev) } amd_pmc_dbgfs_register(dev); - err = amd_pmc_s2d_init(dev); + err = amd_s2d_init(dev); if (err) goto err_pci_dev_put; diff --git a/drivers/platform/x86/amd/pmc/pmc.h b/drivers/platform/x86/amd/pmc/pmc.h index 07fcb13a4136..7e7f9170124c 100644 --- a/drivers/platform/x86/amd/pmc/pmc.h +++ b/drivers/platform/x86/amd/pmc/pmc.h @@ -75,8 +75,8 @@ void amd_mp2_stb_deinit(struct amd_pmc_dev *dev); #define AMD_S2D_REGISTER_RESPONSE 0xA80 #define AMD_S2D_REGISTER_ARGUMENT 0xA88 -int amd_pmc_s2d_init(struct amd_pmc_dev *dev); -int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data); +int amd_s2d_init(struct amd_pmc_dev *dev); +int amd_write_stb(struct amd_pmc_dev *dev, u32 data); int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret); #endif /* PMC_H */ From patchwork Tue Oct 29 15:54:35 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: 13855126 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2056.outbound.protection.outlook.com [40.107.243.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A085195B33 for ; Tue, 29 Oct 2024 15:55:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730217330; cv=fail; b=k/X8r021UqzyrYSCsGqjnwppdS2HhZg44gD/Xa72hZQSN5BstkYJuUyYXiS5tAe0MQX7HQEmoj9Sedv65fpqR3Tfi/V7X6HVLVQjRupxhh9KETjQQrEhUmLYUwuzx+TIUa4wN01pdcVDV5jNzetcd5OLEtNw8+0bmfoeoTInlLA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730217330; c=relaxed/simple; bh=5yQYGk8OyzyrAWmUyuXkfPVnie9sirTMr2j1FWiXScE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FWsDwO3ZTH2YVEPD9Tkhysxkasnhgdzu0UVVC/8A2mGPhogD6DtQ602Aqg7BvN0xQaa/sgM8HMfKcGlIIbofjlnXgSHbxhAvobSBzxtNp0u5pMnIYk9JXMgC7vFNWcNcbELya2A2JuxkRgrhkE0/gKxLcRH+JDdqsDQdKhT8N8E= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=z/9//CLJ; arc=fail smtp.client-ip=40.107.243.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="z/9//CLJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PtyCpn4HQLOAnN4BM5kkXOk5v9eBEt7WSD+a5u/pjsveCYfGa8JNtPHyn/KwqLAzQ6f1+7KejpWjciGoWZghRrGS07QDZJr726H0DUCThs8ObGtPY+XmXqElkfULw1V6v8lAcj66NiiCoWd1YdemL4x6CF9RDL7nWkQUmby4cPHrvAhRcaavSf5XOeJoLCo2Ny/vu6tdNJ4pFjWJ8IZJ8WsRClBP+ukULWWnpenwWTVUMyvT2BaSxFWv//sKbCKx9AyrKY41C4Pc0BNUAtmHLdH+hqFGt0/BAi/ZfPau1jqFK7r3sW0KyL4cARU9uJklaWRVYCshxmBz9Rd8FrZqUQ== 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=gRdHaIq9nrKgsDiCSXHk2WDkmwL6VFMgitQ6OGtgjq4=; b=jMCY/pSYrtbDxZ9bvCfcHj4sbALRCRzNzgu6Hbk6Nf7PVXVqpWws2waeVRi6mU3rZtBo2OUr/ye9cDJy0eQpsFxKa4g0IvP73i0EmYmrZg9jGweniesK1aX8bSOJG+ZX+qpxHQ+YYdX/GpuwiV+ols59DMQcYMMfe43mq6f6f7/ygX5I7rp49nVd2M8ZzLSKFAD1ds+PLqLgdGBds1Myer9xWxJHXQ3jYj2Fww5ZrvDw6tqTU7JILqP7SrVpw73OjrZDnZkrG/agO3JV5F0fV1JsDn8mImc4nX0zPrlkM37pvfUOnNyx8Ny+jjfQrXMa8A+tS8tfO998m4dHTfgVEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=gRdHaIq9nrKgsDiCSXHk2WDkmwL6VFMgitQ6OGtgjq4=; b=z/9//CLJCXoVUYXdGY5zDTgXIwWGOH1NwuvLLi4AbxIlLDyH05yEFn8oGJ4o/Y8gglfvznHrB3IaybGycw/kxXUo6yu7lFs8m42oiiJafRtoqL5CBqzloSezLBmw8ctsEIXqwoV1K1WSQbTm4A8vnU9Xgg90taDNTaUCMvl7Ggc= Received: from BYAPR08CA0027.namprd08.prod.outlook.com (2603:10b6:a03:100::40) by CY5PR12MB6106.namprd12.prod.outlook.com (2603:10b6:930:29::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Tue, 29 Oct 2024 15:55:20 +0000 Received: from MWH0EPF000989E8.namprd02.prod.outlook.com (2603:10b6:a03:100:cafe::63) by BYAPR08CA0027.outlook.office365.com (2603:10b6:a03:100::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.17 via Frontend Transport; Tue, 29 Oct 2024 15:55:19 +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 MWH0EPF000989E8.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8114.16 via Frontend Transport; Tue, 29 Oct 2024 15:55:19 +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; Tue, 29 Oct 2024 10:55:11 -0500 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v2 3/8] platform/x86/amd/pmc: Define enum for S2D/PMC msg_port Date: Tue, 29 Oct 2024 21:24:35 +0530 Message-ID: <20241029155440.3499273-4-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241029155440.3499273-1-Shyam-sundar.S-k@amd.com> References: <20241029155440.3499273-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E8:EE_|CY5PR12MB6106:EE_ X-MS-Office365-Filtering-Correlation-Id: 540d9070-a6d1-49dc-d880-08dcf8321705 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info: h9a0HeZ64CSPNef8SCnCE32jcnsn7xIMigYSab0V51PiA3olnaB4OG4BQRZHP17w6ftXVc9Ow43Lqbtv+kW7SKMk02kiTmVnzl8XH3EJ4+S23W2tnzQqFQuw+opwdNT/g6dEsnpuR8MgYrgxByRfzmMTkJpPtbo8WKQm1dPMqMRapqHkZMvQOUCAFiVEypiFwMJsZExna77pfOiZozGiqgVteh5vMa9KFuZd7QlDAErYbD2bfN+7Ac4YpfVdD/ebiUl8UaKG/xen0UHbZmjTuxkSkPRaUzdaran18yOIOCLDmDY6+bAVHN9Cpn+8/6jU1iUMxwzmuqkNOWjxGTUMlARZm9+o9PexkVL2i7nA4bBcuXGf0ThJ6z2IPSvxfdI9huoMpsN/x48an8lHaSeAJk2euiJOfbnDnYuhdwS88ucMYIaJvk4jmy6CUuaOyI+GkYEJv2g+eicGb9BoTzR6IjinlXlV8+qnlZrqvNFAQC2wFMkJ6G3cRaRMZeicwDLgTqXWypNR8leqNLgoYuWRQAlh/uHDB7eDJAyO/ZorEqDqW2Teg4jXXmwN8mj4Ci6wv/thNXugZ4Ic0HhqaS7M9bFMjUKQDgQ3NQD/gx9Q03k2FruGPLTuLklVZnx1ONwRvYCp1Wo/6regwWDzQ2nxTDo+ZMejIAlKnIDdqZ3Ohc7kjGkf6jEryD15bBcBtZ8KxHSh7pUNquwMwyBNdkayrzgYcMuXH4P2fjcUBQ0BU6VvGe+nu1Yn91qFqnSVD8EweBKKjf4wbKqHEhr+MMmMGRjuZ+6ciFKsdOzmIAELcFQs7K+M55V5T6+jF6jG3DGWIKYFUv/15aim6qOxE6BuzXQA37efsODWJEZBRMhqZHWjNmo1/02PKQLekuv1Ch61AHjdNkm99rjME7D1/aSlHbp/X7XJlqOKP+/Q0v1nbHgGRTGTvtU1D32rB9u1TSFAkY20m6lUAl5PBEMXI9z5Ovv9pnK+p5hfaIZCvgU+3Fnu3uhbjBt2+aSBb1xuk6ldZMJErC6gKPf90ydffkjW+E3ZS/wSCu+5v5lpBbfuxDoONKCe5JTylsmB1tngX7hAuYoPEvfUfjsMffywcMPLjZu0QbPHzZmnu4TnhByHfa15a/JnoQpSkCANWS3yGbSuZ01TH9LjfGUiMxX0fGg9QrsQRlNC2QfL8rfZN+aeP91Zvf3YLP/TUwAmPB1G4utssN6IaDFHfuVAwqHqzvd5Cw17y0LLJAODmeUFhpxeGQicxOwTRLU3eFXN4YgMnmFzAo3rx/KSrIUi9v3Dzu/LHfZwn6Tas+Wv0avKWVC5EUYDNIeEYFHXTDm+BYGfpBHAF83ZJF0LlVTOmMKiI1FrnzToZsVYOrMcLiB+g00wOTOIf5yRw++ugzo0fNQfU2CJmbcHUsNc1INyiVpYjg/FIA== 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)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 15:55:19.6517 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 540d9070-a6d1-49dc-d880-08dcf8321705 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: MWH0EPF000989E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6106 To distinguish between the PMC message port and the S2D (Spill to DRAM) message port, replace the use of 0 and 1 with an enum. Reviewed-by: Mario Limonciello Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmc/mp1_stb.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c index 5efec020ecac..2b06861c479b 100644 --- a/drivers/platform/x86/amd/pmc/mp1_stb.c +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -47,6 +47,11 @@ enum s2d_arg { S2D_DRAM_SIZE, }; +enum s2d_msg_port { + MSG_PORT_PMC, + MSG_PORT_S2D, +}; + struct amd_stb_v2_data { size_t size; u8 data[] __counted_by(size); @@ -156,7 +161,7 @@ static int amd_stb_debugfs_open_v2(struct inode *inode, struct file *filp) dev_err(dev->dev, "error writing to STB: %d\n", ret); /* Spill to DRAM num_samples uses separate SMU message port */ - dev->msg_port = 1; + dev->msg_port = MSG_PORT_S2D; ret = amd_pmc_send_cmd(dev, 0, &val, STB_FORCE_FLUSH_DATA, 1); if (ret) @@ -173,7 +178,7 @@ static int amd_stb_debugfs_open_v2(struct inode *inode, struct file *filp) /* Get the num_samples to calculate the last push location */ ret = amd_pmc_send_cmd(dev, S2D_NUM_SAMPLES, &num_samples, dev->s2d_msg_id, true); /* Clear msg_port for other SMU operation */ - dev->msg_port = 0; + dev->msg_port = MSG_PORT_PMC; if (ret) { dev_err(dev->dev, "error: S2D_NUM_SAMPLES not supported : %d\n", ret); return ret; @@ -266,7 +271,7 @@ int amd_s2d_init(struct amd_pmc_dev *dev) &amd_stb_debugfs_fops); /* Spill to DRAM feature uses separate SMU message port */ - dev->msg_port = 1; + dev->msg_port = MSG_PORT_S2D; amd_pmc_send_cmd(dev, S2D_TELEMETRY_SIZE, &size, dev->s2d_msg_id, true); if (size != S2D_TELEMETRY_BYTES_MAX) @@ -284,7 +289,7 @@ int amd_s2d_init(struct amd_pmc_dev *dev) stb_phys_addr = ((u64)phys_addr_hi << 32 | phys_addr_low); /* Clear msg_port for other SMU operation */ - dev->msg_port = 0; + dev->msg_port = MSG_PORT_PMC; dev->stb_virt_addr = devm_ioremap(dev->dev, stb_phys_addr, dev->dram_size); if (!dev->stb_virt_addr) From patchwork Tue Oct 29 15:54:36 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: 13855124 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2047.outbound.protection.outlook.com [40.107.100.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C62B3802 for ; Tue, 29 Oct 2024 15:55:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.47 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730217327; cv=fail; b=t0SOLG4Jp3lnEeQHDG42nYk3ADe8R5hOAmSg3NoGTSBfO/z/4zuN0YuPqGRB2ltw7ANipTtsjBHyAhY8r8ERax7/vZnPdW4kZTWPP97I/qtHZwY/MRMI3fGxh0flcNV2n82uFq5YEDbS5pRYImlCcOjJr5d/96LFpXZ2shHfEZ4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730217327; c=relaxed/simple; bh=VH4xdiiV9HQdtuwCZ0TwdsVRZcAFCCUNRmGQWyiXqH0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XRLJXhdZGXDyTKyLc/CTsCgBsA2ZT+4mArN62GNBDSoEdOqHCdNZUIEnOEP2P8GB9+M2HXXncEs8R35zQElz4NQ2nxqdCb6PENXKfMYm/qWMPvUpa6grl04JC/U51eTZ88/hEZK6NyrmCcfs8/AV6CBjjGW8AzJSBV2jr8bgVYs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=EEhITiRQ; arc=fail smtp.client-ip=40.107.100.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="EEhITiRQ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bDjvAXaAj0oNjambHZfQMwJjd3zaDtIY3Llr2wMe+QMlDDHbUNSE1FLKxC/9ocOLufmLtBAOW5ViRVhpDDui9qnlSZhSefg8TtgqGQtywE6uHZLJ9sRGfN3e/5yPHq0kJhWHDicQo/lYoQs0RouJKMPrYJ75HkXE2rPMD9oIBSKI0qsRpf7/ebPzqaAznQOxg86nbBM3l/7YIgDPObkY0hIaSk9WE5p7P97jBILiy1X5K4wmUs4yoKYjtmi1MwoMrGws5P2JNGSKJ8dctcwvj7g3hx2luUKglUpTLncD2hI+1308tZ8lalD650anAi04zIidu1SdF2sY3PrbUOnFiQ== 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=n9cDw22g+j8TAc4a2qDEm7CgN6AcCwu6e46PXzoizFI=; b=M73pohLVWWPUtDbIu/svcfQXtW4pMOw+tVJQzuhfh+O/FhGJy16869qjK+lrix8w7IY60tCtGLB5dHFHBBVbvS06sU0W9O3srRYN8s6jATNlkaxmp8TpHLZo91BSEE12KLkqYVIGsNgVtLTlme9tx/6aNp4eoVo+uhsL7xqjuXo2Uq4Kp3u105jQZw3lB88tqhdGQB9xEjXRHcj88RZI7Gj3YXmla5kvpx9XPau5caUsE3jSLNLTLUGPGHahzyn3iX/GfYdzY2/HZF5Sme9mkY5XEad5KvxAF7rmAWW20+z8Bz8IIEVUfSVV56BDpZ6FPQIvqdNEWpK24scGnBwB2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=n9cDw22g+j8TAc4a2qDEm7CgN6AcCwu6e46PXzoizFI=; b=EEhITiRQZsknroWEk2MVWEt9mPl1ZtNphCFCY1e0sX39JmBAQdKWh+WgwIUrRTXE85M5zSTQp1g4Vqgs0MEEkOYWpbL+08O5I3vb/BYYXMwVlozBJfHDNz49V2N8aD2NPATwhBzvleDXkDZWYwRjXMp0YSjZFYAo0vUA+mZmOjM= Received: from BYAPR08CA0001.namprd08.prod.outlook.com (2603:10b6:a03:100::14) by SJ0PR12MB6805.namprd12.prod.outlook.com (2603:10b6:a03:44f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Tue, 29 Oct 2024 15:55:19 +0000 Received: from MWH0EPF000989E8.namprd02.prod.outlook.com (2603:10b6:a03:100:cafe::7e) by BYAPR08CA0001.outlook.office365.com (2603:10b6:a03:100::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.26 via Frontend Transport; Tue, 29 Oct 2024 15:55:19 +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 MWH0EPF000989E8.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8114.16 via Frontend Transport; Tue, 29 Oct 2024 15:55:18 +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; Tue, 29 Oct 2024 10:55:13 -0500 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v2 4/8] platform/x86/amd/pmc: Isolate STB code changes to a new file Date: Tue, 29 Oct 2024 21:24:36 +0530 Message-ID: <20241029155440.3499273-5-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241029155440.3499273-1-Shyam-sundar.S-k@amd.com> References: <20241029155440.3499273-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E8:EE_|SJ0PR12MB6805:EE_ X-MS-Office365-Filtering-Correlation-Id: d5668ed6-17b1-410d-f662-08dcf8321620 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: cmahMn+ofYs9XDYPs8VoTW56qoPjluGpw1dgFamlXpBr5upkiYx1ZaUX509fj9vbX2p+ytuOZM+PHGudGb+j9JiycA84sVXQiGKLdiRfatPVusLwG73uzKD1+3yp8Lj+Np3eUtJVrDd+1HdttNVrA3Aub0B5PZbmr1wLHMsL640zncpxJ/5jSmjAakLKtaxtR/bRog3GqRgXNOpHJJhCAe5fjs4rChfzG5qHLKqMsIzgkbBTKfAlJINdMgH+QddcCjFPwH5xngDyV1bKxVDCVQfHNQNcQ+oF5FTWQX3C+GOGu01bh3h3lbtRzArRd7jraOcrZYY5fgWqC9yuTR0B5JUcCwgGJQmfE+FbkehMQR8ZhQp78bJbXdZSD4/4Ea4KNaHVpnc9XMk7FikoQ+UBwoMZz7Vvd/Jw6fJ8+Ev2Li3C+gYd5CdpYwNEH7CX5yM4nTKuo4HaYzTfuEoUBLdgCJYWhcqB4MHg3tjDYX5kMh1rXHoeijDFtfVkMljAmop5bEF49SvjoJFw+9clYFm+GUspP49K1Wg/jLW1uKQPnVZW2hna+mk9WGKRZFl5m56tHJRWPTQT3PWybdxVOyOKUfxsC6VxUQQ+tySvhNTT+/zt1ocEKe11oZX0r9W9aGUncxsR8WpmZKC1NOLk8ekkY6iZ1SFiT5yGx56pzCvLJ2KYwnWwPJsuIq2GrOWvzs3K8bwiCmeQzZVKsb+8rtg+147SoaN3ejDzutEl3z5/TR8AJmxR+dxo67N9UShrtKbuQJxu6RaonhpS57xzZvr0k/c4HTp3vQmiomh0fCedkwlOdgsDBUkDyM39qLZNnlLrhxZu4MC0dqiRpX5SOOkyLahZdnXHf4qMyyRV3KX92k5iCJDuRaD7G/BWPZHZzrF8IhYnVOXbXZ2c3z2amZn5IagXvSMInVwcTWOc0ePA3GwvhXR1Z+XEpNNHbN/+fHEQ/5i6drU9gdtQu0+QSznRk+vRyfWmHN/w6i2u2w5KDk25KUnwN7QliVYdk2a92NnGOK41Ehbay8RpnRGtM3s/CcQiGPDepw9u/NhewcnUMoIJ7X73d15pHp6W/T3K4+Ot5xSc05KLcQZOzCMwgOTlJl2knn/VgoaNe31GqNz26CAzendCEh+RzZfVFjSyMhzCG82WjBTSHapjc5psVv2653q9WoRfWzYAgW/8Du+KnZy/7XBkGgl1Vb0wsqf7LWireclYW+ULQO3PN+uSdxvVCn+UAI6HjMdUcvH3b13fnqfPVfH6wBT1mqA28Uce+DX64VkORcnODaGC5LpbT5LOF/YhldPU27RtN0ssm3n04wZznafVuZaMEoZ3ScdSyNGdDnKSHCE/49Gy5/g3KalN8NHLeebalTZp0PYSy1ta5J5yeCjRCv+XsC4IsdFfLp1mHBUHH0GWHvB6pvyZuaeQyw== 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)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 15:55:18.1204 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d5668ed6-17b1-410d-f662-08dcf8321620 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: MWH0EPF000989E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6805 Since S2D (Spill to DRAM) uses different message port offsets compared to PMC message offsets for communication with PMFW, relocate the S2D macros from pmc.c to a new file, mp1_stb.c, for better code organization. Following this change, it is logical to introduce a new structure, "struct stb_arg," to pass the message, argument, and response offset details to PMFW via the amd_pmc_send_cmd() call. Additionally, move the s2d_msg_id member from amd_pmc_dev into the new structure. Reviewed-by: Mario Limonciello Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmc/mp1_stb.c | 33 +++++++++++++++++--------- drivers/platform/x86/amd/pmc/pmc.c | 12 +++++----- drivers/platform/x86/amd/pmc/pmc.h | 14 ++++++----- 3 files changed, 36 insertions(+), 23 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c index 2b06861c479b..1501793b9281 100644 --- a/drivers/platform/x86/amd/pmc/mp1_stb.c +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -31,6 +31,11 @@ #define STB_FORCE_FLUSH_DATA 0xCF #define FIFO_SIZE 4096 +/* STB S2D(Spill to DRAM) has different message port offset */ +#define AMD_S2D_REGISTER_MESSAGE 0xA20 +#define AMD_S2D_REGISTER_RESPONSE 0xA80 +#define AMD_S2D_REGISTER_ARGUMENT 0xA88 + static bool enable_stb; module_param(enable_stb, bool, 0644); MODULE_PARM_DESC(enable_stb, "Enable the STB debug mechanism"); @@ -176,7 +181,7 @@ static int amd_stb_debugfs_open_v2(struct inode *inode, struct file *filp) return amd_stb_handle_efr(filp); /* Get the num_samples to calculate the last push location */ - ret = amd_pmc_send_cmd(dev, S2D_NUM_SAMPLES, &num_samples, dev->s2d_msg_id, true); + ret = amd_pmc_send_cmd(dev, S2D_NUM_SAMPLES, &num_samples, dev->stb_arg.s2d_msg_id, true); /* Clear msg_port for other SMU operation */ dev->msg_port = MSG_PORT_PMC; if (ret) { @@ -239,18 +244,24 @@ static bool amd_is_stb_supported(struct amd_pmc_dev *dev) switch (dev->cpu_id) { case AMD_CPU_ID_YC: case AMD_CPU_ID_CB: - dev->s2d_msg_id = 0xBE; - return true; + dev->stb_arg.s2d_msg_id = 0xBE; + break; case AMD_CPU_ID_PS: - dev->s2d_msg_id = 0x85; - return true; + dev->stb_arg.s2d_msg_id = 0x85; + break; case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: - dev->s2d_msg_id = 0xDE; - return true; + dev->stb_arg.s2d_msg_id = 0xDE; + break; default: return false; } + + dev->stb_arg.msg = AMD_S2D_REGISTER_MESSAGE; + dev->stb_arg.arg = AMD_S2D_REGISTER_ARGUMENT; + dev->stb_arg.resp = AMD_S2D_REGISTER_RESPONSE; + + return true; } int amd_s2d_init(struct amd_pmc_dev *dev) @@ -273,18 +284,18 @@ int amd_s2d_init(struct amd_pmc_dev *dev) /* Spill to DRAM feature uses separate SMU message port */ dev->msg_port = MSG_PORT_S2D; - amd_pmc_send_cmd(dev, S2D_TELEMETRY_SIZE, &size, dev->s2d_msg_id, true); + amd_pmc_send_cmd(dev, S2D_TELEMETRY_SIZE, &size, dev->stb_arg.s2d_msg_id, true); if (size != S2D_TELEMETRY_BYTES_MAX) return -EIO; /* Get DRAM size */ - ret = amd_pmc_send_cmd(dev, S2D_DRAM_SIZE, &dev->dram_size, dev->s2d_msg_id, true); + ret = amd_pmc_send_cmd(dev, S2D_DRAM_SIZE, &dev->dram_size, dev->stb_arg.s2d_msg_id, true); if (ret || !dev->dram_size) dev->dram_size = S2D_TELEMETRY_DRAMBYTES_MAX; /* Get STB DRAM address */ - amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_LOW, &phys_addr_low, dev->s2d_msg_id, true); - amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_HIGH, &phys_addr_hi, dev->s2d_msg_id, true); + amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_LOW, &phys_addr_low, dev->stb_arg.s2d_msg_id, true); + amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_HIGH, &phys_addr_hi, dev->stb_arg.s2d_msg_id, true); stb_phys_addr = ((u64)phys_addr_hi << 32 | phys_addr_low); diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index 8e7c87505327..f9900a03391a 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -450,9 +450,9 @@ static void amd_pmc_dump_registers(struct amd_pmc_dev *dev) u32 value, message, argument, response; if (dev->msg_port) { - message = AMD_S2D_REGISTER_MESSAGE; - argument = AMD_S2D_REGISTER_ARGUMENT; - response = AMD_S2D_REGISTER_RESPONSE; + message = dev->stb_arg.msg; + argument = dev->stb_arg.arg; + response = dev->stb_arg.resp; } else { message = dev->smu_msg; argument = AMD_PMC_REGISTER_ARGUMENT; @@ -477,9 +477,9 @@ int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool r mutex_lock(&dev->lock); if (dev->msg_port) { - message = AMD_S2D_REGISTER_MESSAGE; - argument = AMD_S2D_REGISTER_ARGUMENT; - response = AMD_S2D_REGISTER_RESPONSE; + message = dev->stb_arg.msg; + argument = dev->stb_arg.arg; + response = dev->stb_arg.resp; } else { message = dev->smu_msg; argument = AMD_PMC_REGISTER_ARGUMENT; diff --git a/drivers/platform/x86/amd/pmc/pmc.h b/drivers/platform/x86/amd/pmc/pmc.h index 7e7f9170124c..d3c6730ebcd7 100644 --- a/drivers/platform/x86/amd/pmc/pmc.h +++ b/drivers/platform/x86/amd/pmc/pmc.h @@ -25,6 +25,13 @@ struct amd_mp2_dev { bool is_stb_data; }; +struct stb_arg { + u32 s2d_msg_id; + u32 msg; + u32 arg; + u32 resp; +}; + struct amd_pmc_dev { void __iomem *regbase; void __iomem *smu_virt_addr; @@ -36,7 +43,6 @@ struct amd_pmc_dev { u32 active_ips; u32 dram_size; u32 num_ips; - u32 s2d_msg_id; u32 smu_msg; /* SMU version information */ u8 smu_program; @@ -50,6 +56,7 @@ struct amd_pmc_dev { struct quirk_entry *quirks; bool disable_8042_wakeup; struct amd_mp2_dev *mp2; + struct stb_arg stb_arg; }; void amd_pmc_process_restore_quirks(struct amd_pmc_dev *dev); @@ -70,11 +77,6 @@ void amd_mp2_stb_deinit(struct amd_pmc_dev *dev); #define PCI_DEVICE_ID_AMD_1AH_M60H_ROOT 0x1122 #define PCI_DEVICE_ID_AMD_MP2_STB 0x172c -/* STB S2D(Spill to DRAM) has different message port offset */ -#define AMD_S2D_REGISTER_MESSAGE 0xA20 -#define AMD_S2D_REGISTER_RESPONSE 0xA80 -#define AMD_S2D_REGISTER_ARGUMENT 0xA88 - int amd_s2d_init(struct amd_pmc_dev *dev); int amd_write_stb(struct amd_pmc_dev *dev, u32 data); int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret); From patchwork Tue Oct 29 15:54:37 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: 13855123 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2046.outbound.protection.outlook.com [40.107.220.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF056195B1A for ; Tue, 29 Oct 2024 15:55:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730217326; cv=fail; b=CFZNyn0fa8INMY3i4lWnuNu0BVdQkRy2ROPdsETDHKeinUWyN+3Y58EwF919AL0v586QDFtSOzneDiPFUSw0irNifYBoiRS0khi/6lD7+N2deaoBz91ECXIb320gz3xqJlG1B7GgRgMeEo3FSkqvYCwCwGTGq8brkKbU6FL4Y5E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730217326; c=relaxed/simple; bh=CSBAXidFgMOCvEEUtdfATHeu2eGvy8A4XS0DZ1Hw4Io=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Tak/vXRsmGkZBhfU7Y+KU4z2BcsQvqPiMfeAVDvUQ+gB+zgkoZIR5ZFy/GBw4txakqJQ9V7n0MefhhdePHxL1FZJFmyErdK2UR7Gcu6Kl7uXrPFX6vz50gQy3Z2AyWsAQF0KOOF59RaO3U+WspxzkV5LwpuiZGFv47JjT8RsPyo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=fU+llRHB; arc=fail smtp.client-ip=40.107.220.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="fU+llRHB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=i4fF9tSU9cZtUz0QBOAVl7CSjQUyP9GhHOrG2HG5AzS5UkVitGchFiFFlGc3ZtC6k7vSNIoxxKQHpGHWUMm6dMCkjGPWA6kUVg+qUwpdULUQ949NspSvuw22yncblq2AKgOjodc7pzw7zNqDha9q95qWJeEVJJlp1kcTz5rTtTnwZwZzP7pS4YZB2JtJcC1DzVojcIiJ9ljbAt5v6gLgMhVVIEgjVkAg7uNkQ11FIp5YPq1p52KmcNM9jUTHbSzO5gNvRZjBvh0e9wPQ4B0T0eQlPFZ1KgfoQfGw5vqr1UUSrNDqt0s7bfIyeN1K2OHvK/3tbYTNKdeiKy16ISx+2w== 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=F2VVgrnDR/J+lx+trSxoDgKMPvQ7821oEf1GiG/5vUQ=; b=oIaCY35SN7GBc4QNUJ0jx/vw25MELCrczjjbbeBiqQElrGdpo60T5hq0p0SvtLk1kvqDbFFkOxnoYKS0hNWM+MYQwEyw/md31JHnEzcsz6+KJstVgeOt3Yh1WyisrUMQAtAlEjFsnNEPNJ11TSXSC2lwUPwI0zXr0zc4roZ7jr/LcQ9yBRdlgcThw2rXx23LJQ6nPwYaye5WO464a6SlZOHBX8kM3pBB1QpkLa/ublDxUn5Z+lxJTw6YDMv89qpIJVoJXxOIxPq+NA1u03Id7kKMHle8wZFLjLi7dGQTwGi+5ApV7+I7PimdtoNsckrIw2iGExmy0KoNYQbn7o43Pw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=F2VVgrnDR/J+lx+trSxoDgKMPvQ7821oEf1GiG/5vUQ=; b=fU+llRHB/V5fugGezTe2MMhiinLpHMYM/rNGylbuPb7Z9L/YOWgIvmsVYkN5CDx2NKSsRpkMey/Sbdpgxl2ypp6ASJ+PYp3+oYAzaSxMWsJFj+YubVuPNOKDL47K5oFi+fcKET/M52bP2k+RMuxGCp+JGdSvIATglbVScmthw7g= Received: from BYAPR08CA0026.namprd08.prod.outlook.com (2603:10b6:a03:100::39) by SJ0PR12MB8616.namprd12.prod.outlook.com (2603:10b6:a03:485::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 15:55:21 +0000 Received: from MWH0EPF000989E8.namprd02.prod.outlook.com (2603:10b6:a03:100:cafe::7c) by BYAPR08CA0026.outlook.office365.com (2603:10b6:a03:100::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.17 via Frontend Transport; Tue, 29 Oct 2024 15:55:21 +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 MWH0EPF000989E8.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8114.16 via Frontend Transport; Tue, 29 Oct 2024 15:55:21 +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; Tue, 29 Oct 2024 10:55:15 -0500 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" Subject: [PATCH v2 5/8] platform/x86/amd/pmc: Update IP information structure for newer SoCs Date: Tue, 29 Oct 2024 21:24:37 +0530 Message-ID: <20241029155440.3499273-6-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241029155440.3499273-1-Shyam-sundar.S-k@amd.com> References: <20241029155440.3499273-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E8:EE_|SJ0PR12MB8616:EE_ X-MS-Office365-Filtering-Correlation-Id: 1173d928-291d-450d-05a1-08dcf8321837 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: bxyaQklhSrp3u4CIVGIv0Kj9KwpxgKmcZa5m54kJMfaQfPZiHIQLdR5CJ95G/smDYvfx3Fl+qo4M3OBw2DLS0H4qyqlk60GIoVFlliwICYFCelzglGhNXY2PQNrwK6q6MbjmEDgAntF63puPb0IMK6hDMMH7cnUTri5hepXoB4+b3lwsIfqJ21kmgzRUO/OkqG/Evy6PErGIIr6iKs8wNU9aJeuvVrnqBPK+BLQ/3ywKzbS3YSU7r0R8TL4QpnOTYbQUgGjuOjRY+GVHFUOOCVCfZW0T/nGYh7KLr3EskzZN4qy4yGyV6zpLm2UdXWXdSNgDs915u29k0ANGh/2VpC4WpOXVF8JBMF2F/lAgXyCU+cUBgMASpM8qawFO/pWqj7Op13toZm97gVxONHQ6A+WTvKbvNi7fZIhEYeLenD47QuLw9vv4/EgSzxifOfgrVwF9JGUOr86Dgfg5ud2YPibjih3AdA1t3W7q4h0JucXI5Jqb2Evzq3sBw+EDcZ6L5JgBkKaWFQW6NagkTSxCznxD5+G7b9ptR4w8gQV46OE6sI7ny0aZegahq+uyr126dm+137iNZLvqgtohgIVqKCX+WHIT/1tDT90cfHeoUBxXA1DgLDVyTXRTy6CPL8MrQrSajLRQpooXUR4x+T2a1RaZ4CnHnnOdcDj1dj6CBIqxirZXKQiheylFC6PSo8t14Vs54Uh2Uzd0pY0oz/jfXW1vFhunjHhon2ncLJ42fe/1Pm6q3Pf1+3un7JNpsJG7/fFNHTtciXnH7PP2cbszBfEvbnpMYcoOgL1UEoGZ9mFFfQfEccRC6GZ1iDvSHsZ09f0+Jl33dYXM+xHZkEOqUG0ekRV5eTDeluAx6nJ/Odjgxnfc1cAZM+wE/ku7dw2tNP25N64xtjrOzAJKm3t53i4gJpwxrUOuEMypHrrZTJ0wv3zkglwQKs6JfLTGqErpcw3YwCOyTewOEidwvQtAZM7WczCpDauM/+Ks6D6oflNdDotUM22g/5gHkdVZg7x5YUMKu93bDW5jEuixSZ+jY/XFRau/kThkaIjBkslwF9+wy5Ug8l1ct020ZhFoKrILrr9Ac/UyfzHcBmi/FgZjXD4w2e6ZFDpgUgdWIW3dBv/DoCGh3Mdzvn2DYq8HLxphrDc2dSiWYeuyCh/CKqt7IsTGgP0cxWIkRBRIVnsPIkhNnNkVBioXTpgfxEJvJt/dH1ObTeIQjtUN/j4VuQ/v4h4VjJXOFDh5x8wACZ7c6JoLyg/ufSkx9uNHIpxWO4UDF+M02S7ED61ebBKCpYZhSp1o4jfpEzsdCEALz4sA7PpZB/Namx9J9UvEqIsJqcXKUL5R21uThMHNPFDPdwT/QdXLDUqc+KeYCqigrtFiD7lIq2J07KKTzQtlSLzytkdqsuEJ6N9EdF1ohkIg7kCAUw== 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: 29 Oct 2024 15:55:21.6361 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1173d928-291d-450d-05a1-08dcf8321837 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: MWH0EPF000989E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB8616 The latest AMD processors include additional IP blocks that must be turned off before transitioning to low power. PMFW provides an interface to retrieve debug information from each IP block, which is useful for diagnosing issues if the system fails to enter or exit low power states, or for profiling which IP block takes more time. Add support for using this information within the driver. Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmc/pmc.c | 42 ++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index f9900a03391a..0bf4065153da 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -95,6 +95,35 @@ struct amd_pmc_bit_map { u32 bit_mask; }; +static const struct amd_pmc_bit_map soc15_ip_blk_v2[] = { + {"DISPLAY", BIT(0)}, + {"CPU", BIT(1)}, + {"GFX", BIT(2)}, + {"VDD", BIT(3)}, + {"VDD_CCX", BIT(4)}, + {"ACP", BIT(5)}, + {"VCN_0", BIT(6)}, + {"VCN_1", BIT(7)}, + {"ISP", BIT(8)}, + {"NBIO", BIT(9)}, + {"DF", BIT(10)}, + {"USB3_0", BIT(11)}, + {"USB3_1", BIT(12)}, + {"LAPIC", BIT(13)}, + {"USB3_2", BIT(14)}, + {"USB4_RT0", BIT(15)}, + {"USB4_RT1", BIT(16)}, + {"USB4_0", BIT(17)}, + {"USB4_1", BIT(18)}, + {"MPM", BIT(19)}, + {"JPEG_0", BIT(20)}, + {"JPEG_1", BIT(21)}, + {"IPU", BIT(22)}, + {"UMSCH", BIT(23)}, + {"VPE", BIT(24)}, + {} +}; + static const struct amd_pmc_bit_map soc15_ip_blk[] = { {"DISPLAY", BIT(0)}, {"CPU", BIT(1)}, @@ -170,7 +199,10 @@ static void amd_pmc_get_ip_info(struct amd_pmc_dev *dev) break; case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: - dev->num_ips = 22; + if (boot_cpu_data.x86_model == 0x70) + dev->num_ips = 25; + else + dev->num_ips = 22; dev->smu_msg = 0x938; break; } @@ -338,9 +370,15 @@ static int smu_fw_info_show(struct seq_file *s, void *unused) seq_puts(s, "\n=== Active time (in us) ===\n"); for (idx = 0 ; idx < dev->num_ips ; idx++) { - if (soc15_ip_blk[idx].bit_mask & dev->active_ips) + if (dev->cpu_id == PCI_DEVICE_ID_AMD_1AH_M20H_ROOT && + boot_cpu_data.x86_model == 0x70) { + if (soc15_ip_blk_v2[idx].bit_mask & dev->active_ips) + seq_printf(s, "%-8s : %lld\n", soc15_ip_blk_v2[idx].name, + table.timecondition_notmet_lastcapture[idx]); + } else if (soc15_ip_blk[idx].bit_mask & dev->active_ips) { seq_printf(s, "%-8s : %lld\n", soc15_ip_blk[idx].name, table.timecondition_notmet_lastcapture[idx]); + } } return 0; From patchwork Tue Oct 29 15:54:38 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: 13855125 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2086.outbound.protection.outlook.com [40.107.223.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DA79195B33 for ; Tue, 29 Oct 2024 15:55:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730217327; cv=fail; b=exG1Li7ArJIjnl8Jt4ZQXfi6pcAhbbEcY86OofEVqv1yvY55nJqqmxzAILPIriSusGpl6V3bQTK2OiuoOxxgXni7pU999qBgyaCZjbGxP/izU/wwIHcLEFvE5Q7aemaZ4PFSI5J6dv44KaMF93a2KBqNVNvq3QwRMXsLO9rBjH8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730217327; c=relaxed/simple; bh=ZZS4W9VoewGLxhSCaManuN/LEzpURITPpL9uJj26748=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nmsxEVv2bp9sonK7OKnzj0G1EyI2lJMgGlwa+TI+cRlFon/d9r/bCjrsf4zZyTIRO/L/GUfiwtxozYVPQJ871RwKgmzVqX/tRv+4n084OT5znXihZfL7SwCMg30YBSXnFF+tQKm4yb/ulti3bh2ZCdnWrAFUV1eOJx8iZZtlh/8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=3mWSAx1L; arc=fail smtp.client-ip=40.107.223.86 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="3mWSAx1L" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JQ8AbruEYFzwUj81BvrE8etdnz6A2Nc1wZI6kEsCMqcFGVXVU4YmNY7gSuN5NFxV2TVzuvQ7jp6VcpWObr14blz5kYdD/Wg/cBGlE9uCZVjv9nF60iBTPHNgR3c4TQmRNK3IhomNUkaqOZleVRGPIuTvNTWxmy8xDjndZTlnoguQpqFEL/FrsyzUG/ZX/DttWAROkBso4cYHI97xbfznW14loQrcPTrbXvNWCnYX+9HgtP3wwNE6uUuYu00VS5nHVb2EuLtCHgXo7qEkwmrFCgDY5atFG8q7JuFsxJ+OhaeIXHrd39tRRLdaMH2ytxTp1/2Ci+t5v3W1YTpXMQy4hw== 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=CJaVMVdC8F71A7WWJI4SOLxVtSQgx/gr8r4gD/2gXPc=; b=o5ThJg68vI6HPbeEGi55UqApvsVfQ7n3FAycWnno76v8TSpMbn8bd4fw2xoTSQQ5XaPEm/PgzHdSRgnUu9o4etEGbITm5LFgloD7q+2bC9HfIwRD60ELpgae5t/7P2ybhlmwfV58Zfr0xVhUWJ/SKgzSsQIAmZMBPw6Gl3GCtFH2Tuxfc/ohAB57St0eAjKoODERrFxEl0BxIdYir0CGHmhcTUGbDkx08ZMzcfQVUKPQ8WV73CWmbi89gHq3jjyf6IyMPahZTQI6gEpDWjzj57jSB7zDJWmOm6ocsSOe5/VB3zVHKrgiVuJv58PMmB1glnmz1c9el/g8ThG9wBaiMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=CJaVMVdC8F71A7WWJI4SOLxVtSQgx/gr8r4gD/2gXPc=; b=3mWSAx1LBmWtWq8K6i3/EJ+qH9u3eNCemQXzLfMWGYslWMdRCn6axbsLzbmaEYkJpx9HhmopDhSAHU0fvYz45P1dOvsPRPowjP2oth7QZ5RY0d9gEsYUKe1HECSO4xTuovHTSiT2DklFXCPllL1BNLL8Qn77auB86+WhiXnx/Vs= Received: from BYAPR08CA0022.namprd08.prod.outlook.com (2603:10b6:a03:100::35) by CY5PR12MB6621.namprd12.prod.outlook.com (2603:10b6:930:43::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Tue, 29 Oct 2024 15:55:22 +0000 Received: from MWH0EPF000989E8.namprd02.prod.outlook.com (2603:10b6:a03:100:cafe::99) by BYAPR08CA0022.outlook.office365.com (2603:10b6:a03:100::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.17 via Frontend Transport; Tue, 29 Oct 2024 15:55:22 +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 MWH0EPF000989E8.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8114.16 via Frontend Transport; Tue, 29 Oct 2024 15:55:22 +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; Tue, 29 Oct 2024 10:55:17 -0500 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" Subject: [PATCH v2 6/8] platform/x86/amd/pmc: Update S2D message id for 1Ah Family 70h model Date: Tue, 29 Oct 2024 21:24:38 +0530 Message-ID: <20241029155440.3499273-7-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241029155440.3499273-1-Shyam-sundar.S-k@amd.com> References: <20241029155440.3499273-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E8:EE_|CY5PR12MB6621:EE_ X-MS-Office365-Filtering-Correlation-Id: a0065fa3-b18b-48c1-d902-08dcf83218ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: wM9TQxn+i7x5bzXH8RlZBdiBDQX9/NJOLs0d9Li31ai7tm16QCK3mblq+/6UlW/dhXISZI6KSQOf1dODFl9TPLuqheD7xfzsKEEM4nHPpaexWOnb+NWHESiDI0+5QKOcfX5AWvlY+DzfxwDQNeLbyA1eYx6+OYFIXIpOTypKvc6no+TeZStQ2LrOTuT6CrdswU+8JRWBUZhDX2Rs7o3nUET/Ih/74ZWBKDdlBbxEFtyeQXG1kJR+PJ99RBA3U2r4oibSCjaL/J9XS9yRnR59OTt9MtSkpx1HAinyJqRggpqsGnMFlrPKEw+ay09aWcJBqun24TdaffyS7IyuBSurbPyMeFvZneD6jfjaELJPGBunmErtcixwB++xKLDcKRwssqB7Vk47EjV8hmAGiizedaS0CvLpEv0ekm2HFcZ9hGu7/eiu03g5cKclr45Jx6ICIDfjv7OLpK/ZQaYhEeWTKJZ9mA1SQvA24ZeG+Iu9v1W2602Gtq0VZmaHxEtj8Mpq0ThG6U2JqyMVgctSp76pLtxfok5h1fJ69LkGTMx+ipC+UIvDw8QYo9pssqLVXnATaQTcfa1maXkUv0C7TEZKqPGpPIOc9iqXM12Rb4NrxyJCRYzEQwHG6QjCGinJ6YgH7NCaPsGPlIgTkt+ZQI/+EMfzHmZ59HmroDj5oaEF7K+8+RyQuykqmscmZMbKecIDgTn6uKuOux0PiOFTinotDCWGqtJ0PaQP7qGriV6H8jXmNecEpwYTRhxTa3JYvzOS63dq6f8wHPiVWPeHvvZvhCeY84s/QOfNVxmy8ka89PZTK4EiyuFsl0sEfrPU5MV9gern6oUpFKKeoGeGo9LRy8KNOz6KbgwgDKvyCbtmF7cPy4p02O4yhzn+dLAClSLYFR/ifbo4fnJffHMXzayA4T4vmGIDeMvkWICShKyl9p3Ciiy6/5tZWCfcEZuXIqfodt/LDjtlM3EjFjZWHOpX2aewVN9EiGDP7FJxg965nwU4G7TSkTP4271x8rL45t3gNWshvKnLonr2T4v2c09isZeE1t0HHY3WAP7zWNXwTcRa94NKw7LVu7RSoebToGzvAemqT7XzwQny9XG9DsVYb6VowUfJIjp0y33mpNfBndQQym1UTgOYie3dHTqMBx6Ttn8Dr75hJ0nx6HIcctDVmyHbhXPPNaU+rWea6g/I6OSw0YCQwgJ1Fb77wwyaSBjJm3dw5gDrQN5MERqiHAT12wToZvwYqjmqhSe4LL6iFDqLPrQVyYRK+x6UlLwCWCsDgPLg2/ibKXKehOPpRebMhsGxDJBUNcome6WYsmARu3pUniobyZDB6PhbooGZn+nBk2WE0NodGHwpMMu/R2PT6a1OHH7XR01QrHQqN+EHn/ymmy555J/rxsSiLfb47NGE073262gHoZeACyYeZmid5w== 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)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 15:55:22.4642 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a0065fa3-b18b-48c1-d902-08dcf83218ab 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: MWH0EPF000989E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6621 AMD's 1Ah family 70h model uses a different S2D (Spill to DRAM) message ID. Update the driver with this information. Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K Reviewed-by: Mario Limonciello --- drivers/platform/x86/amd/pmc/mp1_stb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c index 1501793b9281..917c111b31c9 100644 --- a/drivers/platform/x86/amd/pmc/mp1_stb.c +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -251,7 +251,10 @@ static bool amd_is_stb_supported(struct amd_pmc_dev *dev) break; case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: - dev->stb_arg.s2d_msg_id = 0xDE; + if (boot_cpu_data.x86_model == 0x70) + dev->stb_arg.s2d_msg_id = 0xF1; + else + dev->stb_arg.s2d_msg_id = 0xDE; break; default: return false; From patchwork Tue Oct 29 15:54:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13855127 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2069.outbound.protection.outlook.com [40.107.92.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A87D195FE8 for ; Tue, 29 Oct 2024 15:55:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.69 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730217330; cv=fail; b=H0RR/TsRWxIBozt1Gh91iX/CQBW5cMm2HLnjkojz1JDEOp1PP8MpmWwDWLUYycSWUXqcXXKTcvWNwkjXBDTEh7MI0W9mJfos/hjLHGtbPZt0TxjOb8jY9jzbR5XSSVFT0/8yA4V2RnR7poao4YFJOIMLaIU7gAiI/VhoyfjDgCE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730217330; c=relaxed/simple; bh=y623mwSs31Wb0JKe1s4zSKBsdBc3t3XzwNocoHyCPpc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hB9sk+8Rgp4HzZ6xj1la1+vDhVPRtspPWPugQrZupfT5p/amcMUKn+ZMnThkhx+S8AhxpAQ4VcTj0RfORASZZVvqZT6wNcLeISXwO2ZduW+M0y031AtR7kJuegXm+OCfQ6aWWvfzoK6ticA4vyJAo7y7Gp66LVA7xhs0ZUvjfsA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=BTKXEzU/; arc=fail smtp.client-ip=40.107.92.69 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="BTKXEzU/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YgQiU70MJM1VoAKhtET3Xhdq4nkqt7V2IFQiDhLeggqzT1KtgNhBsxwCxHwKBVYYMcMCaFPg1/UER+ZNrQxGoh07jW7IFLks0nnZz+vOy49aSJYu4AyeRvWkwTDWsdqwFPeFtOAG5OFyW1vHxw40qmfNAmcrDt6oVmBlxUkFuiAvGc2rDT58HoOgmre8kIpBxcPgl88Zq3tQ8MnlwMI2hKrdLXviyiYR72x5zK01aV9ZJ8LgqhIJ/QvxGWmG+FbbwK1RivDDt7RKUGqRzL7l24InVzzfGZQ9ogdbEbZT55qq0Jvj3Ug50K6QqOs9UEj9o4fWRubJXzJfMVK6HPGLKg== 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=71/0rAfMtJbL6TtDByo2rJ15jkbgO0FqWYI6DvErQ+w=; b=vRUmLSVjN3h5pY1cNha0gNTl3oklYF3/lfhQOqNDrhG6xqrskwoUxs6OMzuW9St/FKfMjdsRycPd8GPKw4NKAlf7h3+QPqBJRZem1zd7Tk+tM4HB7bpAFZwcu0hAIbh0NNJX+OtaByCdrUi1BDLUUIFRH2pg0e+sVpz89HR/IAk7NutEZTIWC2S9GMMUVC3h9cmTCvQeKz+wuKFXKOxGGC6gF4zDx8IbC2Jo2OVmaUMRWeE1h3uuHspcUtqy1uL8pOFdVlTahZeVp+Fwyh0uYtHwgCm1Tx3eoDrQoO1esyZXnuF0Gqge+j3Vl2JJaTHqFdKb95lTHgDJEt08J+e0Jg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=71/0rAfMtJbL6TtDByo2rJ15jkbgO0FqWYI6DvErQ+w=; b=BTKXEzU/OfRRieiteuPeVBTna7d6VgJXMVAl/q0oCJqcaLJz4Djzh/LlCGw+bjAPjLDZdnS+LTkvVvuOKeBtusXfJy0r1Z/Cniv1JCojxmN5aqd9GafnxXV5sPHs3C3bBijYBdRqP2TJX8RAvp8E+baliH0ep0105BP8I3treb0= Received: from BYAPR08CA0010.namprd08.prod.outlook.com (2603:10b6:a03:100::23) by SJ0PR12MB7457.namprd12.prod.outlook.com (2603:10b6:a03:48d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 15:55:23 +0000 Received: from MWH0EPF000989E8.namprd02.prod.outlook.com (2603:10b6:a03:100:cafe::61) by BYAPR08CA0010.outlook.office365.com (2603:10b6:a03:100::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.26 via Frontend Transport; Tue, 29 Oct 2024 15:55:23 +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 MWH0EPF000989E8.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8114.16 via Frontend Transport; Tue, 29 Oct 2024 15:55:23 +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; Tue, 29 Oct 2024 10:55:19 -0500 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" Subject: [PATCH v2 7/8] platform/x86/amd/pmc: Add STB support for AMD Desktop variants Date: Tue, 29 Oct 2024 21:24:39 +0530 Message-ID: <20241029155440.3499273-8-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241029155440.3499273-1-Shyam-sundar.S-k@amd.com> References: <20241029155440.3499273-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E8:EE_|SJ0PR12MB7457:EE_ X-MS-Office365-Filtering-Correlation-Id: 5560903c-e89f-4ab3-8584-08dcf8321919 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: dyTCdhtWZAvs5DcOc41pZXFwFxeWfwtWaRYOPqBzPaBNGy/SNtR/3jAp0aK6MlIyIUlyZsipuYplnUOnh0+TvvqI3yLpB1yc9oqclItKIv6GwIdEF8FT+4qJDupjRWlAHjbwr7Rk6UzXixsGc0XDoEkH6bW2onn1zaIrhKasrM82tmYJOtw0fcNHI5NBzWJ5CRfCLL6aSspXeT9PvhZKeogrzpeHPOQ7ayXr1NC/aIvkbN5DPd5AVSqyGsyunC8NCFYR+Vl3zr2avuWX/N5X1j2G5jrY0ds5T1n9pPa/1EzJ6pAq8HJFyyiYR+cFW0pMR+4fA0AcRP2MscaD/RdWJGqtZvH72kUxSZff+akPGj16wf0ElnO9HcEcT0QWWVKhQhmYfD/H6MECCNR0g0en/slX3QSJMob16JyzazNuJ4JRgU56tsQT8C4JM1F0YKxpjsTYP3BXvOmgvzcMF0GWF5eiYIMLolJGWpWxEw3pK9qLaQig2jC+7ZwH+cO5wuhQarLlN9ofzJAcSNqlCutCfCdQV7aP7J5ctdV7gUoVJ2Q/oBqj4b3J2WzBZE1qRA0/OBmQmFCs4z5OREywDzBDVhs+5AMjDZDS4EeAhlLXuXXIPb6LMenokQO9tJ70VkpGpZOjDQg0HGjOvlphC6GI3+FFgfcRGkKpA9SCl6Ax3UUDnhPGX0ARDoPXsgeFL6HB0heXaDhYvodnbKPAo4B52KnlMBcb9z6c98W8aSga7aAVlSEcexo76l2NgU+iJWp3ZqRZTeP/daWt8ApHW4QmaME9xknQMP8hB0VQ2FrlIJfN4YR/dTFoECX7ZBYAKuDbRijqN9BA81fN7dt653s8W2kr2XzAMCy5rAXNlwq972EnKDi1aol0114jwFQsc5dvxETtrm861gKhtjg/hi+3i8uBpDWANkidX/WCC+0F5CfNY/DhLmJxnrPFGbc12IGMiI7y3/PubSv2pQgJB2/rOt3s1i7Z7seAiIJwWbPQvazDxTIvoRkm9gi5uoHYVjKCBIh6JGN2BOcVuzc+I+Pieap1pu6cBZvo8N9GImc2Kk9Iqk65hcWuHBpmuLp8R0riLkwjEJrvfHVL4nXrrwjTRBjBzes4Wb3cgzgrnbqPmDL2/yN7FH0mXo8wmn1btWkSIm7Ef3oG64ms/+uc6xmwuJAQ0FyXBQs0yhzJNf93U0JMwwd5vfCtr5YAX+n63ZE85uGbo0CC3xGzB1uKVAnfqrhNZ19SYi7mnxf35cw5HEdw0NtUJN5AH/xvxxNuDenWX9eRc6wz8N0rMWTM1jE+XlIpG8yE6v7R4KBcqR0nP6vL0yQGc9m8Q4G33tEr8xRylaVl7/b4JhBwfPYiib9foKzllpz9hNLwoS2ANJMaRsWC3qwzFnOeM95Y51ABZg+0vSk6NYYo0Q24XXyR3ozDtQ== 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: 29 Oct 2024 15:55:23.1361 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5560903c-e89f-4ab3-8584-08dcf8321919 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: MWH0EPF000989E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7457 Previously, AMD's Ryzen Desktop SoCs did not include support for STB. However, to accommodate this recent change, PMFW has implemented a new message port pair mechanism for handling messages, arguments, and responses, specifically designed for distinguishing from Mobile SoCs. Therefore, it is necessary to update the driver to properly handle this incoming change. Add a new function amd_stb_update_args() to simply the arguments that needs to be passed between S2D supported Mobile SoCs vs Desktop SoCs. Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K Reviewed-by: Mario Limonciello --- drivers/platform/x86/amd/pmc/mp1_stb.c | 31 +++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c index 917c111b31c9..6a3cfcbb614e 100644 --- a/drivers/platform/x86/amd/pmc/mp1_stb.c +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -36,6 +36,11 @@ #define AMD_S2D_REGISTER_RESPONSE 0xA80 #define AMD_S2D_REGISTER_ARGUMENT 0xA88 +/* STB S2D(Spill to DRAM) message port offset for 44h model */ +#define AMD_GNR_REGISTER_MESSAGE 0x524 +#define AMD_GNR_REGISTER_RESPONSE 0x570 +#define AMD_GNR_REGISTER_ARGUMENT 0xA40 + static bool enable_stb; module_param(enable_stb, bool, 0644); MODULE_PARM_DESC(enable_stb, "Enable the STB debug mechanism"); @@ -239,12 +244,31 @@ static const struct file_operations amd_stb_debugfs_fops_v2 = { .release = amd_stb_debugfs_release_v2, }; +static void amd_stb_update_args(struct amd_pmc_dev *dev) +{ + if (cpu_feature_enabled(X86_FEATURE_ZEN5)) + switch (boot_cpu_data.x86_model) { + case 0x44: + dev->stb_arg.msg = AMD_GNR_REGISTER_MESSAGE; + dev->stb_arg.arg = AMD_GNR_REGISTER_ARGUMENT; + dev->stb_arg.resp = AMD_GNR_REGISTER_RESPONSE; + return; + } + + dev->stb_arg.msg = AMD_S2D_REGISTER_MESSAGE; + dev->stb_arg.arg = AMD_S2D_REGISTER_ARGUMENT; + dev->stb_arg.resp = AMD_S2D_REGISTER_RESPONSE; +} + static bool amd_is_stb_supported(struct amd_pmc_dev *dev) { switch (dev->cpu_id) { case AMD_CPU_ID_YC: case AMD_CPU_ID_CB: - dev->stb_arg.s2d_msg_id = 0xBE; + if (boot_cpu_data.x86_model == 0x44) + dev->stb_arg.s2d_msg_id = 0x9B; + else + dev->stb_arg.s2d_msg_id = 0xBE; break; case AMD_CPU_ID_PS: dev->stb_arg.s2d_msg_id = 0x85; @@ -260,10 +284,7 @@ static bool amd_is_stb_supported(struct amd_pmc_dev *dev) return false; } - dev->stb_arg.msg = AMD_S2D_REGISTER_MESSAGE; - dev->stb_arg.arg = AMD_S2D_REGISTER_ARGUMENT; - dev->stb_arg.resp = AMD_S2D_REGISTER_RESPONSE; - + amd_stb_update_args(dev); return true; } From patchwork Tue Oct 29 15:54:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13855128 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2083.outbound.protection.outlook.com [40.107.243.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7ADBB197512 for ; Tue, 29 Oct 2024 15:55:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730217343; cv=fail; b=dImsb2subszKNj3m2PDJj+UlKSUBmuVh8hXTkfB+K0KzylSJpkNbZPg0jJVjjocFCk5SdoL9FjgmDUhNpxK9tHz69YI+q4N5hs4aR1FiOAjaWI7ZtLwEi3sdSrYuen0C1JxGbyEGVF7V/iwX5LMvmquz7Q1ssfmu36SwJNgLMnA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730217343; c=relaxed/simple; bh=7Y2XP+lZCOz7kfCIhmhgw1H7In38gAeWCGbKxMingUA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VKyJ+y7syTD4Grizf0X1mpak4pgs7bh/4IP6aqmiq3eVG5++vDP5h0pjpSEMC+YCQUd7a9A93zOuG62leWYhoFqHyMsyfgQgFtsDR6QMBPzkn+XoLf2DRI880vbCataaGke4wH2cWKoWnq7Hn8BtJmU+meLmTwvDxPMapbQPstU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=SOMdiyjz; arc=fail smtp.client-ip=40.107.243.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="SOMdiyjz" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BYWUh9+jS6k2mQRsnVNrUxRYriqCW8GrvdYO4kPQZ6sWZrrD7fcYSdmZ4RZ/dWFCW7JLGRWwpxBIf1u3Y1NQSg7cvxWSVglMzUP0kU84zcBmAN2NJ4u/l+VixQslasdzWYL6AykOK0ThfCis6Q1fExS5i/G2LmBRRUpHOD4X1wmai2zDiPMReucm2E2XdlbBmUgpeUWEz9i8FmQdQrLSSopo8/hql/l6aRMvX8BiVqAawQNZ4wJJrFnm7w2tgMxx9WTBJXu0Vql16zU52hnn3TyEvIMIPo3FmI+bPunWXKEWOVl8Y/O01qHY5AZ8GLsPKPryGlL7IMNslSg5IctZnA== 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=fe78vjteOw1vJpEF7ZH9qRFRL4vhZAfJZ6Zgpgw1uDQ=; b=JnEZlpQnJ3aSqaM22eNdbU4xqFvcDAyajXcpezpGXrIgHJtIKdDAca/HHFxBJ9eA6vYYJKatC05/j6anPKB3mUadN2FZXS1o9awzyJfh973iIQAmBXqN2Pe/1kTOO0+AMH49zwT+JS02Epa+s+O7eUJAbayfN6ZMmOnuHjHio3C9XVIhI2qvFAyJvRCHRVFD4M/Uha04SUeZrGANZdF435T0vrLc0er9CdrIh+i7Z2+oQqtFel62/7lG4Mlio9Ep/lnOwrHrLdlj0qSHaGjT8gCIaDBnDC8XwWJm8RD8Mh3FRzhAxr+zmNm3fZCzQaYQQk+OODgDjASNeknQ62T2wg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=fe78vjteOw1vJpEF7ZH9qRFRL4vhZAfJZ6Zgpgw1uDQ=; b=SOMdiyjzRI4gHjBwhgAtgy8H5mZX5oWYyxJ9E9rVijhmiIWMQqJcwudimv/5x1fE1I89iTsCSwQkHY+QEnSS8CdavYeNvg4R4xdaY7AOl0kFZMoQw3A2hKTL3QapOXDooj+xTVEv7z9AmHY93Orxced85j/pO6Gru3iS1w4PKZA= Received: from BYAPR08CA0026.namprd08.prod.outlook.com (2603:10b6:a03:100::39) by MW6PR12MB8949.namprd12.prod.outlook.com (2603:10b6:303:248::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 15:55:24 +0000 Received: from MWH0EPF000989E8.namprd02.prod.outlook.com (2603:10b6:a03:100:cafe::30) by BYAPR08CA0026.outlook.office365.com (2603:10b6:a03:100::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.17 via Frontend Transport; Tue, 29 Oct 2024 15:55:23 +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 MWH0EPF000989E8.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8114.16 via Frontend Transport; Tue, 29 Oct 2024 15:55:23 +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; Tue, 29 Oct 2024 10:55:21 -0500 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v2 8/8] MAINTAINERS: Change AMD PMF driver status to "Supported" Date: Tue, 29 Oct 2024 21:24:40 +0530 Message-ID: <20241029155440.3499273-9-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241029155440.3499273-1-Shyam-sundar.S-k@amd.com> References: <20241029155440.3499273-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E8:EE_|MW6PR12MB8949:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f7a6c03-fbf2-4b1a-a839-08dcf832197d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: JGC/UsCOZ7qSPJoclAxv3VPjW+XKE4QWpQSBVWQloXrgjLxmyk6ZzRG8rbEWqddwgao43hIk0GNawrrw9Qmw0Y/tEmqTi8D0o3mk16d+ZSVnUg2tNp5zzd0bDwSq/NkSodJGDz1VLi47EsvNHGsy1FXcnctHXjw+8fz/MPYO4m/xMYkKHaT2A0e+oQWlCebUOtXtHT4bnZDVbed9EjXk44sheb/eJ5faxFwzq2Lby74wYUtcZ7QLJs4dkiSwV7Josnd0P+08wHb1pbFYqqOBJU0vwDw+YoPzN+Pi7QMpzjCAnFjEMSVIeBShtHyrpF7VN7DqL8YYLpYYNfzlggciY3KkNwUkFWopu5OYBh2384WA/Q/hXUOYQVyutWdCb33Zoa4UJ8urAgDoQPzDTuovaTElW8NKDWlwIB5LN3Uddma3g9aP9uYKqr/DkuGKSUnuId4euY2VrdQ1URykNjmhZnhxMU8sIqsaLYpesXQvAGycdn7bXu9/4aDYrKC0m6nY+K6sJLC6MVI6IWY6WpZ0oCRjvUEsPXBSmdf42FqL92gqD7x4SCWUpRFsOK72ujuy7owD2AjEwjTuPP5ZpasMROmxvmelDxL+YLhgji3ZxAbWQQea3IR7oxPO7KpAOo9H9+tK/LiHUyHCP7anPMB5vvmzIz/PLMDE1UND654OWdsHo0xErrd+i/81zto4zdjcSySfbtJ/rDUA/EQcwu5khlkVSrRZnJauaFb/HXD++o1mgwZ2fWKYZWvsZd3e/kaJKh4fLSCwzWeHcmoP+X2XYpjysSWM2ioNFAfqCkkHsWVgtG7rnF+9ZqY2lIRaUGyRfTWYuMXeQiUKkhNSzu54FNDrWFwg1/lZhjq25+65oj9eKCP2s4d3e4AguLW9FwvhkWMk485Is6dLD1L70EY5wIrzT2qACgul21sxCmevhOk0jigt8FoPcHN1ahTc465j5ZwMwrSXhHGZmqGYPrn2eM4K0OiN43rDOtPqvYhRGGJM4F/U7bKy8AuqRPmwEw7xHNQ20b6xwIKy9y950fzJ2FAO2Vo2mmLNY0Tj0iuW/FV37cePuWxIpNprLsRlwKP5u8dA0vn3ochlheAv5eCg9C9suiMXaRccdVINfOD9/Py3FsDabrGxuT19JxSB5QKuN+3KsZ9kN4Sm3ON2NuombBFujpFz0onTSpbA0jA1LngjDtWNx/C1pTITzQsyw0pyPinNpVxvtHfaSbQ/lfI4z0TZhU4hD96oyxogrRXUfKABLqzo8HS2fx7drnrA1nEjfqESXoSAfI2BPmuofR5Fk5hA3JYpm+rxynq0hkutcu84cemonXRolOdE1kchkAb+IAXecPX0n3rt3/zAvFeXdoNNmL0/P7WNb6aKoi3Fo9k1WPAiiekrar2d5bHdEksQPlYLnPRY6eCIZa0E1xGoGw== 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)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 15:55:23.7924 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8f7a6c03-fbf2-4b1a-a839-08dcf832197d 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: MWH0EPF000989E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8949 The AMD PMC driver is actively being developed, so the MAINTAINERS record should reflect "Supported" instead of "Maintained." Update the MAINTAINERS database to reflect this change. Reviewed-by: Mario Limonciello Signed-off-by: Shyam Sundar S K --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index a27407950242..6594a74b3d11 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1118,7 +1118,7 @@ F: include/linux/pds/ AMD PMC DRIVER M: Shyam Sundar S K L: platform-driver-x86@vger.kernel.org -S: Maintained +S: Supported F: drivers/platform/x86/amd/pmc/ AMD PMF DRIVER