From patchwork Sat Feb 18 15:29:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 13145579 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 F0016C6379F for ; Sat, 18 Feb 2023 15:30:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229735AbjBRPaU (ORCPT ); Sat, 18 Feb 2023 10:30:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbjBRPaS (ORCPT ); Sat, 18 Feb 2023 10:30:18 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBA8816AC7; Sat, 18 Feb 2023 07:30:17 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id z7so1207822edb.12; Sat, 18 Feb 2023 07:30:17 -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=Ni0fK5BfMyJtYgVbYHoBsAm9oiht0nB3z1bCOO7slv4=; b=N8ggBGuqML1xN64UiQy3Wx5Inec69C0sv/QjAB3bzhi1ET+ddaU+h5baJ3p8zR0750 J637LBnZS6vMICvdf7a16QclscJxfE5o8e+vixIfFhgvSdzXnAjvV3ch+yl5nla7W3n7 SwXq+xXz45DubgBtXwkp477GFiamCSclJJvgQBEL03nup+N7ufm/d8cBdr8lGtY6AU2+ LUuFZNlvZ1ewMwQMXLOgIyYebtXFYpTZD91W9veGG3984jyY/wCdPPjkYL5RWXigHnnH UUcHyts0BjIkgLLaQfcH17XZgVQNMdH+VT8fhUE0+dj6+Ss0xhVsmWV1cFy5XldFYRfz cqGA== 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=Ni0fK5BfMyJtYgVbYHoBsAm9oiht0nB3z1bCOO7slv4=; b=IHItRh5LEdJSh22hBxoOBNe2aPzbBD1rlDoksrKMCf0SC98V7tqVkpkl5LDxUdtgqI +5utXOoBEzDZzqsQUNCcgFGbmqXZxpuRL33p9L8RIOTl79QY1IXilhJlHoSVQZZ4PhaW D9OXcNqZ7u2r2fLQuUcye+vxsmXoAymXUbMnHD09ckvtLsJOYSI6QM3dowXVagnsqMA5 j2salkFYAseq+U4At1ayVPMhIRRvo+Bn1qMR32iJ1kA0Vec6FihMEBiNrruwER2tZmIT fSuLByZ+4aeXLz9Fkg4tz4X3AWMzFqILWqnoMUhcW1FgWG+SdvEE8JzxnX6Y/NbWAloP mS2A== X-Gm-Message-State: AO0yUKWJUaLNsa28jx0cWQe0XB/l+n1/419ysrPhZ2qguXY62/q8Bpsk 7r2Bus43+ZZFICnYbRI3x0+WYZ1hciM= X-Google-Smtp-Source: AK7set8k6KJcWyyC8FuI6gCgwXuHPYBhPz/DMopMYVeI3LW9KzQU1VQ4rnzrXj0fWLs0o/Htpj/lXw== X-Received: by 2002:a05:6402:34d5:b0:4ae:e548:1222 with SMTP id w21-20020a05640234d500b004aee5481222mr456057edc.15.1676734216067; Sat, 18 Feb 2023 07:30:16 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c23-b8cf-1500-0000-0000-0000-0e63.c23.pool.telefonica.de. [2a01:c23:b8cf:1500::e63]) by smtp.googlemail.com with ESMTPSA id a65-20020a509ec7000000b004acc5077026sm3742554edf.79.2023.02.18.07.30.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Feb 2023 07:30:15 -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 v2 1/5] wifi: rtw88: mac: Add support for the SDIO HCI in rtw_pwr_seq_parser() Date: Sat, 18 Feb 2023 16:29:40 +0100 Message-Id: <20230218152944.48842-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230218152944.48842-1-martin.blumenstingl@googlemail.com> References: <20230218152944.48842-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 Reviewed-by: Ping-Ke Shih --- 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 Sat Feb 18 15:29:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 13145581 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 2DE21C64ED9 for ; Sat, 18 Feb 2023 15:30:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229751AbjBRPaV (ORCPT ); Sat, 18 Feb 2023 10:30:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229736AbjBRPaU (ORCPT ); Sat, 18 Feb 2023 10:30:20 -0500 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42D80166F7; Sat, 18 Feb 2023 07:30:19 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id ek11so3751995edb.9; Sat, 18 Feb 2023 07:30:19 -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=lAX2N6AbPGFaXeQ/ovhQE8jiqNbqXdojdWHTF/rY/eM=; b=PtzeIhjC1ZIl+el5rAE5SO9jgu6i5CMiyrTNKiC11SATiM2IaeoZoH10VTqM0Pd87R NjGNzwojd7oDMC0PDoHxn4P/D5tDcw0tSGTFeFySvQKFAlArwStUL0tj5UwwpzYjNQJJ jyZsHidTIs41U8DzcFbZZQa3pMnyvmscU6civdekkIWg7b6zRpB0QB1MSm1zn1dezCRp NkaOgwajaxVt5mSTFzS3ahNVPRFFiOk4IvaXb3BjnSkYxyym4ohPYTWBopDSOSnmXsTu NUGqT6WY5n41S5xB1ijS/14uES5mkcrY7x+Bo76FZqyF0uEhwSw4zE1sIoh6vtUpi+Rl K0vA== 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=lAX2N6AbPGFaXeQ/ovhQE8jiqNbqXdojdWHTF/rY/eM=; b=3lzRBzvL/mEDDakSgoPxE8AHfz8GpLWGhgFZ9d6tiWsYAxVMQUgOWzCBMLzHqamplb arM8vZs6c9v3eGIHp4VG6ZvyYSfEdiw9ZxggpPmlGU8PnmMYOxEleatXvvAk33DQML76 rDE3W624oVmRWC3zbJIcO1JtKmyoQrylQwD2UmlAxX/ghNWbMZME6rOgrltai0B8NALt HIOIbbDej60+gaXvhJgjDUDHDI/iMIq1GYsFEACUAospmw2oBkQG8MsvgiEEYl/wbMSz X5n8tmf3nqiIgf+bnGSRnrynmSZfChwqPrES7CS4ivy0I9VgCe2NLtWI99H4jtA0FTei HxIQ== X-Gm-Message-State: AO0yUKWVvpnkHv5pJgMYtrJJwmp8iptsLkcks7P4PBcASjVD3YKMC6Ru JlQdkVAkxIL3nSMJDLodQ7NIptK94as= X-Google-Smtp-Source: AK7set+NuC0A8Oew/bYh6372+JpMtkhPa/2UXxN52lGuNh1/+Z5IFABcd++LRmXiifx1YGSBHQlDEA== X-Received: by 2002:a05:6402:d2:b0:4ab:4ad1:a37e with SMTP id i18-20020a05640200d200b004ab4ad1a37emr817334edu.16.1676734217077; Sat, 18 Feb 2023 07:30:17 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c23-b8cf-1500-0000-0000-0000-0e63.c23.pool.telefonica.de. [2a01:c23:b8cf:1500::e63]) by smtp.googlemail.com with ESMTPSA id a65-20020a509ec7000000b004acc5077026sm3742554edf.79.2023.02.18.07.30.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Feb 2023 07:30:16 -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 v2 2/5] wifi: rtw88: mac: Add SDIO HCI support in the TX/page table setup Date: Sat, 18 Feb 2023 16:29:41 +0100 Message-Id: <20230218152944.48842-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230218152944.48842-1-martin.blumenstingl@googlemail.com> References: <20230218152944.48842-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 Reviewed-by: Ping-Ke Shih --- 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 Sat Feb 18 15:29:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 13145580 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 DAB9CC636CC for ; Sat, 18 Feb 2023 15:30:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229766AbjBRPaW (ORCPT ); Sat, 18 Feb 2023 10:30:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbjBRPaU (ORCPT ); Sat, 18 Feb 2023 10:30:20 -0500 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 826D216AC6; Sat, 18 Feb 2023 07:30:19 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id fd2so3567474edb.2; Sat, 18 Feb 2023 07:30:19 -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=j+7Oq4TPhe/bGdXGLEkYt4uVs6oTPzxKjeEpllAxDeY=; b=GeKzr6+bv66/KA8JqqQjWZleGr8Wsn7bojhQShZQDujWMkrSoG49hBMB8Cc43/I1mR fI/ZfboPrD/WdH968xbiCtyTLZIeWEHYcbhOVkYlr0L/7NYWxCSPz6BZTVOSXzU4WKBL +qZVx/5Z2HvQI8g6uhH/ch92XmFg2eAxfc+djrr4AMyw76t5OuMblDxAwDleDzYFsCUU T9BQ3rcwvkM3uEGq2TEme2HhkMvhN7OEUrWb+YFU+99QUVJ0xRKmzr4G4EO4vxAAfaCm d1Xir4Ubutkpzvnum8w6ToVpHdIECQWYcWGwHCcyzC1mPTotIaNNs+uUgy+u+nPdqRWZ Mnaw== 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=j+7Oq4TPhe/bGdXGLEkYt4uVs6oTPzxKjeEpllAxDeY=; b=32fEiSAq7AaWrCMJAOLRYM0UbP5Eg/F5O9tOIkaO5Hy7IlGwpNw7cPeueAibLRtg6X cpOMaopcvXJUybYvFbPhEq+LADwaU4afmy3Ef0tUdkc2VkOtVHaahC7e2TCpCZCcGAqs 4KeNN5L6KeTYSBhWJscKtFD39aKPrKADAya+SQi/QRcj2A0AlknPheHXv5KToYDEJCDo Sv7lOjPzUHqqlbgz0RMuihd27JAQ0Jhe1zGNtjVYiJe6EG+kdoxj5Rlc3P/GZMkl+0WS 9+VYdbCYD/cVWURMVOXj2iYE6ETg5q+Tjhs6Ngv4XCEuhiKeV19YrsaVnBF+0EtlXvXp cxiQ== X-Gm-Message-State: AO0yUKWb9BXh6p/PMfTBKjjwjGVrb23cUM/4MByWUS6ezwM4WKIuqbH7 DqRPfP9YKVWplaAhRksA3XQ4rDDGHNE= X-Google-Smtp-Source: AK7set8up7sj90ZjCWw4rMHFUCaxQpyb4KV+9rGyRG766UFC94UPSb3v+bOSHyJEyWl0drcPcByHQQ== X-Received: by 2002:aa7:cb53:0:b0:4ad:8fc5:3d2a with SMTP id w19-20020aa7cb53000000b004ad8fc53d2amr4914639edt.11.1676734217799; Sat, 18 Feb 2023 07:30:17 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c23-b8cf-1500-0000-0000-0000-0e63.c23.pool.telefonica.de. [2a01:c23:b8cf:1500::e63]) by smtp.googlemail.com with ESMTPSA id a65-20020a509ec7000000b004acc5077026sm3742554edf.79.2023.02.18.07.30.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Feb 2023 07:30:17 -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 v2 3/5] wifi: rtw88: rtw8821c: Implement RTL8821CS (SDIO) efuse parsing Date: Sat, 18 Feb 2023 16:29:42 +0100 Message-Id: <20230218152944.48842-4-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230218152944.48842-1-martin.blumenstingl@googlemail.com> References: <20230218152944.48842-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 Reviewed-by: Ping-Ke Shih --- changes from v1 -> v2: - add the new function/union member/case statement last (after USB) 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..7ae0541d7b99 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c @@ -32,6 +32,12 @@ static void rtw8821cu_efuse_parsing(struct rtw_efuse *efuse, ether_addr_copy(efuse->addr, map->u.mac_addr); } +static void rtw8821cs_efuse_parsing(struct rtw_efuse *efuse, + struct rtw8821c_efuse *map) +{ + ether_addr_copy(efuse->addr, map->s.mac_addr); +} + enum rtw8821ce_rf_set { SWITCH_TO_BTG, SWITCH_TO_WLG, @@ -77,6 +83,9 @@ static int rtw8821c_read_efuse(struct rtw_dev *rtwdev, u8 *log_map) case RTW_HCI_TYPE_USB: rtw8821cu_efuse_parsing(efuse, map); break; + case RTW_HCI_TYPE_SDIO: + rtw8821cs_efuse_parsing(efuse, map); + break; default: /* unsupported now */ return -ENOTSUPP; diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.h b/drivers/net/wireless/realtek/rtw88/rtw8821c.h index 1c81260f3a54..fcff31688c45 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]; @@ -94,6 +99,7 @@ struct rtw8821c_efuse { union { struct rtw8821ce_efuse e; struct rtw8821cu_efuse u; + struct rtw8821cs_efuse s; }; }; From patchwork Sat Feb 18 15:29:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 13145582 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 7DDA4C64ED8 for ; Sat, 18 Feb 2023 15:30:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229797AbjBRPah (ORCPT ); Sat, 18 Feb 2023 10:30:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbjBRPaV (ORCPT ); Sat, 18 Feb 2023 10:30:21 -0500 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AEC416AC8; Sat, 18 Feb 2023 07:30:20 -0800 (PST) Received: by mail-ed1-x532.google.com with SMTP id ec30so3549302edb.10; Sat, 18 Feb 2023 07:30:20 -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=oE7zFa3zY/saVOKDiXgo1nSrjJBFbOP4MGfXZYfHkSM=; b=d9hnyTd/NMz+BqGb3NBhRUtX7bo+aN98O/C6/oNOiA7nRJh+lptJyyYH92goCvFMeS pLD+9GXJA7F8z3sTcu8cjApn4Hss5jLFyYYyS2RHacGf5YIfaK/lUF5JBMCzGj68i97H rHpkFHIYgszhJmVtzNNfluKpB3Gt8SzOUPc6k/CC6Tgyp2KEPgBD/0Z3Rr8G6kEDJSz9 OG2rsg5zJjd2L13EbTwCj97CdjAt61Nq7eAx4LJ160clohuktFiHslHqXep8FzqFOwQ6 CldDwHhfdTs6QFqY5CSNd4JbvUKE9+jPtdvw2nQOCHkUdWbEuHZSdvPtVlVKWscU4rln m9Ew== 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=oE7zFa3zY/saVOKDiXgo1nSrjJBFbOP4MGfXZYfHkSM=; b=QIknLSaxW3gVfrHzj0QktBa7fJgHDz2NsTwJQY94F0mLIzozCt8Y1xBxSBUxA1bxD4 zOQoe3Whpyw0aMyeFMgfew829OSQ+tGuFAdNIAYCQQaOnPbWFpYEkaL/yiOpZg/+4c09 yWqeGKlkwvQbAs5ptQ8V4Xt8otYRzzzPNljHphaJmy5Zo6pVy8Crbbul2OD9bwrqztL4 NHZD0ClGyZLFa8LLcdjMyzun8jNewSgc97y1w274pjEtJvgKoRO++kdMF0Iz5sfLKaJJ 6ToMDATDGABm8hioxAF2fQK3jNLfqhul1XlDuNNu+n479eJKVwG0ymAXhbdQUvbMSDx9 SKdg== X-Gm-Message-State: AO0yUKWWiHQ7FKJBZc5ylgzNnqLo5u764veKBAL8/+OtT0rb+9+3ppQs dTVb+bEhDYTGg9O+yZnbtZ5Stm8dqlA= X-Google-Smtp-Source: AK7set9NPHs2R627B6yMhW/ilaSeJrppJP4lXzJ4lM++p8kDhMt9ssQkDdFOm0ED6EOTMZspSo0RMA== X-Received: by 2002:a05:6402:3d8:b0:4ab:b0d5:6bb0 with SMTP id t24-20020a05640203d800b004abb0d56bb0mr4181332edw.18.1676734218668; Sat, 18 Feb 2023 07:30:18 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c23-b8cf-1500-0000-0000-0000-0e63.c23.pool.telefonica.de. [2a01:c23:b8cf:1500::e63]) by smtp.googlemail.com with ESMTPSA id a65-20020a509ec7000000b004acc5077026sm3742554edf.79.2023.02.18.07.30.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Feb 2023 07:30:18 -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 v2 4/5] wifi: rtw88: rtw8822b: Implement RTL8822BS (SDIO) efuse parsing Date: Sat, 18 Feb 2023 16:29:43 +0100 Message-Id: <20230218152944.48842-5-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230218152944.48842-1-martin.blumenstingl@googlemail.com> References: <20230218152944.48842-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 Reviewed-by: Ping-Ke Shih --- changes from v1 -> v2: - remove extra newline which was added by accident in the USB function - add the new function/union member/case statement last (after USB) - while here, also sort the union members to be consistent with the switch case (PCIe first, USB second, SDIO last) drivers/net/wireless/realtek/rtw88/rtw8822b.c | 9 +++++++++ drivers/net/wireless/realtek/rtw88/rtw8822b.h | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822b.c b/drivers/net/wireless/realtek/rtw88/rtw8822b.c index 74dfb89b2c94..531b67787e2e 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c @@ -32,6 +32,12 @@ static void rtw8822bu_efuse_parsing(struct rtw_efuse *efuse, ether_addr_copy(efuse->addr, map->u.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 int rtw8822b_read_efuse(struct rtw_dev *rtwdev, u8 *log_map) { struct rtw_efuse *efuse = &rtwdev->efuse; @@ -65,6 +71,9 @@ static int rtw8822b_read_efuse(struct rtw_dev *rtwdev, u8 *log_map) case RTW_HCI_TYPE_USB: rtw8822bu_efuse_parsing(efuse, map); break; + case RTW_HCI_TYPE_SDIO: + rtw8822bs_efuse_parsing(efuse, map); + break; default: /* unsupported now */ return -ENOTSUPP; diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822b.h b/drivers/net/wireless/realtek/rtw88/rtw8822b.h index 01d3644e0c94..2dc3a6660f06 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]; @@ -92,8 +97,9 @@ struct rtw8822b_efuse { u8 country_code[2]; u8 res[3]; union { - struct rtw8822bu_efuse u; struct rtw8822be_efuse e; + struct rtw8822bu_efuse u; + struct rtw8822bs_efuse s; }; }; From patchwork Sat Feb 18 15:29:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 13145583 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 2913AC61DA4 for ; Sat, 18 Feb 2023 15:30:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229813AbjBRPaq (ORCPT ); Sat, 18 Feb 2023 10:30:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229762AbjBRPaW (ORCPT ); Sat, 18 Feb 2023 10:30:22 -0500 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3731F1716B; Sat, 18 Feb 2023 07:30:21 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id eq13so3520835edb.11; Sat, 18 Feb 2023 07:30:21 -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=uCrLcBOXf45KI5NWv36Ke5ebNksAMkuWC8S0/ItarqA=; b=mj5XB9XrMP+HH8GYkBWTy0sm6rgNEb+SNqxnOsW+qfMsVUV27WE7/fo3dbNA9xP2k2 W69tJrGcoGJYCqCOR+Pt8xMDI32JFn/eevCiCB2pGXQzb5QEd1FOHZ1NQYb/q1ITgYOr dNr1cc6ChRDEf3OmCvB/lO4E+38ZIOSMqWRidvpEbA+6GUWIVFBkk+uvdpn8sC1h/IeW DIV7DvJ/FM3f7JUakQakxt3hKe9sxguR7DeaYLlM2QggMYPc9rdOAQhdvQbBF37Yj5lq wyNMZB7fdtKeeg3Ycn9VBCSgGC0QmkcKQuzecjfMRQxCw7lQqLG9wzysHTxEw3Frl3z6 UuHw== 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=uCrLcBOXf45KI5NWv36Ke5ebNksAMkuWC8S0/ItarqA=; b=WgQuyHl6uxpBNsU4jfG5MSzc7lcxeLnK7S1fmBNMlGms6DaNDu+qdVJY41hb80JgD6 gMLfpa5P/VWyGNz5Na/fTpb14o5gvXyzlRF1K+12BIlXPCrz/JR0Tv03S2GtsKqjtmk1 JdXNwD+/DIJSBdxpABetp4ToV3kDEz9s0m/iIRavXRPiio1lKxR3k7lmHlx0IrHTc2JO 1BH2A0pm6epa7gqaFAlLt2ft0OKpi51tfHC5kw2IdY6gy6tyEVnE9+o9R4Hcn0guo4Ah mVmTvQqVX4vtfCiBMzkRRd8F7/hZAyVSU/2uj8v+qniFstUNlu7GJu5qKxZWH17aV0qM zLJA== X-Gm-Message-State: AO0yUKUCCNrrGS5TnEly3D3uuPbx9NnS/KsJtI6hw276HjBmw8Nb0piq PX1CaIhaX6V+AGItAhgl/6myc2qZN4c= X-Google-Smtp-Source: AK7set+ilpQBfm3cccbDG7nHfOrMlhLgZuuIrXXDNZUtdmZfizhCMdLNbZ2/OsUYSzdltGk+4xDKuA== X-Received: by 2002:aa7:c0cc:0:b0:4ab:4d55:6f74 with SMTP id j12-20020aa7c0cc000000b004ab4d556f74mr4183444edp.13.1676734219443; Sat, 18 Feb 2023 07:30:19 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c23-b8cf-1500-0000-0000-0000-0e63.c23.pool.telefonica.de. [2a01:c23:b8cf:1500::e63]) by smtp.googlemail.com with ESMTPSA id a65-20020a509ec7000000b004acc5077026sm3742554edf.79.2023.02.18.07.30.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Feb 2023 07:30:19 -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 v2 5/5] wifi: rtw88: rtw8822c: Implement RTL8822CS (SDIO) efuse parsing Date: Sat, 18 Feb 2023 16:29:44 +0100 Message-Id: <20230218152944.48842-6-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230218152944.48842-1-martin.blumenstingl@googlemail.com> References: <20230218152944.48842-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 Reviewed-by: Ping-Ke Shih --- - add the new function/union member/case statement last (after USB) - while here, also sort the union members to be consistent with the switch case (PCIe first, USB second, SDIO last) drivers/net/wireless/realtek/rtw88/rtw8822c.c | 9 +++++++++ drivers/net/wireless/realtek/rtw88/rtw8822c.h | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c b/drivers/net/wireless/realtek/rtw88/rtw8822c.c index 964e27887fe2..5a2c004b12df 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c @@ -35,6 +35,12 @@ static void rtw8822cu_efuse_parsing(struct rtw_efuse *efuse, ether_addr_copy(efuse->addr, map->u.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 int rtw8822c_read_efuse(struct rtw_dev *rtwdev, u8 *log_map) { struct rtw_efuse *efuse = &rtwdev->efuse; @@ -67,6 +73,9 @@ static int rtw8822c_read_efuse(struct rtw_dev *rtwdev, u8 *log_map) case RTW_HCI_TYPE_USB: rtw8822cu_efuse_parsing(efuse, map); break; + case RTW_HCI_TYPE_SDIO: + rtw8822cs_efuse_parsing(efuse, map); + break; default: /* unsupported now */ return -ENOTSUPP; diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.h b/drivers/net/wireless/realtek/rtw88/rtw8822c.h index 479d5d769c52..1bc0e7f5d6bb 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]; @@ -91,8 +96,9 @@ struct rtw8822c_efuse { u8 res9; u8 res10[0x42]; union { - struct rtw8822cu_efuse u; struct rtw8822ce_efuse e; + struct rtw8822cu_efuse u; + struct rtw8822cs_efuse s; }; };