Received: by 2002:ab2:5d18:0:b0:1ef:7a0f:c32d with SMTP id j24csp132478lqk; Sat, 9 Mar 2024 03:57:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWv1otDAnpfcQyhMJbgGLtx0hMKoBAv3JJOk3qo7Mv30cgFIVAZXonSWC4lggJzR9tP0NiJ854hHh1OSDScduj46/iBzxlA5U1Lqw0KMw== X-Google-Smtp-Source: AGHT+IFF2mcMYzxFgAff6Qw3rsFJ4Gvilu544ptOPnwIicbKc64YpTdjrWT+ovAl2VafeMv6WBUz X-Received: by 2002:a17:902:ecc2:b0:1dc:7bc:d025 with SMTP id a2-20020a170902ecc200b001dc07bcd025mr2044732plh.4.1709985464908; Sat, 09 Mar 2024 03:57:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709985464; cv=pass; d=google.com; s=arc-20160816; b=GJqA0wT4TvHdE7HKJh4SKSIHeMzDabkZHU+I0ayHUwa3tsznAI+JnAjE4vU7SH4BHd C9M+FjTKBhS9VXJV0lVKC8/nBsWFJycIpB1KWYgyOuhAiH30eua4Mg1FgvQZ0EQk7J6r zHmQfi1zTkh3+nEUYBAI94x6WyuH5HkgW49rKeeQ/NpQdcFrJWI2j/Q2zIMNC3wGgYwp epvGLOhR20J0bQGXZzCglsfaeSI3Tm0bct+fCunnCb0wscxT0Rj6iKmYnXv5sZVat46Z 82DBkYAPtJVoeoOuG7gxTGLebeseEyn4c3RF+Y0ag/Hm6jqjQlYKc8PMbp8OtTRyzqlv m/Cg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from:dkim-signature; bh=0GYCon2lpJaXAzYv+oScKXmSWsxTFRtzvOb28y8zpBg=; fh=vioCFxE9EDeLWBo4RaQu0jJXdc5Dsw8ZcaS0cbULLd0=; b=IqPN/0Gu8gepIctGGBQLYmnZvK805VfLQjw0zH5u0KUEMk6p1xmVNBSSjynPkXGwGt 0kA+L8hYRVE3e2Wu7doPDvFfdBd0ITuEoQVJR4jSSa0Jp1hW3SlmRUuKABY4YCmMWeG/ yJXO1skQ/kzcBEv8vzGt83AYDv43IJo+MHUZXVMKiZ+GABskd0gpoJm965I5ovXVUj0L v7sYMj2g2J4LJvD9NfdhgoCK6jcj32Nbqy978txTsS11l9PzSheNNXFfxw1aPQTdnnJV z4zqpT5yqndktHl5mtbA47Lc6JKysmHQmBk68LoUNnCuqn6jfgcLQA8RZH2EXxEl3v3k A7lQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=sTufG0mq; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-wireless+bounces-4508-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4508-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h7-20020a170902f70700b001dd015de11csi1324870plo.37.2024.03.09.03.57.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Mar 2024 03:57:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4508-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=sTufG0mq; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-wireless+bounces-4508-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4508-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4E424281A1B for ; Sat, 9 Mar 2024 11:57:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 779D1374D4; Sat, 9 Mar 2024 11:57:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=fiona.klute@gmx.de header.b="sTufG0mq" X-Original-To: linux-wireless@vger.kernel.org Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E13FA22612; Sat, 9 Mar 2024 11:57:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709985461; cv=none; b=dNM71PNKmc8VL6pVIHDRb2GnPEDWpnkSd0MoqAL/ekuAhqBAFspFd5AZTvGnBUixHMkZFhfbqfkGPq/c/lo/z8HBEBlObqren1jmjiWVcI9uDW3b8nlAeCUtido7sOjKW7rSGIZz6tiy8nW8NLgM58MS6XlsZ8B/V+a5uclTRBo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709985461; c=relaxed/simple; bh=Do3jN5CcuhLPhWl0DEQ3pyZoDmUQS19YwPwPANcgouE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=seWwggiSUbWRNqvyLbWMoTM06bgrmjbO3RZK7vTzTXcfRPd5tUllVEfkK+HJa5yA//MHSdLZz0LYve8xoC+0XVtrAArfHa3tjGiI7Rv2jNUhpVYOF9gbifB58pm5i0L7vCN5MUczDKUuuNZNJuWuM81XU5OsNc5ekHAihbh3mDc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=fiona.klute@gmx.de header.b=sTufG0mq; arc=none smtp.client-ip=212.227.15.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1709985441; x=1710590241; i=fiona.klute@gmx.de; bh=Do3jN5CcuhLPhWl0DEQ3pyZoDmUQS19YwPwPANcgouE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=sTufG0mq536PxkgIVaJDMPaxcCX/C0ZA8vsfV6lJQE6M8epp/FqgaaKffRuLK0SX eF7FzLrLzAv5Kwjw8Arxl9LVPqprDrh9tlbyMY9oN2dW0yGsrIFMqpe5MVDmghJeK 7z0ZyHIup35J3xplFwZNi/38MG9HX2RVkV/SWFoJfLr9h0jJRL+944qy4XnPpn2+l mZydniuR2SUmaXeuUgIAtWMVVhZm42HbjOEBI2a6Cc5lHNRmQ0LPyxRduMk332p5o syQ7aASgblQHBKua/RRiHvBm1z/qd8VvL1vqU+QxsJ9VeUAL/OEryJuy+3m6x6SRL AYIYgtKUO7iYLwI+tQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from haruka.lan ([85.22.112.71]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N0G1d-1qwKec0xSZ-00xJLu; Sat, 09 Mar 2024 12:57:21 +0100 From: Fiona Klute To: linux-wireless@vger.kernel.org, Ping-Ke Shih Cc: Fiona Klute , Kalle Valo , Ulf Hansson , linux-mmc@vger.kernel.org, Pavel Machek , =?UTF-8?q?Ond=C5=99ej=20Jirman?= Subject: [PATCH v3 0/9] rtw88: Add support for RTL8723CS/RTL8703B Date: Sat, 9 Mar 2024 12:56:36 +0100 Message-ID: <20240309115650.367204-1-fiona.klute@gmx.de> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:AjJE1XckzQTfF3Oi5ZFc2dyURXjwhM164Gf+hA1MthIzDzcSXrw EMwOTkj7ADYjlkD0/gFppanmGCSER5imuITfHuIuxvlPvOiy79FPft8bfku1XCKyZVblHfe JwpWsJt8iESQX7DGXr99yAHK7KyvrWffIrX8zdofai/EoHGHSxPmItdcejqTYWnZ2njx7gc Klovf9Yp8/wug1EgOH/Vw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:ary083shjtM=;Ax7IIpWfpZJzirnf3wOiA0BMHSV +pOBrvC0AJhP9KqNXpODGNdC4tZCYeLQtl2MnXioaR52Fzq82MQIvWwENwdQIvKTr/XR2sOf0 2lZTwz5IHOqvM4+aRgbmKvOg8CrrEBi8nVaVVxiXPGwwS1fLQzq6DpywyqIhDSJhxqxwoh6/L vSut20y+a/hMyJf5j+Pww4IJHyaGP+lmtZQLT7jL1QiLSFhNcYbyORdQIS7vVhFz0RBiUFl6F dfyRCClpP8BuXxi3r7T9wiXSFM/yoGCI5EXMq8msdI0NmtKG7dc6HOUCu2arodeFUU9m9yQZ4 0Zt+QrOnKKygZkiZ85t0QSAMjAun+YwvinvtAo66wqAVEfBzRxKVLFKfgFKqigyuvROtzyUHG M5J+VN3xeRKsiNUe4umxd3QnX+7IxfMTz1UKhemqlWectfPTeQT3I1ZftCV9J3/ZhGiUuDppt kHOMl6RLyekxAkAmFbdGFEEW9GQ/5YCmshYYny5x1svynpN+1uwNEyX66xbx+Z4HDeNW6Vxie hNhtxoZbo556ucJFkvi47/awVm4EIljPHN/dpvmqrUocZ9twsQeRWFMBC5Ptfo1QTO2E1OwKX 0XFJORUaLSz8eamxe0XuINvtfmGYcRMiKQeaWno4rE7WZxFVKqW3JMMhnRAoF9Kr/Ki/PIjv0 Z1tAYlZjenReIX9isBLL6DW/+c6ZWv3IdZXeZNkNUXhDv+FoijSz0mffSAavvwy/KkvRnnpOe XH1qw7QfwjnMaHp6dVY3E1qpWWUYB1WB45pAUDbflx1n3P/WFaFltN0lLJjgtEDDqvJuh+v9w h27rLtjOlf8ish99CZMqUcE4unK7aralNLMSEJCjFNQvo= 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]. Thanks to Ping-Ke Shih for advice, and Ond=C5=99ej 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 v3 has only minor changes requested in review, so I hope it's good to merge now: * rtw8703b.h: #include rtw8723x.h instead of linux/types.h and linux/compiler_attributes.h * rtw8703b_tables.c: #include rtw8703b_tables.h * rtw8703b.c: define TRANS_SEQ_END without braces (checkpatch.pl doesn't like this, but I assume maintainer request overrides it) 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 | 102 + .../wireless/realtek/rtw88/rtw8703b_tables.c | 902 +++++++ .../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 =2D- 2.43.0