summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/realtek/rtw89/reg.h
AgeCommit message (Collapse)AuthorFilesLines
2024-04-29wifi: rtw89: 8852b: update hardware parameters for RFE type 5Ping-Ke Shih1-0/+3
RFE type 5 of 8852B is a type of hardware module, which can use different external components, so update register settings accordingly. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://msgid.link/20240423121247.24714-2-pkshih@realtek.com
2024-04-04wifi: rtw89: 8922a: configure UL MU/OFDMA power settingKuan-Chung Chen1-0/+3
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 <damon.chen@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://msgid.link/20240401063818.12880-1-pkshih@realtek.com
2024-03-26wifi: rtw89: disable txptctrl IMR to avoid flase alarmChia-Yuan Li1-1/+0
The hardware command parser of txptctrl (TX protocol control) has overly stringent timeout conditions, which results in false alarm. So disable it. Signed-off-by: Chia-Yuan Li <leo.li@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://msgid.link/20240321025603.20614-1-pkshih@realtek.com
2024-03-05wifi: rtw89: update suspend/resume for different generationChin-Yen Lee1-0/+13
The setting during suspend or resume is different between different generation, so update it. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240302005828.13666-6-pkshih@realtek.com
2024-03-05wifi: rtw89: wow: update config mac function with different generationChin-Yen Lee1-0/+16
The registers to configure mac function for WoWLAN mode that are different from different generation, so update them. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240302005828.13666-5-pkshih@realtek.com
2024-03-05wifi: rtw89: wow: update WoWLAN status register for different generationChin-Yen Lee1-0/+6
The statue register is for driver to check if WoWLAN mode works or stops successfully. It is changed for new generation, so update it. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240302005828.13666-3-pkshih@realtek.com
2024-03-05wifi: rtw89: coex: add init_info H2C command format version 7Ching-Te Ku1-0/+7
To avoid using bit fields for H2C command, rearrange the structure. And also patch the corresponding code for the using of this structure. No logic changes for existing chips. Signed-off-by: Ching-Te Ku <ku920601@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240229074514.219276-4-pkshih@realtek.com
2024-03-05wifi: rtw89: 8922a: add coexistence helpers of SW grantPing-Ke Shih1-0/+28
Under some circumstances, coexistence mechanism want to keep grant BT or WiFi, such as inquiry and WiFi is connecting, to ensure BT or WiFi can transmit or receive data in that period. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240229074514.219276-3-pkshih@realtek.com
2024-03-05wifi: rtw89: mac: add coexistence helpers {cfg/get}_pltPing-Ke Shih1-0/+14
When hardware grant BT initially but transition to grant WiFi, the PLT (polluted) bit is set to assist coexistence mechanism to debug if grant signal is expected. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240229074514.219276-2-pkshih@realtek.com
2024-02-19wifi: rtw89: 8922a: add set_channel RF partPing-Ke Shih1-0/+8
Configure RF registers according to band, channel, bandwidth. Since this chip will support MLO, it needs check the operating mode to decide paths we are going to configure. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240215055741.14148-4-pkshih@realtek.com
2024-02-19wifi: rtw89: 8922a: add set_channel BB partPing-Ke Shih1-0/+37
In additional to configure band, channel and bandwidth registers, it also configure CCK support on 2GHZ band, spur elimination, and RX gain. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240215055741.14148-3-pkshih@realtek.com
2024-02-19wifi: rtw89: 8922a: add set_channel MAC partPing-Ke Shih1-1/+32
To set channel, add a function to get TXSB (TX subband) that is hardware index to indicate primary channel. Then, configure band, channel, bandwidth and TXSB via registers. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240215055741.14148-2-pkshih@realtek.com
2024-02-12wifi: rtw89: 8922a: implement AP mode related reg for BE generationChih-Kang Chang1-0/+6
Modify reg for BE generation when AP stop, otherwise have warning messages "Polling beacon packet empty fail". Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240209065229.34515-10-pkshih@realtek.com
2024-02-12wifi: rtw89: 8922a: correct register definition and merge IO for ↵Ping-Ke Shih1-1/+5
ctrl_nbtg_bt_tx() ctrl_nbtg_bt_tx is used to control AGC settings under non-shared path condition, which is affected by BT TX. To speed up IO, merge continual bit mask into one IO. Also, correct a register definition. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240209065229.34515-9-pkshih@realtek.com
2024-02-12wifi: rtw89: use PLCP information to match BSS_COLOR and AIDPing-Ke Shih1-0/+14
Hardware can use spatial reuse to reduce interference in OBSS environment, and originally use MAC header to match BSS color and AID. Change to use PLCP to match them earlier to prevent margin timing. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240209065229.34515-7-pkshih@realtek.com
2024-02-12wifi: rtw89: mac: return held quota of DLE when changing MAC-1Ping-Ke Shih1-0/+10
DLE (data link engine) could hold quota when we are going to enable/disable MAC-1 block, so trigger hardware to return all held quota. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240209065229.34515-4-pkshih@realtek.com
2024-02-06wifi: rtw89: 8922a: add chip_ops::rfk_hw_initPing-Ke Shih1-0/+6
Add a chip_ops for WiFi 7 chips to set additional RF configurations including MLO and PLL settings. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240202030642.108385-12-pkshih@realtek.com
2024-02-06wifi: rtw89: rfk: send channel information to firmware for RF calibrationsPing-Ke Shih1-0/+2
We are going to do RF calibrations in firmware, so driver needs to provide channel information for calibrations, which can do the same things as they did in driver. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240202030642.108385-3-pkshih@realtek.com
2024-02-01wifi: rtw89: update ps_state register for chips with different generationChin-Yen Lee1-0/+3
The ps_state register is used for driver to check if the WiFi chip leave power save mode successfully. The register is changed for new generation, so update it. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240126063356.17857-7-pkshih@realtek.com
2024-02-01wifi: rtw89: 8922a: add chip_ops to get thermal valuePing-Ke Shih1-0/+1
Get thermal value as a clue to do RF calibration if the delta is larger than a threshold, but 8922A doesn't need this, so we only read out the value when debugging to reduce IO. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240124033802.12508-1-pkshih@realtek.com
2024-02-01wifi: rtw89: 8922a: add RF read/write v2Ping-Ke Shih1-0/+15
Implement indirect interface v2 to read/write RF registers via PHY registers for 8922A. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240124033637.12330-5-pkshih@realtek.com
2024-02-01wifi: rtw89: 8922a: add chip_ops::cfg_txrx_pathPing-Ke Shih1-0/+24
This function is to set TX/RX path. Especially for 1SS rate, it can select to TX on one or two antenna. Before this operation, stop hardware to prevent transmitting/receiving unexpected packets. After that, restore settings and reset hardware to prevent it stays on abnormal state. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240124033637.12330-4-pkshih@realtek.com
2024-02-01wifi: rtw89: 8922a: implement {stop,resume}_sch_tx and cfg_ppduPing-Ke Shih1-0/+44
To set TX/RX path or set channel, we need these helpers to stop TX and restore settings. The sch_tx stands for scheduler TX channel, and the cfg_ppdu is to stop reporting PPDU status, so we should stop them during setting. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240124033637.12330-3-pkshih@realtek.com
2024-02-01wifi: rtw89: pci: update SER timer unit and timeout timePing-Ke Shih1-0/+3
Be higher resolution of SER timer unit from 32ms to 16ms to detect abnormal situation more accurately, and set hardware watchdog timer to 4ms. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240121071826.10159-2-pkshih@realtek.com
2024-01-23wifi: rtw89: 8922a: add BTG functions to assist BT coexistence to control TX/RXChung-Hsuan Hung1-0/+50
These functions are to control baseband AGC while BT coexists with WiFi. Among these functions, ctrl_btg_bt_rx is used to control AGC related settings, which is affected by BT RX, while BT shares the same path with WiFi; ctrl_nbtg_bt_tx is used to control AGC settings under non-shared path condition, which is affected by BT TX. Signed-off-by: Chung-Hsuan Hung <hsuan8331@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240120003831.7014-7-pkshih@realtek.com
2024-01-23wifi: rtw89: 8922a: add TX power related opsPing-Ke Shih1-1/+17
The ::power_trim is to write bias value programmed in efuse to normalize TX power, and then using ::set_txpwr_ctrl to set reference TX power value. The ::set_txpwr is to set final TX power according to regulation of current country. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240120003831.7014-6-pkshih@realtek.com
2024-01-23wifi: rtw89: 8922a: add register definitions of H2C, C2H, page, RRSR and EDCCAPing-Ke Shih1-0/+22
Firmware H2C commands and C2H events can go via registers, so define them accordingly. The page registers are to arrange local buffer of WiFi chip. RRSR is to define rate selection to transmit BA or ACK. EDCCA is to set threshold of engine detection mechanism by BB hardware. Like other chips, define these registers and we can share the same flow. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240120003831.7014-5-pkshih@realtek.com
2024-01-23wifi: rtw89: 8922a: add chip_ops related to BB initPing-Ke Shih1-0/+73
The chip_ops::bb_preinit and ::bb_postinit are called before and after loading BB parameters from tables of firmware file. The ::bb_reset is used to reset hardware state, and currently it is not needed by 8922AE so leave it as empty. The ::bb_sethw is to implement conditional parameters. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240120003831.7014-4-pkshih@realtek.com
2024-01-23wifi: rtw89: 8922a: add chip_ops::{enable,disable}_bb_rfPing-Ke Shih1-0/+36
When we are going to up interface to make connection, turn on BB and RF hardware power by enable_bb_rf ops. Oppositely, using disable_bb_rf to turn them off. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240120003831.7014-3-pkshih@realtek.com
2024-01-10wifi: rtw89: phy: set channel_info for WiFi 7 chipsPing-Ke Shih1-0/+11
The channel_info is hardware settings to reflect operational status, such as scale factor, report unit, buffer matrix size, RU size and so on. Then, we can get desired reports to do further tuning. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240105064440.36926-1-pkshih@realtek.com
2024-01-10wifi: rtw89: phy: add BB wrapper of TX power for WiFi 7 chipsPing-Ke Shih1-0/+47
TX power is controlled by BB layer basically, but it should interact with MAC layer, so these registers are put on MAC register domain and called BB wrapper, which contains TX power for each MAC ID, OFDMA RU power, and consideration of power type table. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240105064433.36870-1-pkshih@realtek.com
2024-01-10wifi: rtw89: 8922a: add NCTL pre-settings for WiFi 7 chipsPing-Ke Shih1-0/+17
NCTL standing for nano-controller is used to assist RF calibration. Basically, we write settings from a table, but format of the table can't describe register mask and additional conditions, so add a function to set this kind of settings. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240105064422.36812-1-pkshih@realtek.com
2024-01-10wifi: rtw89: 8922a: update the register used in DIG and the DIG flowCheng-Chieh Hsieh1-0/+4
DIG standing for dynamic initial gain that is used to adjust RX coverage, and PD lower threshold is packet detection power level by received signal strength to avoid false detection of the WiFi packet. Because of the hardware is different between WiFi 7 and 6 ICs, we adjust flow and add register definition for 8922A. Signed-off-by: Cheng-Chieh Hsieh <cj.hsieh@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240105064228.36580-5-pkshih@realtek.com
2023-12-19wifi: rtw89: mac: implement to configure TX/RX engines for WiFi 7 chipsPing-Ke Shih1-0/+527
After enabling DMAC and CMAC, configure detail registers one by one. DMAC includes DLE (data link engine), packet preload engine, HFC (HCI flow control) for DMA channels, security egine and etc. CMAC includes scheduler, address CAM, RX filter, CCA control and etc. The SER IMR is to configure to help SER. When hardware TX/RX get abnormal, it raises an interrupt to firmware to determine if send C2H events to notify driver to reset PCI bus or call ieee80211_restart_hw(). Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20231216045739.10432-3-pkshih@realtek.com
2023-12-19wifi: rtw89: mac: add sys_init and filter option for WiFi 7 chipsPing-Ke Shih1-0/+14
The sys_init is to enable hardware function block of DMAC (data-path MAC), CMAC (control-path MAC) and others called 'chip_func'. To understand the functionality of this function, we keep some functions as empty. The other is typ_fltr_opt that is to configure filter option to decide whether RX packets engine can forward packets to host or WiFi CPU. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20231216045739.10432-2-pkshih@realtek.com
2023-12-15wifi: rtw89: 8922a: add power on/off functionsPing-Ke Shih1-0/+168
The power on/off functions are to turn on hardware function blocks and to turn off them if we are going to stay in idle state. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20231211083341.118047-3-pkshih@realtek.com
2023-12-15wifi: rtw89: add XTAL SI for WiFi 7 chipsPing-Ke Shih1-0/+8
The XTAL SI is a serial interface to indirectly access registers of analog hardware circuit. Since WiFi 7 chips use different registers, add a ops to access them via common functions. This patch doesn't change logic for existing chips. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20231211083341.118047-2-pkshih@realtek.com
2023-12-07wifi: rtw89: 8922a: dump MAC registers when SER occursChia-Yuan Li1-0/+572
To diagnose the reason why firmware or hardware get abnormal, add to dump MAC registers related to counters and interrupt masks. With these values, people can classify problems and check if registers values are unexpected, and then correct them. However, it could possible false alarm because firmware triggers this SER event by wrong conditions that we should correct it at firmware or register settings. In field, SER might happen under special conditions, and very hard to happen again, so dump lots of registers to provide rich information to catch the problem. Signed-off-by: Chia-Yuan Li <leo.li@realtek.com> Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231204080751.15354-5-pkshih@realtek.com
2023-12-07wifi: rtw89: 8922a: add SER IMR tablesPing-Ke Shih1-0/+1134
To activate SER (system error recovery) in firmware, we have to configure IMR to trigger interrupts, and then SER can check registers to know if it need to reset hardware or notify driver to re-configure whole settings. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231204080751.15354-4-pkshih@realtek.com
2023-12-07wifi: rtw89: fw: extend program counter dump for Wi-Fi 7 chipZong-Zhe Yang1-0/+2
Extend FW program counter dump for Wi-Fi 7 chip. They poll different addresses. Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231204080751.15354-3-pkshih@realtek.com
2023-12-01wifi: rtw89: fix not entering PS mode after AP stopsPo-Hao Huang1-0/+17
The attempt to enter power save mode might fail if there are still beacons pending in the queue. This sometimes happens after stopping P2P GO or AP mode. Extend stop AP function and flush all beacons to resolve this. Signed-off-by: Po-Hao Huang <phhuang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231129070046.18443-2-pkshih@realtek.com
2023-12-01wifi: rtw89: mac: functions to configure hardware engine and quota for WiFi ↵Ping-Ke Shih1-0/+264
7 chips Add functions to configure HCI, DMAC (data MAC), DLE (data link engine), HFC (HCI flow control), PLE (payload engine) and etc for WiFi 7 chips. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231124071703.132549-9-pkshih@realtek.com
2023-12-01wifi: rtw89: mac: check queue empty according to chip genZong-Zhe Yang1-0/+30
This function, currently called by WoWLAN flow, polls until specific HW queues are empty. The polling bit definitions are not totally the same between WiFi 6 and 7 chips. In addition, the check conditions are also a little different. So, we differentiate the implementations according to chip gen. Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231124071703.132549-6-pkshih@realtek.com
2023-11-30wifi: rtw89: phy: dynamically adjust EDCCA thresholdYi-Chen Chen1-3/+36
Add dynamic mechanism EDCCA (Energy Detection Clear Channel Assessment) in track work. Using a fixed-value threshold will make EDCCA particularly sensitive and cause failure to transmit under certain circumstances. Therefore, the threshold is dynamically adjusted to make EDCCA suitable for any situation. However, in some cases, we will adjust the EDCCA threshold to the highest level so that urgent transmissions can be performed successfully, such as scanning. Finally, in order to observe the EDCCA report in time, add the EDCCA perIC register macro and EDCCA HW report analysis. EDCCA logs can be displayed by using the EDCCA debug mask. Signed-off-by: Yi-Chen Chen <jamie_chen@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231122060458.30878-3-pkshih@realtek.com
2023-11-22wifi: rtw89: mac: add to access efuse for WiFi 7 chipsPing-Ke Shih1-0/+72
MAC address, hardware type, calibration values and etc are stored in efuse, so we read them at probe stage and use them as capabilities to register hardware. There are two physical efuse -- one is the main efuse for digital hardware part, and the other is for analog part. Because they are very similar, we only describe the main efuse below. The main efuse is split into two regions -- one is for logic map, and the other is for physical map. For both regions, we use the same method to read data, but need additional parser to get logic map. To allow reading operation, we need to convert power state to active, and turn to idle state after reading. For WiFi 7 chips, we introduce efuse blocks to define feature group easier, and these blocks are discontinue. For example, RF block is from 0x1_0000 ~ 0x1_0240, and the next block PCIE_SDIO is starting from 0x2_0000. Comparing to old one used by WiFi 6 chips, there is only single one logic map, it would be a little hard to add an new field to a group if we don't reserve a room in advance. The relationship between efuse, region and block is shown as below: (logical map) +------------+ +---------------+ +-----------------+ | main efuse | | region 1 | | block 0x1_0000~ | | (digital) | |(to logcal map)| +-----------------+ | | | | => +-----------------+ | | => | | | block 0x2_0000~ | | | | | +-----------------+ | | |---------------| : | | | region 2 | +------------+ +---------------+ +------------+ +-----------------+ | 2nd efuse | ======================> | block 0x7_0000~ | | (analog) | +-----------------+ +------------+ The parser converting from raw data to logic map is to decode block page, block page offset, and word_en bits. Each word_en bit indicates two following bytes as data of logic map, so total four word_en bits can represent eight bytes. Thus, block page offset is 8-byte alignment. The layout of a tuple is shown as below +--------+--------+--------+--------+--------+--------+ | fixed 3 byte header | | | | | | | | | | [19:17] block_page | | | ... | | [16:4] block_page_offset| | | | | [3:0] word_en | ^ | ^ | | +----|---+--------+--------+---|----+----|---+--------+ | | | +-------------------------+---------+ a word_en bit indicates two bytes as data For example, block_page = 0x3 block_page_offset = 0x80 (must 8-byte alignment) word_en = 0x6 (b'0110; 0 means data is presented) following 4 bytes = 34 56 78 90 Then, 0x3_0080 = 34 56 0x3_0086 = 78 90 A special block page is RTW89_EFUSE_BLOCK_ADIE (7) that uses different but similar format, because its real efuse size is smaller than main efuse. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231117024029.113845-4-pkshih@realtek.com
2023-11-22wifi: rtw89: 8922a: add 8922A basic chip infoPing-Ke Shih1-0/+9
8922A is a 802.11be chip that can support 2/5/6 GHz bands 160MHz bandwidth. Introduce the basic info such as firmware file name, some hardware address and size, supported spatial stream, TX descriptor and so on, and then we can add more attributes by later patches. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231117024029.113845-2-pkshih@realtek.com
2023-11-14wifi: rtw89: 8922ae: add v2 interrupt handlers for 8922AEPing-Ke Shih1-0/+27
The handlers include three parts -- 1) configure interrupt mask; 2) enable/disable interrupt; 3) recognize (read) interrupt status. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231110012319.12727-6-pkshih@realtek.com
2023-11-14wifi: rtw89: pci: generalize interrupt status bits of interrupt handlersPing-Ke Shih1-0/+27
For WiFi 7, interrupt status registers and their definitions are changed a lot, but the logic is still the same, so define fields to reuse the code. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231110012319.12727-5-pkshih@realtek.com
2023-11-14wifi: rtw89: pci: add pre_deinit to be called after probe completePing-Ke Shih1-0/+9
At probe stage, we only do partial initialization to enable ability to download firmware and read capabilities. After that, we use this pre_deinit to disable HCI to save power. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231110012319.12727-4-pkshih@realtek.com
2023-11-08wifi: rtw89: pci: add LTR v2 for WiFi 7 chipPing-Ke Shih1-0/+43
PCI LTR (Latency Tolerance Reporting) is a capability to yield expected power consumption, and we configure the parameters according to design. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231101072149.21997-5-pkshih@realtek.com