From patchwork Tue Feb 14 21:14:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 13140817 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8C01C6379F for ; Tue, 14 Feb 2023 21:15:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232417AbjBNVPF (ORCPT ); Tue, 14 Feb 2023 16:15:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232164AbjBNVPE (ORCPT ); Tue, 14 Feb 2023 16:15:04 -0500 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A24512E835; Tue, 14 Feb 2023 13:14:30 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id dr8so43232439ejc.12; Tue, 14 Feb 2023 13:14:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EdzJHZtvCjiajcTbwikaf9ObTwwLylq1F+vbECZVj10=; b=AC4Vb6aEo+exPXiScKa3vdrajE36oOuauqTOpoByqNWijGtJEBDuwgapSQTGe1Y1+M MYmWDKdZ9v+uQaTjFX7L9/EGWPx2/3zneIJ3hWNPVjUmSnesOj/385B2PHPLub27VFrS d6Y8OXec4xrjH8dxUxjCySI44BgTmi7myS4oss7P1nXyT5WqyQ9nAzK722+WBthAq8v+ 33MUw0ddtmeiGUQPWz+4PiS/ua0FKUquR35L8+FBNryVJ33vYwMVmnZXWHeLOVA+iWBC BT+97WPuUUNEzlIZZcaAWGGmnRE1tXseBRyAaZMdBGaK/Ga7az2TgeInMoNiN4OlD6Kf OcVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EdzJHZtvCjiajcTbwikaf9ObTwwLylq1F+vbECZVj10=; b=WcRYEErfjKKcPqyKzc/eZqnIjs4E8Rxmlcw2b1J98WCHAmc7qcanMei+REfbm7UXVW tC2B3Scc+KWzgGe8uMolkveA5poyIeC28rBE9r6VsQgPZx94f2PQpSBRFzIK/VIqfysK fEW/Ej5OiPUT8FMmBjYjjPznhi0T5wBU9/LkorK+uow3F06mAe9t6mve6aYFCZ7Ryt/k X6okkIW8gB6kxHIo4CjcWGozFv2iRSNp6nYgFJv1hpehSeHj524QFuZLAgZCgSsnaQKY pLV61d80ykoiyZhj37Lw6zuZiKz3o2N9a0e1u1WHJwepc3tB+FbuQk7PTjgOTjlDxRlK N9lA== X-Gm-Message-State: AO0yUKUSDftkcoyCrRAzlHsCTylmOsqvGbVlV76kthuz1UsIuDH1dR3I bHZbCCyYB16mHRoVUF7ueZG7C1ipmoo= X-Google-Smtp-Source: AK7set98aa4pYv0zLJBwJ4PbN1+IIXEpBDzlDgjQsDM27pPvfBHTOinOFp6lTCm59SBbcfzHaL3zHQ== X-Received: by 2002:a17:906:e256:b0:8aa:1f89:122e with SMTP id gq22-20020a170906e25600b008aa1f89122emr4278783ejb.39.1676409264906; Tue, 14 Feb 2023 13:14:24 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c22-768e-b000-0000-0000-0000-0e63.c22.pool.telefonica.de. [2a01:c22:768e:b000::e63]) by smtp.googlemail.com with ESMTPSA id uz2-20020a170907118200b008b134555e9fsm949806ejb.42.2023.02.14.13.14.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 13:14:24 -0800 (PST) From: Martin Blumenstingl To: linux-wireless@vger.kernel.org Cc: tony0620emma@gmail.com, kvalo@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Neo Jou , Jernej Skrabec , pkshih@realtek.com, Martin Blumenstingl Subject: [PATCH v1 1/5] wifi: rtw88: mac: Add support for the SDIO HCI in rtw_pwr_seq_parser() Date: Tue, 14 Feb 2023 22:14:17 +0100 Message-Id: <20230214211421.2290102-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214211421.2290102-1-martin.blumenstingl@googlemail.com> References: <20230214211421.2290102-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org rtw_pwr_seq_parser() needs to know about the HCI bus interface mask for the SDIO bus so it can parse the chip state change sequences. Signed-off-by: Martin Blumenstingl --- drivers/net/wireless/realtek/rtw88/mac.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/mac.c b/drivers/net/wireless/realtek/rtw88/mac.c index 4e5c194aac29..3ed88d38f1b4 100644 --- a/drivers/net/wireless/realtek/rtw88/mac.c +++ b/drivers/net/wireless/realtek/rtw88/mac.c @@ -222,6 +222,9 @@ static int rtw_pwr_seq_parser(struct rtw_dev *rtwdev, case RTW_HCI_TYPE_USB: intf_mask = RTW_PWR_INTF_USB_MSK; break; + case RTW_HCI_TYPE_SDIO: + intf_mask = RTW_PWR_INTF_SDIO_MSK; + break; default: return -EINVAL; } From patchwork Tue Feb 14 21:14:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 13140821 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1118BC61DA4 for ; Tue, 14 Feb 2023 21:15:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232547AbjBNVPI (ORCPT ); Tue, 14 Feb 2023 16:15:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232113AbjBNVPF (ORCPT ); Tue, 14 Feb 2023 16:15:05 -0500 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A72CB2FCCA; Tue, 14 Feb 2023 13:14:30 -0800 (PST) Received: by mail-ej1-x630.google.com with SMTP id ml19so43483798ejb.0; Tue, 14 Feb 2023 13:14:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DeA/Fs5OrkYfLy7sfZ1TbPFwb47uZI+seq9bXI57mCE=; b=irA1GIZiRIghJL58pWmFEBIjmlCEJ+SHfBIK8jnYTxv1BpneXqdHz3q4SAp2Si8D5z fvW1+E1znO4hKRT9vV2SCgbQQkGPZCYhkuuNhTMThlVt6E2stQ+30jfejfUKniNdwBuV FzDmOwko4nZUPoPWBMgW45rLzeQ7fLU8UgkXLYlG6rCZSFJuPUSxlXY8yftQxM4wSbg4 w4+T9LfEaF9HfwIpg/9vrV8h8JNPugvZ2hKY/jxblPEuSzysDa7cPPE6zmUgPalfRL7m E76QZBIcjH0OinQf6YwN6NtquXh1BWE7eqeck0jLy9FLegP87EYLSzEhEuNbJADVS5Ae xuPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DeA/Fs5OrkYfLy7sfZ1TbPFwb47uZI+seq9bXI57mCE=; b=n9tf322mvJM7pDQkEDyLz21AsS8BIc0Q/2xqVN/FHWYbjJC4XtoMZhXTjC0ZD0Bu+x kiXFPy8ZGLARnFgIZ+W6CuZdpyjZoF3P+REphrSm01fgTYswxDxNA8GUJ3sEQHYrYaC5 EYqNA5K5K1p5T2QylcWT6l1UhYxPBylz7dYeQkDQIKV1DNSmRfJ9uU2El2igU5KxAGfT 9oWxT4IwOrBAH0jMz0H6aZjr7hDyLNHpIAJcbkxhkUyWYKLJDKPQlJozi5dM5S00rwes An7+MV4wRi6FCysT786FHRZRCGMJL/FIREMPkNre741TP9rbjt/umTAL8puM/9p3Yagg Ck7Q== X-Gm-Message-State: AO0yUKUMhBzAL5jhil7TaPr9gDS+AWT0stcwuszn0hBKWKSHVDSraBFB 9TkZwxm2lGcTzqV6O7dOoa+65to6YPw= X-Google-Smtp-Source: AK7set87KFOBYJ5H6LMVo4ORSWtMUXdB/iynMJTYLXZcpFaiQ4agdgzRbn8aS4TboIywPnmmkkgnyg== X-Received: by 2002:a17:906:ccda:b0:8b1:2ebf:386c with SMTP id ot26-20020a170906ccda00b008b12ebf386cmr4000404ejb.11.1676409265803; Tue, 14 Feb 2023 13:14:25 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c22-768e-b000-0000-0000-0000-0e63.c22.pool.telefonica.de. [2a01:c22:768e:b000::e63]) by smtp.googlemail.com with ESMTPSA id uz2-20020a170907118200b008b134555e9fsm949806ejb.42.2023.02.14.13.14.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 13:14:25 -0800 (PST) From: Martin Blumenstingl To: linux-wireless@vger.kernel.org Cc: tony0620emma@gmail.com, kvalo@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Neo Jou , Jernej Skrabec , pkshih@realtek.com, Martin Blumenstingl Subject: [PATCH v1 2/5] wifi: rtw88: mac: Add SDIO HCI support in the TX/page table setup Date: Tue, 14 Feb 2023 22:14:18 +0100 Message-Id: <20230214211421.2290102-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214211421.2290102-1-martin.blumenstingl@googlemail.com> References: <20230214211421.2290102-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org txdma_queue_mapping() and priority_queue_cfg() can use the first entry of each chip's rqpn_table and page_table. Add this mapping so data transmission is possible on SDIO based chipsets. Signed-off-by: Martin Blumenstingl --- drivers/net/wireless/realtek/rtw88/mac.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/mac.c b/drivers/net/wireless/realtek/rtw88/mac.c index 3ed88d38f1b4..6a234eec09ff 100644 --- a/drivers/net/wireless/realtek/rtw88/mac.c +++ b/drivers/net/wireless/realtek/rtw88/mac.c @@ -1033,6 +1033,9 @@ static int txdma_queue_mapping(struct rtw_dev *rtwdev) else return -EINVAL; break; + case RTW_HCI_TYPE_SDIO: + rqpn = &chip->rqpn_table[0]; + break; default: return -EINVAL; } @@ -1195,6 +1198,9 @@ static int priority_queue_cfg(struct rtw_dev *rtwdev) else return -EINVAL; break; + case RTW_HCI_TYPE_SDIO: + pg_tbl = &chip->page_table[0]; + break; default: return -EINVAL; } From patchwork Tue Feb 14 21:14:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 13140822 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A87DC61DA4 for ; Tue, 14 Feb 2023 21:15:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232193AbjBNVPR (ORCPT ); Tue, 14 Feb 2023 16:15:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232454AbjBNVPF (ORCPT ); Tue, 14 Feb 2023 16:15:05 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 520982FCDC; Tue, 14 Feb 2023 13:14:31 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id dr8so43232610ejc.12; Tue, 14 Feb 2023 13:14:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UuYUbOJgJkM7vBMQK3GiYLrn1dU8B5/xrGPzHJMu+oA=; b=jaZrEvoRIqb0h2WzR0sEksdJP7o9kOi4cg2gJGcipkxaKFRqaOTQcyC7KzpGWdS7Q6 OhpIv1hPnBNnAQHJrT+2T/Bqymi1eivUpatpJd3raIXlFxNtc1SJDC2LNVXUB4a9ocz3 nEBSR27X97GL8voLvI3qN9bhBg0egEyW/VwhLS7MCX+/ALoVr/OlKgc3cjjU9gF5iyrY gUZaTUDT65OrbSlBJEPoArLjUYFBv//Ab+0HYoTvQzdyto8j+TCf1rCYt08PQKGRQlUx L/1zwT28Prer80SWUG3mTAoOU5o+i+8gJ/jCfm4OebtnfeO9+TNCTyO2wOdfdH9CExgb 7DUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UuYUbOJgJkM7vBMQK3GiYLrn1dU8B5/xrGPzHJMu+oA=; b=oTk9OPmiH6vJhFhyXzQCcgPDSAnRYWv2Xpz9iNX1ThnaTMlXqYKX8zYNUt2YRV3pQV zp5pUvnylXvYF9OYgdHkzGluaZMWdKF/sgiBIfnB2YkhVPVhIjocG62BPiNOnfdJwZCE S7PnzoHlrK7PrdfvZURcwmPakwWod2nkfGR3jFS951d+voZR04eNVHgME6wi4Dt5Op2i uL70+/m01BiEEFgPAh1fuqmFD5KVvQ/uj4ACh/gke6aHREGN+frqZ0bkNxZQLVhEdjci 3Htly4OZFFH1RslozrCP/k9aazZ7ndxQavFDtVHqXickVWsuXTeq7RUEAAnJlkfFraYN OPYw== X-Gm-Message-State: AO0yUKX9VXaXqTVjq5PQzCco+omeEC+u3ibRb+Biv9SZuFrZ6kY3aCWp BOwRvGPQguSahgbO27HyDUh8jOxor20= X-Google-Smtp-Source: AK7set9Dl4jc93KPxEW+qkA3MsH55VgtB8c1cj91O/Ez7wYdbtS7uzCFfJErASL/6X60FHiDpNS2sA== X-Received: by 2002:a17:906:6686:b0:878:7f6e:38a7 with SMTP id z6-20020a170906668600b008787f6e38a7mr4418573ejo.44.1676409266655; Tue, 14 Feb 2023 13:14:26 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c22-768e-b000-0000-0000-0000-0e63.c22.pool.telefonica.de. [2a01:c22:768e:b000::e63]) by smtp.googlemail.com with ESMTPSA id uz2-20020a170907118200b008b134555e9fsm949806ejb.42.2023.02.14.13.14.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 13:14:26 -0800 (PST) From: Martin Blumenstingl To: linux-wireless@vger.kernel.org Cc: tony0620emma@gmail.com, kvalo@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Neo Jou , Jernej Skrabec , pkshih@realtek.com, Martin Blumenstingl Subject: [PATCH v1 3/5] wifi: rtw88: rtw8821c: Implement RTL8821CS (SDIO) efuse parsing Date: Tue, 14 Feb 2023 22:14:19 +0100 Message-Id: <20230214211421.2290102-4-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214211421.2290102-1-martin.blumenstingl@googlemail.com> References: <20230214211421.2290102-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The efuse of the SDIO RTL8821CS chip has only one known member: the mac address is at offset 0x11a. Add a struct rtw8821cs_efuse describing this and use it for copying the mac address when the SDIO bus is used. Signed-off-by: Martin Blumenstingl --- drivers/net/wireless/realtek/rtw88/rtw8821c.c | 9 +++++++++ drivers/net/wireless/realtek/rtw88/rtw8821c.h | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.c b/drivers/net/wireless/realtek/rtw88/rtw8821c.c index 17f800f6efbd..dd01b22f9770 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c @@ -26,6 +26,12 @@ static void rtw8821ce_efuse_parsing(struct rtw_efuse *efuse, ether_addr_copy(efuse->addr, map->e.mac_addr); } +static void rtw8821cs_efuse_parsing(struct rtw_efuse *efuse, + struct rtw8821c_efuse *map) +{ + ether_addr_copy(efuse->addr, map->s.mac_addr); +} + static void rtw8821cu_efuse_parsing(struct rtw_efuse *efuse, struct rtw8821c_efuse *map) { @@ -74,6 +80,9 @@ static int rtw8821c_read_efuse(struct rtw_dev *rtwdev, u8 *log_map) case RTW_HCI_TYPE_PCIE: rtw8821ce_efuse_parsing(efuse, map); break; + case RTW_HCI_TYPE_SDIO: + rtw8821cs_efuse_parsing(efuse, map); + break; case RTW_HCI_TYPE_USB: rtw8821cu_efuse_parsing(efuse, map); break; diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.h b/drivers/net/wireless/realtek/rtw88/rtw8821c.h index 1c81260f3a54..1cc77a42be6f 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.h +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.h @@ -65,6 +65,11 @@ struct rtw8821ce_efuse { u8 res7; }; +struct rtw8821cs_efuse { + u8 res4[0x4a]; /* 0xd0 */ + u8 mac_addr[ETH_ALEN]; /* 0x11a */ +} __packed; + struct rtw8821c_efuse { __le16 rtl_id; u8 res0[0x0e]; @@ -93,6 +98,7 @@ struct rtw8821c_efuse { u8 res[3]; union { struct rtw8821ce_efuse e; + struct rtw8821cs_efuse s; struct rtw8821cu_efuse u; }; }; From patchwork Tue Feb 14 21:14:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 13140819 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAB98C64ED6 for ; Tue, 14 Feb 2023 21:15:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232596AbjBNVPJ (ORCPT ); Tue, 14 Feb 2023 16:15:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232511AbjBNVPH (ORCPT ); Tue, 14 Feb 2023 16:15:07 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D56D2CFE6; Tue, 14 Feb 2023 13:14:34 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id dr8so43232683ejc.12; Tue, 14 Feb 2023 13:14:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LDCMFuAMkFIViBtxIzrrBhJMMUrvQzY9dO0YrEL2Ffw=; b=W4W7JIpC+UtJd9OTDkmJtkFAuqYRj1JTrusimew4lUsens7aEQ2AVWS9CqaBjbfMr/ tv3vcq4xJNdsPOJwMavK7f52O21UVfHeLuOguA1PDENkVxLZCDM4Ti/asgvt0cOwr6f+ jb5Bgc1ArdZ7hiOvrR+LzcrPSoSm5VFxWF+4+HLt8ZkHdlQn0+CpbP1MGdMHiFlg9tY/ zwpkdtQBhYLKoQoDlY2+JAgzxPltDA1y0ogNWrZbbxkvCq3MaVmJS6ucUZLWYpV8iV9N TQQFfOq5r+KqDxXtZL7a8e3SkVI0cw61kfSEbBAWEHq19GL0M+LlLH/BXJZGlFHdo2x5 Io0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LDCMFuAMkFIViBtxIzrrBhJMMUrvQzY9dO0YrEL2Ffw=; b=pYHmyGxgn29vA6r0RoSyDRN7rBSGxb/nS7Z/Za/sPewgd1ypdZWEyZ9LcUY7WToktI yreRrLXQG6Y241i5heanKnTKyfz0zv7vPOftCkzmeH5JuAUpsQadTQTjbs8Tj6G/KcY5 Jua0Fk+pEjNZFdSQOYSkyaUE32fySl9cUVhB0/V5r7z/fhr1fpW/XoOAQFb/sxsBcqzL LKhcemK1WgtEA6yzbGE2pQGPB2Sg7bEPsEgfNCO5zppyKQ1wlBJPCDIxpNJr6+632p2K tojHHOa6++8w2F0PBeJMXDdcyCdMdTK70OCAMZ7MxfX/RbZFB0lzVkpaQQS7Me/ujR/a GmAw== X-Gm-Message-State: AO0yUKXa885OBFJ+WJ2bpKRHGmwUkTNY/OR/H4KMzfpkrQ0HHMH+qnQt Vm3Lc+LBWlDNOQNfcaJQKaiFjT+Qc7w= X-Google-Smtp-Source: AK7set8eFKMyYEHXAsV4oZNDpxb9+asF+mFop6BN6YNOeeQIktz52QKrlcTOH1lwZ4JQYE42A5lynQ== X-Received: by 2002:a17:906:c40d:b0:8af:2a97:91d4 with SMTP id u13-20020a170906c40d00b008af2a9791d4mr4550092ejz.14.1676409267638; Tue, 14 Feb 2023 13:14:27 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c22-768e-b000-0000-0000-0000-0e63.c22.pool.telefonica.de. [2a01:c22:768e:b000::e63]) by smtp.googlemail.com with ESMTPSA id uz2-20020a170907118200b008b134555e9fsm949806ejb.42.2023.02.14.13.14.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 13:14:27 -0800 (PST) From: Martin Blumenstingl To: linux-wireless@vger.kernel.org Cc: tony0620emma@gmail.com, kvalo@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Neo Jou , Jernej Skrabec , pkshih@realtek.com, Martin Blumenstingl Subject: [PATCH v1 4/5] wifi: rtw88: rtw8822b: Implement RTL8822BS (SDIO) efuse parsing Date: Tue, 14 Feb 2023 22:14:20 +0100 Message-Id: <20230214211421.2290102-5-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214211421.2290102-1-martin.blumenstingl@googlemail.com> References: <20230214211421.2290102-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The efuse of the SDIO RTL8822BS chip has only one known member: the mac address is at offset 0x11a. Add a struct rtw8822bs_efuse describing this and use it for copying the mac address when the SDIO bus is used. Signed-off-by: Martin Blumenstingl --- drivers/net/wireless/realtek/rtw88/rtw8822b.c | 10 ++++++++++ drivers/net/wireless/realtek/rtw88/rtw8822b.h | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822b.c b/drivers/net/wireless/realtek/rtw88/rtw8822b.c index 74dfb89b2c94..4ed5b98fab23 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c @@ -26,10 +26,17 @@ static void rtw8822be_efuse_parsing(struct rtw_efuse *efuse, ether_addr_copy(efuse->addr, map->e.mac_addr); } +static void rtw8822bs_efuse_parsing(struct rtw_efuse *efuse, + struct rtw8822b_efuse *map) +{ + ether_addr_copy(efuse->addr, map->s.mac_addr); +} + static void rtw8822bu_efuse_parsing(struct rtw_efuse *efuse, struct rtw8822b_efuse *map) { ether_addr_copy(efuse->addr, map->u.mac_addr); + } static int rtw8822b_read_efuse(struct rtw_dev *rtwdev, u8 *log_map) @@ -62,6 +69,9 @@ static int rtw8822b_read_efuse(struct rtw_dev *rtwdev, u8 *log_map) case RTW_HCI_TYPE_PCIE: rtw8822be_efuse_parsing(efuse, map); break; + case RTW_HCI_TYPE_SDIO: + rtw8822bs_efuse_parsing(efuse, map); + break; case RTW_HCI_TYPE_USB: rtw8822bu_efuse_parsing(efuse, map); break; diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822b.h b/drivers/net/wireless/realtek/rtw88/rtw8822b.h index 01d3644e0c94..8d05805c046c 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8822b.h +++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.h @@ -65,6 +65,11 @@ struct rtw8822be_efuse { u8 res7; }; +struct rtw8822bs_efuse { + u8 res4[0x4a]; /* 0xd0 */ + u8 mac_addr[ETH_ALEN]; /* 0x11a */ +} __packed; + struct rtw8822b_efuse { __le16 rtl_id; u8 res0[0x0e]; @@ -94,6 +99,7 @@ struct rtw8822b_efuse { union { struct rtw8822bu_efuse u; struct rtw8822be_efuse e; + struct rtw8822bs_efuse s; }; }; From patchwork Tue Feb 14 21:14:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 13140820 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E76C3C64EC7 for ; Tue, 14 Feb 2023 21:15:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232620AbjBNVPL (ORCPT ); Tue, 14 Feb 2023 16:15:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232515AbjBNVPH (ORCPT ); Tue, 14 Feb 2023 16:15:07 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACF002DE41; Tue, 14 Feb 2023 13:14:34 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id qw12so43366020ejc.2; Tue, 14 Feb 2023 13:14:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/koSKoAghWBYGzOWWdzRawqtviMRFfn1Iz3iCEopgFg=; b=MTdHin4tmQuKcn/5Ie1YL09iyP0P3oTPaVj9j3tlYbpLmuEbQA6WMfwdXaXERjrVF9 0UTK0X6WkqxujwgtpVlBKUOhlpWFX4+3vU6zstyyCfsyvehF2eabuyESSP+rMrkSeIB9 nySEpWVeYegEoyMKby0dERGzhUh6KT2TM2S+ZlnuzqzWELcSU2qC9oCb7ne6GW0T93vJ dyFKaL9WnwXwoAdd666XGtlvKqVupFca77xkX/xu+OHNK7dQY1a5EDWt/wGDV5VHkZYC YKf0WAzKOICv5iMYE6ayqMDYy6h02Rdo+c1+16Z2j3sfzQUzNaeDtOxneHVhklxt/Y1D in/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/koSKoAghWBYGzOWWdzRawqtviMRFfn1Iz3iCEopgFg=; b=VoOcvRhoeUrvhU4rN87Ifbeq7/nUaBaHiDPsYR+L7S8wT3dIFIU2FfpTpMkVQnXoIp veTHaI2bPdQdpwZUa+f61XqF5ePmxlBSFGxKkg0aOBM2pu1kNUY/K7J8us0y975e8NB0 HnGc+Xm6KN37hVL9wKWENeGSKYf4ojxYBKecycQbz677PLQQHxhAEaQlv3m5LSVbpeQ6 OscqzkveJ454lRTMkiKABmufEtEhT2ru+iJt5Q7zGNU+bCEMrsEvvUT9i3dVIu3EW2Dc oThI6K2yeOouQiq5SXbv8xruJBb9IjuljxgV/mSmlgT0jIShxLr1s+0zPFiq6toqb2NY v+fg== X-Gm-Message-State: AO0yUKW1Np6v/XrE58F3o0AoJkYbUzuK6MI57J3JQBCxDgEltEKUTO4u fpsFUWh2tVJGSlI7meAxhu5fePy1JZ4= X-Google-Smtp-Source: AK7set9oqf7C8LWNURRSUPI57zSsvzDD+KClf8nfmUmxnjrEStJGjsjiJmMcKqgb/pTCU6NqjvcmjA== X-Received: by 2002:a17:906:8396:b0:8b1:3002:bd6d with SMTP id p22-20020a170906839600b008b13002bd6dmr3198216ejx.31.1676409268487; Tue, 14 Feb 2023 13:14:28 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c22-768e-b000-0000-0000-0000-0e63.c22.pool.telefonica.de. [2a01:c22:768e:b000::e63]) by smtp.googlemail.com with ESMTPSA id uz2-20020a170907118200b008b134555e9fsm949806ejb.42.2023.02.14.13.14.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 13:14:28 -0800 (PST) From: Martin Blumenstingl To: linux-wireless@vger.kernel.org Cc: tony0620emma@gmail.com, kvalo@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Neo Jou , Jernej Skrabec , pkshih@realtek.com, Martin Blumenstingl Subject: [PATCH v1 5/5] wifi: rtw88: rtw8822c: Implement RTL8822CS (SDIO) efuse parsing Date: Tue, 14 Feb 2023 22:14:21 +0100 Message-Id: <20230214211421.2290102-6-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214211421.2290102-1-martin.blumenstingl@googlemail.com> References: <20230214211421.2290102-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The efuse of the SDIO RTL8822CS chip has only one known member: the mac address is at offset 0x16a. Add a struct rtw8822cs_efuse describing this and use it for copying the mac address when the SDIO bus is used. Signed-off-by: Martin Blumenstingl --- drivers/net/wireless/realtek/rtw88/rtw8822c.c | 9 +++++++++ drivers/net/wireless/realtek/rtw88/rtw8822c.h | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c b/drivers/net/wireless/realtek/rtw88/rtw8822c.c index 964e27887fe2..8ec779c7ab84 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c @@ -29,6 +29,12 @@ static void rtw8822ce_efuse_parsing(struct rtw_efuse *efuse, ether_addr_copy(efuse->addr, map->e.mac_addr); } +static void rtw8822cs_efuse_parsing(struct rtw_efuse *efuse, + struct rtw8822c_efuse *map) +{ + ether_addr_copy(efuse->addr, map->s.mac_addr); +} + static void rtw8822cu_efuse_parsing(struct rtw_efuse *efuse, struct rtw8822c_efuse *map) { @@ -64,6 +70,9 @@ static int rtw8822c_read_efuse(struct rtw_dev *rtwdev, u8 *log_map) case RTW_HCI_TYPE_PCIE: rtw8822ce_efuse_parsing(efuse, map); break; + case RTW_HCI_TYPE_SDIO: + rtw8822cs_efuse_parsing(efuse, map); + break; case RTW_HCI_TYPE_USB: rtw8822cu_efuse_parsing(efuse, map); break; diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.h b/drivers/net/wireless/realtek/rtw88/rtw8822c.h index 479d5d769c52..959d6537b2fe 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8822c.h +++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.h @@ -16,6 +16,11 @@ struct rtw8822cu_efuse { u8 res2[0x3d]; }; +struct rtw8822cs_efuse { + u8 res0[0x4a]; /* 0x120 */ + u8 mac_addr[ETH_ALEN]; /* 0x16a */ +} __packed; + struct rtw8822ce_efuse { u8 mac_addr[ETH_ALEN]; /* 0x120 */ u8 vender_id[2]; @@ -92,6 +97,7 @@ struct rtw8822c_efuse { u8 res10[0x42]; union { struct rtw8822cu_efuse u; + struct rtw8822cs_efuse s; struct rtw8822ce_efuse e; }; };