From patchwork Sat Aug 10 03:51:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacobe Zang X-Patchwork-Id: 13759394 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 554D9C3DA4A for ; Sat, 10 Aug 2024 03:53:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=JWxvyZebHcn5nlT/XWQT3uL3yRarW/BmR9Lh58Ys/cE=; b=cxQPHHoU87CN9J/SQN4qlmnxee soMaYUOibUz0quk1Xcs3zw9rgIt2ONpwJDHgWxSN9hKi0mLdRbBRI7GAHiCpxR+6AtUMlTFAeR3sQ oiNYunA50UxSC+3I+nNGp18NSLuIXBusGnukFgBhDbsQjFEvR50KJ27VUL78Q3EmMiiKd6vaTLu4h qKdqHyTEWI1kyX57kuWdzJ8fI4lL9u0bC4zlee6zaVWO4da/bLYQLUdkGtsPwl4clC1kLIy6lfusa bkZ42pa3XDUkmD5wAwe62zBZ+2pCto7wci59P7PO2Ya3B+v1NUE3ft87y91Y0iyn0ACVXaDmUMml4 YXWEIlQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scd9v-0000000D7Zm-0y26; Sat, 10 Aug 2024 03:52:51 +0000 Received: from mail-psaapc01on20702.outbound.protection.outlook.com ([2a01:111:f400:feae::702] helo=APC01-PSA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scd9J-0000000D7NI-3yo9; Sat, 10 Aug 2024 03:52:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Dv5Wg3TV90FEU9u/+VnM3GGtTXAVSv9TdOwDwNTdR2aNZ5DABgYJRBgARXuiARPUAzYLsaE6pg6X0IhWJehwJpdn364jzAGU0Q2y110YGOc5xMdzCZ/D7R9ivxYeTF/MyXqsk9pQARYD6ZF/o8+rxpB4L5hucmeYyCKZqr/Z9LOkuJDEIpAWcwfLiI6Rbc/LRsjmHqETMbABLyWruORI7UnnujuP9kAMTmQImNIhqndH4qS0k0sYpick15hMfMPUsGwg+2smTx9ibvSVGJ4RbfjLOUrRZhudy9ZqwqmWPMjSEwvDQ0Xd3v2aDqk80Jkg0P8R9sYCsYbjMcumyylLUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JWxvyZebHcn5nlT/XWQT3uL3yRarW/BmR9Lh58Ys/cE=; b=BDcpioPZ/LtvwA8JEosJh46AhSp+2tpY6fldTZecEEvnhaAVPxJ9pX24ihP5UvMdQ9nDOYOsf+vTpRZNovVhgtPd1yi652jdS7Onl6uXn8CeIS3xC+n+2zBBpak2dW2BqF/sJ+6NIN+jjZ+ihkPUm+D4akvmZjc1kqsrLEy5rDb396XCwkyKpX6g8b11LypC0Tk4Gcr1KUmUj9havqFe+RF+i62pDh6TLOPu4+zHovZ5WgUg1AqqKHu7tV0cXHUhU5bppchFRdPmSvZDo2BKO7gbAyt/8xglKLEl+v1yq0D+WBN7zLcwHZIyvLxa0yu1RpAAQIQtpLR1Y2QKZt8xNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wesion.com; dmarc=pass action=none header.from=wesion.com; dkim=pass header.d=wesion.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wesion.com; Received: from TYZPR03MB7001.apcprd03.prod.outlook.com (2603:1096:400:26a::14) by TYSPR03MB8564.apcprd03.prod.outlook.com (2603:1096:405:61::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.27; Sat, 10 Aug 2024 03:51:56 +0000 Received: from TYZPR03MB7001.apcprd03.prod.outlook.com ([fe80::78dd:5e68:1a9c:36c0]) by TYZPR03MB7001.apcprd03.prod.outlook.com ([fe80::78dd:5e68:1a9c:36c0%6]) with mapi id 15.20.7849.015; Sat, 10 Aug 2024 03:51:56 +0000 From: Jacobe Zang To: robh@kernel.org, krzk+dt@kernel.org, heiko@sntech.de, kvalo@kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, conor+dt@kernel.org, arend.vanspriel@broadcom.com Cc: efectn@protonmail.com, dsimic@manjaro.org, jagan@edgeble.ai, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, arend@broadcom.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, megi@xff.cz, duoming@zju.edu.cn, bhelgaas@google.com, minipli@grsecurity.net, brcm80211@lists.linux.dev, brcm80211-dev-list.pdl@broadcom.com, nick@khadas.com, Jacobe Zang Subject: [PATCH v9 0/5] Add AP6275P wireless support Date: Sat, 10 Aug 2024 11:51:36 +0800 Message-Id: <20240810035141.439024-1-jacobe.zang@wesion.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: TYAPR03CA0020.apcprd03.prod.outlook.com (2603:1096:404:14::32) To TYZPR03MB7001.apcprd03.prod.outlook.com (2603:1096:400:26a::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR03MB7001:EE_|TYSPR03MB8564:EE_ X-MS-Office365-Filtering-Correlation-Id: 9881e7b0-87ec-42af-64dc-08dcb8efc73b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|7416014|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: 6l67MsjeBj5NnZm22cGom4kJEwnbc65erypE75jX7hBh7doYZK0KIZf4Fx3LiKJ4K77EtYFJOL7qRyFxujiIvCHVxK9yaTDfOn5zdJUXYK4Xv5h68a/c3DQMCxm7oPpAhsqK0+8BN5ChY/q+Bo9OuRii4t9IHV66d5yd5Tb8TbJQAOwnPpxSG1+KZSBxeL3p4smInjDqv1CFqK1fKagiGC4qEHwj7XaKHkG5LoBP2okcjpcD2DcjCsF65f2HVF4nZ9hOnoyOCIcJuMP61faCl+JyAxQcAR7DQhZNU3fYPIHty+aFjyE0k89YHweLCeWXlpJyPrRBzjoOVczdTZgoT9PZxKrxHIlgWYBfeEVQfU7Vc0gKwywlca+8iWzwRX9Ep1QvbAoPIB5hNoaOwZ7ekaywIoR0NZMJOsvqYYTORFzUMeJYgTYr2BMNONdrj2hOUvdZFhBp8ceVyhK9EHjVa0ipBnnyQ+f6fIrqyCCIOFdmbH3N2IudNzM600wXEpqr7iHzw1C3Z5QJE2BOOZPF7LZyE2Tzf7aXl9H9ipyRWsuVeKq4RWUsT2dRd8R63LgKRoHp9Y5IVEWqbqIj9+tpgIacQAf4DoQwTS6O0XHlm/CBkK52YxFXvtrnwFgUR5wKcs2CTmpLOADFUV65lC2ovPPFtFG49uO9H0YIxLkgnXDQDvcnQDhO8rcQgteiRqmxbOy74/nb4Hd8ayIrE+mfBNYZB+4+UDELwe1IW0U0bla5sBM8qprqYZSkjw7e8XLJZD+8vjlyILVQ63PnLxMtZZQPc2iqpHF/pc7syXz1jexTRysuHCFeoYsgzW1NfSQv2zmFTViKEtAhD8I5o1bsDD7zuGtkF+jL1xfNMrtRXyLck7I8jb+FlXy8aDgYSXIq8DbZnnrC1BY1b7W/QOVblNHuGbjIOHAsZOJVpj8jxWSnjKjjJkAUFaliDGMTf1NiGPVrwY+wNcLPeJLaZe4ctcy8krsdFO7/OzqV5Rwtgk/4S2uBlKUi6LbvItsIsM7WRl8EgMSnfRwlVaCQNc/c9GclnSdLliIDqWpcHmRUtomAw83JUV1btwVGs763WYekFFUUU6AP5Syk/xkvKQT4wpckscI1QiUHEfZ6M9VoXTZbG9YEPuSAbPSX/It71+ykb62jBppOrozpJ7qeDSElbj0POx664DtMe23OmggIV48GI0p76SHmxWdJvWgi9ZrxVF8glpWWVXGGLvWZ+FLxUis3QjFSl3asuC2G1zKR+udS2gDOzPjl9vza7q0AY2onfWHjEOeWB+QCM2z/pCehfCfb397UUphcmd+SiHn43ATyjVMZGzp5L2PZ7oEznfi42jUqaljJNnZgzPLOV7YnhNpLuRLrKCbBBqDvAQP20gmpP2AKyFWNvucrpifb9t13 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR03MB7001.apcprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(52116014)(7416014)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: p0DyWeVu0/JUMyANZu7XFvDctZ7nsxM9ofCHkbsMXSMeVzGO4G6m30TrwDXWVc8KvO21qmxMEnP8aNQtAyf6m1UouYqFvajBbbQ4a8KOSu6QPbRX9cuuzGU3VZMCFHqpXcVegLIM3Ho6nXAeaennLQ1ynKSx1hONpRI3IDr6PUjxXIV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VUfxv7FzjNmeSCJ5lOG2edSHq5PntRt62hqP5rqsY+C2KR4oTwTfv5ONh2T/ZfDeMXHZ5nfWY+jJQoGE7d2gL9T8FZF+D2+tdfKXp+8rbH3w+xDGnwJLY9FrP2f/TTFLK4yT06SH2daMgZSC4FbAKXo+luU9RvNs8FlQRBpz/dHNDdBCFmw2XVYgFTu9nGW1iXYg2wD5B+Xr9Yzf9zwtcs/nItShp+gIBV1rRJ0Gh8PGav7rPDVRzvL8X1sXHQbg4xNRz+Xa7ivqqddRoYM/RyvLJutFC8ukwsnYsqYTE9zxG9niGL+PZ2btGc0WavWCe6010zUan0TFPCxJviBf4x3OSd X-OriginatorOrg: wesion.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9881e7b0-87ec-42af-64dc-08dcb8efc73b X-MS-Exchange-CrossTenant-AuthSource: TYZPR03MB7001.apcprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2024 03:51:56.0559 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 2dc3bd76-7ac2-4780-a5b7-6c6cc6b5af9b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1uSpsAOu/Sz5vnMHFdP+3ys3FgW3ErEUl7bUJ5FIC0j9jegFLNMOjZhmInQ/FSjJNm0QKOHD0Cxp9qYS9pLenw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYSPR03MB8564 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240809_205213_998707_AAF200CC X-CRM114-Status: GOOD ( 12.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org These add AP6275P wireless support on Khadas Edge2. Enable 32k clock for Wi-Fi module and extend the hardware IDs table in the brcmfmac driver for it to attach. Changes in v9: - Add return -ENODEV error pointer from brcmf_sdio_probe as the default for the fail path - Add if statement for brcmf_of_probe in common.c - Retain modifications to of.c other than the return values - Link to v8: https://lore.kernel.org/all/20240805073425.3492078-1-jacobe.zang@wesion.com/ Changes in v8: - Add appropriate errno's for return values that will be send to bus when error occurred. - Link to v7: https://lore.kernel.org/all/20240802025715.2360456-1-jacobe.zang@wesion.com/ Changes in v7: - Change brcmf_of_probe prototypes from void to int, add appropriate errno's for return value, move clock check to the end of brcmf_of_probe - Add "brcm,bcm4329-fmac" compatible for wifi node - Link to v6: https://lore.kernel.org/all/20240731061132.703368-1-jacobe.zang@wesion.com/ Changes in v6: - Move "brcm,bcm4329-fmac" check to the top of brcmf_of_probe in of.c - Add return if clk didn't set in DTS -Link to v5: https://lore.kernel.org/all/20240730033053.4092132-1-jacobe.zang@wesion.com/ Changes in v5: - Add more commit message to the clock in bindings - Use IS_ERR_OR_NULL as a judgment condition of clk - Link to v4: https://lore.kernel.org/all/20240729070102.3770318-1-jacobe.zang@wesion.com/ Changes in v4: - Change clock description in dt-bindings - Move enable clk from pcie.c to of.c - Add compatible for wifi node in DTS - Add random seed flag for firmware download - Link to v3: https://lore.kernel.org/all/20240630073605.2164346-1-jacobe.zang@wesion.com/ Changes in v3: - Dropped redundant parts in dt-bindings. - Change driver patch title prefix as 'wifi: brcmfmac:'. - Change DTS Wi-Fi node clock-name as 'lpo'. - Link to v2: https://lore.kernel.org/all/20240624081906.1399447-1-jacobe.zang@wesion.com/ Changes in v2: - Add SoB tags for original developer. - Add dt-bindings for pci14e4,449d and clocks. - Replace dev_info to brcmf_dbg in pcie.c - Link to v1: https://lore.kernel.org/all/20240620020015.4021696-1-jacobe.zang@wesion.com/ Jacobe Zang (5): dt-bindings: net: wireless: brcm4329-fmac: add pci14e4,449d dt-bindings: net: wireless: brcm4329-fmac: add clock description for AP6275P arm64: dts: rockchip: Add AP6275P wireless support to Khadas Edge 2 wifi: brcmfmac: Add optional lpo clock enable support wifi: brcmfmac: add flag for random seed during firmware download .../net/wireless/brcm,bcm4329-fmac.yaml | 9 +++ .../dts/rockchip/rk3588s-khadas-edge2.dts | 16 ++++++ .../broadcom/brcm80211/brcmfmac/bcmsdh.c | 4 +- .../broadcom/brcm80211/brcmfmac/common.c | 3 +- .../wireless/broadcom/brcm80211/brcmfmac/of.c | 53 +++++++++++------- .../wireless/broadcom/brcm80211/brcmfmac/of.h | 9 +-- .../broadcom/brcm80211/brcmfmac/pcie.c | 55 ++++++++++++++++--- .../broadcom/brcm80211/brcmfmac/sdio.c | 24 +++++--- .../broadcom/brcm80211/brcmfmac/usb.c | 3 + .../broadcom/brcm80211/include/brcm_hw_ids.h | 2 + 10 files changed, 134 insertions(+), 44 deletions(-)