From nobody Fri Jun 03 16:43:11 2022 X-Original-To: dev-commits-src-branches@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 D11011BD3C51; Fri, 3 Jun 2022 16:43:12 +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 4LF7ww1jLfz3sGk; Fri, 3 Jun 2022 16:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654274592; 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=f0G1S2tL1ANcYQomI8hfjtJkWUxr1shU88FUXrjCPxM=; b=tRwXO1RJPvNWP0WTR7xjXICnIu7blRlpWZeKKFoavslAlEczm64Z/D/G4VV1d75UGcRRnl B8O3nsHMEx2fJ9kwz4h5003LJhFG3ZjThOfDNKEMNQjtWsrqvxHr9m2QhOUjJs5kCVk5n/ LjnLPnppy5VMEzdo64imkG8yD/axuIJ+Gz796B6Y442rR5nCu0+ZKwNrsyjAiqxs4/kE7o mUJqFFuKRzBk9k5qU+uPrdef9D+VTlRIdpwJgP5wyw+NcBj65pWpwk1lf/6m1wG83fJl4e Hj/t0Jwqf5pduUalCzKWhJNvT3Yau1P6OXIPXsFJOpMQvl1GfRsaDAd2XyWBYw== 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 CF1FC4FAC; Fri, 3 Jun 2022 16:43:11 +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 253GhB9Y021796; Fri, 3 Jun 2022 16:43:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 253GhBfZ021795; Fri, 3 Jun 2022 16:43:11 GMT (envelope-from git) Date: Fri, 3 Jun 2022 16:43:11 GMT Message-Id: <202206031643.253GhBfZ021795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: d3b0a58ee78e - stable/13 - rtw88: import firmware for Realtek's rtw88 supported chipsets. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: d3b0a58ee78ecdc5e2700e0aaaab21755496d148 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654274592; 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=f0G1S2tL1ANcYQomI8hfjtJkWUxr1shU88FUXrjCPxM=; b=Yw3FSmETAGQncW6hDWxihOqh4v0c2VJfUXhreUcrMB2K0araYC/01kOTVPCva3dw/Z+6pw SZQHGXl1lsVuhE1leFvXYr1uZs1g9LUZ458LWfShJKgrp53M2UPYJsTWU6hBoHdZVk+gWK RndjW+BoYwnJxgJxFyvvfJK9C0VFWNMAzMochIvFOA5qRRRa/PfPI17MRrF3gfzJnaT6rC oP/V1/7MvE3bexUIAkcqWS2LG0u/fSixAYnOqPELqW3wxoPdtfQFsEX1x+6q30x6YZZEA1 4BbN2ScENw7StSqWwghPzjQu/2xns4/1O+f1tKS8p8NJFOc/JPNNrFuCa/CmYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654274592; a=rsa-sha256; cv=none; b=YzN7ubItWSQaYuEeGosBvD8hcKnPVnVtz6xArMyTE5nz9iBvU3+dyOgFlTNguVb3evNXT8 eaGj98yCbfLc9ZtKTTWRX2IX7KA3Tot+6laBSkFe2qGJHtNlTD3upilLDjclKHhNgJSY+G OMPsH579iGVm20GymwNR412mbFhAACOEMnV1a2USnKMB41+qyuCzBoD6fM1qIMOTc5ubnY 8QE17JdNmxSXNCC2N/6SW+3Em0k9uBaOdrZIEU9TOAUGdCr0JkWefFkMHxzhsm+fgfYO7h mpFvMmKc+IBYtX+qG0H9yXLDu3yiOjTyigA2qPHXNF2ZXpch+qTMfjtysP2Mmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d3b0a58ee78ecdc5e2700e0aaaab21755496d148 commit d3b0a58ee78ecdc5e2700e0aaaab21755496d148 Author: Bjoern A. Zeeb AuthorDate: 2022-03-30 22:06:14 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-06-03 15:49:22 +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. rtw8822c firmware got downgraded in a later commit to 9.9.10: firmware version 9.9.11 added support for hw_scan and is reportedly causing more problems than 9.9.10 does. 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) PR: 248235 (cherry picked from commit 73d4ebea3567f18db549638c3d897b6d6758faa4) (cherry picked from commit 3443476ca9e751cebbb1c467091551bf3d518814) --- .../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 -> 200312 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..af894bc10185 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..38313ecaf87e --- /dev/null +++ b/sys/modules/rtw88fw/rtw8822c/Makefile @@ -0,0 +1,6 @@ +# $FreeBSD$ + +VERSION= 9910 +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