Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1262031lqz; Sun, 31 Mar 2024 23:39:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWmVMDALZjINF+rd4qa7VoHGG1ggMUMuNF/DOMu7XChtXul4aUErClqJu8XYOsIC9z0y81JGjylmvgunDrlV+qNwzDSB3Fi41MssfX4NQ== X-Google-Smtp-Source: AGHT+IGPcSggyxVTD15P/hRWMAndL788DIg1oq49nF6vYmNR0bg9IbjFUMR9uju0UULOqWGMcnCD X-Received: by 2002:a05:6808:2f08:b0:3c3:e7bb:9e6f with SMTP id gu8-20020a0568082f0800b003c3e7bb9e6fmr12424078oib.20.1711953585677; Sun, 31 Mar 2024 23:39:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711953585; cv=pass; d=google.com; s=arc-20160816; b=nJncqrzLw1B3Kn2hHcBclUednw1MPOpT5ZpGlZJdQQqPJI0EI5lJnXh/STgaxzilSA 0Vlwbhvij9EH9om1LsO6CDb5YcMpTWZ4EGuUJhzAhvv5jgY/BcR/xU9bRvWoGJ4L8Tcs eP4m9GdZfp7jss5x8r053DI43OYUd//kqGBrn2wKYkf3D1+ASD0ifLltDpnFxP91OR5X X3MEyfir9cRxHsbONOR51zLO0vmBoTAj2uPvbrUb9zUMIb/cxq7nJT4xb32CJoG4CmgK MCaBakYy0gO0k8Qka5fmQRZIypdEUFvePDnC04r7eHP+GPPOc7BRMq8LCyUvVvzJWxyN EsyA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=4lSANNDQw5DBQZRnX1N3rOrc8wB9NIdrOKG8wy5HFCo=; fh=nZ4EW4wIR4SOAkMnfyQxvIgBa/rft4E9njpUUoXsYRI=; b=K2TGy2q3Ab902adJEUs0HtrLZh/FcnYvZlBnW37C+vTDyNUD13/nD6MV4bhcYVKkRp 2GVfMt1XuswHMxRgn22XnBdp7TVxHvSD07JLbaMUc6cgkOLsBngx9cqyqIyIEoQ05B3M dg+Pc0J0Gn3N2vCul/Ow3dXWEYUJJJ6+wvuVd+V6MYUse4fTPjkCiUWjMF31w9Dhh4yS N8IeKc3dtMgpzXSpHWVMfRsKDuOW5dpMjHPas448agh5d+WEE5mUozGNA7LAsCG0VR93 x4+ek6NH4hD5cqQ4TbY2yHpfa4zeGnRn552iUg9D6JYOD267cBpA1fbBEMJca8ndidge xNsQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-5708-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5708-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n11-20020a63590b000000b005e84c73a015si8495710pgb.766.2024.03.31.23.39.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 23:39:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5708-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-5708-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5708-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A1D10B20E6E for ; Mon, 1 Apr 2024 06:39:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B118137E; Mon, 1 Apr 2024 06:39:38 +0000 (UTC) X-Original-To: linux-wireless@vger.kernel.org Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A207F1113 for ; Mon, 1 Apr 2024 06:39:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711953578; cv=none; b=l1YL22twYDFMDFWwY7/bMbk6/CPNObfpVqpRjyfzJQJ7Ffnb++llpHOE261rZMW2/70Y2eoUVpIif4c1+YaLogOIvcGONJbWVWB00TrDtb07nMzXXqO5YDMgxxyM9DAs12yy+U8Z6XKHMe0cLP70oggEBvCKj7JLxm+h0lVQPes= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711953578; c=relaxed/simple; bh=Y5FRZmHMrQm4J6Q0HQqXg0jRoqyeRHzk+H8PGTeQ3SE=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=OCb8vtMIUaea9HriFNZllCvzBECZrtxF/sLhKJ7Xo3hpGIaQ9Pj/qWbjQoC7HVmXcToQP1+QCj0WyFzuOLlTNjJ3mQvTjGEschfs1GYF4QO3T1oZKcGoNcCi3u9r/7rnxaaQ+Q7yCqP4vdc4MTHghXNwt53/QeqkaerW2hRg6hI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4316dW9112557814, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 4316dW9112557814 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 1 Apr 2024 14:39:32 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 1 Apr 2024 14:39:33 +0800 Received: from [127.0.1.1] (172.21.69.94) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 1 Apr 2024 14:39:32 +0800 From: Ping-Ke Shih To: CC: Subject: [PATCH] wifi: rtw89: 8922a: configure UL MU/OFDMA power setting Date: Mon, 1 Apr 2024 14:38:18 +0800 Message-ID: <20240401063818.12880-1-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback From: Kuan-Chung Chen 8922A needs to set UL MU/OFDMA power and fine tune power error tolerance for proper response to AP's trigger frame. Signed-off-by: Kuan-Chung Chen Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/phy_be.c | 18 ++++++++++++++++++ drivers/net/wireless/realtek/rtw89/reg.h | 3 +++ 2 files changed, 21 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw89/phy_be.c b/drivers/net/wireless/realtek/rtw89/phy_be.c index be0148f2b96f..72eda9bbd3ae 100644 --- a/drivers/net/wireless/realtek/rtw89/phy_be.c +++ b/drivers/net/wireless/realtek/rtw89/phy_be.c @@ -381,6 +381,23 @@ static void rtw89_phy_bb_wrap_ftm_init(struct rtw89_dev *rtwdev, rtw89_write32_mask(rtwdev, addr, 0x7, 0); } +static void rtw89_phy_bb_wrap_ul_pwr(struct rtw89_dev *rtwdev) +{ + enum rtw89_core_chip_id chip_id = rtwdev->chip->chip_id; + u8 mac_idx; + u32 addr; + + if (chip_id != RTL8922A) + return; + + for (mac_idx = 0; mac_idx < RTW89_MAC_NUM; mac_idx++) { + addr = rtw89_mac_reg_by_idx(rtwdev, R_BE_PWR_RSSI_TARGET_LMT, mac_idx); + rtw89_write32(rtwdev, addr, 0x0201FE00); + addr = rtw89_mac_reg_by_idx(rtwdev, R_BE_PWR_TH, mac_idx); + rtw89_write32(rtwdev, addr, 0x00FFEC7E); + } +} + static void rtw89_phy_bb_wrap_init_be(struct rtw89_dev *rtwdev) { enum rtw89_mac_idx mac_idx = RTW89_MAC_0; @@ -391,6 +408,7 @@ static void rtw89_phy_bb_wrap_init_be(struct rtw89_dev *rtwdev) rtw89_phy_bb_wrap_force_cr_init(rtwdev, mac_idx); rtw89_phy_bb_wrap_ftm_init(rtwdev, mac_idx); rtw89_phy_bb_wrap_tpu_set_all(rtwdev, mac_idx); + rtw89_phy_bb_wrap_ul_pwr(rtwdev); } static void rtw89_phy_ch_info_init_be(struct rtw89_dev *rtwdev) diff --git a/drivers/net/wireless/realtek/rtw89/reg.h b/drivers/net/wireless/realtek/rtw89/reg.h index ccf74d9f9224..0c0d3c84b178 100644 --- a/drivers/net/wireless/realtek/rtw89/reg.h +++ b/drivers/net/wireless/realtek/rtw89/reg.h @@ -7496,6 +7496,9 @@ #define B_BE_PWR_BT_VAL GENMASK(8, 0) #define B_BE_PWR_FORCE_COEX_ON GENMASK(29, 27) +#define R_BE_PWR_TH 0x11A78 +#define R_BE_PWR_RSSI_TARGET_LMT 0x11A84 + #define R_BE_PWR_OFST_SW 0x11AE8 #define B_BE_PWR_OFST_SW_DB GENMASK(27, 24) -- 2.25.1