From patchwork Tue Aug 13 08:20:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacobe Zang X-Patchwork-Id: 13761527 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2133.outbound.protection.outlook.com [40.107.215.133]) (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 00D5518E29; Tue, 13 Aug 2024 08:20:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.133 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723537226; cv=fail; b=T2j0QZ6TZmeq3A2akqmpizt7n7fxl98q+IRkXAfhZnF+G6LUthHQJyN9UY177i+JZ9E3j4oa466U4ttcanKpX44HavsGvXB2e0n8qxyHsUT6WDaETO5yzSWNecvqjJx1U/FaV7x7pXCaadpkRxHxBfDd3LrfxFMnjg4F/OnQ/Io= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723537226; c=relaxed/simple; bh=QLM+SwMkH/4ULPUg7heBOEurzKWzpwdqtLxyPir6eSk=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=BHV0dAyfG90PNV6Mbo7KW5Uzxar8Rj/Hx6MCM/zXFvAayjkkRp00UmJELKPv2G5ZQqWdBclRdIJBv8ycQcseK+fV6XLrwolKaFDeB2igJo51ob71kOLWm0n2tdAQzcw4rf+GpA6fHArLLT0hbXewEGVZkPDiq9YkyXkIM9z3C34= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wesion.com; spf=pass smtp.mailfrom=wesion.com; arc=fail smtp.client-ip=40.107.215.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wesion.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wesion.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KjvoEGx7JQrYWqHQ0gVjy0QY1LuLNZSLA/WbrQzva+gtvGB7zTVHvAcF+krT9bHurmNxm6AetsNzYE0BO0cp9YrkqlQlVcPPVUyr5+2o5nNWQ1b/kw3PBsWXbD15k/E1IX+23uGFLR5bCXBSq2b1CZxxYSDI2iyuPOl9PDqBixed7wIwDnFz2MvWusbp/TaD38E9BS0Aslam78yVcD+kdVL6cDg4Cftv/UMABQs3AOZ/ecz1EgJgHuEYzK4bWIhxn2W5x92pbU6UVcANvwNhTvqMQOaLxArbVY5CWYSz1SSY3fAzsa8smTdJHa1RpDflfS5uquWKp5j/i0YeJ8QPsg== 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=Qngay0JW9A6HmYeVLCyYDAVp6HXyaqvXfsF8k3Qk2wA=; b=HsuffRlcMo0HZNXg4OqzmyjRPd4u/9LqO/7Xpol/mqHFKzkA7EIXj+eo8k1v5fpCH48bAvj4h1wooFrlbYYCr0wt+8TpR4mX8Co0m4odx2827AZ9T7B71R3y5N+taxibfCnNvH/ssQPIk+h3J/YCA2oiMA0UUauSaWdYVC4at+cuu04/76WfxsbVf6WkrunzOkrcJY9jJVE8SJwxJZaXYiAB4vzh0x1UsvGtCyI2amm9dxXwXomIHlNKBtdJhrN/vKoA/4pdW85/f+wjUvtxgyaX9yXZKyTJB0DQs0vPWReqcIATtXbK/erNE6oVmjSDUQSmhfSq9N0e7yjauRcBaw== 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 OSQPR03MB8748.apcprd03.prod.outlook.com (2603:1096:604:275::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Tue, 13 Aug 2024 08:20:19 +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.019; Tue, 13 Aug 2024 08:20:19 +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 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 v10 0/5] Add AP6275P wireless support Date: Tue, 13 Aug 2024 16:20:02 +0800 Message-Id: <20240813082007.2625841-1-jacobe.zang@wesion.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: TYCP286CA0309.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:38b::10) To TYZPR03MB7001.apcprd03.prod.outlook.com (2603:1096:400:26a::14) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR03MB7001:EE_|OSQPR03MB8748:EE_ X-MS-Office365-Filtering-Correlation-Id: 22a53096-89d4-400e-a5ea-08dcbb70c485 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: 6L4ht0Xm1gTUe3immVspvgXWB3QlBHF2xTsbKmbSAk94sf9GwFrIiJJ1+EvCysoHuHwL2R8HwoayhS+fqub9IZ+N0KTZXeeIWfzc35h57VIwWVhl0S0kk9FhIDxkErGwg/OrnqtjVL6GSDVjgHy7tE6F56rrisXG7MEtDTgIEnjoxIvg566fYuwSHVdwLGo58BVhm1UUboOBp4mxB6NDmqROASm461z/arGjw7FU1Akgxvyq9Tli8D/AzCRmKKwDW5DHdh7bvpgRGVB4RdlnKNEUN3QTY8yUN9lUCm8zlPnX2Nkvx7FXeJSQ1AWVWOahsWoAyF7KvKXCFD81jXjlcCN9IBDFPkA9oLf4RBlNA/7BVCPmTW6r/314idbxF/3+UZhH20sqvddnSh8u6+/VND4Zsr7hxRwSLsMtettq2TT7bmFwbfMabSlfNfansf189kfDLR/btXaTZBp0FGZYIOu6B4L7No0WCfDDERjEpys0BJ4ASVVhNsHLDEeakmVip3cTV/2Ivj7Jp6hCIjCAcNSgEwN301CpZMST7gaUR+R28djgepZ2exBaBKWfHlaqsXMbI3VFRQspf2mct5iALXhY1Fa3aQUjFUWftSd5R2j51liD4rsp3Ib+QNVeQv7Ly0bhRCX/ZI1/DMNdxER0sFAJoEr6Zo3XBLDu/f/q22wZEVoQNXgqZ7RbB+r+/gKv5u8ycA2PCsaO7gp1/yz3ZaklM9i5adbQwba9CLKNalm5XgAWNyRmtqQlnU9RieA6GBrYScG1MkPG4neELEnopoIKXk9MTFOuhr/DHo1TyfRk/0uaCscIYV0A7QheNSWlsweNhsLPxL2gWhxpEPUJ2CPUiUWnXf7Nyd2eQExlqy7oV2KxSslFghuVzTHgRx/swvrbssdwP1Q0tt5OKmQr+aBjrZS73wcwVm5PznHis1gQKM4syMGbTlDe6ET1Urpg3M88W2upO3epVFRbfuaUS6wkStqWplKHJf1epEze/P4dFZYOjUu1ke6BOaK7Yln5GF2ETJQEfycYcbeKyVpuD1EZKZXegSEXU3GdjUSG68FIHgWd0TZ+AUkrcgU+bGWdkZpjwbuq8a33+0MxpX6QZQ+IPZqo/JPat6yk+32QZ3OEVZ38+NXAJsd9bx2grNEnAfV1RO/hZ3utj44XQIkpc6KcaOqhE2xflaCnxHsnlcNERhkhEw5kqXdDOV27Ap76+0c8UwBsoLZU4V6oZvuSveCg8aOB6GfSfpdhAkng2tMQ+JhFbkKnCyWHAt1OWcTTi4lpoZ8oGhT+AgXDe2Gj3YHbGNheDjDENJgKv9hCjsfvzwMn87DEALw17Oo9bKUd 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)(7416014)(376014)(52116014)(1800799024)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6piLFKMwjeVMviX3D2JRw4gxsdPhforeNncbm0ZVmrScVAhcxDsAg7Ujo5Dckvtk7RthnYYm0fURkicXfu67HE2cJS4vYyhw1o4AWfAJDGmAq//0tdCQSl3VxV+ikeoPI+7f4ulLgSaBfoH1yIbo7gBnD4BExrS0P/D6i9ifIDQSzh7kTBoQyEyxTnWeBo707i5Mq9xcAQJGGV/B6VHc6QkHIoCZJN6Q7mapD3QEzmSLCWo+qQyQ8Q1Tn364YH2qHWukv65pJSIcfFOoRLjjUsjcWM9v18W5AcPX3oXlITVaVXSpBkgVksslEN5oGfpXZaVKK/BzieERrmM4hUUP1p1GPbR3nLjbbijN/K3+DBp2/wtxUq4WvC7lcflmPjk3EwB92gYkFNC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8j8ieB6HMV4W1TganWZAu1fefUHnnvIHKk+ZkCFj8xMZqnQFyjHRGM2gvhtDW/sLf6D9hQz9nc4FDtoWduy4mEgRCYq/4pF/nymfZMdwbRFvHHnPDVlWRsFF3tvXb2VxV+ts4Fx67 X-OriginatorOrg: wesion.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22a53096-89d4-400e-a5ea-08dcbb70c485 X-MS-Exchange-CrossTenant-AuthSource: TYZPR03MB7001.apcprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 08:20:18.9881 (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: tT87yCNAtAJ4VAQP2NCYKdCna8Vqe79fxErPbih4lkuM4yuHy9snUK6Gd3xm/gcKZSzP9AUmiaYIWJWvZN8ulw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSQPR03MB8748 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 v10: - Use ret instead unused probe_attach_result in sdio.c - Link to v9: https://lore.kernel.org/all/20240810035141.439024-1-jacobe.zang@wesion.com/ 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 | 22 +++++--- .../broadcom/brcm80211/brcmfmac/usb.c | 3 + .../broadcom/brcm80211/include/brcm_hw_ids.h | 2 + 10 files changed, 132 insertions(+), 44 deletions(-)