forked from Openwrt-EcoNet/openwrt
Renamed 046..051 pending patches with the merged tag/hash. Two patches were skipped, they make use of WQ_BH present since v6.14:13221be720
3e3aa566dd
Manually refreshed 062-v6.14-wifi-rtw88-Add-support-for-LED-blinking.patch Manually refreshed 063-v6.14-wifi-rtw88-add-RTW88_LEDS-depends-on-LEDS_CLASS-to-K.patch Manually backported 090-v6.15-wifi-rtw88-Enable-the-new-RTL8814AE-RTL8814AU-driver.patch git log --no-merges --pretty=oneline --abbrev-commit 4c2c372de...0daa521a drivers/net/wireless/realtek/rtw88: 4c2c372de2e1 wifi: rtw88: fix the 'para' buffer size to avoid reading out of bounds f24d0d8c3cd7 wifi: rtw88: Fix the random "error beacon valid" messages for USB 80fe0bc1659c wifi: rtw88: usb: Upload the firmware in bigger chunks 490340faddea wifi: rtw88: usb: Reduce control message timeout to 500 ms b7f0cc647e52 wifi: rtw88: rtw8822bu VID/PID for BUFFALO WI-U2-866DM 2c17afde9ff6 wifi: rtw88: Handle RTL8723D(S) with blank efuse 0ffa1ba81b35 wifi: rtw88: Fix RX aggregation settings for RTL8723DS 20d3c19bd8f9 wifi: rtw88: do not ignore hardware read error during DPK fc5f5a0ec463 wifi: rtw88: sdio: call rtw_sdio_indicate_tx_status unconditionally b2effcdc2379 wifi: rtw88: sdio: map mgmt frames to queue TX_DESC_QSEL_MGMT 581cf3a9cb61 wifi: rtw88: Fix the module names printed in dmesg b8d49bb8d16a wifi: rtw88: Don't set SUPPORTS_AMSDU_IN_AMPDU for RTL8814AU 0d2a88690e58 wifi: rtw88: Set AMPDU factor to hardware for RTL8814A dcbb7bb3a364 wifi: rtw88: usb: Enable RX aggregation for RTL8814AU bf1103654df9 wifi: rtw88: usb: Enable switching the RTL8814AU to USB 3 625fbc16524a wifi: rtw88: usb: Remove redundant 'flush_workqueue()' calls 5c4cf36c538b wifi: rtw88: sdio: Remove redundant 'flush_workqueue()' calls d58ad77d5cc2 wifi: rtw88: Add __nonstring annotations for unterminated strings deb3ddeb1865 wifi: rtw88: Enable the new RTL8814AE/RTL8814AU drivers bad060e8a425 wifi: rtw88: Add rtw8814au.c dad8e8793102 wifi: rtw88: Add rtw8814ae.c 1a7545784642 wifi: rtw88: Add rtw8814a.{c,h} e38246889cc9 wifi: rtw88: Add rtw8814a_table.c (part 2/2) f4debfcb1b3c wifi: rtw88: Add rtw8814a_table.c (part 1/2) 679ec431477c wifi: rtw88: Add some definitions for RTL8814AU c374281f8285 wifi: rtw88: Extend rtw_debugfs_get_tx_pwr_tbl() for RTL8814AU cfebabdd351e wifi: rtw88: Extend rtw_debugfs_get_phy_info() for RTL8814AU 8b42c46cf665 wifi: rtw88: Extend rtw_phy_config_swing_table() for RTL8814AU 053a7aace020 wifi: rtw88: Fix rtw_rx_phy_stat() for RTL8814AU 6be7544d19fc wifi: rtw88: Fix rtw_init_vht_cap() for RTL8814AU c7eea1ba05ca wifi: rtw88: Fix rtw_init_ht_cap() for RTL8814AU 86d04f8f991a wifi: rtw88: Fix rtw_desc_to_mcsrate() to handle MCS16-31 e66bca16638e wifi: rtw88: Fix rtw_mac_power_switch() for RTL8814AU 80c4668d024f wifi: rtw88: Add support for Mercusys MA30N and D-Link DWA-T185 rev. A1 9f00e2218e15 wifi: rtw88: Fix rtw_update_sta_info() for RTL8814AU 0f98a5959657 wifi: rtw88: Extend TX power stuff for 3-4 spatial streams ad815f392003 wifi: rtw88: Rename RTW_RATE_SECTION_MAX to RTW_RATE_SECTION_NUM e66f3b5c7535 wifi: rtw88: Constify some more structs and arrays 8f0076726b66 wifi: rtw88: Extend rtw_fw_send_ra_info() for RTL8814AU d80e7d9b6ba3 wifi: rtw88: Extend rf_base_addr and rf_sipi_addr for RTL8814AU 62f726848da4 wifi: rtw88: Extend struct rtw_pwr_track_tbl for RTL8814AU 9e8243025cc0 wifi: rtw88: Fix download_firmware_validate() for RTL8814AU 8425f5c8f04d wifi: rtw88: Fix __rtw_download_firmware() for RTL8814AU 105dc94233e4 wifi: rtw88: Fix a typo of debug message in rtw8723d_iqk_check_tx_failed() 0d1d165eff9d wifi: rtw88: Don't use static local variable in rtw8821c_set_tx_power_index_by_rate 00451eb3bec7 wifi: rtw88: Don't use static local variable in rtw8822b_set_tx_power_index_by_rate b4bfbc50b1b9 wifi: rtw88: add RTW88_LEDS depends on LEDS_CLASS to Kconfig 4b6652bc6d8d wifi: rtw88: Add support for LED blinking fb2fcfbe5eef wifi: rtw88: sdio: Fix disconnection after beacon loss a806a8160a0f wifi: rtw88: 8703b: Fix RX/TX issues 5ad483955acc wifi: rtw88: Delete rf_type member of struct rtw_sta_info 5b1b9545262b wifi: rtw88: Add USB PHY configuration not backported (3e3aa566dd18 wifi: rtw88: usb: Preallocate and reuse the RX skbs) not backported (13221be72034 wifi: rtw88: Handle C2H_ADAPTIVITY in rtw_fw_c2h_cmd_handle() ) e9048e2935f7 wifi: rtw88: usb: Copy instead of cloning the RX skb 74a72c367573 wifi: rtw88: 8821a/8812a: Set ptct_efuse_size to 0 59ab27a9f20f wifi: rtw88: 8812a: Support RFE type 2 Signed-off-by: Marty Jones <mj8263788@gmail.com> Link: https://github.com/openwrt/openwrt/pull/19052 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
199 lines
6.3 KiB
Diff
199 lines
6.3 KiB
Diff
From 2c17afde9ff6713f3e080ed1ea1a4bd7480be9aa Mon Sep 17 00:00:00 2001
|
|
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
|
Date: Fri, 2 May 2025 14:49:34 +0300
|
|
Subject: [PATCH] wifi: rtw88: Handle RTL8723D(S) with blank efuse
|
|
|
|
Some users have RTL8723DS chips with nearly blank efuse. Currently these
|
|
chips cannot connect when using rtw88, but they do work using the old
|
|
out-of-tree driver.
|
|
|
|
Use reasonable default values for TX power, antenna configuration, and
|
|
crystal cap if the chip's efuse is missing these things.
|
|
|
|
RTL8723D can use the same default values as RTL8703B, so simply move
|
|
the code from rtl8703b_read_efuse() to the shared function
|
|
__rtl8723x_read_efuse().
|
|
|
|
Link: https://github.com/lwfinger/rtw88/issues/157
|
|
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
|
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
|
|
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
|
Link: https://patch.msgid.link/5734afe7-0870-40b2-acd4-5657a02d7c56@gmail.com
|
|
---
|
|
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 60 -------------------
|
|
drivers/net/wireless/realtek/rtw88/rtw8723x.c | 59 ++++++++++++++++++
|
|
2 files changed, 59 insertions(+), 60 deletions(-)
|
|
|
|
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
|
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
|
@@ -519,15 +519,6 @@ static const struct rtw_rqpn rqpn_table_
|
|
RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH},
|
|
};
|
|
|
|
-/* Default power index table for RTL8703B, used if EFUSE does not
|
|
- * contain valid data. Replaces EFUSE data from offset 0x10 (start of
|
|
- * txpwr_idx_table).
|
|
- */
|
|
-static const u8 rtw8703b_txpwr_idx_table[] = {
|
|
- 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D,
|
|
- 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x02
|
|
-};
|
|
-
|
|
static void try_mac_from_devicetree(struct rtw_dev *rtwdev)
|
|
{
|
|
struct device_node *node = rtwdev->dev->of_node;
|
|
@@ -544,15 +535,9 @@ static void try_mac_from_devicetree(stru
|
|
}
|
|
}
|
|
|
|
-#define DBG_EFUSE_FIX(rtwdev, name) \
|
|
- rtw_dbg(rtwdev, RTW_DBG_EFUSE, "Fixed invalid EFUSE value: " \
|
|
- # name "=0x%x\n", rtwdev->efuse.name)
|
|
-
|
|
static int rtw8703b_read_efuse(struct rtw_dev *rtwdev, u8 *log_map)
|
|
{
|
|
struct rtw_efuse *efuse = &rtwdev->efuse;
|
|
- u8 *pwr = (u8 *)efuse->txpwr_idx_table;
|
|
- bool valid = false;
|
|
int ret;
|
|
|
|
ret = rtw8723x_read_efuse(rtwdev, log_map);
|
|
@@ -562,51 +547,6 @@ static int rtw8703b_read_efuse(struct rt
|
|
if (!is_valid_ether_addr(efuse->addr))
|
|
try_mac_from_devicetree(rtwdev);
|
|
|
|
- /* If TX power index table in EFUSE is invalid, fall back to
|
|
- * built-in table.
|
|
- */
|
|
- for (int i = 0; i < ARRAY_SIZE(rtw8703b_txpwr_idx_table); i++)
|
|
- if (pwr[i] != 0xff) {
|
|
- valid = true;
|
|
- break;
|
|
- }
|
|
- if (!valid) {
|
|
- for (int i = 0; i < ARRAY_SIZE(rtw8703b_txpwr_idx_table); i++)
|
|
- pwr[i] = rtw8703b_txpwr_idx_table[i];
|
|
- rtw_dbg(rtwdev, RTW_DBG_EFUSE,
|
|
- "Replaced invalid EFUSE TX power index table.");
|
|
- rtw8723x_debug_txpwr_limit(rtwdev,
|
|
- efuse->txpwr_idx_table, 2);
|
|
- }
|
|
-
|
|
- /* Override invalid antenna settings. */
|
|
- if (efuse->bt_setting == 0xff) {
|
|
- /* shared antenna */
|
|
- efuse->bt_setting |= BIT(0);
|
|
- /* RF path A */
|
|
- efuse->bt_setting &= ~BIT(6);
|
|
- DBG_EFUSE_FIX(rtwdev, bt_setting);
|
|
- }
|
|
-
|
|
- /* Override invalid board options: The coex code incorrectly
|
|
- * assumes that if bits 6 & 7 are set the board doesn't
|
|
- * support coex. Regd is also derived from rf_board_option and
|
|
- * should be 0 if there's no valid data.
|
|
- */
|
|
- if (efuse->rf_board_option == 0xff) {
|
|
- efuse->regd = 0;
|
|
- efuse->rf_board_option &= GENMASK(5, 0);
|
|
- DBG_EFUSE_FIX(rtwdev, rf_board_option);
|
|
- }
|
|
-
|
|
- /* Override invalid crystal cap setting, default comes from
|
|
- * vendor driver. Chip specific.
|
|
- */
|
|
- if (efuse->crystal_cap == 0xff) {
|
|
- efuse->crystal_cap = 0x20;
|
|
- DBG_EFUSE_FIX(rtwdev, crystal_cap);
|
|
- }
|
|
-
|
|
return 0;
|
|
}
|
|
|
|
--- a/drivers/net/wireless/realtek/rtw88/rtw8723x.c
|
|
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723x.c
|
|
@@ -69,6 +69,9 @@ static void __rtw8723x_lck(struct rtw_de
|
|
#define DBG_EFUSE_2BYTE(rtwdev, map, name) \
|
|
rtw_dbg(rtwdev, RTW_DBG_EFUSE, # name "=0x%02x%02x\n", \
|
|
(map)->name[0], (map)->name[1])
|
|
+#define DBG_EFUSE_FIX(rtwdev, name) \
|
|
+ rtw_dbg(rtwdev, RTW_DBG_EFUSE, "Fixed invalid EFUSE value: " \
|
|
+ # name "=0x%x\n", rtwdev->efuse.name)
|
|
|
|
static void rtw8723xe_efuse_debug(struct rtw_dev *rtwdev,
|
|
struct rtw8723x_efuse *map)
|
|
@@ -238,10 +241,21 @@ static void rtw8723xs_efuse_parsing(stru
|
|
ether_addr_copy(efuse->addr, map->s.mac_addr);
|
|
}
|
|
|
|
+/* Default power index table for RTL8703B/RTL8723D, used if EFUSE does
|
|
+ * not contain valid data. Replaces EFUSE data from offset 0x10 (start
|
|
+ * of txpwr_idx_table).
|
|
+ */
|
|
+static const u8 rtw8723x_txpwr_idx_table[] = {
|
|
+ 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D,
|
|
+ 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x02
|
|
+};
|
|
+
|
|
static int __rtw8723x_read_efuse(struct rtw_dev *rtwdev, u8 *log_map)
|
|
{
|
|
struct rtw_efuse *efuse = &rtwdev->efuse;
|
|
+ u8 *pwr = (u8 *)efuse->txpwr_idx_table;
|
|
struct rtw8723x_efuse *map;
|
|
+ bool valid = false;
|
|
int i;
|
|
|
|
map = (struct rtw8723x_efuse *)log_map;
|
|
@@ -279,6 +293,51 @@ static int __rtw8723x_read_efuse(struct
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
+ /* If TX power index table in EFUSE is invalid, fall back to
|
|
+ * built-in table.
|
|
+ */
|
|
+ for (i = 0; i < ARRAY_SIZE(rtw8723x_txpwr_idx_table); i++)
|
|
+ if (pwr[i] != 0xff) {
|
|
+ valid = true;
|
|
+ break;
|
|
+ }
|
|
+ if (!valid) {
|
|
+ for (i = 0; i < ARRAY_SIZE(rtw8723x_txpwr_idx_table); i++)
|
|
+ pwr[i] = rtw8723x_txpwr_idx_table[i];
|
|
+ rtw_dbg(rtwdev, RTW_DBG_EFUSE,
|
|
+ "Replaced invalid EFUSE TX power index table.");
|
|
+ rtw8723x_debug_txpwr_limit(rtwdev,
|
|
+ efuse->txpwr_idx_table, 2);
|
|
+ }
|
|
+
|
|
+ /* Override invalid antenna settings. */
|
|
+ if (efuse->bt_setting == 0xff) {
|
|
+ /* shared antenna */
|
|
+ efuse->bt_setting |= BIT(0);
|
|
+ /* RF path A */
|
|
+ efuse->bt_setting &= ~BIT(6);
|
|
+ DBG_EFUSE_FIX(rtwdev, bt_setting);
|
|
+ }
|
|
+
|
|
+ /* Override invalid board options: The coex code incorrectly
|
|
+ * assumes that if bits 6 & 7 are set the board doesn't
|
|
+ * support coex. Regd is also derived from rf_board_option and
|
|
+ * should be 0 if there's no valid data.
|
|
+ */
|
|
+ if (efuse->rf_board_option == 0xff) {
|
|
+ efuse->regd = 0;
|
|
+ efuse->rf_board_option &= GENMASK(5, 0);
|
|
+ DBG_EFUSE_FIX(rtwdev, rf_board_option);
|
|
+ }
|
|
+
|
|
+ /* Override invalid crystal cap setting, default comes from
|
|
+ * vendor driver. Chip specific.
|
|
+ */
|
|
+ if (efuse->crystal_cap == 0xff) {
|
|
+ efuse->crystal_cap = 0x20;
|
|
+ DBG_EFUSE_FIX(rtwdev, crystal_cap);
|
|
+ }
|
|
+
|
|
return 0;
|
|
}
|
|
|