git: 866e021654cf - main - rtw89: import firmware for Realtek's rtw89 supported chipsets.

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Fri, 09 Sep 2022 16:36:46 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=866e021654cfb72c050fd228dee476fb92fa6f48

commit 866e021654cfb72c050fd228dee476fb92fa6f48
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-09-09 12:52:54 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-09-09 16:32:17 +0000

    rtw89: import firmware for Realtek's rtw89 supported chipsets.
    
    Import the most recent versions of the firmware images for the
    rtw89 driver.
    
    This is based on linux-firmware at 2f2f0181581d3e35bfdb9fc65f609ee9d3fbaeb7.
    
    The license of the firmware matches the previously added rtw88(4) firmware
    and you can find a copy in sys/contrib/dev/rtw89fw/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.11 (imp) [2022-03-27]
    MFC after:      6 weeks
---
 .../dev/rtw89fw/LICENCE.rtlwifi_firmware.txt       |  39 +++++++++++++++++++++
 sys/contrib/dev/rtw89fw/WHENCE                     |   8 +++++
 sys/contrib/dev/rtw89fw/rtw8852a_fw.bin            | Bin 0 -> 1423232 bytes
 sys/contrib/dev/rtw89fw/rtw8852c_fw.bin            | Bin 0 -> 1340192 bytes
 sys/modules/rtw89fw/Makefile                       |   7 ++++
 sys/modules/rtw89fw/Makefile.inc                   |  17 +++++++++
 sys/modules/rtw89fw/rtw8852a/Makefile              |   6 ++++
 sys/modules/rtw89fw/rtw8852c/Makefile              |   6 ++++
 8 files changed, 83 insertions(+)

diff --git a/sys/contrib/dev/rtw89fw/LICENCE.rtlwifi_firmware.txt b/sys/contrib/dev/rtw89fw/LICENCE.rtlwifi_firmware.txt
new file mode 100644
index 000000000000..d70921f49379
--- /dev/null
+++ b/sys/contrib/dev/rtw89fw/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/rtw89fw/WHENCE b/sys/contrib/dev/rtw89fw/WHENCE
new file mode 100644
index 000000000000..496ef115ef0b
--- /dev/null
+++ b/sys/contrib/dev/rtw89fw/WHENCE
@@ -0,0 +1,8 @@
+
+Driver: rtw89 - Realtek 802.11ax WLAN driver for RTL8852A
+
+File: rtw89/rtw8852a_fw.bin
+File: rtw89/rtw8852c_fw.bin
+
+Licence: Redistributable. See LICENCE.rtlwifi_firmware.txt for details.
+
diff --git a/sys/contrib/dev/rtw89fw/rtw8852a_fw.bin b/sys/contrib/dev/rtw89fw/rtw8852a_fw.bin
new file mode 100644
index 000000000000..00d139b3f2f1
Binary files /dev/null and b/sys/contrib/dev/rtw89fw/rtw8852a_fw.bin differ
diff --git a/sys/contrib/dev/rtw89fw/rtw8852c_fw.bin b/sys/contrib/dev/rtw89fw/rtw8852c_fw.bin
new file mode 100644
index 000000000000..86b634aeb69f
Binary files /dev/null and b/sys/contrib/dev/rtw89fw/rtw8852c_fw.bin differ
diff --git a/sys/modules/rtw89fw/Makefile b/sys/modules/rtw89fw/Makefile
new file mode 100644
index 000000000000..2db828c06f00
--- /dev/null
+++ b/sys/modules/rtw89fw/Makefile
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+SUBDIR=	\
+	rtw8852a \
+	rtw8852c
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/rtw89fw/Makefile.inc b/sys/modules/rtw89fw/Makefile.inc
new file mode 100644
index 000000000000..96ab73502152
--- /dev/null
+++ b/sys/modules/rtw89fw/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/rtw89fw/${IMG}
+	cp ${.ALLSRC} ${.TARGET}
+
diff --git a/sys/modules/rtw89fw/rtw8852a/Makefile b/sys/modules/rtw89fw/rtw8852a/Makefile
new file mode 100644
index 000000000000..7ed7ad1f6c71
--- /dev/null
+++ b/sys/modules/rtw89fw/rtw8852a/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+VERSION=	013360
+NAME=		8852a
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtw89fw/rtw8852c/Makefile b/sys/modules/rtw89fw/rtw8852c/Makefile
new file mode 100644
index 000000000000..7b871745cde4
--- /dev/null
+++ b/sys/modules/rtw89fw/rtw8852c/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+VERSION=	027200
+NAME=		8852c
+
+.include <bsd.kmod.mk>