From nobody Fri Apr 01 00:32:28 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 88B471A4E6D8; Fri, 1 Apr 2022 00:32:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KV1Mw365qz3kMB; Fri, 1 Apr 2022 00:32:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648773148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r88rKGElNMD2Ky/KQcocnr8/y1HMlcSMFU1x1C2vctw=; b=m0UGkRI2Zv1L3GMmdQ9bqo0Sz1FoJntqRlMEO3FKy2OFqv7ACKJp5CqvEkJRMcgbsGR45+ w4QawgRvt3r/KSBrnXot41mi6xhplbouLZqUsWBJsfOyTzm4uJG1pTLxCHsGqsAN+8kj4+ JbZBNjE7TSYKVq/Qp7KGLuK2KwrIRhHOnCDCmudh2j+FnT4U6VDbAPdvO6aHYaiSBtSRAy yzMh+4YGRZwohWtivCkUidtHxL9Ag4jeuS3G4KT6xwZQ1bSPbCZBlB+XFCnccKWpPJv35N Q3ov6BCXIGAzu5ZXF531f7XV7QQcBqN141NJMzRsrgp9Q09MsEN26zSY7tBrxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42A7A1BF2; Fri, 1 Apr 2022 00:32:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2310WSwA082074; Fri, 1 Apr 2022 00:32:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2310WS5D082073; Fri, 1 Apr 2022 00:32:28 GMT (envelope-from git) Date: Fri, 1 Apr 2022 00:32:28 GMT Message-Id: <202204010032.2310WS5D082073@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 73d4ebea3567 - main - rtw88: import firmware for Realtek's rtw88 supported chipsets. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73d4ebea3567f18db549638c3d897b6d6758faa4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648773148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r88rKGElNMD2Ky/KQcocnr8/y1HMlcSMFU1x1C2vctw=; b=WR4gzwzNPMQ6zigHZOM0ZwoDHjOkoMf5CVu2Pc4/8MrSgd5+qZU+43Fjoiv4F5pUN4zjAL bfMh64dvmgwnSHNiLr3JgEg99mwMbQQpohnZnpoCP7T/JR8eXNwH5pwUbJk5G7Jj57Hw61 3uK6aK4SE/W796jQPrGikDuEWRBrOx8o3lSRlNe3tgMpjclrZ2Uj7Lxd4ber+PS4aHwxWD wYqLpeR0fN1KPty8X2AxqoYmgi4F2G8tZ+0r3d1fnZ0Hz8kLwzc4dQbyodKnEYIP1NgvrB ChFoNCb2Pts4/PdnYKm4+OxUUbED0pCNvCWtzalBuyEGeX8pAsDnOYHKEx6r0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648773148; a=rsa-sha256; cv=none; b=c87wD1Fkuktc+cT5zbR0CWc3O/XSWByc/hTiAIkzIuNF1IyyObZgtjuqvwzrqfGIxEpIea bOo0Fx9LIrRbvdNkqNYfj/ZcytKeDGvSIT99lx/guAEl5FUAz3IpycIDaEzMsXuvLwCWko vlH0qcWoTsdiBjV42xcNjCksUjvvg3dwEO6v1QzkuARgcNQuDR2OsFQL2YlzMAWUOobapL +xWtrDNTEtOZsRAamiLPW0V+I+EKGD0dJWIMN0kgQmIyofQLZ3ZajVd+mmEtu8a9DOKPte gc/S1+Ov/7ZWIM2mpBV2pEPbCuIvZiV0Qn+oq/tEWOi8R4tUNhBdjcsau8pshQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=73d4ebea3567f18db549638c3d897b6d6758faa4 commit 73d4ebea3567f18db549638c3d897b6d6758faa4 Author: Bjoern A. Zeeb AuthorDate: 2022-03-30 22:06:14 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-04-01 00:07:24 +0000 rtw88: import firmware for Realtek's rtw88 supported chipsets. Import the most recent versions of the firmware images for the rtw88 driver. This is based on linux-firmware at 681281e49fb6778831370e5d94e6e1d97f0752d6. The license of the firmware matches the previous rtwnfw(4) firmware files (modulo a Copyright year) and you can find a copy in sys/contrib/dev/rtw88fw/LICENCE.rtlwifi_firmware.txt. Add build infrastructure to create the .ko files but do not yet hook it up to the build until all parts are in the tree. Approved by: core (imp) MFC after: 2 weeks --- .../dev/rtw88fw/LICENCE.rtlwifi_firmware.txt | 39 +++++++++++++++++++++ sys/contrib/dev/rtw88fw/README | 34 ++++++++++++++++++ sys/contrib/dev/rtw88fw/WHENCE | 19 ++++++++++ sys/contrib/dev/rtw88fw/rtw8723d_fw.bin | Bin 0 -> 28884 bytes sys/contrib/dev/rtw88fw/rtw8821c_fw.bin | Bin 0 -> 138984 bytes sys/contrib/dev/rtw88fw/rtw8822b_fw.bin | Bin 0 -> 150984 bytes sys/contrib/dev/rtw88fw/rtw8822c_fw.bin | Bin 0 -> 202456 bytes sys/contrib/dev/rtw88fw/rtw8822c_wow_fw.bin | Bin 0 -> 145224 bytes sys/modules/rtw88fw/Makefile | 10 ++++++ sys/modules/rtw88fw/Makefile.inc | 17 +++++++++ sys/modules/rtw88fw/rtw8723d/Makefile | 6 ++++ sys/modules/rtw88fw/rtw8821c/Makefile | 6 ++++ sys/modules/rtw88fw/rtw8822b/Makefile | 6 ++++ sys/modules/rtw88fw/rtw8822c/Makefile | 6 ++++ sys/modules/rtw88fw/rtw8822c_wow/Makefile | 6 ++++ 15 files changed, 149 insertions(+) diff --git a/sys/contrib/dev/rtw88fw/LICENCE.rtlwifi_firmware.txt b/sys/contrib/dev/rtw88fw/LICENCE.rtlwifi_firmware.txt new file mode 100644 index 000000000000..d70921f49379 --- /dev/null +++ b/sys/contrib/dev/rtw88fw/LICENCE.rtlwifi_firmware.txt @@ -0,0 +1,39 @@ +Copyright (c) 2010, Realtek Semiconductor Corporation +All rights reserved. + +Redistribution. Redistribution and use in binary form, without +modification, are permitted provided that the following conditions are +met: + +* Redistributions must reproduce the above copyright notice and the + following disclaimer in the documentation and/or other materials + provided with the distribution. +* Neither the name of Realtek Semiconductor Corporation nor the names of its + suppliers may be used to endorse or promote products derived from this + software without specific prior written permission. +* No reverse engineering, decompilation, or disassembly of this software + is permitted. + +Limited patent license. Realtek Semiconductor Corporation grants a world-wide, +royalty-free, non-exclusive license under patents it now or hereafter +owns or controls to make, have made, use, import, offer to sell and +sell ("Utilize") this software, but solely to the extent that any +such patent is necessary to Utilize the software alone, or in +combination with an operating system licensed under an approved Open +Source license as listed by the Open Source Initiative at +http://opensource.org/licenses. The patent license shall not apply to +any other combinations which include this software. No hardware per +se is licensed hereunder. + +DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/sys/contrib/dev/rtw88fw/README b/sys/contrib/dev/rtw88fw/README new file mode 100644 index 000000000000..01449ca72e4c --- /dev/null +++ b/sys/contrib/dev/rtw88fw/README @@ -0,0 +1,34 @@ + + rtw88 firmware +================ + +This repository contains firmware images supported by Realtek's wireless +driver rtw88. And some of the devices run with more than one firmware +file. Basically, a "normal" firmware is necessary to be downloaded to +the device. +And another is called "wowlan" firmware, it should be loaded when a +device is going to suspend. Which means driver will "re-download/swap" +the firmware image. The wowlan firmware contains wake up functions that +can recognize specific events and send a wake up signal to device if +needed, and the system will resume to running state. During resume, +driver will then swap the normal firmware back, return to running state. + +If any distros or platforms do not require wowlan feature, they can +_only_ pick the normal firmware. And everything still works fine, +except that the device cannot be waken from the wireless NICs. + +Currently supported devices with corresponding firmwares: + +RTL8822BE + rtw8822b_fw.bin + +RTL8821CE + rtw8821c_fw.bin + +RTL8822CE + rtw8822c_fw.bin + rtw8822c_wow_fw.bin + +RTL8723DE + rtw8723d_fw.bin + diff --git a/sys/contrib/dev/rtw88fw/WHENCE b/sys/contrib/dev/rtw88fw/WHENCE new file mode 100644 index 000000000000..71cb61f86a1f --- /dev/null +++ b/sys/contrib/dev/rtw88fw/WHENCE @@ -0,0 +1,19 @@ +Driver: rtw88 - Realtek 802.11ac WLAN driver for RTL8822BE and RTL8822CE + +Info: Sent to Larry Finger by Realtek engineer Yan-Hsuan Chuang +File: rtw88/rtw8822b_fw.bin +File: rtw88/rtw8822c_fw.bin +File: rtw88/rtw8822c_wow_fw.bin +File: rtw88/README +File: rtw88/rtw8723d_fw.bin +File: rtw88/rtw8821c_fw.bin + +Licence: Redistributable. See LICENCE.rtlwifi_firmware.txt for details. + + These firmware should be put under /lib/firmware/rtw88/ + And note that the rtw88 driver is able to support wake-on-wireless LAN + for RTL8822C devices, after kernel v5.6+. So, make sure the firmware + rtw88/rtw8822c_wow_fw.bin is also packed, otherwise the firmware load + fail could be a problem. + Although RTL8723D devices are 802.11n device, they are also supported + by rtw88 because the hardware arch is similar. diff --git a/sys/contrib/dev/rtw88fw/rtw8723d_fw.bin b/sys/contrib/dev/rtw88fw/rtw8723d_fw.bin new file mode 100644 index 000000000000..ac2b9250c39e Binary files /dev/null and b/sys/contrib/dev/rtw88fw/rtw8723d_fw.bin differ diff --git a/sys/contrib/dev/rtw88fw/rtw8821c_fw.bin b/sys/contrib/dev/rtw88fw/rtw8821c_fw.bin new file mode 100644 index 000000000000..8264e3480cc8 Binary files /dev/null and b/sys/contrib/dev/rtw88fw/rtw8821c_fw.bin differ diff --git a/sys/contrib/dev/rtw88fw/rtw8822b_fw.bin b/sys/contrib/dev/rtw88fw/rtw8822b_fw.bin new file mode 100644 index 000000000000..0934ffcc77a3 Binary files /dev/null and b/sys/contrib/dev/rtw88fw/rtw8822b_fw.bin differ diff --git a/sys/contrib/dev/rtw88fw/rtw8822c_fw.bin b/sys/contrib/dev/rtw88fw/rtw8822c_fw.bin new file mode 100644 index 000000000000..807044f11768 Binary files /dev/null and b/sys/contrib/dev/rtw88fw/rtw8822c_fw.bin differ diff --git a/sys/contrib/dev/rtw88fw/rtw8822c_wow_fw.bin b/sys/contrib/dev/rtw88fw/rtw8822c_wow_fw.bin new file mode 100644 index 000000000000..1ce74fda8bff Binary files /dev/null and b/sys/contrib/dev/rtw88fw/rtw8822c_wow_fw.bin differ diff --git a/sys/modules/rtw88fw/Makefile b/sys/modules/rtw88fw/Makefile new file mode 100644 index 000000000000..9a3b82b78922 --- /dev/null +++ b/sys/modules/rtw88fw/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +SUBDIR= \ + rtw8723d \ + rtw8821c \ + rtw8822b \ + rtw8822c \ + rtw8822c_wow + +.include diff --git a/sys/modules/rtw88fw/Makefile.inc b/sys/modules/rtw88fw/Makefile.inc new file mode 100644 index 000000000000..dfdfd17cb245 --- /dev/null +++ b/sys/modules/rtw88fw/Makefile.inc @@ -0,0 +1,17 @@ +# $FreeBSD$ +# +# Common rules for building firmware. Note this gets auto-included +# by the subdir Makefile's as a consequence of included bsd.kmod.mk. + +_NAME= rtw${NAME}_fw.bin + +IMG= ${_NAME} +KMOD= ${_NAME} + +CLEANFILES+= ${IMG} + +FIRMWS= ${IMG}:${IMG}:${VERSION} + +${IMG}: ${SRCTOP}/sys/contrib/dev/rtw88fw/${IMG} + cp ${.ALLSRC} ${.TARGET} + diff --git a/sys/modules/rtw88fw/rtw8723d/Makefile b/sys/modules/rtw88fw/rtw8723d/Makefile new file mode 100644 index 000000000000..6bc8dcecc365 --- /dev/null +++ b/sys/modules/rtw88fw/rtw8723d/Makefile @@ -0,0 +1,6 @@ +# $FreeBSD$ + +VERSION= 48 +NAME= 8723d + +.include diff --git a/sys/modules/rtw88fw/rtw8821c/Makefile b/sys/modules/rtw88fw/rtw8821c/Makefile new file mode 100644 index 000000000000..d8a7c03e82e9 --- /dev/null +++ b/sys/modules/rtw88fw/rtw8821c/Makefile @@ -0,0 +1,6 @@ +# $FreeBSD$ + +VERSION= 2408 +NAME= 8821c + +.include diff --git a/sys/modules/rtw88fw/rtw8822b/Makefile b/sys/modules/rtw88fw/rtw8822b/Makefile new file mode 100644 index 000000000000..12a732d3907a --- /dev/null +++ b/sys/modules/rtw88fw/rtw8822b/Makefile @@ -0,0 +1,6 @@ +# $FreeBSD$ + +VERSION= 0 +NAME= 8822b + +.include diff --git a/sys/modules/rtw88fw/rtw8822c/Makefile b/sys/modules/rtw88fw/rtw8822c/Makefile new file mode 100644 index 000000000000..0f92657b28c0 --- /dev/null +++ b/sys/modules/rtw88fw/rtw8822c/Makefile @@ -0,0 +1,6 @@ +# $FreeBSD$ + +VERSION= 9911 +NAME= 8822c + +.include diff --git a/sys/modules/rtw88fw/rtw8822c_wow/Makefile b/sys/modules/rtw88fw/rtw8822c_wow/Makefile new file mode 100644 index 000000000000..149d9bdf378e --- /dev/null +++ b/sys/modules/rtw88fw/rtw8822c_wow/Makefile @@ -0,0 +1,6 @@ +# $FreeBSD$ + +VERSION= 994 +NAME= 8822c_wow + +.include