mbox series

[v2,0/9] rtw88: Add support for RTL8723CS/RTL8703B

Message ID 20240227235507.781615-1-fiona.klute@gmx.de (mailing list archive)
Headers show
Series rtw88: Add support for RTL8723CS/RTL8703B | expand

Message

Fiona Klute Feb. 27, 2024, 11:54 p.m. UTC
This patch set adds a driver for RTL8723CS, which is used in the
Pinephone and a few other devices. It is a combined wifi/bluetooth
device, the wifi part is called RTL8703B. There is already a mainline
driver for the bluetooth part. RTL8703B is similar to the RTL8723D
chip already supported by rtw88. I've been using the out-of-tree
rtl8723cs driver as reference.

Station and monitor mode work well enough for daily use on my
Pinephone, I have not tested other modes yet. WOW firmware is
declared, but WOW isn't implemented yet. RX rates stay fairly low
still.

Ping-Ke Shih kindly offered to add the required s-o-b for the firmware
and help get it into linux-firmware when it's time, for testing now
please see the code I used to extract firmware from the out-of-tree
driver [1].

I'm trying to follow the "one file per patch" rule for new drivers
while integrating with the existing rtw88 code, please let me know if
I should split it differently. I'll be including a few questions for
reviewers in the relevant patch mails.

Thanks to Ping-Ke Shih for advice, and Ondřej Jirman for debug logs!

[1] https://github.com/airtower-luna/rtw8703b-fw-extractor

v2:
  * Parse PHY status using struct instead of macros
  * Prefer MAC from EFUSE if available, move retrieving MAC from DT to
    a separate function
  * Tidy up wait for IQK to be done, replace mdelay loop with
    read_poll_timeout
  * Set dual author for rtw88_8723x
  * Add missing "static" to rtw8723x function declarations, fixes
    build failure when not built as a module
  * Various style fixes

Fiona Klute (9):
  wifi: rtw88: Shared module for rtw8723x devices
  wifi: rtw88: Debug output for rtw8723x EFUSE
  wifi: rtw88: Add definitions for 8703b chip
  wifi: rtw88: Add rtw8703b.h
  wifi: rtw88: Add rtw8703b.c
  wifi: rtw88: Add rtw8703b_tables.h
  wifi: rtw88: Add rtw8703b_tables.c
  wifi: rtw88: Reset 8703b firmware before download
  wifi: rtw88: SDIO device driver for RTL8723CS

 drivers/net/wireless/realtek/rtw88/Kconfig    |   22 +
 drivers/net/wireless/realtek/rtw88/Makefile   |    9 +
 drivers/net/wireless/realtek/rtw88/mac.c      |    6 +
 drivers/net/wireless/realtek/rtw88/main.h     |    3 +
 drivers/net/wireless/realtek/rtw88/rtw8703b.c | 2112 +++++++++++++++++
 drivers/net/wireless/realtek/rtw88/rtw8703b.h |  103 +
 .../wireless/realtek/rtw88/rtw8703b_tables.c  |  901 +++++++
 .../wireless/realtek/rtw88/rtw8703b_tables.h  |   14 +
 .../net/wireless/realtek/rtw88/rtw8723cs.c    |   34 +
 drivers/net/wireless/realtek/rtw88/rtw8723d.c |  673 +-----
 drivers/net/wireless/realtek/rtw88/rtw8723d.h |  269 +--
 drivers/net/wireless/realtek/rtw88/rtw8723x.c |  721 ++++++
 drivers/net/wireless/realtek/rtw88/rtw8723x.h |  518 ++++
 include/linux/mmc/sdio_ids.h                  |    1 +
 14 files changed, 4486 insertions(+), 900 deletions(-)
 create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8703b.c
 create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8703b.h
 create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8703b_tables.c
 create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8703b_tables.h
 create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8723cs.c
 create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8723x.c
 create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8723x.h

--
2.43.0

Comments

Ping-Ke Shih Feb. 29, 2024, 6:40 a.m. UTC | #1
> -----Original Message-----
> From: Fiona Klute <fiona.klute@gmx.de>
> Sent: Wednesday, February 28, 2024 7:55 AM
> To: linux-wireless@vger.kernel.org; Ping-Ke Shih <pkshih@realtek.com>
> Cc: Fiona Klute <fiona.klute@gmx.de>; kvalo@kernel.org; ulf.hansson@linaro.org; linux-mmc@vger.kernel.org;
> pavel@ucw.cz; megi@xff.cz
> Subject: [PATCH v2 0/9] rtw88: Add support for RTL8723CS/RTL8703B
> 

