Difference between revisions of "Rtw89"

From ThinkWiki
Jump to: navigation, search
m (Firmware: dot)
m (Kernel patches: tf)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
'''rtw89''' is the Linux driver for Realtek 802.11ax WiFi devices starting with the Realtek 8852AE ASIC. Rather than updating the exiting rtw88 driver, Realtek engineers wrote and contributed a completely rewritten one for their redesigned wireless chipset of the 8852AE, which will be used in future Realtek WiFi chips as well.
 
'''rtw89''' is the Linux driver for Realtek 802.11ax WiFi devices starting with the Realtek 8852AE ASIC. Rather than updating the exiting rtw88 driver, Realtek engineers wrote and contributed a completely rewritten one for their redesigned wireless chipset of the 8852AE, which will be used in future Realtek WiFi chips as well.
  
The driver is part of wireless-drivers-next and will be included in Linux kernel 5.16. Patches for kernels 5.4 to 5.15 are available.
+
The driver is included in Linux kernel 5.16 (released Jan 2022), patches for kernels 5.4 (Nov 2019) to 5.15 are available.
  
 
For example, the Lenovo ThinkPad {{P14s}} Gen2 series from 2021 requires the new driver.
 
For example, the Lenovo ThinkPad {{P14s}} Gen2 series from 2021 requires the new driver.
 +
 +
== Kernel configuration ==
 +
The rtw89 driver may be built into the kernel <code>[*]</code> or as a loadable kernel module <code>&lt;M&gt;</code> and can be selected in the kernel configuration as follows (example: make menuconfig):
 +
 +
Device Drivers  --->
 +
  [*] Network device support  --->  (NETDEVICES [=y])
 +
        [*]  Wireless LAN  --->  (WLAN [=y])
 +
            <M>    Realtek 802.11ax wireless chips support  --->  (RTW89 [=m])
 +
                --- Realtek 802.11ax wireless chips support
 +
                <M>  Realtek 8852AE PCI wireless network adapter  (RTW89_8852AE [=m])
 +
                [*]  Realtek rtw89 debug message support  (RTW89_DEBUGMSG [=y])
 +
                [ ]  Realtek rtw89 debugfs support  (RTW89_DEBUGFS [=n])
  
 
== Kernel patches ==
 
== Kernel patches ==
 
The patch series to get the rtw89 driver into the kernel sources requires the kernel and/or its modules to be compiled by the end-user, alternatively some distributions may provide a pre-compiled DKMS package for the driver as well.
 
The patch series to get the rtw89 driver into the kernel sources requires the kernel and/or its modules to be compiled by the end-user, alternatively some distributions may provide a pre-compiled DKMS package for the driver as well.
  
