Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2563336rdh; Mon, 30 Oct 2023 00:21:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXn0/oWEOGP2B/eo+/7VK3LBLxXSpgysB93UPbwOzScaHZOztbTBsr0wGNZuw8f4JW6xy+ X-Received: by 2002:a17:903:2155:b0:1c4:56c8:27f8 with SMTP id s21-20020a170903215500b001c456c827f8mr5244484ple.68.1698650486886; Mon, 30 Oct 2023 00:21:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698650486; cv=pass; d=google.com; s=arc-20160816; b=FSmwxMU7B7GBb6lwTUksQCtTRlrVFAqnqioThs9usjCZbNLUnSQmK4v0EM8n5YfrAh L96VF7pq8Zc/HBZw3jWlehPr//id55mkenE8v+swPzKMR+KLsV+YFkRIkMkwNM4G+q/m DhlnuRD3DblosD7fsNQZYglO561IgF46NKg2gmlSIGRnfR76K16Wt/dgu/uT9F+Y3pyf 0BjYScvpvxSJAKEljvayP0mK9eP/HDn0MJ7bc+nOeATRdyR6FlV5cVluFC9Fw9eTdxYN 74BsOA2q5ALGz2NccGv98bxWeUX5K5mmfSrx4Tqg2VuyM6ywEe9MVtVuG8QKEOhn/Zhg Zs6A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=e3lWQhY7OSYd615EbJ2fmw+a4DyyXEAjHX1cTrCRk9I=; fh=Ja71TtLtfJIYkEAHW3eJOGMkPYaCZ9PcKimqOS6C8mw=; b=QvY5YQ9AWxJNLIn36lU+JnKiKcU6ezzz617lExGtVBL9L/FqSSQpM9VIy4zLPdoezJ ZbeEN9rdCdvx0e3hMMmxpLjXiPH0EZBc4YknnlYhbe2SR4WlOk37FK/N+vne9zEaQ3+F eFXZk1EN0myspeu/lyvvqTox0Wf0yCTzimzIBLGYHStgHlIc1ghIe2s1Fb2IVWGH9z8w Tsrj3D1hTSheoN75eiFhKwAp+XdSPsqP2udSDHiPfxf0ob9zqHyajaEWOs8kJLnxuJ2M b/dBN6Djijvjorl3Z1XzdZXtaJrEUehwsah8TC0bgIozoHC/o4QC4WFu5OyLxDW3UH8O BHCA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=DqKlxqj1; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id m13-20020a170902db0d00b001ca119ef46csi4728815plx.478.2023.10.30.00.21.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 00:21:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=DqKlxqj1; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 65D468087FD3; Mon, 30 Oct 2023 00:21:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231963AbjJ3HU5 (ORCPT + 52 others); Mon, 30 Oct 2023 03:20:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231956AbjJ3HUh (ORCPT ); Mon, 30 Oct 2023 03:20:37 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2050.outbound.protection.outlook.com [40.107.212.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86ABC1A8; Mon, 30 Oct 2023 00:20:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EEHdqcG94tt1xQdyz8Vp6N6OLcooJC7z3uPtcM4WX6wHqBSPzeTjbiHNzmIzMBRwkznq3waq/5Uhro/oDCo6U2Vv4lmYgxTMrGWVqhJ1/DfzbEw/L3xxJzCrqC9zBGxBkX5r94bL4I0FN+7hI3mQB8W8uhST7ooFiQJUqMbkw7zMUA2n2AM6tyqqJKMl0zYb5cTTfyY44EZWeX4Mt+9/Oswjz6YgAHtGMAEsKBPgeYGxXaN2XQwYuWAwEJQ6rwQ7q4TqlBdKghXvmiorwPua60isfFUdD2k0dSZkqMPJX831IhU9ms5e7ArgbiytV+UISvO224Y/Gfj/Lel1tp97VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=e3lWQhY7OSYd615EbJ2fmw+a4DyyXEAjHX1cTrCRk9I=; b=lI1qraPUJ06+3KRtSqHizbZbuHvnxxZWpwbgW8pakv2YKS/t8I4lS3tz2gTsixeMpJ63cI6pRSLDWvv0gZwxJosHWW88+ua73wYomu0UUHNKg7shq6FUuaMkqOnSmCOv7JC5gxsm8TA3rQBHDy4+HIRugI+miMLE7SPzMqeR7h8o//f/UVUcI3JzxaOgenB2m3oa3ADX6sEwrUPoQBryNlH4FadBVjHCPSofGWwMe7xdaDeMQl1Qkl1qKYvb8lcQO7532kROMv9ywN/kkRl9iHoF4iwEVUP2kopIhn0ey2gTLLKzFw5sQpPbROUg6ZZeZSCZhxom1RgY1nocOcBxzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org 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=e3lWQhY7OSYd615EbJ2fmw+a4DyyXEAjHX1cTrCRk9I=; b=DqKlxqj1e7WFInSN1ctVWFBnGaK8IVnp1woYT3tyIJbp2sgLsaeUklvm9Ug1uOT2RaElGsyoDfec+7HdCfVQ30XuTf0ZGo8K4ishRiViwVmmrIteNn10+dhPsURRGesMMENKojHYL7tJXwWO0VsDLVkDrITUovIRbPgiSZvLAC8= Received: from CY5PR15CA0201.namprd15.prod.outlook.com (2603:10b6:930:82::10) by SA0PR12MB7074.namprd12.prod.outlook.com (2603:10b6:806:2d5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.28; Mon, 30 Oct 2023 07:20:18 +0000 Received: from CY4PEPF0000E9DB.namprd05.prod.outlook.com (2603:10b6:930:82:cafe::f4) by CY5PR15CA0201.outlook.office365.com (2603:10b6:930:82::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.28 via Frontend Transport; Mon, 30 Oct 2023 07:20:18 +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 CY4PEPF0000E9DB.mail.protection.outlook.com (10.167.241.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6933.15 via Frontend Transport; Mon, 30 Oct 2023 07:20:18 +0000 Received: from compile-server.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.32; Mon, 30 Oct 2023 02:20:13 -0500 From: Ma Jun To: , , , , , , , , , , , , , , CC: , Ma Jun , Evan Quan Subject: [Patch v13 8/9] drm/amd/pm: enable Wifi RFI mitigation feature support for SMU13.0.0 Date: Mon, 30 Oct 2023 15:18:31 +0800 Message-ID: <20231030071832.2217118-9-Jun.Ma2@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231030071832.2217118-1-Jun.Ma2@amd.com> References: <20231030071832.2217118-1-Jun.Ma2@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9DB:EE_|SA0PR12MB7074:EE_ X-MS-Office365-Filtering-Correlation-Id: c8c981a3-81fb-4fd8-8104-08dbd918ab8c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: plElnVLag3UdXk7zYvzoGrTt12ORPNtFLz2lPGykuacQURO+gr4z6G4/1bGRJtGAdIAq/iFHYHwDjUU6kc2mZP1duIaAOM+orJstq82AndQ0bYuiZ0Fa4g/zcF4KuBVOuRbhcFfspgZ+8qLmdkFpVtNb9JbhkeQiqnHOumUfubytB4l+AtPenQsKL1m+uard9qE8V2g2QtnmjWAEfayRQgfOKefN0VHP7qHoZtHImNpL0ercjM4BIU1Nj4SebuW/pYy5rJRCPVmdZEwPixkIGc5vLyvoztjBgQMjl0Twf9NtfqcbfvFLHzaOsRcX2a+d2dD1hLegxSWYpLpq7v55FX8KM0h50F8WATCKjez1nkSVnRa6Y2jUyQUkIS6yGLf+3KBClATFGLisrRZNXWAw/gBlcJtPTsDUbpqvShyagPfiFOWWPOlBgk32pRcMOb0JY195c61fIZCktRbgW2r5X7SEU5SbHKFfOuHHIELR3HQeR2r6b/J7fLGWWMHQoCYtloIsSBmhWYtO13ZOBKOF5Yt7o+bxz7qBnAK+hInNsY12YTahr4DiMgPK+DTJizD8s4GQ+NixjYadcuDsV6fPPWrP6UHydfJKwXGVSZkTV4FRI+mw086J2oBZ2tCl+ePPah6NJQX886juk39ArAleyUYKegBEZskNGSV6A/5yVK3f0S/h/TnDM16ZHo4oeOKA6ZYOIyPCriYK4qMLl3GzqEzDDJPnMZsQlmueEuEHTG6tFXdkVT82KMk4n0rQaMKVrren4pitZFh0i/OuMDno3eaRk/5jf5WVdRepFhdkuJGqTdyHnQ7WAeKldrbThhRzwh0oXA5WKXKuE0wBIlGdaA== 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:(13230031)(4636009)(39860400002)(136003)(396003)(376002)(346002)(230273577357003)(230173577357003)(230922051799003)(451199024)(64100799003)(1800799009)(186009)(82310400011)(40470700004)(36840700001)(45080400002)(478600001)(356005)(81166007)(26005)(336012)(2616005)(426003)(1076003)(83380400001)(32650700002)(16526019)(7696005)(6666004)(36860700001)(921008)(316002)(110136005)(70206006)(70586007)(54906003)(8676002)(40460700003)(8936002)(86362001)(36756003)(41300700001)(5660300002)(40480700001)(2906002)(7416002)(82740400003)(4326008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2023 07:20:18.2517 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c8c981a3-81fb-4fd8-8104-08dbd918ab8c 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: CY4PEPF0000E9DB.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB7074 X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 30 Oct 2023 00:21:09 -0700 (PDT) Fulfill the SMU13.0.0 support for Wifi RFI mitigation feature. Co-developed-by: Evan Quan Signed-off-by: Evan Quan Reviewed-by: Mario Limonciello Signed-off-by: Ma Jun -- v10->v11: - downgrade the prompt level on message failure(Lijo) v13: - Fix the format issue (IIpo Jarvinen) - Move function smu_v13_0_0_set_wbrf_exclusion_ranges to smu_v13_0.c as a generic code for later use (IIpo Jarvinen) --- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 2 + drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 3 +- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 4 ++ .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 48 +++++++++++++++++++ .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 22 +++++++++ 5 files changed, 78 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h index 5e62b7474c20..4e8aacf9f6e6 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +++ b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h @@ -23,6 +23,7 @@ #define __AMDGPU_SMU_H__ #include +#include #include "amdgpu.h" #include "kgd_pp_interface.h" @@ -319,6 +320,7 @@ enum smu_table_id { SMU_TABLE_PACE, SMU_TABLE_ECCINFO, SMU_TABLE_COMBO_PPTABLE, + SMU_TABLE_WIFIBAND, SMU_TABLE_COUNT, }; diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h index e57265cf637c..2ea840534aad 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h +++ b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h @@ -247,7 +247,8 @@ __SMU_DUMMY_MAP(Mode2Reset), \ __SMU_DUMMY_MAP(RequestI2cTransaction), \ __SMU_DUMMY_MAP(GetMetricsTable), \ - __SMU_DUMMY_MAP(DALNotPresent), + __SMU_DUMMY_MAP(DALNotPresent), \ + __SMU_DUMMY_MAP(EnableUCLKShadow), #undef __SMU_DUMMY_MAP #define __SMU_DUMMY_MAP(type) SMU_MSG_##type diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h index 355c156d871a..74272fa87669 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h +++ b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h @@ -299,5 +299,9 @@ int smu_v13_0_update_pcie_parameters(struct smu_context *smu, uint32_t pcie_gen_cap, uint32_t pcie_width_cap); +int smu_v13_0_enable_uclk_shadow(struct smu_context *smu, bool enable); + +int smu_v13_0_set_wbrf_exclusion_ranges(struct smu_context *smu, + struct freq_band_range *exclusion_ranges); #endif #endif diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c index 0232adb95df3..438eceec01b2 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c @@ -2466,3 +2466,51 @@ int smu_v13_0_update_pcie_parameters(struct smu_context *smu, return 0; } + +int smu_v13_0_enable_uclk_shadow(struct smu_context *smu, bool enable) +{ + return smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_EnableUCLKShadow, enable, NULL); +} + +int smu_v13_0_set_wbrf_exclusion_ranges(struct smu_context *smu, + struct freq_band_range *exclusion_ranges) +{ + WifiBandEntryTable_t wifi_bands; + int valid_entries = 0; + int ret, i; + + memset(&wifi_bands, 0, sizeof(wifi_bands)); + for (i = 0; i < ARRAY_SIZE(wifi_bands.WifiBandEntry); i++) { + if (!exclusion_ranges[i].start && !exclusion_ranges[i].end) + break; + + /* PMFW expects the inputs to be in Mhz unit */ + wifi_bands.WifiBandEntry[valid_entries].LowFreq = + DIV_ROUND_DOWN_ULL(exclusion_ranges[i].start, HZ_PER_MHZ); + wifi_bands.WifiBandEntry[valid_entries++].HighFreq = + DIV_ROUND_UP_ULL(exclusion_ranges[i].end, HZ_PER_MHZ); + } + wifi_bands.WifiBandEntryNum = valid_entries; + + /* + * Per confirm with PMFW team, WifiBandEntryNum = 0 + * is a valid setting. + * + * Considering the scenarios below: + * - At first the wifi device adds an exclusion range e.g. (2400,2500) to + * BIOS and our driver gets notified. We will set WifiBandEntryNum = 1 + * and pass the WifiBandEntry (2400, 2500) to PMFW. + * + * - Later the wifi device removes the wifiband list added above and + * our driver gets notified again. At this time, driver will set + * WifiBandEntryNum = 0 and pass an empty WifiBandEntry list to PMFW. + * + * - PMFW may still need to do some uclk shadow update(e.g. switching + * from shadow clock back to primary clock) on receiving this. + */ + ret = smu_cmn_update_table(smu, SMU_TABLE_WIFIBAND, 0, &wifi_bands, true); + if (ret) + dev_warn(smu->adev->dev, "Failed to set wifiband!"); + + return ret; +} diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c index 3903a47669e4..0b7c25db4d24 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c @@ -163,6 +163,7 @@ static struct cmn2asic_msg_mapping smu_v13_0_0_message_map[SMU_MSG_MAX_COUNT] = MSG_MAP(AllowIHHostInterrupt, PPSMC_MSG_AllowIHHostInterrupt, 0), MSG_MAP(ReenableAcDcInterrupt, PPSMC_MSG_ReenableAcDcInterrupt, 0), MSG_MAP(DALNotPresent, PPSMC_MSG_DALNotPresent, 0), + MSG_MAP(EnableUCLKShadow, PPSMC_MSG_EnableUCLKShadow, 0), }; static struct cmn2asic_mapping smu_v13_0_0_clk_map[SMU_CLK_COUNT] = { @@ -246,6 +247,7 @@ static struct cmn2asic_mapping smu_v13_0_0_table_map[SMU_TABLE_COUNT] = { TAB_MAP(I2C_COMMANDS), TAB_MAP(ECCINFO), TAB_MAP(OVERDRIVE), + TAB_MAP(WIFIBAND), }; static struct cmn2asic_mapping smu_v13_0_0_pwr_src_map[SMU_POWER_SOURCE_COUNT] = { @@ -505,6 +507,9 @@ static int smu_v13_0_0_tables_init(struct smu_context *smu) PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); SMU_TABLE_INIT(tables, SMU_TABLE_ECCINFO, sizeof(EccInfoTable_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); + SMU_TABLE_INIT(tables, SMU_TABLE_WIFIBAND, + sizeof(WifiBandEntryTable_t), PAGE_SIZE, + AMDGPU_GEM_DOMAIN_VRAM); smu_table->metrics_table = kzalloc(sizeof(SmuMetricsExternal_t), GFP_KERNEL); if (!smu_table->metrics_table) @@ -2609,6 +2614,20 @@ static ssize_t smu_v13_0_0_get_ecc_info(struct smu_context *smu, return ret; } +static bool smu_v13_0_0_wbrf_support_check(struct smu_context *smu) +{ + struct amdgpu_device *adev = smu->adev; + + switch (adev->ip_versions[MP1_HWIP][0]) { + case IP_VERSION(13, 0, 0): + return smu->smc_fw_version >= 0x004e6300; + case IP_VERSION(13, 0, 10): + return smu->smc_fw_version >= 0x00503300; + default: + return false; + } +} + static const struct pptable_funcs smu_v13_0_0_ppt_funcs = { .get_allowed_feature_mask = smu_v13_0_0_get_allowed_feature_mask, .set_default_dpm_table = smu_v13_0_0_set_default_dpm_table, @@ -2689,6 +2708,9 @@ static const struct pptable_funcs smu_v13_0_0_ppt_funcs = { .gpo_control = smu_v13_0_gpo_control, .get_ecc_info = smu_v13_0_0_get_ecc_info, .notify_display_change = smu_v13_0_notify_display_change, + .is_asic_wbrf_supported = smu_v13_0_0_wbrf_support_check, + .enable_uclk_shadow = smu_v13_0_enable_uclk_shadow, + .set_wbrf_exclusion_ranges = smu_v13_0_set_wbrf_exclusion_ranges, }; void smu_v13_0_0_set_ppt_funcs(struct smu_context *smu) -- 2.34.1