Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3792915rwl; Tue, 27 Dec 2022 15:32:30 -0800 (PST) X-Google-Smtp-Source: AMrXdXt/4gHttSZAVsZ3yc3aLSyQ4MF7AxzxItMQyF4Sac1YBQu6wnFA7ix71Uf1weOY6KUS+YD6 X-Received: by 2002:a05:6402:158d:b0:472:adc9:6eb2 with SMTP id c13-20020a056402158d00b00472adc96eb2mr20202404edv.29.1672183950635; Tue, 27 Dec 2022 15:32:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672183950; cv=none; d=google.com; s=arc-20160816; b=YY5jzsCe0fpS/2pEIyXQHSJdox1k22DRPwOW4rcFP6ycF2NMaIR9KuKLySIoTA8kvj lz1Dbr7FEXHpB+5NvX/e6bMaJTKifRatg7yc8hGXCLYdlXvtb0SJ2bIDPaIqd69+srCZ JTLtoPj7JGOcLHgFLnhq2/pnVj+nub5w8qnCeKqb0du0GpS0AasGghate79t2kWmsRh+ OrgjgYMBbbDJ8vDrQkk3TMthdHE4EmR4BOScg1PNzjyWnHxuZzRZZZsw+xqqbqOf9T1Y JG9AxVpfQaCy+PTCI7GVLXiZZUf8tjWtzlw/1r/r6xZ+ac26t9VBA3kaaS6yo4ZwNTUa S9HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=A522Jt6HhfnBCacJa8yLyhSRn9fiN5RDQFLQBl+szdU=; b=OnQEzx7XVVkMcxgzx0izCozmOgDUR8G/K4DdtDMN4ioaU1th/xYuzP4g84q0CYQVVm UTT2TOagcGfP08qt/AUvdJIJVJftWz2a8pkNxXJlNGxP+IcCwakAMjW8ga2rN7dy46zy Bfu+zda/CmqeZEyTtJu8etMMM8a3kQM9RpNLaM/IlFS5sT+WwhosbZvxpk5U+0eDIgyP amIryP5WwLk2860m/3gW5RXRNAFOpPah/gCVelpwH5Z0ewgNvSgkgQVp9TvMi/Fwd1aV FjApxkbLKyZ0pqWhgiDo1AGqWw0/1rezqyndj9F5sCTkdKCEdoESGGT9/SWAsOa6pBCY EcCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20210112 header.b="MJQ/XSgT"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb16-20020a1709076d9000b007c0e240faf4si12227115ejc.344.2022.12.27.15.32.11; Tue, 27 Dec 2022 15:32:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20210112 header.b="MJQ/XSgT"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232207AbiL0XbH (ORCPT + 68 others); Tue, 27 Dec 2022 18:31:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232272AbiL0Xar (ORCPT ); Tue, 27 Dec 2022 18:30:47 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85D5F3BB; Tue, 27 Dec 2022 15:30:43 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id r26so15660428edc.5; Tue, 27 Dec 2022 15:30:43 -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=A522Jt6HhfnBCacJa8yLyhSRn9fiN5RDQFLQBl+szdU=; b=MJQ/XSgTkapv3EpIbAO8XLCrxJPt/iWc1zTsffUVfG6sA/ybEptpnXcuLak7XB3PIQ Ihdw5tH4+sscSaNDvtOvKul2WNmJrPasn5e6wzXj5Zuu0dy0ygDshPp7s0ID0F0veT+Y OiiKr1tzJB+kStlcwVFqJbgK1herJfnG0Q8d+wOBrPRXmYNzuSROK9gVhwdD32+2QFbj TgTYPhjgnFih9U7IrxdQttkH4vEvGLtK6Qb4NhvqEKx8r4QI80Ds1yNXTzBFdAG0GBIK 7FaP28dkjw0mNSp/E00hk0fTjqtiZKPTPeJfHqMAXnOG7adcQIRwtAlQEEaGGGoxOAxW vjCA== 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=A522Jt6HhfnBCacJa8yLyhSRn9fiN5RDQFLQBl+szdU=; b=AsukRgtTPdznlbyyBZfa5HNwQ2SeRsEv7T5Y++hYWHazuj6CIp6RZ03w4Nw+NxAF23 9knLQDK3bvCHNcHAyiXeZvGuRUf5gu0LVuXhxmu5Hqhw2lXTTNovh/Q955JAX/nQm+wl 9IZILAlXkn+JK3XHIHss1CoYdbKr1XJZAuD81mqjom00qqiZtami9oAFyNdJnL3UA+lt aQNF0LfIH241/5crnLyvTmzQn6opVcCL6JgzGSKVbcCHtSaHBbb6AJ2L5/yiaiLs/7yN JNdqQH7iVWHRCqMpDHzRyniUn7i+mvPqrbT/elCwMpCCsFoA7SrLgR3B5uulruIOX8g6 ZGng== X-Gm-Message-State: AFqh2kouJA03nhjVEHVPi9iZEzgq+/Be1BG7i2EzgWyUKzEAGLIHIBGy i+TDvNOjjmkvFdC0TmBW2jsIXxJwbv0= X-Received: by 2002:a05:6402:48c:b0:483:d49f:e26c with SMTP id k12-20020a056402048c00b00483d49fe26cmr9760873edv.15.1672183841899; Tue, 27 Dec 2022 15:30:41 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c23-c4cf-d900-0000-0000-0000-0e63.c23.pool.telefonica.de. [2a01:c23:c4cf:d900::e63]) by smtp.googlemail.com with ESMTPSA id r7-20020aa7c147000000b0046cbcc86bdesm6489978edp.7.2022.12.27.15.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Dec 2022 15:30:41 -0800 (PST) From: Martin Blumenstingl To: linux-wireless@vger.kernel.org Cc: Yan-Hsuan Chuang , Kalle Valo , Ulf Hansson , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-mmc@vger.kernel.org, Chris Morgan , Nitin Gupta , Neo Jou , Pkshih , Jernej Skrabec , Martin Blumenstingl Subject: [RFC PATCH v1 07/19] rtw88: rtw8822b: Add support for parsing the RTL8822BS (SDIO) efuse Date: Wed, 28 Dec 2022 00:30:08 +0100 Message-Id: <20221227233020.284266-8-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221227233020.284266-1-martin.blumenstingl@googlemail.com> References: <20221227233020.284266-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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..f84bfb6b0df9 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 */ +}; + 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; }; }; -- 2.39.0