One way to patch an existing kernel is to download the v6 patch from [https://lore.kernel.org/all/482cc641-7ba1-7d7a-f2eb-5d39aea9a5cd@lwfinger.net/T/ lore.kernel.org]; It is sufficient to copy&paste the whole message into one files, e.g. rtw89v6.patch. Alternatively, using links or lynx (example with links) the v6 patch series can be downloaded from the shell:
+
One way to patch an existing kernel is to download the v6 patch from [https://lore.kernel.org/all/482cc641-7ba1-7d7a-f2eb-5d39aea9a5cd@lwfinger.net/T/ lore.kernel.org]; It is sufficient to copy&paste the whole message into one file, e.g. rtw89v6.patch. Alternatively, using links or lynx (example with links) the v6 patch series can be downloaded from the shell:
 
  # links -dump "https://lore.kernel.org/all/482cc641-7ba1-7d7a-f2eb-5d39aea9a5cd@lwfinger.net/T/" > /tmp/rtw89v6.patch
 
  # links -dump "https://lore.kernel.org/all/482cc641-7ba1-7d7a-f2eb-5d39aea9a5cd@lwfinger.net/T/" > /tmp/rtw89v6.patch
  
Line 15: Line 27:
 
  $ patch -p1 < /tmp/rtw89v6.patch
 
  $ patch -p1 < /tmp/rtw89v6.patch
  
After patching the kernel, the rtw89 driver is available for selection in the kernel configuration (example: make menuconfig):
+
After patching the kernel, the rtw89 driver is available for selection in the kernel configuration.
      -> Device Drivers
 
        -> Network device support (NETDEVICES [=y])
 
          -> Wireless LAN (WLAN [=y])
 
            -> Realtek devices (WLAN_VENDOR_REALTEK [=y])
 
              -> Realtek 802.11ax wireless chips support (RTW89 [=m])
 
                -> Realtek 8852AE PCI wireless network adapter (RTW89_8852AE [=m])
 
  
After booting this kernel, the driver will be automatically loaded on compatible hardware.
+
The driver will be automatically loaded on compatible hardware (example where rtw89 was build as a loadable module), for proper function the required firmware files have to be provided.
 
  $ uname -r
 
  $ uname -r
 
  5.12.0
 
  5.12.0
Line 33: Line 39:
  
 
== Firmware ==
 
== Firmware ==
The driver requires specific firmware, which should be supplied by the general (non-free) firmware package of your Linux distribution. It a firmware blob is missing, it can be downloaded manually and put in the required path (normally /lib/firmware).
+
The driver requires specific firmware, which should be supplied by the general (non-free) firmware package of any Linux distribution. If a firmware blob is missing, it can be downloaded manually and put in the required path (normally /lib/firmware).
  
 
For the Realtek 8852AE the firmware binary file is rtw89/rtw8852a_fw.bin (in freedesktop.org [https://cgit.freedesktop.org/drm/drm-firmware/commit/?h=tgl_rkl_dmc_updates&id=e576a1bd790b10f9400f05db7d6729f10bd4c410 drm-firmware] since Feb 2021).
 
For the Realtek 8852AE the firmware binary file is rtw89/rtw8852a_fw.bin (in freedesktop.org [https://cgit.freedesktop.org/drm/drm-firmware/commit/?h=tgl_rkl_dmc_updates&id=e576a1bd790b10f9400f05db7d6729f10bd4c410 drm-firmware] since Feb 2021).

Latest revision as of 15:51, 16 January 2022

rtw89 is the Linux driver for Realtek 802.11ax WiFi devices starting with the Realtek 8852AE ASIC. Rather than updating the exiting rtw88 driver, Realtek engineers wrote and contributed a completely rewritten one for their redesigned wireless chipset of the 8852AE, which will be used in future Realtek WiFi chips as well.

The driver is included in Linux kernel 5.16 (released Jan 2022), patches for kernels 5.4 (Nov 2019) to 5.15 are available.

For example, the Lenovo ThinkPad P14s Gen2 series from 2021 requires the new driver.

Kernel configuration

The rtw89 driver may be built into the kernel [*] or as a loadable kernel module <M> and can be selected in the kernel configuration as follows (example: make menuconfig):

Device Drivers  --->
  [*] Network device support  --->  (NETDEVICES [=y])
        [*]   Wireless LAN  --->  (WLAN [=y])
            <M>     Realtek 802.11ax wireless chips support  --->  (RTW89 [=m])
                --- Realtek 802.11ax wireless chips support
                <M>   Realtek 8852AE PCI wireless network adapter  (RTW89_8852AE [=m])
                [*]   Realtek rtw89 debug message support  (RTW89_DEBUGMSG [=y])
                [ ]   Realtek rtw89 debugfs support  (RTW89_DEBUGFS [=n])

Kernel patches

The patch series to get the rtw89 driver into the kernel sources requires the kernel and/or its modules to be compiled by the end-user, alternatively some distributions may provide a pre-compiled DKMS package for the driver as well.

One way to patch an existing kernel is to download the v6 patch from lore.kernel.org; It is sufficient to copy&paste the whole message into one file, e.g. rtw89v6.patch. Alternatively, using links or lynx (example with links) the v6 patch series can be downloaded from the shell:

# links -dump "https://lore.kernel.org/all/482cc641-7ba1-7d7a-f2eb-5d39aea9a5cd@lwfinger.net/T/" > /tmp/rtw89v6.patch

Applying the whole patch series to an existing kernel source tree:

$ cd /usr/src/linux
$ patch -p1 < /tmp/rtw89v6.patch

After patching the kernel, the rtw89 driver is available for selection in the kernel configuration.

The driver will be automatically loaded on compatible hardware (example where rtw89 was build as a loadable module), for proper function the required firmware files have to be provided.

$ uname -r
5.12.0
$ lspci -d :8852 -nn
03:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8852AE 802.11ax PCIe Wireless Network Adapter [10ec:8852]
$ lsmod | grep rtw89
rtw89_pci              45056  0
rtw89_core            880640  1 rtw89_pci

Firmware

The driver requires specific firmware, which should be supplied by the general (non-free) firmware package of any Linux distribution. If a firmware blob is missing, it can be downloaded manually and put in the required path (normally /lib/firmware).

For the Realtek 8852AE the firmware binary file is rtw89/rtw8852a_fw.bin (in freedesktop.org drm-firmware since Feb 2021).

External links

  • Phoronix article about initial rtw89 development
  • rtw89 GitHub repository