[...]

> 
> v2:
>   * Parse PHY status using struct instead of macros
>   * Prefer MAC from EFUSE if available, move retrieving MAC from DT to
>     a separate function
>   * Tidy up wait for IQK to be done, replace mdelay loop with
>     read_poll_timeout
>   * Set dual author for rtw88_8723x
>   * Add missing "static" to rtw8723x function declarations, fixes
>     build failure when not built as a module
>   * Various style fixes

You have some changes by v2, so I think you don't need to take my ack-by for
those patches. Then, it will be easier for me to review patches you have
changed. 

Anyway, could you point out patches I should pay attention? Or I will review
entire patchset one-by-one. 

Ping-Ke
Fiona Klute March 1, 2024, 12:45 a.m. UTC | #2
Am 29.02.24 um 07:40 schrieb Ping-Ke Shih:
>
>
>> -----Original Message-----
>> From: Fiona Klute <fiona.klute@gmx.de>
>> Sent: Wednesday, February 28, 2024 7:55 AM
>> To: linux-wireless@vger.kernel.org; Ping-Ke Shih <pkshih@realtek.com>
>> Cc: Fiona Klute <fiona.klute@gmx.de>; kvalo@kernel.org; ulf.hansson@linaro.org; linux-mmc@vger.kernel.org;
>> pavel@ucw.cz; megi@xff.cz
>> Subject: [PATCH v2 0/9] rtw88: Add support for RTL8723CS/RTL8703B
>>
>
> [...]
>
>>
>> v2:
>>    * Parse PHY status using struct instead of macros
>>    * Prefer MAC from EFUSE if available, move retrieving MAC from DT to
>>      a separate function
>>    * Tidy up wait for IQK to be done, replace mdelay loop with
>>      read_poll_timeout
>>    * Set dual author for rtw88_8723x
>>    * Add missing "static" to rtw8723x function declarations, fixes
>>      build failure when not built as a module
>>    * Various style fixes
>
> You have some changes by v2, so I think you don't need to take my ack-by for
> those patches. Then, it will be easier for me to review patches you have
> changed.

Sorry, I thought I was supposed to keep them unless I make larger, not
requested changes.

> Anyway, could you point out patches I should pay attention? Or I will review
> entire patchset one-by-one.

The bigger changes are all in rtw8703b.h (patch 4; the PHY status struct
instead of macros) and rtw8703b.c (patch 5; PHY status parsing, MAC
address retrieval, and IKQ done wait). The PHY status struct is
basically the same as in the vendor driver, I just resolved some macro
detours for big/little endian detection and spelled out "reserved" in
field names.

Changes in the other patches are minimal: additional MODULE_AUTHOR in
rtw8723x.c, missing "static"s in rtw8723x.c and rtw8723x.h, formatting,
and using rtw_read8_mask in the firmware reset (patch 6).

Best regards,
Fiona
Ping-Ke Shih March 1, 2024, 12:57 a.m. UTC | #3
> -----Original Message-----
> From: Fiona Klute <fiona.klute@gmx.de>
> Sent: Friday, March 1, 2024 8:45 AM
> To: Ping-Ke Shih <pkshih@realtek.com>; linux-wireless@vger.kernel.org
> Cc: kvalo@kernel.org; ulf.hansson@linaro.org; linux-mmc@vger.kernel.org; pavel@ucw.cz; megi@xff.cz
> Subject: Re: [PATCH v2 0/9] rtw88: Add support for RTL8723CS/RTL8703B
> 
> The bigger changes are all in rtw8703b.h (patch 4; the PHY status struct
> instead of macros) and rtw8703b.c (patch 5; PHY status parsing, MAC
> address retrieval, and IKQ done wait). The PHY status struct is
> basically the same as in the vendor driver, I just resolved some macro
> detours for big/little endian detection and spelled out "reserved" in
> field names.
> 
> Changes in the other patches are minimal: additional MODULE_AUTHOR in
> rtw8723x.c, missing "static"s in rtw8723x.c and rtw8723x.h, formatting,
> and using rtw_read8_mask in the firmware reset (patch 6).

Thanks for the info. 

Ping-Ke