From 7cdc4e2d1a2d34b48bde8e295bdb76717c6dcd56 Mon Sep 17 00:00:00 2001 From: breeze303 Date: Sun, 20 Oct 2024 09:12:31 +0800 Subject: [PATCH] Remove duplicate patches --- ...ware-qcom-scm-support-indicating-SDI.patch | 41 - ...river-for-qualcomm-ipq6018-pwm-block.patch | 601 --------- ...com-scm-document-IPQ5018-compa.patch.patch | 26 - ...pq5018-indicate-that-SDI-should-be-d.patch | 26 - ...added-for-necessary-clocks-and-reset.patch | 311 ----- ...-gcc_snoc_bus_timeout_ahb_clk-offset.patch | 44 - ...074-Fix-gcc_blsp1_ahb_clk-properties.patch | 41 - .../0600-1-qca-nss-ecm-support-CORE.patch | 875 ------------ ...-2-qca-nss-ecm-support-PPPOE-offload.patch | 600 --------- ...00-3-qca-nss-ecm-support-net-bonding.patch | 46 - ...pport-net-bonding-over-LAG-interface.patch | 685 ---------- .../0600-5-qca-nss-ecm-support-macvlan.patch | 96 -- ...nss-ecm-support-netfilter-DSCPREMARK.patch | 154 --- ...x-IPv6-user-route-change-event-calls.patch | 87 -- ...601-1-qca-add-nss-bridge-mgr-support.patch | 92 -- ...0602-1-qca-nss-drv-add-qdisc-support.patch | 25 - ...-1-qca-nss-clients-add-qdisc-support.patch | 463 ------- ...3-2-qca-nss-clients-add-l2tp-support.patch | 46 - ...3-3-qca-nss-clients-add-PPTP-support.patch | 478 ------- ...qca-nss-clients-add-iptunnel-support.patch | 77 -- ...-5-qca-nss-clients-add-vxlan-support.patch | 103 -- ...-clients-add-l2tp-offloading-support.patch | 368 ------ ...a-nss-clients-iptunnel-lock-this-cpu.patch | 22 - ...-qca-nss-clients-add-tls-mgr-support.patch | 24 - .../0604-1-qca-add-mcs-support.patch | 876 ------------- .../0605-1-qca-nss-cfi-support.patch | 127 -- ...idge-Fixes-for-Bridge-VLAN-Filtering.patch | 341 ----- ...-arm64-dts-qcom-ipq5018-add-watchdog.patch | 31 - ...are-qcom_scm-disable-SDI-if-required.patch | 83 -- ...-compatible-phy-init-sequence-for-IP.patch | 89 -- ...s-qcom-ipq5018-Add-USB-related-nodes.patch | 86 -- ...06-arm64-dts-qcom-ipq5018-Enable-USB.patch | 38 - ...qcom-ipq5018-add-QUP1-SPI-controller.patch | 56 - ...apss-ipq-pll-add-support-for-IPQ5018.patch | 62 - ...q-pll-use-stromer-ops-for-IPQ5018-to.patch | 90 -- ...q-pll-reuse-Stromer-reg-offsets-from.patch | 72 - ...arm64-dts-qcom-ipq5018-add-mdio-node.patch | 39 - ...1-arm64-dts-qcom-ipq8074-add-ramoops.patch | 16 - ...q-pll-move-Huayra-register-map-to-cl.patch | 82 -- ...m64-dts-qcom-ipq5018-add-ge_phy-node.patch | 23 - ...2-arm64-dts-qcom-ipq6018-add-ramoops.patch | 16 - ...q-pll-constify-match-data-structures.patch | 51 - ...q-pll-constify-clk_init_data-structu.patch | 39 - ...always-enable-SGMII-auto-negotiation.patch | 30 - ...pss-ipq-pll-fix-PLL-rate-for-IPQ5018.patch | 38 - ...m-ipq5018-enable-the-CPUFreq-support.patch | 96 -- ...pq5018-add-few-more-reserved-memory-.patch | 65 - ...-api-disallow-identical-driver-names.patch | 10 - ...0980-3-mtd-silence-UBI-NAND-warnings.patch | 13 - .../0981-1-qca-skb_recycler-support.patch | 431 ------ ...com-disable-swiotlb-for-64mb-savings.patch | 242 ---- ...ts-ipq5018-add-qpic_bam-nand-support.patch | 58 - ...ers-pinctrl-qcom-add-ipq6000-support.patch | 1116 ---------------- ...00-mtd-nand-add-ipq5018-nand-support.patch | 419 ------ ...01-mtd-nand-add-W25N01GWZEIG-support.patch | 21 - ...k-qcom-gcc-ipq5018-remove-q6-clocks-.patch | 59 - ...om-ipq5018-remove-q6-bring-up-clocks.patch | 471 ------- ..._scm-ipq5018-Add-WCSS-AHB-pd-support.patch | 164 --- ...-q6v5-Add-multipd-interrupts-support.patch | 129 -- ...Add-Hexagon-based-multipd-rproc-driv.patch | 1167 ----------------- ...9-01-add-serveal-support-for-ipq6018.patch | 154 --- .../patches-6.6/9999-add-nss-macsec.patch | 15 - 62 files changed, 12246 deletions(-) delete mode 100644 target/linux/qualcommax/patches-6.6/0063-v6.7-dt-bindings-firmware-qcom-scm-support-indicating-SDI.patch delete mode 100755 target/linux/qualcommax/patches-6.6/0064-pwm-driver-for-qualcomm-ipq6018-pwm-block.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0065-v6.7-dt-bindings-firmware-qcom-scm-document-IPQ5018-compa.patch.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0066-v6.7-arm64-dts-qcom-ipq5018-indicate-that-SDI-should-be-d.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0170-clk-qcom-ipq8074-Support-added-for-necessary-clocks-and-reset.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0171-1-clk-qcom-ipq8074-Fix-gcc_snoc_bus_timeout_ahb_clk-offset.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0171-2-clk-qcom-ipq8074-Fix-gcc_blsp1_ahb_clk-properties.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0600-1-qca-nss-ecm-support-CORE.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0600-2-qca-nss-ecm-support-PPPOE-offload.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0600-3-qca-nss-ecm-support-net-bonding.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0600-4-qca-nss-ecm-support-net-bonding-over-LAG-interface.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0600-5-qca-nss-ecm-support-macvlan.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0600-6-qca-nss-ecm-support-netfilter-DSCPREMARK.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0600-7-qca-nss-ecm-fix-IPv6-user-route-change-event-calls.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0601-1-qca-add-nss-bridge-mgr-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0602-1-qca-nss-drv-add-qdisc-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0603-1-qca-nss-clients-add-qdisc-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0603-2-qca-nss-clients-add-l2tp-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0603-3-qca-nss-clients-add-PPTP-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0603-4-qca-nss-clients-add-iptunnel-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0603-5-qca-nss-clients-add-vxlan-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0603-6-qca-nss-clients-add-l2tp-offloading-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0603-7-qca-nss-clients-iptunnel-lock-this-cpu.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0603-8-qca-nss-clients-add-tls-mgr-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0604-1-qca-add-mcs-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0605-1-qca-nss-cfi-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0606-1-qca-nss-ecm-bridge-Fixes-for-Bridge-VLAN-Filtering.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0901-arm64-dts-qcom-ipq5018-add-watchdog.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0902-firmware-qcom_scm-disable-SDI-if-required.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0904-phy-qcom-m31-Add-compatible-phy-init-sequence-for-IP.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0905-arm64-dts-qcom-ipq5018-Add-USB-related-nodes.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0906-arm64-dts-qcom-ipq5018-Enable-USB.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0907-arm64-dts-qcom-ipq5018-add-QUP1-SPI-controller.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0908-clk-qcom-apss-ipq-pll-add-support-for-IPQ5018.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0909-clk-qcom-apss-ipq-pll-use-stromer-ops-for-IPQ5018-to.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0910-clk-qcom-apss-ipq-pll-reuse-Stromer-reg-offsets-from.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0911-arm64-dts-qcom-ipq5018-add-mdio-node.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0911-arm64-dts-qcom-ipq8074-add-ramoops.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0911-clk-qcom-apss-ipq-pll-move-Huayra-register-map-to-cl.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0912-arm64-dts-qcom-ipq5018-add-ge_phy-node.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0912-arm64-dts-qcom-ipq6018-add-ramoops.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0912-clk-qcom-apss-ipq-pll-constify-match-data-structures.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0913-clk-qcom-apss-ipq-pll-constify-clk_init_data-structu.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0913-net-dsa-qca8k-always-enable-SGMII-auto-negotiation.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0914-clk-qcom-apss-ipq-pll-fix-PLL-rate-for-IPQ5018.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0915-arm64-dts-qcom-ipq5018-enable-the-CPUFreq-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0916-arm64-dts-qcom-ipq5018-add-few-more-reserved-memory-.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0980-2-Revert-crypto-api-disallow-identical-driver-names.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0980-3-mtd-silence-UBI-NAND-warnings.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0981-1-qca-skb_recycler-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/0982-1-arm64-dts-qcom-disable-swiotlb-for-64mb-savings.patch delete mode 100644 target/linux/qualcommax/patches-6.6/1903-arch-arm64-dts-ipq5018-add-qpic_bam-nand-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/2000-drivers-pinctrl-qcom-add-ipq6000-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/2000-mtd-nand-add-ipq5018-nand-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/2001-mtd-nand-add-W25N01GWZEIG-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/2002-dt-bindings-clock-qcom-gcc-ipq5018-remove-q6-clocks-.patch delete mode 100644 target/linux/qualcommax/patches-6.6/2003-clk-qcom-ipq5018-remove-q6-bring-up-clocks.patch delete mode 100644 target/linux/qualcommax/patches-6.6/2004-firmware-qcom_scm-ipq5018-Add-WCSS-AHB-pd-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/2005-remoteproc-qcom-q6v5-Add-multipd-interrupts-support.patch delete mode 100644 target/linux/qualcommax/patches-6.6/2006-remoteproc-qcom-Add-Hexagon-based-multipd-rproc-driv.patch delete mode 100644 target/linux/qualcommax/patches-6.6/9999-01-add-serveal-support-for-ipq6018.patch delete mode 100644 target/linux/qualcommax/patches-6.6/9999-add-nss-macsec.patch diff --git a/target/linux/qualcommax/patches-6.6/0063-v6.7-dt-bindings-firmware-qcom-scm-support-indicating-SDI.patch b/target/linux/qualcommax/patches-6.6/0063-v6.7-dt-bindings-firmware-qcom-scm-support-indicating-SDI.patch deleted file mode 100644 index 6c70233f944..00000000000 --- a/target/linux/qualcommax/patches-6.6/0063-v6.7-dt-bindings-firmware-qcom-scm-support-indicating-SDI.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 92dab9ea5f389c12828283146c60054642453a91 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 16 Aug 2023 18:45:38 +0200 -Subject: [PATCH 1/4] dt-bindings: firmware: qcom,scm: support indicating SDI - default state - -IPQ5018 has SDI (Secure Debug Image) enabled by TZ by default, and that -means that WDT being asserted or just trying to reboot will hang the board -in the debug mode and only pulling the power and repowering will help. -Some IPQ4019 boards like Google WiFI have it enabled as well. - -So, lets add a boolean property to indicate that SDI is enabled by default -and thus needs to be disabled by the kernel. - -Signed-off-by: Robert Marko -Acked-by: Mukesh Ojha -Reviewed-by: Krzysztof Kozlowski -Reviewed-by: Brian Norris -Link: https://lore.kernel.org/r/20230816164641.3371878-1-robimarko@gmail.com -Signed-off-by: Bjorn Andersson ---- - Documentation/devicetree/bindings/firmware/qcom,scm.yaml | 8 ++++++++ - 1 file changed, 8 insertions(+) - ---- a/Documentation/devicetree/bindings/firmware/qcom,scm.yaml -+++ b/Documentation/devicetree/bindings/firmware/qcom,scm.yaml -@@ -89,6 +89,14 @@ properties: - protocol to handle sleeping SCM calls. - maxItems: 1 - -+ qcom,sdi-enabled: -+ description: -+ Indicates that the SDI (Secure Debug Image) has been enabled by TZ -+ by default and it needs to be disabled. -+ If not disabled WDT assertion or reboot will cause the board to hang -+ in the debug mode. -+ type: boolean -+ - qcom,dload-mode: - $ref: /schemas/types.yaml#/definitions/phandle-array - items: diff --git a/target/linux/qualcommax/patches-6.6/0064-pwm-driver-for-qualcomm-ipq6018-pwm-block.patch b/target/linux/qualcommax/patches-6.6/0064-pwm-driver-for-qualcomm-ipq6018-pwm-block.patch deleted file mode 100755 index f9a1afc6b02..00000000000 --- a/target/linux/qualcommax/patches-6.6/0064-pwm-driver-for-qualcomm-ipq6018-pwm-block.patch +++ /dev/null @@ -1,601 +0,0 @@ -From patchwork Thu Oct 5 16:05:47 2023 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 8bit -X-Patchwork-Submitter: Devi Priya -X-Patchwork-Id: 13410404 -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 D89C1E92716 - for ; - Thu, 5 Oct 2023 16:21:19 +0000 (UTC) -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S242346AbjJEQUu (ORCPT - ); - Thu, 5 Oct 2023 12:20:50 -0400 -Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34274 "EHLO - lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S242441AbjJEQR7 (ORCPT - ); - Thu, 5 Oct 2023 12:17:59 -0400 -Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com - [205.220.168.131]) - by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 654563F020; - Thu, 5 Oct 2023 09:06:56 -0700 (PDT) -Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) - by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id - 395Aarqd017488; - Thu, 5 Oct 2023 16:06:23 GMT -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; - h=from : to : cc : - subject : date : message-id : in-reply-to : references : mime-version : - content-type : content-transfer-encoding; s=qcppdkim1; - bh=pL305QZpgz9DE4v+JRgsjWEqf1lM32BSKRkIofAZtYI=; - b=N/VkHpLPyHQX0FtgqwJTY18MM5NIRAxm/+ejcJgF+GzogJXQJVrX/JAaY+GrGMI/jBWB - fXAGI3rifkl9eKUkW2WiW2CM3NLpeKa1XcRfGYC3FvWNeVEKpAdNUnneWq5jII/7rjwr - LOEF9iGjSkqgE38uQGz0bcm+TCePCLBym1xS29C8u1B7Xx0M74w+Du98muz8yAqjQbLM - xbUkhQ5rGl34cLkYMUaT8Zuu4Je14xfsUL+dVCk2/TppUvaqZz3mzOdGiwKGz9AWdnJ2 - 1+/sxswdw/5WhuALaDoCncbTHD0BtxYj3SYmNtE0+NHQ4IJ6rpa04qfytuU3+2V8h0xw FQ== -Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com - [129.46.96.20]) - by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3th8e1u8ty-1 - (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 - verify=NOT); - Thu, 05 Oct 2023 16:06:22 +0000 -Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com - [10.47.209.196]) - by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id - 395G6Lmf025392 - (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 - verify=NOT); - Thu, 5 Oct 2023 16:06:21 GMT -Received: from hu-devipriy-blr.qualcomm.com (10.80.80.8) by - nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server - (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id - 15.2.1118.36; Thu, 5 Oct 2023 09:06:16 -0700 -From: Devi Priya -To: , , - , , , - , , - , , - , , - , , - , -CC: , , - -Subject: [PATCH V15 1/4] pwm: driver for qualcomm ipq6018 pwm block -Date: Thu, 5 Oct 2023 21:35:47 +0530 -Message-ID: <20231005160550.2423075-2-quic_devipriy@quicinc.com> -X-Mailer: git-send-email 2.34.1 -In-Reply-To: <20231005160550.2423075-1-quic_devipriy@quicinc.com> -References: <20231005160550.2423075-1-quic_devipriy@quicinc.com> -MIME-Version: 1.0 -X-Originating-IP: [10.80.80.8] -X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To - nalasex01a.na.qualcomm.com (10.47.209.196) -X-QCInternal: smtphost -X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 - signatures=585085 -X-Proofpoint-GUID: dUK910BXNf0cPwSxJTAoChM7COrWyzeE -X-Proofpoint-ORIG-GUID: dUK910BXNf0cPwSxJTAoChM7COrWyzeE -X-Proofpoint-Virus-Version: vendor=baseguard - engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 - definitions=2023-10-05_11,2023-10-05_01,2023-05-22_02 -X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 - phishscore=0 suspectscore=0 - adultscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 spamscore=0 - bulkscore=0 mlxlogscore=999 malwarescore=0 impostorscore=0 clxscore=1015 - classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 - definitions=main-2310050126 -Precedence: bulk -List-ID: -X-Mailing-List: linux-arm-msm@vger.kernel.org - -Driver for the PWM block in Qualcomm IPQ6018 line of SoCs. Based on -driver from downstream Codeaurora kernel tree. Removed support for older -(V1) variants because I have no access to that hardware. - -Tested on IPQ6010 based hardware. - -Co-developed-by: Baruch Siach -Signed-off-by: Baruch Siach -Signed-off-by: Devi Priya ---- -V15: - No change - -V14: - No change - -V13: - No change - -V12: - - Fix the below clang warning for overflow check reported by kernel test robot - drivers/pwm/pwm-ipq.c:122:11: warning: result of comparison of constant 16000000000 - with expression of type 'unsigned long' is always false [-Wtautological-constant-out-of-range-compare] ->> if (rate > 16ULL * GIGA) - -v11: - -Address comment from Uwe Kleine-König: - - Drop redundant registers field comments - - Fix period limit check in .apply - - Clarify the comment explaining skip of pre_div > pwm_div values - - Add explicit check for clock rate within limit - - Add comment explaining the selection of initial pre_div - - Use pwm_div division with remainder instead of separate diff calculation - - Round up duty_cycle calculation in .get_state - -v10: - - Restore round up in pwm_div calculation; otherwise diff is always <= - 0, so only bingo match works - - Don't overwrite min_diff on every loop iteration - -v9: - -Address comment from Uwe Kleine-König: - - Use period_ns*rate in dividers calculation for better accuracy - - Round down pre_div and pwm_div - - Add a comment explaining why pwm_div can't underflow - - Add a comment explaining why pre_div > pwm_div end the search loop - - Drop 'CFG_' from register macros - - Rename to_ipq_pwm_chip() to ipq_pwm_from_chip() - - Change bare 'unsigned' to 'unsigned int' - - Clarify the comment on separate REG1 write for enable/disable - Round up the period value in .get_state - - Use direct readl/writel so no need to check for regmap errors - -v7: - - Change 'offset' to 'reg' for the tcsr offset (Rob) - - Drop clock name; there is only one clock (Bjorn) - - Simplify probe failure code path (Bjorn) - -v6: - -Address Uwe Kleine-König review comments: - - Drop IPQ_PWM_MAX_DEVICES - - Rely on assigned-clock-rates; drop IPQ_PWM_CLK_SRC_FREQ - - Simplify register offset calculation - - Calculate duty cycle more precisely - - Refuse to set inverted polarity - - Drop redundant IPQ_PWM_REG1_ENABLE bit clear - - Remove x1000 factor in pwm_div calculation, use rate directly, and round up - - Choose initial pre_div such that pwm_div < IPQ_PWM_MAX_DIV - - Ensure pre_div <= pwm_div - - Rename close_ to best_ - - Explain in comment why effective_div doesn't overflow - - Limit pwm_div to IPQ_PWM_MAX_DIV - 1 to allow 100% duty cycle - - Disable clock only after pwmchip_remove() - - const pwm_ops - -Other changes: - - Add missing linux/bitfield.h header include (kernel test robot) - - Adjust code for PWM device node under TCSR (Rob Herring) - -v5: - - Use &tcsr_q6 syscon to access registers (Bjorn Andersson) - - Address Uwe Kleine-König review comments: - - Implement .get_state() - - Add IPQ_PWM_ prefix to local macros - - Use GENMASK/BIT/FIELD_PREP for register fields access - - Make type of config_div_and_duty() parameters consistent - - Derive IPQ_PWM_MIN_PERIOD_NS from IPQ_PWM_CLK_SRC_FREQ - - Integrate enable/disable into config_div_and_duty() to save register read, - and reduce frequency glitch on update - - Use min() instead of min_t() - - Fix comment format - - Use dev_err_probe() to indicate probe step failure - - Add missing clk_disable_unprepare() in .remove - - Don't set .owner - -v4: - - Use div64_u64() to fix link for 32-bit targets ((kernel test robot - , Uwe Kleine-König) - -v3: - - s/qcom,pwm-ipq6018/qcom,ipq6018-pwm/ (Rob Herring) - - Fix integer overflow on 32-bit targets (kernel test robot ) - -v2: - -Address Uwe Kleine-König review comments: - - Fix period calculation when out of range - - Don't set period larger than requested - - Remove PWM disable on configuration change - - Implement .apply instead of non-atomic .config/.enable/.disable - - Don't modify PWM on .request/.free - - Check pwm_div underflow - - Fix various code and comment formatting issues - -Other changes: - - Use u64 divisor safe division - - Remove now empty .request/.free - - drivers/pwm/Kconfig | 12 ++ - drivers/pwm/Makefile | 1 + - drivers/pwm/pwm-ipq.c | 282 ++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 295 insertions(+) - create mode 100644 drivers/pwm/pwm-ipq.c - ---- a/drivers/pwm/Kconfig -+++ b/drivers/pwm/Kconfig -@@ -282,6 +282,18 @@ config PWM_INTEL_LGM - To compile this driver as a module, choose M here: the module - will be called pwm-intel-lgm. - -+config PWM_IPQ -+ tristate "IPQ PWM support" -+ depends on ARCH_QCOM || COMPILE_TEST -+ depends on HAVE_CLK && HAS_IOMEM -+ help -+ Generic PWM framework driver for IPQ PWM block which supports -+ 4 pwm channels. Each of the these channels can be configured -+ independent of each other. -+ -+ To compile this driver as a module, choose M here: the module -+ will be called pwm-ipq. -+ - config PWM_IQS620A - tristate "Azoteq IQS620A PWM support" - depends on MFD_IQS62X || COMPILE_TEST ---- a/drivers/pwm/Makefile -+++ b/drivers/pwm/Makefile -@@ -24,6 +24,7 @@ obj-$(CONFIG_PWM_IMX1) += pwm-imx1.o - obj-$(CONFIG_PWM_IMX27) += pwm-imx27.o - obj-$(CONFIG_PWM_IMX_TPM) += pwm-imx-tpm.o - obj-$(CONFIG_PWM_INTEL_LGM) += pwm-intel-lgm.o -+obj-$(CONFIG_PWM_IPQ) += pwm-ipq.o - obj-$(CONFIG_PWM_IQS620A) += pwm-iqs620a.o - obj-$(CONFIG_PWM_JZ4740) += pwm-jz4740.o - obj-$(CONFIG_PWM_KEEMBAY) += pwm-keembay.o ---- /dev/null -+++ b/drivers/pwm/pwm-ipq.c -@@ -0,0 +1,282 @@ -+// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 -+/* -+ * Copyright (c) 2016-2017, 2020 The Linux Foundation. All rights reserved. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* The frequency range supported is 1 Hz to clock rate */ -+#define IPQ_PWM_MAX_PERIOD_NS ((u64)NSEC_PER_SEC) -+ -+/* -+ * The max value specified for each field is based on the number of bits -+ * in the pwm control register for that field -+ */ -+#define IPQ_PWM_MAX_DIV 0xFFFF -+ -+/* -+ * Two 32-bit registers for each PWM: REG0, and REG1. -+ * Base offset for PWM #i is at 8 * #i. -+ */ -+#define IPQ_PWM_REG0 0 -+#define IPQ_PWM_REG0_PWM_DIV GENMASK(15, 0) -+#define IPQ_PWM_REG0_HI_DURATION GENMASK(31, 16) -+ -+#define IPQ_PWM_REG1 4 -+#define IPQ_PWM_REG1_PRE_DIV GENMASK(15, 0) -+/* -+ * Enable bit is set to enable output toggling in pwm device. -+ * Update bit is set to reflect the changed divider and high duration -+ * values in register. -+ */ -+#define IPQ_PWM_REG1_UPDATE BIT(30) -+#define IPQ_PWM_REG1_ENABLE BIT(31) -+ -+struct ipq_pwm_chip { -+ struct pwm_chip chip; -+ struct clk *clk; -+ void __iomem *mem; -+}; -+ -+static struct ipq_pwm_chip *ipq_pwm_from_chip(struct pwm_chip *chip) -+{ -+ return container_of(chip, struct ipq_pwm_chip, chip); -+} -+ -+static unsigned int ipq_pwm_reg_read(struct pwm_device *pwm, unsigned int reg) -+{ -+ struct ipq_pwm_chip *ipq_chip = ipq_pwm_from_chip(pwm->chip); -+ unsigned int off = 8 * pwm->hwpwm + reg; -+ -+ return readl(ipq_chip->mem + off); -+} -+ -+static void ipq_pwm_reg_write(struct pwm_device *pwm, unsigned int reg, -+ unsigned int val) -+{ -+ struct ipq_pwm_chip *ipq_chip = ipq_pwm_from_chip(pwm->chip); -+ unsigned int off = 8 * pwm->hwpwm + reg; -+ -+ writel(val, ipq_chip->mem + off); -+} -+ -+static void config_div_and_duty(struct pwm_device *pwm, unsigned int pre_div, -+ unsigned int pwm_div, unsigned long rate, u64 duty_ns, -+ bool enable) -+{ -+ unsigned long hi_dur; -+ unsigned long val = 0; -+ -+ /* -+ * high duration = pwm duty * (pwm div + 1) -+ * pwm duty = duty_ns / period_ns -+ */ -+ hi_dur = div64_u64(duty_ns * rate, (pre_div + 1) * NSEC_PER_SEC); -+ -+ val = FIELD_PREP(IPQ_PWM_REG0_HI_DURATION, hi_dur) | -+ FIELD_PREP(IPQ_PWM_REG0_PWM_DIV, pwm_div); -+ ipq_pwm_reg_write(pwm, IPQ_PWM_REG0, val); -+ -+ val = FIELD_PREP(IPQ_PWM_REG1_PRE_DIV, pre_div); -+ ipq_pwm_reg_write(pwm, IPQ_PWM_REG1, val); -+ -+ /* PWM enable toggle needs a separate write to REG1 */ -+ val |= IPQ_PWM_REG1_UPDATE; -+ if (enable) -+ val |= IPQ_PWM_REG1_ENABLE; -+ ipq_pwm_reg_write(pwm, IPQ_PWM_REG1, val); -+} -+ -+static int ipq_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, -+ const struct pwm_state *state) -+{ -+ struct ipq_pwm_chip *ipq_chip = ipq_pwm_from_chip(chip); -+ unsigned int pre_div, pwm_div, best_pre_div, best_pwm_div; -+ unsigned long rate = clk_get_rate(ipq_chip->clk); -+ u64 period_ns, duty_ns, period_rate; -+ u64 min_diff; -+ -+ if (state->polarity != PWM_POLARITY_NORMAL) -+ return -EINVAL; -+ -+ if (state->period < DIV64_U64_ROUND_UP(NSEC_PER_SEC, rate)) -+ return -ERANGE; -+ -+ period_ns = min(state->period, IPQ_PWM_MAX_PERIOD_NS); -+ duty_ns = min(state->duty_cycle, period_ns); -+ -+ /* -+ * period_ns is 1G or less. As long as rate is less than 16 GHz, -+ * period_rate does not overflow. Make that explicit. -+ */ -+ if ((unsigned long long)rate > 16ULL * GIGA) -+ return -EINVAL; -+ period_rate = period_ns * rate; -+ best_pre_div = IPQ_PWM_MAX_DIV; -+ best_pwm_div = IPQ_PWM_MAX_DIV; -+ /* -+ * We don't need to consider pre_div values smaller than -+ * -+ * period_rate -+ * pre_div_min := ------------------------------------ -+ * NSEC_PER_SEC * (IPQ_PWM_MAX_DIV + 1) -+ * -+ * because pre_div = pre_div_min results in a better -+ * approximation. -+ */ -+ pre_div = div64_u64(period_rate, -+ (u64)NSEC_PER_SEC * (IPQ_PWM_MAX_DIV + 1)); -+ min_diff = period_rate; -+ -+ for (; pre_div <= IPQ_PWM_MAX_DIV; pre_div++) { -+ u64 remainder; -+ -+ pwm_div = div64_u64_rem(period_rate, -+ (u64)NSEC_PER_SEC * (pre_div + 1), &remainder); -+ /* pwm_div is unsigned; the check below catches underflow */ -+ pwm_div--; -+ -+ /* -+ * Swapping values for pre_div and pwm_div produces the same -+ * period length. So we can skip all settings with pre_div > -+ * pwm_div which results in bigger constraints for selecting -+ * the duty_cycle than with the two values swapped. -+ */ -+ if (pre_div > pwm_div) -+ break; -+ -+ /* -+ * Make sure we can do 100% duty cycle where -+ * hi_dur == pwm_div + 1 -+ */ -+ if (pwm_div > IPQ_PWM_MAX_DIV - 1) -+ continue; -+ -+ if (remainder < min_diff) { -+ best_pre_div = pre_div; -+ best_pwm_div = pwm_div; -+ min_diff = remainder; -+ -+ if (min_diff == 0) /* bingo */ -+ break; -+ } -+ } -+ -+ /* config divider values for the closest possible frequency */ -+ config_div_and_duty(pwm, best_pre_div, best_pwm_div, -+ rate, duty_ns, state->enabled); -+ -+ return 0; -+} -+ -+static int ipq_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, -+ struct pwm_state *state) -+{ -+ struct ipq_pwm_chip *ipq_chip = ipq_pwm_from_chip(chip); -+ unsigned long rate = clk_get_rate(ipq_chip->clk); -+ unsigned int pre_div, pwm_div, hi_dur; -+ u64 effective_div, hi_div; -+ u32 reg0, reg1; -+ -+ reg0 = ipq_pwm_reg_read(pwm, IPQ_PWM_REG0); -+ reg1 = ipq_pwm_reg_read(pwm, IPQ_PWM_REG1); -+ -+ state->polarity = PWM_POLARITY_NORMAL; -+ state->enabled = reg1 & IPQ_PWM_REG1_ENABLE; -+ -+ pwm_div = FIELD_GET(IPQ_PWM_REG0_PWM_DIV, reg0); -+ hi_dur = FIELD_GET(IPQ_PWM_REG0_HI_DURATION, reg0); -+ pre_div = FIELD_GET(IPQ_PWM_REG1_PRE_DIV, reg1); -+ -+ /* No overflow here, both pre_div and pwm_div <= 0xffff */ -+ effective_div = (u64)(pre_div + 1) * (pwm_div + 1); -+ state->period = DIV64_U64_ROUND_UP(effective_div * NSEC_PER_SEC, rate); -+ -+ hi_div = hi_dur * (pre_div + 1); -+ state->duty_cycle = DIV64_U64_ROUND_UP(hi_div * NSEC_PER_SEC, rate); -+ -+ return 0; -+} -+ -+static const struct pwm_ops ipq_pwm_ops = { -+ .apply = ipq_pwm_apply, -+ .get_state = ipq_pwm_get_state, -+ .owner = THIS_MODULE, -+}; -+ -+static int ipq_pwm_probe(struct platform_device *pdev) -+{ -+ struct ipq_pwm_chip *pwm; -+ struct device *dev = &pdev->dev; -+ int ret; -+ -+ pwm = devm_kzalloc(dev, sizeof(*pwm), GFP_KERNEL); -+ if (!pwm) -+ return -ENOMEM; -+ -+ platform_set_drvdata(pdev, pwm); -+ -+ pwm->mem = devm_platform_ioremap_resource(pdev, 0); -+ if (IS_ERR(pwm->mem)) -+ return dev_err_probe(dev, PTR_ERR(pwm->mem), -+ "regs map failed"); -+ -+ pwm->clk = devm_clk_get(dev, NULL); -+ if (IS_ERR(pwm->clk)) -+ return dev_err_probe(dev, PTR_ERR(pwm->clk), -+ "failed to get clock"); -+ -+ ret = clk_prepare_enable(pwm->clk); -+ if (ret) -+ return dev_err_probe(dev, ret, "clock enable failed"); -+ -+ pwm->chip.dev = dev; -+ pwm->chip.ops = &ipq_pwm_ops; -+ pwm->chip.npwm = 4; -+ -+ ret = pwmchip_add(&pwm->chip); -+ if (ret < 0) { -+ dev_err_probe(dev, ret, "pwmchip_add() failed\n"); -+ clk_disable_unprepare(pwm->clk); -+ } -+ -+ return ret; -+} -+ -+static int ipq_pwm_remove(struct platform_device *pdev) -+{ -+ struct ipq_pwm_chip *pwm = platform_get_drvdata(pdev); -+ -+ pwmchip_remove(&pwm->chip); -+ clk_disable_unprepare(pwm->clk); -+ -+ return 0; -+} -+ -+static const struct of_device_id pwm_ipq_dt_match[] = { -+ { .compatible = "qcom,ipq6018-pwm", }, -+ {} -+}; -+MODULE_DEVICE_TABLE(of, pwm_ipq_dt_match); -+ -+static struct platform_driver ipq_pwm_driver = { -+ .driver = { -+ .name = "ipq-pwm", -+ .of_match_table = pwm_ipq_dt_match, -+ }, -+ .probe = ipq_pwm_probe, -+ .remove = ipq_pwm_remove, -+}; -+ -+module_platform_driver(ipq_pwm_driver); -+ -+MODULE_LICENSE("Dual BSD/GPL"); diff --git a/target/linux/qualcommax/patches-6.6/0065-v6.7-dt-bindings-firmware-qcom-scm-document-IPQ5018-compa.patch.patch b/target/linux/qualcommax/patches-6.6/0065-v6.7-dt-bindings-firmware-qcom-scm-document-IPQ5018-compa.patch.patch deleted file mode 100644 index 0d6d52d09d1..00000000000 --- a/target/linux/qualcommax/patches-6.6/0065-v6.7-dt-bindings-firmware-qcom-scm-document-IPQ5018-compa.patch.patch +++ /dev/null @@ -1,26 +0,0 @@ -From f6aa7386bc40b552eea8ec1b1d2168afe3b31110 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 16 Aug 2023 18:45:40 +0200 -Subject: [PATCH 3/4] dt-bindings: firmware: qcom,scm: document IPQ5018 - compatible - -It seems that IPQ5018 compatible was never documented in the bindings. - -Signed-off-by: Robert Marko -Reviewed-by: Krzysztof Kozlowski -Link: https://lore.kernel.org/r/20230816164641.3371878-3-robimarko@gmail.com -Signed-off-by: Bjorn Andersson ---- - Documentation/devicetree/bindings/firmware/qcom,scm.yaml | 1 + - 1 file changed, 1 insertion(+) - ---- a/Documentation/devicetree/bindings/firmware/qcom,scm.yaml -+++ b/Documentation/devicetree/bindings/firmware/qcom,scm.yaml -@@ -24,6 +24,7 @@ properties: - - qcom,scm-apq8064 - - qcom,scm-apq8084 - - qcom,scm-ipq4019 -+ - qcom,scm-ipq5018 - - qcom,scm-ipq5332 - - qcom,scm-ipq6018 - - qcom,scm-ipq806x diff --git a/target/linux/qualcommax/patches-6.6/0066-v6.7-arm64-dts-qcom-ipq5018-indicate-that-SDI-should-be-d.patch b/target/linux/qualcommax/patches-6.6/0066-v6.7-arm64-dts-qcom-ipq5018-indicate-that-SDI-should-be-d.patch deleted file mode 100644 index 57267d74e95..00000000000 --- a/target/linux/qualcommax/patches-6.6/0066-v6.7-arm64-dts-qcom-ipq5018-indicate-that-SDI-should-be-d.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 79796e87215db9587d6c66ec6f6781e091bc6464 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 16 Aug 2023 18:45:41 +0200 -Subject: [PATCH 4/4] arm64: dts: qcom: ipq5018: indicate that SDI should be - disabled - -Now that SCM has support for indicating that SDI has been enabled by -default, lets set the property so SCM disables it during probing. - -Signed-off-by: Robert Marko -Link: https://lore.kernel.org/r/20230816164641.3371878-4-robimarko@gmail.com -Signed-off-by: Bjorn Andersson ---- - arch/arm64/boot/dts/qcom/ipq5018.dtsi | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi -@@ -57,6 +57,7 @@ - firmware { - scm { - compatible = "qcom,scm-ipq5018", "qcom,scm"; -+ qcom,sdi-enabled; - }; - }; - diff --git a/target/linux/qualcommax/patches-6.6/0170-clk-qcom-ipq8074-Support-added-for-necessary-clocks-and-reset.patch b/target/linux/qualcommax/patches-6.6/0170-clk-qcom-ipq8074-Support-added-for-necessary-clocks-and-reset.patch deleted file mode 100644 index 056fba00aa5..00000000000 --- a/target/linux/qualcommax/patches-6.6/0170-clk-qcom-ipq8074-Support-added-for-necessary-clocks-and-reset.patch +++ /dev/null @@ -1,311 +0,0 @@ -From 6504bc9edeb1a2a54d813f4bb5d0267e7bf827f9 Mon Sep 17 00:00:00 2001 -From: Praveenkumar I -Date: Thu, 6 Feb 2020 17:35:42 +0530 -Subject: [PATCH 4/8] clk: ipq8074: Support added for necessary clocks and - reset - -Change-Id: I21a76a44185f766e9b6dcba274392ea8e599718b -Signed-off-by: Praveenkumar I -Signed-off-by: Rajkumar Ayyasamy ---- - drivers/clk/qcom/gcc-ipq8074.c | 238 ++++++++++++++++++- - include/dt-bindings/clock/qcom,gcc-ipq8074.h | 35 ++- - 2 files changed, 258 insertions(+), 15 deletions(-) - ---- a/drivers/clk/qcom/gcc-ipq8074.c -+++ b/drivers/clk/qcom/gcc-ipq8074.c -@@ -48,6 +48,22 @@ enum { - P_UNIPHY2_TX, - }; - -+static const char * const gcc_xo_gpll4_gpll0_gpll6_gpll0_div2[] = { -+ "xo", -+ "gpll4", -+ "gpll0", -+ "gpll6", -+ "gpll0_out_main_div2", -+}; -+ -+static const struct parent_map gcc_xo_gpll4_gpll0_gpll6_gpll0_div2_map[] = { -+ { P_XO, 0 }, -+ { P_GPLL4, 1 }, -+ { P_GPLL0, 2 }, -+ { P_GPLL6, 3 }, -+ { P_GPLL0_DIV2, 4 }, -+}; -+ - static struct clk_alpha_pll gpll0_main = { - .offset = 0x21000, - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], -@@ -629,6 +645,12 @@ static const struct freq_tbl ftbl_pcie_a - { } - }; - -+struct freq_tbl ftbl_pcie_rchng_clk_src[] = { -+ F(19200000, P_XO, 1, 0, 0), -+ F(100000000, P_GPLL0, 8, 0, 0), -+ { } -+}; -+ - static struct clk_rcg2 pcie0_axi_clk_src = { - .cmd_rcgr = 0x75054, - .freq_tbl = ftbl_pcie_axi_clk_src, -@@ -2031,6 +2053,78 @@ static struct clk_rcg2 gp3_clk_src = { - }, - }; - -+struct freq_tbl ftbl_qdss_tsctr_clk_src[] = { -+ F(160000000, P_GPLL0_DIV2, 2.5, 0, 0), -+ F(320000000, P_GPLL0, 2.5, 0, 0), -+ F(600000000, P_GPLL6, 2, 0, 0), -+ { } -+}; -+ -+struct clk_rcg2 qdss_tsctr_clk_src = { -+ .cmd_rcgr = 0x29064, -+ .freq_tbl = ftbl_qdss_tsctr_clk_src, -+ .hid_width = 5, -+ .parent_map = gcc_xo_gpll4_gpll0_gpll6_gpll0_div2_map, -+ .clkr.hw.init = &(struct clk_init_data){ -+ .name = "qdss_tsctr_clk_src", -+ .parent_names = gcc_xo_gpll4_gpll0_gpll6_gpll0_div2, -+ .num_parents = 5, -+ .ops = &clk_rcg2_ops, -+ }, -+}; -+ -+static struct clk_fixed_factor qdss_dap_sync_clk_src = { -+ .mult = 1, -+ .div = 4, -+ .hw.init = &(struct clk_init_data){ -+ .name = "qdss_dap_sync_clk_src", -+ .parent_names = (const char *[]){ -+ "qdss_tsctr_clk_src" -+ }, -+ .num_parents = 1, -+ .ops = &clk_fixed_factor_ops, -+ }, -+}; -+ -+struct freq_tbl ftbl_qdss_at_clk_src[] = { -+ F(66670000, P_GPLL0_DIV2, 6, 0, 0), -+ F(240000000, P_GPLL6, 6, 0, 0), -+ { } -+}; -+ -+struct clk_rcg2 qdss_at_clk_src = { -+ .cmd_rcgr = 0x2900c, -+ .freq_tbl = ftbl_qdss_at_clk_src, -+ .hid_width = 5, -+ .parent_map = gcc_xo_gpll4_gpll0_gpll6_gpll0_div2_map, -+ .clkr.hw.init = &(struct clk_init_data){ -+ .name = "qdss_at_clk_src", -+ .parent_names = gcc_xo_gpll4_gpll0_gpll6_gpll0_div2, -+ .num_parents = 5, -+ .ops = &clk_rcg2_ops, -+ }, -+}; -+ -+ -+struct freq_tbl ftbl_adss_pwm_clk_src[] = { -+ F(19200000, P_XO, 1, 0, 0), -+ F(200000000, P_GPLL0, 4, 0, 0), -+ { } -+}; -+ -+struct clk_rcg2 adss_pwm_clk_src = { -+ .cmd_rcgr = 0x1c008, -+ .freq_tbl = ftbl_adss_pwm_clk_src, -+ .hid_width = 5, -+ .parent_map = gcc_xo_gpll0_map, -+ .clkr.hw.init = &(struct clk_init_data){ -+ .name = "adss_pwm_clk_src", -+ .parent_data = gcc_xo_gpll0, -+ .num_parents = 2, -+ .ops = &clk_rcg2_ops, -+ }, -+}; -+ - static struct clk_branch gcc_blsp1_ahb_clk = { - .halt_reg = 0x01008, - .clkr = { -@@ -4226,13 +4320,7 @@ static struct clk_branch gcc_gp3_clk = { - }, - }; - --static const struct freq_tbl ftbl_pcie_rchng_clk_src[] = { -- F(19200000, P_XO, 1, 0, 0), -- F(100000000, P_GPLL0, 8, 0, 0), -- { } --}; -- --static struct clk_rcg2 pcie0_rchng_clk_src = { -+struct clk_rcg2 pcie0_rchng_clk_src = { - .cmd_rcgr = 0x75070, - .freq_tbl = ftbl_pcie_rchng_clk_src, - .hid_width = 5, -@@ -4324,6 +4412,114 @@ static const struct alpha_pll_config nss - .alpha_en_mask = BIT(24), - }; - -+static struct clk_branch gcc_snoc_bus_timeout2_ahb_clk = { -+ .halt_reg = 0x4700c, -+ .halt_bit = 31, -+ .clkr = { -+ .enable_reg = 0x4700c, -+ .enable_mask = BIT(0), -+ .hw.init = &(struct clk_init_data){ -+ .name = "gcc_snoc_bus_timeout2_ahb_clk", -+ .parent_names = (const char *[]){ -+ "usb0_master_clk_src" -+ }, -+ .num_parents = 1, -+ .flags = CLK_SET_RATE_PARENT, -+ .ops = &clk_branch2_ops, -+ }, -+ }, -+}; -+ -+static struct clk_branch gcc_snoc_bus_timeout3_ahb_clk = { -+ .halt_reg = 0x47014, -+ .halt_bit = 31, -+ .clkr = { -+ .enable_reg = 0x47014, -+ .enable_mask = BIT(0), -+ .hw.init = &(struct clk_init_data){ -+ .name = "gcc_snoc_bus_timeout3_ahb_clk", -+ .parent_names = (const char *[]){ -+ "usb1_master_clk_src" -+ }, -+ .num_parents = 1, -+ .flags = CLK_SET_RATE_PARENT, -+ .ops = &clk_branch2_ops, -+ }, -+ }, -+}; -+ -+static struct clk_branch gcc_dcc_clk = { -+ .halt_reg = 0x77004, -+ .halt_bit = 31, -+ .clkr = { -+ .enable_reg = 0x77004, -+ .enable_mask = BIT(0), -+ .hw.init = &(struct clk_init_data){ -+ .name = "gcc_dcc_clk", -+ .parent_names = (const char *[]){ -+ "pcnoc_clk_src" -+ }, -+ .num_parents = 1, -+ .flags = CLK_SET_RATE_PARENT, -+ .ops = &clk_branch2_ops, -+ }, -+ }, -+}; -+ -+static struct clk_branch gcc_qdss_at_clk = { -+ .halt_reg = 0x29024, -+ .halt_bit = 31, -+ .clkr = { -+ .enable_reg = 0x29024, -+ .enable_mask = BIT(0), -+ .hw.init = &(struct clk_init_data){ -+ .name = "gcc_qdss_at_clk", -+ .parent_names = (const char *[]){ -+ "qdss_at_clk_src" -+ }, -+ .num_parents = 1, -+ .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, -+ .ops = &clk_branch2_ops, -+ }, -+ }, -+}; -+ -+static struct clk_branch gcc_qdss_dap_clk = { -+ .halt_reg = 0x29084, -+ .halt_bit = 31, -+ .clkr = { -+ .enable_reg = 0x29084, -+ .enable_mask = BIT(0), -+ .hw.init = &(struct clk_init_data){ -+ .name = "gcc_qdss_dap_clk", -+ .parent_names = (const char *[]){ -+ "qdss_dap_sync_clk_src" -+ }, -+ .num_parents = 1, -+ .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, -+ .ops = &clk_branch2_ops, -+ }, -+ }, -+}; -+ -+static struct clk_branch gcc_adss_pwm_clk = { -+ .halt_reg = 0x1c020, -+ .halt_bit = 31, -+ .clkr = { -+ .enable_reg = 0x1c020, -+ .enable_mask = BIT(0), -+ .hw.init = &(struct clk_init_data){ -+ .name = "gcc_adss_pwm_clk", -+ .parent_names = (const char *[]){ -+ "adss_pwm_clk_src" -+ }, -+ .num_parents = 1, -+ .flags = CLK_SET_RATE_PARENT, -+ .ops = &clk_branch2_ops, -+ }, -+ }, -+}; -+ - static struct clk_hw *gcc_ipq8074_hws[] = { - &gpll0_out_main_div2.hw, - &gpll6_out_main_div2.hw, -@@ -4332,6 +4528,7 @@ static struct clk_hw *gcc_ipq8074_hws[] - &gcc_xo_div4_clk_src.hw, - &nss_noc_clk_src.hw, - &nss_ppe_cdiv_clk_src.hw, -+ &qdss_dap_sync_clk_src.hw, - }; - - static struct clk_regmap *gcc_ipq8074_clks[] = { -@@ -4563,6 +4760,15 @@ static struct clk_regmap *gcc_ipq8074_cl - [GCC_PCIE0_RCHNG_CLK] = &gcc_pcie0_rchng_clk.clkr, - [GCC_PCIE0_AXI_S_BRIDGE_CLK] = &gcc_pcie0_axi_s_bridge_clk.clkr, - [GCC_CRYPTO_PPE_CLK] = &gcc_crypto_ppe_clk.clkr, -+ [GCC_SNOC_BUS_TIMEOUT2_AHB_CLK] = &gcc_snoc_bus_timeout2_ahb_clk.clkr, -+ [GCC_SNOC_BUS_TIMEOUT3_AHB_CLK] = &gcc_snoc_bus_timeout3_ahb_clk.clkr, -+ [GCC_DCC_CLK] = &gcc_dcc_clk.clkr, -+ [QDSS_TSCTR_CLK_SRC] = &qdss_tsctr_clk_src.clkr, -+ [QDSS_AT_CLK_SRC] = &qdss_at_clk_src.clkr, -+ [GCC_QDSS_AT_CLK] = &gcc_qdss_at_clk.clkr, -+ [GCC_QDSS_DAP_CLK] = &gcc_qdss_dap_clk.clkr, -+ [ADSS_PWM_CLK_SRC] = &adss_pwm_clk_src.clkr, -+ [GCC_ADSS_PWM_CLK] = &gcc_adss_pwm_clk.clkr, - }; - - static const struct qcom_reset_map gcc_ipq8074_resets[] = { ---- a/include/dt-bindings/clock/qcom,gcc-ipq8074.h -+++ b/include/dt-bindings/clock/qcom,gcc-ipq8074.h -@@ -230,10 +230,19 @@ - #define GCC_GP1_CLK 221 - #define GCC_GP2_CLK 222 - #define GCC_GP3_CLK 223 --#define GCC_PCIE0_AXI_S_BRIDGE_CLK 224 --#define GCC_PCIE0_RCHNG_CLK_SRC 225 --#define GCC_PCIE0_RCHNG_CLK 226 --#define GCC_CRYPTO_PPE_CLK 227 -+#define GCC_CRYPTO_PPE_CLK 224 -+#define GCC_PCIE0_RCHNG_CLK_SRC 225 -+#define GCC_PCIE0_RCHNG_CLK 226 -+#define GCC_PCIE0_AXI_S_BRIDGE_CLK 227 -+#define GCC_SNOC_BUS_TIMEOUT2_AHB_CLK 228 -+#define GCC_SNOC_BUS_TIMEOUT3_AHB_CLK 229 -+#define GCC_DCC_CLK 230 -+#define ADSS_PWM_CLK_SRC 231 -+#define GCC_ADSS_PWM_CLK 232 -+#define QDSS_TSCTR_CLK_SRC 233 -+#define QDSS_AT_CLK_SRC 234 -+#define GCC_QDSS_AT_CLK 235 -+#define GCC_QDSS_DAP_CLK 236 - - #define GCC_BLSP1_BCR 0 - #define GCC_BLSP1_QUP1_BCR 1 diff --git a/target/linux/qualcommax/patches-6.6/0171-1-clk-qcom-ipq8074-Fix-gcc_snoc_bus_timeout_ahb_clk-offset.patch b/target/linux/qualcommax/patches-6.6/0171-1-clk-qcom-ipq8074-Fix-gcc_snoc_bus_timeout_ahb_clk-offset.patch deleted file mode 100644 index 96577d0eda0..00000000000 --- a/target/linux/qualcommax/patches-6.6/0171-1-clk-qcom-ipq8074-Fix-gcc_snoc_bus_timeout_ahb_clk-offset.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 462aa0c53397ec5bf78e3e7f68aa8a3ca300f4ba Mon Sep 17 00:00:00 2001 -From: Selvam Sathappan Periakaruppan -Date: Tue, 24 Mar 2020 19:09:38 +0530 -Subject: [PATCH 5/8] clk: qcom: ipq8074: Fix gcc_snoc_bus_timeout_ahb_clk - offset - -By default, the ipq8074 V2 clks are provided in the gcc driver. -Updating the gcc_snoc_bus_timeout_ahb_clk offsets also as needed -in ipq8074 V2. - -Change-Id: I5a6e98d002f5c3354a804e55dd9ebb1f83f7f974 -Signed-off-by: Selvam Sathappan Periakaruppan ---- - drivers/clk/qcom/gcc-ipq8074.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - ---- a/drivers/clk/qcom/gcc-ipq8074.c -+++ b/drivers/clk/qcom/gcc-ipq8074.c -@@ -4413,10 +4413,10 @@ static const struct alpha_pll_config nss - }; - - static struct clk_branch gcc_snoc_bus_timeout2_ahb_clk = { -- .halt_reg = 0x4700c, -+ .halt_reg = 0x47014, - .halt_bit = 31, - .clkr = { -- .enable_reg = 0x4700c, -+ .enable_reg = 0x47014, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_snoc_bus_timeout2_ahb_clk", -@@ -4431,10 +4431,10 @@ static struct clk_branch gcc_snoc_bus_ti - }; - - static struct clk_branch gcc_snoc_bus_timeout3_ahb_clk = { -- .halt_reg = 0x47014, -+ .halt_reg = 0x4701C, - .halt_bit = 31, - .clkr = { -- .enable_reg = 0x47014, -+ .enable_reg = 0x4701C, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_snoc_bus_timeout3_ahb_clk", diff --git a/target/linux/qualcommax/patches-6.6/0171-2-clk-qcom-ipq8074-Fix-gcc_blsp1_ahb_clk-properties.patch b/target/linux/qualcommax/patches-6.6/0171-2-clk-qcom-ipq8074-Fix-gcc_blsp1_ahb_clk-properties.patch deleted file mode 100644 index 6e4adf685b2..00000000000 --- a/target/linux/qualcommax/patches-6.6/0171-2-clk-qcom-ipq8074-Fix-gcc_blsp1_ahb_clk-properties.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 52315bec6ed633b6a71f28b746029602f8bd70b9 Mon Sep 17 00:00:00 2001 -From: Balaji Prakash J -Date: Wed, 22 Apr 2020 20:35:30 +0530 -Subject: [PATCH] clk: ipq8074: fix gcc_blsp1_ahb_clk properties - -All the voting enabled clocks does not support the enable -from CBCR register. So, updated gcc_blsp1_ahb_clk enable -register and mask to enable bit in APCS_CLOCK_BRANCH_ENA_VOTE. - -Also, the voting controlled clocks are shared among multiple -components like APSS, RPM, NSS, TZ, etc. So, turning the -voting off from APSS does not make the clock off if it has -been voted from another component. Added the flag -BRANCH_HALT_VOTED in order to skip checking the clock -disable status. - -This change is referred from the below commits, -1. 246b4fb3af9bd65d8af794aac2f0e7b1ed9cc2dd -2. c8374157d5ae91d3b3e0d513d62808a798b32d3a - -Signed-off-by: Balaji Prakash J -Change-Id: I505cb560b31ad27a02c165fbe13bb33a2fc7d230 ---- - drivers/clk/qcom/gcc-ipq8074.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - ---- a/drivers/clk/qcom/gcc-ipq8074.c -+++ b/drivers/clk/qcom/gcc-ipq8074.c -@@ -2127,9 +2127,10 @@ struct clk_rcg2 adss_pwm_clk_src = { - - static struct clk_branch gcc_blsp1_ahb_clk = { - .halt_reg = 0x01008, -+ .halt_check = BRANCH_HALT_VOTED, - .clkr = { -- .enable_reg = 0x01008, -- .enable_mask = BIT(0), -+ .enable_reg = 0x0b004, -+ .enable_mask = BIT(10), - .hw.init = &(struct clk_init_data){ - .name = "gcc_blsp1_ahb_clk", - .parent_hws = (const struct clk_hw *[]){ diff --git a/target/linux/qualcommax/patches-6.6/0600-1-qca-nss-ecm-support-CORE.patch b/target/linux/qualcommax/patches-6.6/0600-1-qca-nss-ecm-support-CORE.patch deleted file mode 100644 index 72acefc8441..00000000000 --- a/target/linux/qualcommax/patches-6.6/0600-1-qca-nss-ecm-support-CORE.patch +++ /dev/null @@ -1,875 +0,0 @@ ---- a/include/linux/if_bridge.h -+++ b/include/linux/if_bridge.h -@@ -71,6 +71,9 @@ void brioctl_set(int (*hook)(struct net - void __user *uarg)); - int br_ioctl_call(struct net *net, struct net_bridge *br, unsigned int cmd, - struct ifreq *ifr, void __user *uarg); -+extern void br_dev_update_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *nlstats); -+extern bool br_is_hairpin_enabled(struct net_device *dev); - - #if IS_ENABLED(CONFIG_BRIDGE) && IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING) - int br_multicast_list_adjacent(struct net_device *dev, -@@ -213,4 +216,42 @@ static inline clock_t br_get_ageing_time - } - #endif - -+/* QCA NSS ECM support - Start */ -+extern struct net_device *br_port_dev_get(struct net_device *dev, -+ unsigned char *addr, -+ struct sk_buff *skb, -+ unsigned int cookie); -+extern void br_refresh_fdb_entry(struct net_device *dev, const char *addr); -+extern void br_fdb_entry_refresh(struct net_device *dev, const char *addr, __u16 vid); -+extern struct net_bridge_fdb_entry *br_fdb_has_entry(struct net_device *dev, -+ const char *addr, -+ __u16 vid); -+extern void br_fdb_update_register_notify(struct notifier_block *nb); -+extern void br_fdb_update_unregister_notify(struct notifier_block *nb); -+ -+typedef struct net_bridge_port *br_port_dev_get_hook_t(struct net_device *dev, -+ struct sk_buff *skb, -+ unsigned char *addr, -+ unsigned int cookie); -+extern br_port_dev_get_hook_t __rcu *br_port_dev_get_hook; -+ -+#define BR_FDB_EVENT_ADD 0x01 -+#define BR_FDB_EVENT_DEL 0x02 -+ -+struct br_fdb_event { -+ struct net_device *dev; -+ unsigned char addr[6]; -+ unsigned char is_local; -+ struct net_bridge *br; -+ struct net_device *orig_dev; -+}; -+extern void br_fdb_register_notify(struct notifier_block *nb); -+extern void br_fdb_unregister_notify(struct notifier_block *nb); -+ -+typedef struct net_bridge_port *br_get_dst_hook_t( -+ const struct net_bridge_port *src, -+ struct sk_buff **skb); -+extern br_get_dst_hook_t __rcu *br_get_dst_hook; -+/* QCA NSS ECM support - End */ -+ - #endif ---- a/include/linux/if_vlan.h -+++ b/include/linux/if_vlan.h -@@ -143,7 +143,10 @@ extern struct net_device *__vlan_find_de - extern int vlan_for_each(struct net_device *dev, - int (*action)(struct net_device *dev, int vid, - void *arg), void *arg); -+extern void __vlan_dev_update_accel_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *stats); /* QCA NSS ECM support */ - extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); -+extern struct net_device *vlan_dev_next_dev(const struct net_device *dev); /* QCA NSS ECM support */ - extern u16 vlan_dev_vlan_id(const struct net_device *dev); - extern __be16 vlan_dev_vlan_proto(const struct net_device *dev); - -@@ -236,6 +239,12 @@ extern void vlan_vids_del_by_dev(struct - extern bool vlan_uses_dev(const struct net_device *dev); - - #else -+static inline void __vlan_dev_update_accel_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) -+{ -+ -+} /* QCA NSS ECM support */ -+ - static inline struct net_device * - __vlan_find_dev_deep_rcu(struct net_device *real_dev, - __be16 vlan_proto, u16 vlan_id) ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -2933,6 +2933,10 @@ enum netdev_cmd { - NETDEV_OFFLOAD_XSTATS_REPORT_USED, - NETDEV_OFFLOAD_XSTATS_REPORT_DELTA, - NETDEV_XDP_FEAT_CHANGE, -+ /* QCA NSS ECM Support - Start */ -+ NETDEV_BR_JOIN, -+ NETDEV_BR_LEAVE, -+ /* QCA NSS ECM Support - End */ - }; - const char *netdev_cmd_to_name(enum netdev_cmd cmd); - ---- a/include/net/ip6_route.h -+++ b/include/net/ip6_route.h -@@ -215,6 +215,11 @@ void rt6_multipath_rebalance(struct fib6 - void rt6_uncached_list_add(struct rt6_info *rt); - void rt6_uncached_list_del(struct rt6_info *rt); - -+/* QCA NSS ECM support - Start */ -+int rt6_register_notifier(struct notifier_block *nb); -+int rt6_unregister_notifier(struct notifier_block *nb); -+/* QCA NSS ECM support - End */ -+ - static inline const struct rt6_info *skb_rt6_info(const struct sk_buff *skb) - { - const struct dst_entry *dst = skb_dst(skb); ---- a/include/net/neighbour.h -+++ b/include/net/neighbour.h -@@ -249,6 +249,13 @@ static inline int neigh_parms_family(str - return p->tbl->family; - } - -+/* QCA NSS ECM support - Start */ -+struct neigh_mac_update { -+ unsigned char old_mac[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))]; -+ unsigned char update_mac[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))]; -+}; -+/* QCA NSS ECM support - End */ -+ - #define NEIGH_PRIV_ALIGN sizeof(long long) - #define NEIGH_ENTRY_SIZE(size) ALIGN((size), NEIGH_PRIV_ALIGN) - -@@ -395,6 +402,11 @@ void __neigh_for_each_release(struct nei - int (*cb)(struct neighbour *)); - int neigh_xmit(int fam, struct net_device *, const void *, struct sk_buff *); - -+/* QCA NSS ECM support - Start */ -+extern void neigh_mac_update_register_notify(struct notifier_block *nb); -+extern void neigh_mac_update_unregister_notify(struct notifier_block *nb); -+/* QCA NSS ECM support - End */ -+ - struct neigh_seq_state { - struct seq_net_private p; - struct neigh_table *tbl; -@@ -600,4 +612,5 @@ static inline void neigh_update_is_route - *notify = 1; - } - } -+ - #endif ---- a/include/net/route.h -+++ b/include/net/route.h -@@ -237,6 +237,11 @@ struct rtable *rt_dst_alloc(struct net_d - unsigned int flags, u16 type, bool noxfrm); - struct rtable *rt_dst_clone(struct net_device *dev, struct rtable *rt); - -+/* QCA NSS ECM support - Start */ -+int ip_rt_register_notifier(struct notifier_block *nb); -+int ip_rt_unregister_notifier(struct notifier_block *nb); -+/* QCA NSS ECM support - End */ -+ - struct in_ifaddr; - void fib_add_ifaddr(struct in_ifaddr *); - void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *); ---- a/net/bridge/br_private.h -+++ b/net/bridge/br_private.h -@@ -2267,4 +2267,6 @@ void br_do_suppress_nd(struct sk_buff *s - u16 vid, struct net_bridge_port *p, struct nd_msg *msg); - struct nd_msg *br_is_nd_neigh_msg(struct sk_buff *skb, struct nd_msg *m); - bool br_is_neigh_suppress_enabled(const struct net_bridge_port *p, u16 vid); -+#define __br_get(__hook, __default, __args ...) \ -+ (__hook ? (__hook(__args)) : (__default)) /* QCA NSS ECM support */ - #endif ---- a/net/8021q/vlan_core.c -+++ b/net/8021q/vlan_core.c -@@ -72,6 +72,28 @@ bool vlan_do_receive(struct sk_buff **sk - return true; - } - -+/* QCA NSS ECM support - Start */ -+/* Update the VLAN device with statistics from network offload engines */ -+void __vlan_dev_update_accel_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *nlstats) -+{ -+ struct vlan_pcpu_stats *stats; -+ -+ if (!is_vlan_dev(dev)) -+ return; -+ -+ stats = per_cpu_ptr(vlan_dev_priv(dev)->vlan_pcpu_stats, 0); -+ -+ u64_stats_update_begin(&stats->syncp); -+ u64_stats_add(&stats->rx_packets, nlstats->rx_packets); -+ u64_stats_add(&stats->rx_bytes, nlstats->rx_bytes); -+ u64_stats_add(&stats->tx_packets, nlstats->tx_packets); -+ u64_stats_add(&stats->tx_bytes, nlstats->tx_bytes); -+ u64_stats_update_end(&stats->syncp); -+} -+EXPORT_SYMBOL(__vlan_dev_update_accel_stats); -+/* QCA NSS ECM support - End */ -+ - /* Must be invoked with rcu_read_lock. */ - struct net_device *__vlan_find_dev_deep_rcu(struct net_device *dev, - __be16 vlan_proto, u16 vlan_id) -@@ -110,6 +132,15 @@ struct net_device *vlan_dev_real_dev(con - } - EXPORT_SYMBOL(vlan_dev_real_dev); - -+/* QCA NSS ECM support - Start */ -+/* Caller is responsible to hold the reference of the returned device */ -+struct net_device *vlan_dev_next_dev(const struct net_device *dev) -+{ -+ return vlan_dev_priv(dev)->real_dev; -+} -+EXPORT_SYMBOL(vlan_dev_next_dev); -+/* QCA NSS ECM support - End */ -+ - u16 vlan_dev_vlan_id(const struct net_device *dev) - { - return vlan_dev_priv(dev)->vlan_id; ---- a/net/bridge/br_fdb.c -+++ b/net/bridge/br_fdb.c -@@ -33,6 +33,20 @@ static const struct rhashtable_params br - - static struct kmem_cache *br_fdb_cache __read_mostly; - -+ATOMIC_NOTIFIER_HEAD(br_fdb_notifier_list); -+ -+void br_fdb_register_notify(struct notifier_block *nb) -+{ -+ atomic_notifier_chain_register(&br_fdb_notifier_list, nb); -+} -+EXPORT_SYMBOL_GPL(br_fdb_register_notify); -+ -+void br_fdb_unregister_notify(struct notifier_block *nb) -+{ -+ atomic_notifier_chain_unregister(&br_fdb_notifier_list, nb); -+} -+EXPORT_SYMBOL_GPL(br_fdb_unregister_notify); -+ - int __init br_fdb_init(void) - { - br_fdb_cache = kmem_cache_create("bridge_fdb_cache", -@@ -195,6 +209,25 @@ static void fdb_notify(struct net_bridge - if (swdev_notify) - br_switchdev_fdb_notify(br, fdb, type); - -+ /* QCA NSS ECM support - Start */ -+ if (fdb->dst) { -+ int event; -+ struct br_fdb_event fdb_event; -+ -+ if (type == RTM_NEWNEIGH) -+ event = BR_FDB_EVENT_ADD; -+ else -+ event = BR_FDB_EVENT_DEL; -+ -+ fdb_event.dev = fdb->dst->dev; -+ ether_addr_copy(fdb_event.addr, fdb->key.addr.addr); -+ fdb_event.is_local = test_bit(BR_FDB_LOCAL, &fdb->flags); -+ atomic_notifier_call_chain(&br_fdb_notifier_list, -+ event, -+ (void *)&fdb_event); -+ } -+ /* QCA NSS ECM support - End */ -+ - skb = nlmsg_new(fdb_nlmsg_size(), GFP_ATOMIC); - if (skb == NULL) - goto errout; -@@ -519,6 +552,22 @@ out: - spin_unlock_bh(&br->hash_lock); - } - -+/* QCA NSS ECM support - Start */ -+ATOMIC_NOTIFIER_HEAD(br_fdb_update_notifier_list); -+ -+void br_fdb_update_register_notify(struct notifier_block *nb) -+{ -+ atomic_notifier_chain_register(&br_fdb_update_notifier_list, nb); -+} -+EXPORT_SYMBOL_GPL(br_fdb_update_register_notify); -+ -+void br_fdb_update_unregister_notify(struct notifier_block *nb) -+{ -+ atomic_notifier_chain_unregister(&br_fdb_update_notifier_list, nb); -+} -+EXPORT_SYMBOL_GPL(br_fdb_update_unregister_notify); -+/* QCA NSS ECM support - End */ -+ - void br_fdb_cleanup(struct work_struct *work) - { - struct net_bridge *br = container_of(work, struct net_bridge, -@@ -527,6 +576,7 @@ void br_fdb_cleanup(struct work_struct * - unsigned long delay = hold_time(br); - unsigned long work_delay = delay; - unsigned long now = jiffies; -+ u8 mac_addr[6]; /* QCA NSS ECM support */ - - /* this part is tricky, in order to avoid blocking learning and - * consequently forwarding, we rely on rcu to delete objects with -@@ -553,8 +603,15 @@ void br_fdb_cleanup(struct work_struct * - work_delay = min(work_delay, this_timer - now); - } else { - spin_lock_bh(&br->hash_lock); -- if (!hlist_unhashed(&f->fdb_node)) -+ if (!hlist_unhashed(&f->fdb_node)) { -+ ether_addr_copy(mac_addr, f->key.addr.addr); - fdb_delete(br, f, true); -+ /* QCA NSS ECM support - Start */ -+ atomic_notifier_call_chain( -+ &br_fdb_update_notifier_list, 0, -+ (void *)mac_addr); -+ /* QCA NSS ECM support - End */ -+ } - spin_unlock_bh(&br->hash_lock); - } - } -@@ -891,6 +948,12 @@ void br_fdb_update(struct net_bridge *br - */ - if (unlikely(test_bit(BR_FDB_LOCKED, &fdb->flags))) - clear_bit(BR_FDB_LOCKED, &fdb->flags); -+ -+ /* QCA NSS ECM support - Start */ -+ atomic_notifier_call_chain( -+ &br_fdb_update_notifier_list, -+ 0, (void *)addr); -+ /* QCA NSS ECM support - End */ - } - - if (unlikely(test_bit(BR_FDB_ADDED_BY_USER, &flags))) -@@ -914,6 +977,64 @@ void br_fdb_update(struct net_bridge *br - } - } - -+/* QCA NSS ECM support - Start */ -+/* Refresh FDB entries for bridge packets being forwarded by offload engines */ -+void br_refresh_fdb_entry(struct net_device *dev, const char *addr) -+{ -+ struct net_bridge_port *p = br_port_get_rcu(dev); -+ -+ if (!p || p->state == BR_STATE_DISABLED) -+ return; -+ -+ if (!is_valid_ether_addr(addr)) { -+ pr_info("bridge: Attempt to refresh with invalid ether address %pM\n", -+ addr); -+ return; -+ } -+ -+ rcu_read_lock(); -+ br_fdb_update(p->br, p, addr, 0, true); -+ rcu_read_unlock(); -+} -+EXPORT_SYMBOL_GPL(br_refresh_fdb_entry); -+ -+/* Update timestamp of FDB entries for bridge packets being forwarded by offload engines */ -+void br_fdb_entry_refresh(struct net_device *dev, const char *addr, __u16 vid) -+{ -+ struct net_bridge_fdb_entry *fdb; -+ struct net_bridge_port *p = br_port_get_rcu(dev); -+ -+ if (!p || p->state == BR_STATE_DISABLED) -+ return; -+ -+ rcu_read_lock(); -+ fdb = fdb_find_rcu(&p->br->fdb_hash_tbl, addr, vid); -+ if (likely(fdb)) { -+ fdb->updated = jiffies; -+ } -+ rcu_read_unlock(); -+} -+EXPORT_SYMBOL_GPL(br_fdb_entry_refresh); -+ -+/* Look up the MAC address in the device's bridge fdb table */ -+struct net_bridge_fdb_entry *br_fdb_has_entry(struct net_device *dev, -+ const char *addr, __u16 vid) -+{ -+ struct net_bridge_port *p = br_port_get_rcu(dev); -+ struct net_bridge_fdb_entry *fdb; -+ -+ if (!p || p->state == BR_STATE_DISABLED) -+ return NULL; -+ -+ rcu_read_lock(); -+ fdb = fdb_find_rcu(&p->br->fdb_hash_tbl, addr, vid); -+ rcu_read_unlock(); -+ -+ return fdb; -+} -+EXPORT_SYMBOL_GPL(br_fdb_has_entry); -+ -+/* QCA NSS ECM support - End */ - /* Dump information about entries, in response to GETNEIGH */ - int br_fdb_dump(struct sk_buff *skb, - struct netlink_callback *cb, ---- a/net/bridge/br_if.c -+++ b/net/bridge/br_if.c -@@ -26,6 +26,12 @@ - - #include "br_private.h" - -+/* QCA NSS ECM support - Start */ -+/* Hook for external forwarding logic */ -+br_port_dev_get_hook_t __rcu *br_port_dev_get_hook __read_mostly; -+EXPORT_SYMBOL_GPL(br_port_dev_get_hook); -+/* QCA NSS ECM support - End */ -+ - /* - * Determine initial path cost based on speed. - * using recommendations from 802.1d standard -@@ -697,6 +703,8 @@ int br_add_if(struct net_bridge *br, str - - kobject_uevent(&p->kobj, KOBJ_ADD); - -+ call_netdevice_notifiers(NETDEV_BR_JOIN, dev); /* QCA NSS ECM support */ -+ - return 0; - - err6: -@@ -732,6 +740,8 @@ int br_del_if(struct net_bridge *br, str - if (!p || p->br != br) - return -EINVAL; - -+ call_netdevice_notifiers(NETDEV_BR_LEAVE, dev); /* QCA NSS ECM support */ -+ - /* Since more than one interface can be attached to a bridge, - * there still maybe an alternate path for netconsole to use; - * therefore there is no reason for a NETDEV_RELEASE event. -@@ -775,3 +785,97 @@ bool br_port_flag_is_set(const struct ne - return p->flags & flag; - } - EXPORT_SYMBOL_GPL(br_port_flag_is_set); -+ -+/* br_port_dev_get() -+ * If a skb is provided, and the br_port_dev_get_hook_t hook exists, -+ * use that to try and determine the egress port for that skb. -+ * If not, or no egress port could be determined, use the given addr -+ * to identify the port to which it is reachable, -+ * returing a reference to the net device associated with that port. -+ * -+ * NOTE: Return NULL if given dev is not a bridge or the mac has no -+ * associated port. -+ */ -+struct net_device *br_port_dev_get(struct net_device *dev, unsigned char *addr, -+ struct sk_buff *skb, -+ unsigned int cookie) -+{ -+ struct net_bridge_fdb_entry *fdbe; -+ struct net_bridge *br; -+ struct net_device *netdev = NULL; -+ -+ /* Is this a bridge? */ -+ if (!(dev->priv_flags & IFF_EBRIDGE)) -+ return NULL; -+ -+ rcu_read_lock(); -+ -+ /* If the hook exists and the skb isn't NULL, try and get the port */ -+ if (skb) { -+ br_port_dev_get_hook_t *port_dev_get_hook; -+ -+ port_dev_get_hook = rcu_dereference(br_port_dev_get_hook); -+ if (port_dev_get_hook) { -+ struct net_bridge_port *pdst = -+ __br_get(port_dev_get_hook, NULL, dev, skb, -+ addr, cookie); -+ if (pdst) { -+ dev_hold(pdst->dev); -+ netdev = pdst->dev; -+ goto out; -+ } -+ } -+ } -+ -+ /* Either there is no hook, or can't -+ * determine the port to use - fall back to using FDB -+ */ -+ -+ br = netdev_priv(dev); -+ -+ /* Lookup the fdb entry and get reference to the port dev */ -+ fdbe = br_fdb_find_rcu(br, addr, 0); -+ if (fdbe && fdbe->dst) { -+ netdev = fdbe->dst->dev; /* port device */ -+ dev_hold(netdev); -+ } -+out: -+ rcu_read_unlock(); -+ return netdev; -+} -+EXPORT_SYMBOL_GPL(br_port_dev_get); -+ -+/* Update bridge statistics for bridge packets processed by offload engines */ -+void br_dev_update_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *nlstats) -+{ -+ struct pcpu_sw_netstats *tstats; -+ -+ /* Is this a bridge? */ -+ if (!(dev->priv_flags & IFF_EBRIDGE)) -+ return; -+ -+ tstats = this_cpu_ptr(dev->tstats); -+ -+ u64_stats_update_begin(&tstats->syncp); -+ u64_stats_add(&tstats->rx_packets, nlstats->rx_packets); -+ u64_stats_add(&tstats->rx_bytes, nlstats->rx_bytes); -+ u64_stats_add(&tstats->tx_packets, nlstats->tx_packets); -+ u64_stats_add(&tstats->tx_bytes, nlstats->tx_bytes); -+ u64_stats_update_end(&tstats->syncp); -+} -+EXPORT_SYMBOL_GPL(br_dev_update_stats); -+ -+/* QCA NSS ECM support - Start */ -+/* API to know if hairpin feature is enabled/disabled on this bridge port */ -+bool br_is_hairpin_enabled(struct net_device *dev) -+{ -+ struct net_bridge_port *port = br_port_get_check_rcu(dev); -+ -+ if (likely(port)) -+ return port->flags & BR_HAIRPIN_MODE; -+ return false; -+} -+EXPORT_SYMBOL_GPL(br_is_hairpin_enabled); -+ -+/* QCA NSS ECM support - End */ ---- a/net/core/neighbour.c -+++ b/net/core/neighbour.c -@@ -1275,6 +1275,22 @@ static void neigh_update_hhs(struct neig - } - } - -+/* QCA NSS ECM support - Start */ -+ATOMIC_NOTIFIER_HEAD(neigh_mac_update_notifier_list); -+ -+void neigh_mac_update_register_notify(struct notifier_block *nb) -+{ -+ atomic_notifier_chain_register(&neigh_mac_update_notifier_list, nb); -+} -+EXPORT_SYMBOL_GPL(neigh_mac_update_register_notify); -+ -+void neigh_mac_update_unregister_notify(struct notifier_block *nb) -+{ -+ atomic_notifier_chain_unregister(&neigh_mac_update_notifier_list, nb); -+} -+EXPORT_SYMBOL_GPL(neigh_mac_update_unregister_notify); -+/* QCA NSS ECM support - End */ -+ - /* Generic update routine. - -- lladdr is new lladdr or NULL, if it is not supplied. - -- new is new state. -@@ -1303,6 +1319,7 @@ static int __neigh_update(struct neighbo - struct net_device *dev; - int err, notify = 0; - u8 old; -+ struct neigh_mac_update nmu; /* QCA NSS ECM support */ - - trace_neigh_update(neigh, lladdr, new, flags, nlmsg_pid); - -@@ -1317,7 +1334,10 @@ static int __neigh_update(struct neighbo - new = old; - goto out; - } -- if (!(flags & NEIGH_UPDATE_F_ADMIN) && -+ -+ memset(&nmu, 0, sizeof(struct neigh_mac_update)); /* QCA NSS ECM support */ -+ -+ if (!(flags & NEIGH_UPDATE_F_ADMIN) && - (old & (NUD_NOARP | NUD_PERMANENT))) - goto out; - -@@ -1354,7 +1374,12 @@ static int __neigh_update(struct neighbo - - compare new & old - - if they are different, check override flag - */ -- if ((old & NUD_VALID) && -+ /* QCA NSS ECM update - Start */ -+ memcpy(nmu.old_mac, neigh->ha, dev->addr_len); -+ memcpy(nmu.update_mac, lladdr, dev->addr_len); -+ /* QCA NSS ECM update - End */ -+ -+ if ((old & NUD_VALID) && - !memcmp(lladdr, neigh->ha, dev->addr_len)) - lladdr = neigh->ha; - } else { -@@ -1476,8 +1501,11 @@ out: - neigh_update_gc_list(neigh); - if (managed_update) - neigh_update_managed_list(neigh); -- if (notify) -+ if (notify) { - neigh_update_notify(neigh, nlmsg_pid); -+ atomic_notifier_call_chain(&neigh_mac_update_notifier_list, 0, -+ (struct neigh_mac_update *)&nmu); /* QCA NSS ECM support */ -+ } - trace_neigh_update_done(neigh, err); - return err; - } ---- a/net/ipv4/fib_trie.c -+++ b/net/ipv4/fib_trie.c -@@ -1211,6 +1211,9 @@ static bool fib_valid_key_len(u32 key, u - static void fib_remove_alias(struct trie *t, struct key_vector *tp, - struct key_vector *l, struct fib_alias *old); - -+/* Define route change notification chain. */ -+static BLOCKING_NOTIFIER_HEAD(iproute_chain); /* QCA NSS ECM support */ -+ - /* Caller must hold RTNL. */ - int fib_table_insert(struct net *net, struct fib_table *tb, - struct fib_config *cfg, struct netlink_ext_ack *extack) -@@ -1404,6 +1407,9 @@ int fib_table_insert(struct net *net, st - rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen, new_fa->tb_id, - &cfg->fc_nlinfo, nlflags); - succeeded: -+ blocking_notifier_call_chain(&iproute_chain, -+ RTM_NEWROUTE, fi); -+ - return 0; - - out_remove_new_fa: -@@ -1776,6 +1782,9 @@ int fib_table_delete(struct net *net, st - if (fa_to_delete->fa_state & FA_S_ACCESSED) - rt_cache_flush(cfg->fc_nlinfo.nl_net); - -+ blocking_notifier_call_chain(&iproute_chain, -+ RTM_DELROUTE, fa_to_delete->fa_info); -+ - fib_release_info(fa_to_delete->fa_info); - alias_free_mem_rcu(fa_to_delete); - return 0; -@@ -2408,6 +2417,20 @@ void __init fib_trie_init(void) - 0, SLAB_PANIC | SLAB_ACCOUNT, NULL); - } - -+/* QCA NSS ECM support - Start */ -+int ip_rt_register_notifier(struct notifier_block *nb) -+{ -+ return blocking_notifier_chain_register(&iproute_chain, nb); -+} -+EXPORT_SYMBOL(ip_rt_register_notifier); -+ -+int ip_rt_unregister_notifier(struct notifier_block *nb) -+{ -+ return blocking_notifier_chain_unregister(&iproute_chain, nb); -+} -+EXPORT_SYMBOL(ip_rt_unregister_notifier); -+/* QCA NSS ECM support - End */ -+ - struct fib_table *fib_trie_table(u32 id, struct fib_table *alias) - { - struct fib_table *tb; ---- a/net/ipv6/ndisc.c -+++ b/net/ipv6/ndisc.c -@@ -668,6 +668,7 @@ void ndisc_send_ns(struct net_device *de - if (skb) - ndisc_send_skb(skb, daddr, saddr); - } -+EXPORT_SYMBOL(ndisc_send_ns); - - void ndisc_send_rs(struct net_device *dev, const struct in6_addr *saddr, - const struct in6_addr *daddr) ---- a/net/ipv6/route.c -+++ b/net/ipv6/route.c -@@ -198,6 +198,9 @@ static void rt6_uncached_list_flush_dev( - } - } - -+/* Define route change notification chain. */ -+ATOMIC_NOTIFIER_HEAD(ip6route_chain); /* QCA NSS ECM support */ -+ - static inline const void *choose_neigh_daddr(const struct in6_addr *p, - struct sk_buff *skb, - const void *daddr) -@@ -3868,6 +3871,10 @@ int ip6_route_add(struct fib6_config *cf - return PTR_ERR(rt); - - err = __ip6_ins_rt(rt, &cfg->fc_nlinfo, extack); -+ if (!err) -+ atomic_notifier_call_chain(&ip6route_chain, -+ RTM_NEWROUTE, rt); -+ - fib6_info_release(rt); - - return err; -@@ -3889,6 +3896,9 @@ static int __ip6_del_rt(struct fib6_info - err = fib6_del(rt, info); - spin_unlock_bh(&table->tb6_lock); - -+ if (!err) -+ atomic_notifier_call_chain(&ip6route_chain, -+ RTM_DELROUTE, rt); - out: - fib6_info_release(rt); - return err; -@@ -6336,6 +6346,20 @@ static int ip6_route_dev_notify(struct n - return NOTIFY_OK; - } - -+/* QCA NSS ECM support - Start */ -+int rt6_register_notifier(struct notifier_block *nb) -+{ -+ return atomic_notifier_chain_register(&ip6route_chain, nb); -+} -+EXPORT_SYMBOL(rt6_register_notifier); -+ -+int rt6_unregister_notifier(struct notifier_block *nb) -+{ -+ return atomic_notifier_chain_unregister(&ip6route_chain, nb); -+} -+EXPORT_SYMBOL(rt6_unregister_notifier); -+/* QCA NSS ECM support - End */ -+ - /* - * /proc - */ ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -1699,6 +1699,7 @@ const char *netdev_cmd_to_name(enum netd - N(PRE_CHANGEADDR) N(OFFLOAD_XSTATS_ENABLE) N(OFFLOAD_XSTATS_DISABLE) - N(OFFLOAD_XSTATS_REPORT_USED) N(OFFLOAD_XSTATS_REPORT_DELTA) - N(XDP_FEAT_CHANGE) -+ N(BR_JOIN) N(BR_LEAVE) - } - #undef N - return "UNKNOWN_NETDEV_EVENT"; ---- a/net/ipv6/addrconf.c -+++ b/net/ipv6/addrconf.c -@@ -1002,6 +1002,7 @@ void inet6_ifa_finish_destroy(struct ine - - kfree_rcu(ifp, rcu); - } -+EXPORT_SYMBOL(inet6_ifa_finish_destroy); - - static void - ipv6_link_dev_addr(struct inet6_dev *idev, struct inet6_ifaddr *ifp) ---- a/include/net/vxlan.h -+++ b/include/net/vxlan.h -@@ -440,6 +440,15 @@ static inline __be32 vxlan_compute_rco(u - return vni_field; - } - -+/* -+ * vxlan_get_vni() -+ * Returns the vni corresponding to tunnel -+ */ -+static inline u32 vxlan_get_vni(struct vxlan_dev *vxlan_tun) -+{ -+ return be32_to_cpu(vxlan_tun->cfg.vni); -+} -+ - static inline unsigned short vxlan_get_sk_family(struct vxlan_sock *vs) - { - return vs->sock->sk->sk_family; ---- a/include/uapi/linux/in.h -+++ b/include/uapi/linux/in.h -@@ -63,6 +63,8 @@ enum { - #define IPPROTO_MTP IPPROTO_MTP - IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET */ - #define IPPROTO_BEETPH IPPROTO_BEETPH -+ IPPROTO_ETHERIP = 97, /* ETHERIP protocol number */ -+#define IPPROTO_ETHERIP IPPROTO_ETHERIP - IPPROTO_ENCAP = 98, /* Encapsulation Header */ - #define IPPROTO_ENCAP IPPROTO_ENCAP - IPPROTO_PIM = 103, /* Protocol Independent Multicast */ -@@ -327,7 +329,7 @@ struct sockaddr_in { - #endif - - /* contains the htonl type stuff.. */ --#include -+#include - - - #endif /* _UAPI_LINUX_IN_H */ ---- a/tools/include/uapi/linux/in.h -+++ b/tools/include/uapi/linux/in.h -@@ -63,6 +63,8 @@ enum { - #define IPPROTO_MTP IPPROTO_MTP - IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET */ - #define IPPROTO_BEETPH IPPROTO_BEETPH -+ IPPROTO_ETHERIP = 97, /* ETHERIP protocol number */ -+#define IPPROTO_ETHERIP IPPROTO_ETHERIP - IPPROTO_ENCAP = 98, /* Encapsulation Header */ - #define IPPROTO_ENCAP IPPROTO_ENCAP - IPPROTO_PIM = 103, /* Protocol Independent Multicast */ -@@ -327,7 +329,7 @@ struct sockaddr_in { - #endif - - /* contains the htonl type stuff.. */ --#include -+#include - - - #endif /* _UAPI_LINUX_IN_H */ ---- a/net/netfilter/nf_conntrack_ecache.c -+++ b/net/netfilter/nf_conntrack_ecache.c -@@ -266,7 +266,6 @@ void nf_conntrack_register_notifier(stru - mutex_lock(&nf_ct_ecache_mutex); - notify = rcu_dereference_protected(net->ct.nf_conntrack_event_cb, - lockdep_is_held(&nf_ct_ecache_mutex)); -- WARN_ON_ONCE(notify); - rcu_assign_pointer(net->ct.nf_conntrack_event_cb, new); - mutex_unlock(&nf_ct_ecache_mutex); - } ---- a/include/net/netns/conntrack.h -+++ b/include/net/netns/conntrack.h -@@ -26,6 +26,7 @@ struct nf_tcp_net { - unsigned int timeouts[TCP_CONNTRACK_TIMEOUT_MAX]; - u8 tcp_loose; - u8 tcp_be_liberal; -+ u8 tcp_no_window_check; - u8 tcp_max_retrans; - u8 tcp_ignore_invalid_rst; - #if IS_ENABLED(CONFIG_NF_FLOW_TABLE) ---- a/net/netfilter/nf_conntrack_proto_tcp.c -+++ b/net/netfilter/nf_conntrack_proto_tcp.c -@@ -515,11 +515,15 @@ tcp_in_window(struct nf_conn *ct, enum i - struct ip_ct_tcp *state = &ct->proto.tcp; - struct ip_ct_tcp_state *sender = &state->seen[dir]; - struct ip_ct_tcp_state *receiver = &state->seen[!dir]; -+ const struct nf_tcp_net *tn = nf_tcp_pernet(nf_ct_net(ct)); - __u32 seq, ack, sack, end, win, swin; - bool in_recv_win, seq_ok; - s32 receiver_offset; - u16 win_raw; - -+ if (tn->tcp_no_window_check) -+ return NFCT_TCP_ACCEPT; -+ - /* - * Get the required data from the packet. - */ -@@ -1285,7 +1289,7 @@ int nf_conntrack_tcp_packet(struct nf_co - IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED && - timeouts[new_state] > timeouts[TCP_CONNTRACK_UNACK]) - timeout = timeouts[TCP_CONNTRACK_UNACK]; -- else if (ct->proto.tcp.last_win == 0 && -+ else if (!tn->tcp_no_window_check && ct->proto.tcp.last_win == 0 && - timeouts[new_state] > timeouts[TCP_CONNTRACK_RETRANS]) - timeout = timeouts[TCP_CONNTRACK_RETRANS]; - else -@@ -1601,6 +1605,9 @@ void nf_conntrack_tcp_init_net(struct ne - */ - tn->tcp_be_liberal = 0; - -+ /* Skip Windows Check */ -+ tn->tcp_no_window_check = 0; -+ - /* If it's non-zero, we turn off RST sequence number check */ - tn->tcp_ignore_invalid_rst = 0; - ---- a/net/netfilter/nf_conntrack_standalone.c -+++ b/net/netfilter/nf_conntrack_standalone.c -@@ -630,6 +630,7 @@ enum nf_ct_sysctl_index { - #endif - NF_SYSCTL_CT_PROTO_TCP_LOOSE, - NF_SYSCTL_CT_PROTO_TCP_LIBERAL, -+ NF_SYSCTL_CT_PROTO_TCP_NO_WINDOW_CHECK, - NF_SYSCTL_CT_PROTO_TCP_IGNORE_INVALID_RST, - NF_SYSCTL_CT_PROTO_TCP_MAX_RETRANS, - NF_SYSCTL_CT_PROTO_TIMEOUT_UDP, -@@ -834,6 +835,14 @@ static struct ctl_table nf_ct_sysctl_tab - .extra1 = SYSCTL_ZERO, - .extra2 = SYSCTL_ONE, - }, -+ [NF_SYSCTL_CT_PROTO_TCP_NO_WINDOW_CHECK] = { -+ .procname = "nf_conntrack_tcp_no_window_check", -+ .maxlen = sizeof(u8), -+ .mode = 0644, -+ .proc_handler = proc_dou8vec_minmax, -+ .extra1 = SYSCTL_ZERO, -+ .extra2 = SYSCTL_ONE, -+ }, - [NF_SYSCTL_CT_PROTO_TCP_IGNORE_INVALID_RST] = { - .procname = "nf_conntrack_tcp_ignore_invalid_rst", - .maxlen = sizeof(u8), -@@ -1035,6 +1044,7 @@ static void nf_conntrack_standalone_init - - XASSIGN(LOOSE, &tn->tcp_loose); - XASSIGN(LIBERAL, &tn->tcp_be_liberal); -+ XASSIGN(NO_WINDOW_CHECK, &tn->tcp_no_window_check); - XASSIGN(MAX_RETRANS, &tn->tcp_max_retrans); - XASSIGN(IGNORE_INVALID_RST, &tn->tcp_ignore_invalid_rst); - #undef XASSIGN diff --git a/target/linux/qualcommax/patches-6.6/0600-2-qca-nss-ecm-support-PPPOE-offload.patch b/target/linux/qualcommax/patches-6.6/0600-2-qca-nss-ecm-support-PPPOE-offload.patch deleted file mode 100644 index f7271a6886a..00000000000 --- a/target/linux/qualcommax/patches-6.6/0600-2-qca-nss-ecm-support-PPPOE-offload.patch +++ /dev/null @@ -1,600 +0,0 @@ ---- a/drivers/net/ppp/ppp_generic.c -+++ b/drivers/net/ppp/ppp_generic.c -@@ -48,6 +48,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -255,6 +256,25 @@ struct ppp_net { - #define seq_before(a, b) ((s32)((a) - (b)) < 0) - #define seq_after(a, b) ((s32)((a) - (b)) > 0) - -+ -+/* -+ * Registration/Unregistration methods -+ * for PPP channel connect and disconnect event notifications. -+ */ -+RAW_NOTIFIER_HEAD(ppp_channel_connection_notifier_list); -+ -+void ppp_channel_connection_register_notify(struct notifier_block *nb) -+{ -+ raw_notifier_chain_register(&ppp_channel_connection_notifier_list, nb); -+} -+EXPORT_SYMBOL_GPL(ppp_channel_connection_register_notify); -+ -+void ppp_channel_connection_unregister_notify(struct notifier_block *nb) -+{ -+ raw_notifier_chain_unregister(&ppp_channel_connection_notifier_list, nb); -+} -+EXPORT_SYMBOL_GPL(ppp_channel_connection_unregister_notify); -+ - /* Prototypes. */ - static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf, - struct file *file, unsigned int cmd, unsigned long arg); -@@ -3468,7 +3488,10 @@ ppp_connect_channel(struct channel *pch, - struct ppp_net *pn; - int ret = -ENXIO; - int hdrlen; -+ int ppp_proto; -+ int version; - -+ int notify = 0; - pn = ppp_pernet(pch->chan_net); - - mutex_lock(&pn->all_ppp_mutex); -@@ -3500,13 +3523,40 @@ ppp_connect_channel(struct channel *pch, - ++ppp->n_channels; - pch->ppp = ppp; - refcount_inc(&ppp->file.refcnt); -+ -+ /* Set the netdev priv flag if the prototype -+ * is L2TP or PPTP. Return success in all cases -+ */ -+ if (!pch->chan) -+ goto out2; -+ -+ ppp_proto = ppp_channel_get_protocol(pch->chan); -+ if (ppp_proto == PX_PROTO_PPTP) { -+ ppp->dev->priv_flags_ext |= IFF_EXT_PPP_PPTP; -+ } else if (ppp_proto == PX_PROTO_OL2TP) { -+ version = ppp_channel_get_proto_version(pch->chan); -+ if (version == 2) -+ ppp->dev->priv_flags_ext |= IFF_EXT_PPP_L2TPV2; -+ else if (version == 3) -+ ppp->dev->priv_flags_ext |= IFF_EXT_PPP_L2TPV3; -+ } -+ notify = 1; -+ -+ out2: - ppp_unlock(ppp); - ret = 0; -- - outl: - write_unlock_bh(&pch->upl); - out: - mutex_unlock(&pn->all_ppp_mutex); -+ -+ if (notify && ppp && ppp->dev) { -+ dev_hold(ppp->dev); -+ raw_notifier_call_chain(&ppp_channel_connection_notifier_list, -+ PPP_CHANNEL_CONNECT, ppp->dev); -+ dev_put(ppp->dev); -+ } -+ - return ret; - } - -@@ -3524,6 +3574,13 @@ ppp_disconnect_channel(struct channel *p - pch->ppp = NULL; - write_unlock_bh(&pch->upl); - if (ppp) { -+ if (ppp->dev) { -+ dev_hold(ppp->dev); -+ raw_notifier_call_chain(&ppp_channel_connection_notifier_list, -+ PPP_CHANNEL_DISCONNECT, ppp->dev); -+ dev_put(ppp->dev); -+ } -+ - /* remove it from the ppp unit's list */ - ppp_lock(ppp); - list_del(&pch->clist); -@@ -3603,6 +3660,222 @@ static void *unit_find(struct idr *p, in - return idr_find(p, n); - } - -+/* Updates the PPP interface statistics. */ -+void ppp_update_stats(struct net_device *dev, unsigned long rx_packets, -+ unsigned long rx_bytes, unsigned long tx_packets, -+ unsigned long tx_bytes, unsigned long rx_errors, -+ unsigned long tx_errors, unsigned long rx_dropped, -+ unsigned long tx_dropped) -+{ -+ struct ppp *ppp; -+ -+ if (!dev) -+ return; -+ -+ if (dev->type != ARPHRD_PPP) -+ return; -+ -+ ppp = netdev_priv(dev); -+ -+ ppp_xmit_lock(ppp); -+ ppp->stats64.tx_packets += tx_packets; -+ ppp->stats64.tx_bytes += tx_bytes; -+ ppp->dev->stats.tx_errors += tx_errors; -+ ppp->dev->stats.tx_dropped += tx_dropped; -+ if (tx_packets) -+ ppp->last_xmit = jiffies; -+ ppp_xmit_unlock(ppp); -+ -+ ppp_recv_lock(ppp); -+ ppp->stats64.rx_packets += rx_packets; -+ ppp->stats64.rx_bytes += rx_bytes; -+ ppp->dev->stats.rx_errors += rx_errors; -+ ppp->dev->stats.rx_dropped += rx_dropped; -+ if (rx_packets) -+ ppp->last_recv = jiffies; -+ ppp_recv_unlock(ppp); -+} -+ -+/* Returns >0 if the device is a multilink PPP netdevice, 0 if not or < 0 if -+ * the device is not PPP. -+ */ -+int ppp_is_multilink(struct net_device *dev) -+{ -+ struct ppp *ppp; -+ unsigned int flags; -+ -+ if (!dev) -+ return -1; -+ -+ if (dev->type != ARPHRD_PPP) -+ return -1; -+ -+ ppp = netdev_priv(dev); -+ ppp_lock(ppp); -+ flags = ppp->flags; -+ ppp_unlock(ppp); -+ -+ if (flags & SC_MULTILINK) -+ return 1; -+ -+ return 0; -+} -+EXPORT_SYMBOL(ppp_is_multilink); -+ -+/* ppp_channel_get_protocol() -+ * Call this to obtain the underlying protocol of the PPP channel, -+ * e.g. PX_PROTO_OE -+ * -+ * NOTE: Some channels do not use PX sockets so the protocol value may be very -+ * different for them. -+ * NOTE: -1 indicates failure. -+ * NOTE: Once you know the channel protocol you may then either cast 'chan' to -+ * its sub-class or use the channel protocol specific API's as provided by that -+ * channel sub type. -+ */ -+int ppp_channel_get_protocol(struct ppp_channel *chan) -+{ -+ if (!chan->ops->get_channel_protocol) -+ return -1; -+ -+ return chan->ops->get_channel_protocol(chan); -+} -+EXPORT_SYMBOL(ppp_channel_get_protocol); -+ -+/* ppp_channel_get_proto_version() -+ * Call this to get channel protocol version -+ */ -+int ppp_channel_get_proto_version(struct ppp_channel *chan) -+{ -+ if (!chan->ops->get_channel_protocol_ver) -+ return -1; -+ -+ return chan->ops->get_channel_protocol_ver(chan); -+} -+EXPORT_SYMBOL(ppp_channel_get_proto_version); -+ -+/* ppp_channel_hold() -+ * Call this to hold a channel. -+ * -+ * Returns true on success or false if the hold could not happen. -+ * -+ * NOTE: chan must be protected against destruction during this call - -+ * either by correct locking etc. or because you already have an implicit -+ * or explicit hold to the channel already and this is an additional hold. -+ */ -+bool ppp_channel_hold(struct ppp_channel *chan) -+{ -+ if (!chan->ops->hold) -+ return false; -+ -+ chan->ops->hold(chan); -+ return true; -+} -+EXPORT_SYMBOL(ppp_channel_hold); -+ -+/* ppp_channel_release() -+ * Call this to release a hold you have upon a channel -+ */ -+void ppp_channel_release(struct ppp_channel *chan) -+{ -+ chan->ops->release(chan); -+} -+EXPORT_SYMBOL(ppp_channel_release); -+ -+/* Check if ppp xmit lock is on hold */ -+bool ppp_is_xmit_locked(struct net_device *dev) -+{ -+ struct ppp *ppp; -+ -+ if (!dev) -+ return false; -+ -+ if (dev->type != ARPHRD_PPP) -+ return false; -+ -+ ppp = netdev_priv(dev); -+ if (!ppp) -+ return false; -+ -+ if (spin_is_locked(&(ppp)->wlock)) -+ return true; -+ -+ return false; -+} -+EXPORT_SYMBOL(ppp_is_xmit_locked); -+ -+/* ppp_hold_channels() -+ * Returns the PPP channels of the PPP device, storing each one into -+ * channels[]. -+ * -+ * channels[] has chan_sz elements. -+ * This function returns the number of channels stored, up to chan_sz. -+ * It will return < 0 if the device is not PPP. -+ * -+ * You MUST release the channels using ppp_release_channels(). -+ */ -+int ppp_hold_channels(struct net_device *dev, struct ppp_channel *channels[], -+ unsigned int chan_sz) -+{ -+ struct ppp *ppp; -+ int c; -+ struct channel *pch; -+ -+ if (!dev) -+ return -1; -+ -+ if (dev->type != ARPHRD_PPP) -+ return -1; -+ -+ ppp = netdev_priv(dev); -+ -+ c = 0; -+ ppp_lock(ppp); -+ list_for_each_entry(pch, &ppp->channels, clist) { -+ struct ppp_channel *chan; -+ -+ if (!pch->chan) { -+ /* Channel is going / gone away */ -+ continue; -+ } -+ -+ if (c == chan_sz) { -+ /* No space to record channel */ -+ ppp_unlock(ppp); -+ return c; -+ } -+ -+ /* Hold the channel, if supported */ -+ chan = pch->chan; -+ if (!chan->ops->hold) -+ continue; -+ -+ chan->ops->hold(chan); -+ -+ /* Record the channel */ -+ channels[c++] = chan; -+ } -+ ppp_unlock(ppp); -+ return c; -+} -+EXPORT_SYMBOL(ppp_hold_channels); -+ -+/* ppp_release_channels() -+ * Releases channels -+ */ -+void ppp_release_channels(struct ppp_channel *channels[], unsigned int chan_sz) -+{ -+ unsigned int c; -+ -+ for (c = 0; c < chan_sz; ++c) { -+ struct ppp_channel *chan; -+ -+ chan = channels[c]; -+ chan->ops->release(chan); -+ } -+} -+EXPORT_SYMBOL(ppp_release_channels); -+ - /* Module/initialization stuff */ - - module_init(ppp_init); -@@ -3619,6 +3892,7 @@ EXPORT_SYMBOL(ppp_input_error); - EXPORT_SYMBOL(ppp_output_wakeup); - EXPORT_SYMBOL(ppp_register_compressor); - EXPORT_SYMBOL(ppp_unregister_compressor); -+EXPORT_SYMBOL(ppp_update_stats); - MODULE_LICENSE("GPL"); - MODULE_ALIAS_CHARDEV(PPP_MAJOR, 0); - MODULE_ALIAS_RTNL_LINK("ppp"); ---- a/drivers/net/ppp/pppoe.c -+++ b/drivers/net/ppp/pppoe.c -@@ -62,6 +62,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -87,7 +88,7 @@ - static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb); - - static const struct proto_ops pppoe_ops; --static const struct ppp_channel_ops pppoe_chan_ops; -+static const struct pppoe_channel_ops pppoe_chan_ops; - - /* per-net private data for this module */ - static unsigned int pppoe_net_id __read_mostly; -@@ -692,7 +693,7 @@ static int pppoe_connect(struct socket * - - po->chan.mtu = dev->mtu - sizeof(struct pppoe_hdr) - 2; - po->chan.private = sk; -- po->chan.ops = &pppoe_chan_ops; -+ po->chan.ops = (struct ppp_channel_ops *)&pppoe_chan_ops; - - error = ppp_register_net_channel(dev_net(dev), &po->chan); - if (error) { -@@ -995,9 +996,80 @@ static int pppoe_fill_forward_path(struc - return 0; - } - --static const struct ppp_channel_ops pppoe_chan_ops = { -- .start_xmit = pppoe_xmit, -- .fill_forward_path = pppoe_fill_forward_path, -+/************************************************************************ -+ * -+ * function called by generic PPP driver to hold channel -+ * -+ ***********************************************************************/ -+static void pppoe_hold_chan(struct ppp_channel *chan) -+{ -+ struct sock *sk = (struct sock *)chan->private; -+ -+ sock_hold(sk); -+} -+ -+/************************************************************************ -+ * -+ * function called by generic PPP driver to release channel -+ * -+ ***********************************************************************/ -+static void pppoe_release_chan(struct ppp_channel *chan) -+{ -+ struct sock *sk = (struct sock *)chan->private; -+ -+ sock_put(sk); -+} -+ -+/************************************************************************ -+ * -+ * function called to get the channel protocol type -+ * -+ ***********************************************************************/ -+static int pppoe_get_channel_protocol(struct ppp_channel *chan) -+{ -+ return PX_PROTO_OE; -+} -+ -+/************************************************************************ -+ * -+ * function called to get the PPPoE channel addressing -+ * NOTE: This function returns a HOLD to the netdevice -+ * -+ ***********************************************************************/ -+static int pppoe_get_addressing(struct ppp_channel *chan, -+ struct pppoe_opt *addressing) -+{ -+ struct sock *sk = (struct sock *)chan->private; -+ struct pppox_sock *po = pppox_sk(sk); -+ int err = 0; -+ -+ *addressing = po->proto.pppoe; -+ if (!addressing->dev) -+ return -ENODEV; -+ -+ dev_hold(addressing->dev); -+ return err; -+} -+ -+/* pppoe_channel_addressing_get() -+ * Return PPPoE channel specific addressing information. -+ */ -+int pppoe_channel_addressing_get(struct ppp_channel *chan, -+ struct pppoe_opt *addressing) -+{ -+ return pppoe_get_addressing(chan, addressing); -+} -+EXPORT_SYMBOL(pppoe_channel_addressing_get); -+ -+static const struct pppoe_channel_ops pppoe_chan_ops = { -+ /* PPPoE specific channel ops */ -+ .get_addressing = pppoe_get_addressing, -+ /* General ppp channel ops */ -+ .ops.start_xmit = pppoe_xmit, -+ .ops.get_channel_protocol = pppoe_get_channel_protocol, -+ .ops.hold = pppoe_hold_chan, -+ .ops.release = pppoe_release_chan, -+ .ops.fill_forward_path = pppoe_fill_forward_path, - }; - - static int pppoe_recvmsg(struct socket *sock, struct msghdr *m, ---- a/include/linux/if_pppox.h -+++ b/include/linux/if_pppox.h -@@ -91,4 +91,17 @@ enum { - PPPOX_DEAD = 16 /* dead, useless, please clean me up!*/ - }; - -+/* -+ * PPPoE Channel specific operations -+ */ -+struct pppoe_channel_ops { -+ /* Must be first - general to all PPP channels */ -+ struct ppp_channel_ops ops; -+ int (*get_addressing)(struct ppp_channel *, struct pppoe_opt *); -+}; -+ -+/* Return PPPoE channel specific addressing information */ -+extern int pppoe_channel_addressing_get(struct ppp_channel *chan, -+ struct pppoe_opt *addressing); -+ - #endif /* !(__LINUX_IF_PPPOX_H) */ ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -1761,6 +1761,36 @@ enum netdev_priv_flags { - IFF_NO_IP_ALIGN = BIT_ULL(34), - }; - -+/** -+ * enum netdev_priv_flags_ext - &struct net_device priv_flags_ext -+ * -+ * These flags are used to check for device type and can be -+ * set and used by the drivers -+ * -+ * @IFF_EXT_TUN_TAP: device is a TUN/TAP device -+ * @IFF_EXT_PPP_L2TPV2: device is a L2TPV2 device -+ * @IFF_EXT_PPP_L2TPV3: device is a L2TPV3 device -+ * @IFF_EXT_PPP_PPTP: device is a PPTP device -+ * @IFF_EXT_GRE_V4_TAP: device is a GRE IPv4 TAP device -+ * @IFF_EXT_GRE_V6_TAP: device is a GRE IPv6 TAP device -+ * @IFF_EXT_IFB: device is an IFB device -+ * @IFF_EXT_MAPT: device is an MAPT device -+ * @IFF_EXT_HW_NO_OFFLOAD: device is an NON Offload device -+ * @IFF_EXT_L2TPV3: device is a L2TPV3 Ethernet device -+ */ -+enum netdev_priv_flags_ext { -+ IFF_EXT_TUN_TAP = 1<<0, -+ IFF_EXT_PPP_L2TPV2 = 1<<1, -+ IFF_EXT_PPP_L2TPV3 = 1<<2, -+ IFF_EXT_PPP_PPTP = 1<<3, -+ IFF_EXT_GRE_V4_TAP = 1<<4, -+ IFF_EXT_GRE_V6_TAP = 1<<5, -+ IFF_EXT_IFB = 1<<6, -+ IFF_EXT_MAPT = 1<<7, -+ IFF_EXT_HW_NO_OFFLOAD = 1<<8, -+ IFF_EXT_ETH_L2TPV3 = 1<<9, -+}; -+ - #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN - #define IFF_EBRIDGE IFF_EBRIDGE - #define IFF_BONDING IFF_BONDING -@@ -2126,6 +2156,7 @@ struct net_device { - unsigned int flags; - xdp_features_t xdp_features; - unsigned long long priv_flags; -+ unsigned int priv_flags_ext; - const struct net_device_ops *netdev_ops; - const struct xdp_metadata_ops *xdp_metadata_ops; - int ifindex; ---- a/include/linux/ppp_channel.h -+++ b/include/linux/ppp_channel.h -@@ -19,6 +19,10 @@ - #include - #include - #include -+#include -+ -+#define PPP_CHANNEL_DISCONNECT 0 -+#define PPP_CHANNEL_CONNECT 1 - - struct net_device_path; - struct net_device_path_ctx; -@@ -30,9 +34,19 @@ struct ppp_channel_ops { - int (*start_xmit)(struct ppp_channel *, struct sk_buff *); - /* Handle an ioctl call that has come in via /dev/ppp. */ - int (*ioctl)(struct ppp_channel *, unsigned int, unsigned long); -+ /* Get channel protocol type, one of PX_PROTO_XYZ or specific to -+ * the channel subtype -+ */ -+ int (*get_channel_protocol)(struct ppp_channel *); -+ /* Get channel protocol version */ -+ int (*get_channel_protocol_ver)(struct ppp_channel *); -+ /* Hold the channel from being destroyed */ -+ void (*hold)(struct ppp_channel *); -+ /* Release hold on the channel */ -+ void (*release)(struct ppp_channel *); - int (*fill_forward_path)(struct net_device_path_ctx *, -- struct net_device_path *, -- const struct ppp_channel *); -+ struct net_device_path *, -+ const struct ppp_channel *); - }; - - struct ppp_channel { -@@ -76,6 +90,51 @@ extern int ppp_unit_number(struct ppp_ch - /* Get the device name associated with a channel, or NULL if none */ - extern char *ppp_dev_name(struct ppp_channel *); - -+/* Call this to obtain the underlying protocol of the PPP channel, -+ * e.g. PX_PROTO_OE -+ */ -+extern int ppp_channel_get_protocol(struct ppp_channel *); -+ -+/* Call this get protocol version */ -+extern int ppp_channel_get_proto_version(struct ppp_channel *); -+ -+/* Call this to hold a channel */ -+extern bool ppp_channel_hold(struct ppp_channel *); -+ -+/* Call this to release a hold you have upon a channel */ -+extern void ppp_channel_release(struct ppp_channel *); -+ -+/* Release hold on PPP channels */ -+extern void ppp_release_channels(struct ppp_channel *channels[], -+ unsigned int chan_sz); -+ -+/* Hold PPP channels for the PPP device */ -+extern int ppp_hold_channels(struct net_device *dev, -+ struct ppp_channel *channels[], -+ unsigned int chan_sz); -+ -+/* Test if ppp xmit lock is locked */ -+extern bool ppp_is_xmit_locked(struct net_device *dev); -+ -+/* Test if the ppp device is a multi-link ppp device */ -+extern int ppp_is_multilink(struct net_device *dev); -+ -+/* Register the PPP channel connect notifier */ -+extern void ppp_channel_connection_register_notify(struct notifier_block *nb); -+ -+/* Unregister the PPP channel connect notifier */ -+extern void ppp_channel_connection_unregister_notify(struct notifier_block *nb); -+ -+/* Update statistics of the PPP net_device by incrementing related -+ * statistics field value with corresponding parameter -+ */ -+extern void ppp_update_stats(struct net_device *dev, unsigned long rx_packets, -+ unsigned long rx_bytes, unsigned long tx_packets, -+ unsigned long tx_bytes, unsigned long rx_errors, -+ unsigned long tx_errors, unsigned long rx_dropped, -+ unsigned long tx_dropped); -+ -+ - /* - * SMP locking notes: - * The channel code must ensure that when it calls ppp_unregister_channel, diff --git a/target/linux/qualcommax/patches-6.6/0600-3-qca-nss-ecm-support-net-bonding.patch b/target/linux/qualcommax/patches-6.6/0600-3-qca-nss-ecm-support-net-bonding.patch deleted file mode 100644 index e615943782f..00000000000 --- a/target/linux/qualcommax/patches-6.6/0600-3-qca-nss-ecm-support-net-bonding.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- a/drivers/net/bonding/bond_main.c -+++ b/drivers/net/bonding/bond_main.c -@@ -210,6 +210,7 @@ atomic_t netpoll_block_tx = ATOMIC_INIT( - #endif - - unsigned int bond_net_id __read_mostly; -+static unsigned long bond_id_mask = 0xFFFFFFF0; /* QCA NSS ECM bonding support */ - - static const struct flow_dissector_key flow_keys_bonding_keys[] = { - { -@@ -5911,6 +5912,11 @@ static void bond_destructor(struct net_d - if (bond->wq) - destroy_workqueue(bond->wq); - -+ /* QCA NSS ECM bonding support - Start */ -+ if (bond->id != (~0U)) -+ clear_bit(bond->id, &bond_id_mask); -+ /* QCA NSS ECM bonding support - End */ -+ - free_percpu(bond->rr_tx_counter); - } - -@@ -6464,6 +6470,13 @@ int bond_create(struct net *net, const c - - bond_work_init_all(bond); - -+ /* QCA NSS ECM bonding support - Start */ -+ bond->id = ~0U; -+ if (bond_id_mask != (~0UL)) { -+ bond->id = (u32)ffz(bond_id_mask); -+ set_bit(bond->id, &bond_id_mask); -+ } -+ /* QCA NSS ECM bonding support - End */ - out: - rtnl_unlock(); - return res; ---- a/include/net/bonding.h -+++ b/include/net/bonding.h -@@ -261,6 +261,7 @@ struct bonding { - struct mutex ipsec_lock; - #endif /* CONFIG_XFRM_OFFLOAD */ - struct bpf_prog *xdp_prog; -+ u32 id;/* QCA NSS ECM bonding support */ - }; - - #define bond_slave_get_rcu(dev) \ diff --git a/target/linux/qualcommax/patches-6.6/0600-4-qca-nss-ecm-support-net-bonding-over-LAG-interface.patch b/target/linux/qualcommax/patches-6.6/0600-4-qca-nss-ecm-support-net-bonding-over-LAG-interface.patch deleted file mode 100644 index 0f0bf62fb81..00000000000 --- a/target/linux/qualcommax/patches-6.6/0600-4-qca-nss-ecm-support-net-bonding-over-LAG-interface.patch +++ /dev/null @@ -1,685 +0,0 @@ ---- a/drivers/net/bonding/bond_3ad.c -+++ b/drivers/net/bonding/bond_3ad.c -@@ -116,6 +116,40 @@ static void ad_marker_response_received( - struct port *port); - static void ad_update_actor_keys(struct port *port, bool reset); - -+/* QCA NSS ECM bonding support - Start */ -+struct bond_cb __rcu *bond_cb; -+ -+int bond_register_cb(struct bond_cb *cb) -+{ -+ struct bond_cb *lag_cb; -+ -+ lag_cb = kzalloc(sizeof(*lag_cb), GFP_ATOMIC | __GFP_NOWARN); -+ if (!lag_cb) { -+ return -1; -+ } -+ -+ memcpy((void *)lag_cb, (void *)cb, sizeof(*cb)); -+ -+ rcu_read_lock(); -+ rcu_assign_pointer(bond_cb, lag_cb); -+ rcu_read_unlock(); -+ return 0; -+} -+EXPORT_SYMBOL(bond_register_cb); -+ -+void bond_unregister_cb(void) -+{ -+ struct bond_cb *lag_cb_main; -+ -+ rcu_read_lock(); -+ lag_cb_main = rcu_dereference(bond_cb); -+ rcu_assign_pointer(bond_cb, NULL); -+ rcu_read_unlock(); -+ -+ kfree(lag_cb_main); -+} -+EXPORT_SYMBOL(bond_unregister_cb); -+/* QCA NSS ECM bonding support - End */ - - /* ================= api to bonding and kernel code ================== */ - -@@ -1073,7 +1107,31 @@ static void ad_mux_machine(struct port * - ad_disable_collecting_distributing(port, - update_slave_arr); - port->ntt = true; -+ -+ /* QCA NSS ECM bonding support - Start */ -+ /* Send a notificaton about change in state of this -+ * port. We only want to handle case where port moves -+ * from AD_MUX_COLLECTING_DISTRIBUTING -> -+ * AD_MUX_ATTACHED. -+ */ -+ if (bond_slave_is_up(port->slave) && -+ (last_state == AD_MUX_COLLECTING_DISTRIBUTING)) { -+ struct bond_cb *lag_cb_main; -+ -+ rcu_read_lock(); -+ lag_cb_main = rcu_dereference(bond_cb); -+ if (lag_cb_main && -+ lag_cb_main->bond_cb_link_down) { -+ struct net_device *dev; -+ -+ dev = port->slave->dev; -+ lag_cb_main->bond_cb_link_down(dev); -+ } -+ rcu_read_unlock(); -+ } -+ - break; -+ /* QCA NSS ECM bonding support - End */ - case AD_MUX_COLLECTING_DISTRIBUTING: - port->actor_oper_port_state |= LACP_STATE_COLLECTING; - port->actor_oper_port_state |= LACP_STATE_DISTRIBUTING; -@@ -1917,6 +1975,7 @@ static void ad_enable_collecting_distrib - bool *update_slave_arr) - { - if (port->aggregator->is_active) { -+ struct bond_cb *lag_cb_main; /* QCA NSS ECM bonding support */ - slave_dbg(port->slave->bond->dev, port->slave->dev, - "Enabling port %d (LAG %d)\n", - port->actor_port_number, -@@ -1924,6 +1983,16 @@ static void ad_enable_collecting_distrib - __enable_port(port); - /* Slave array needs update */ - *update_slave_arr = true; -+ -+ /* QCA NSS ECM bonding support - Start */ -+ rcu_read_lock(); -+ lag_cb_main = rcu_dereference(bond_cb); -+ -+ if (lag_cb_main && lag_cb_main->bond_cb_link_up) -+ lag_cb_main->bond_cb_link_up(port->slave->dev); -+ -+ rcu_read_unlock(); -+ /* QCA NSS ECM bonding support - End */ - } - } - -@@ -2683,6 +2752,104 @@ int bond_3ad_get_active_agg_info(struct - return ret; - } - -+/* QCA NSS ECM bonding support - Start */ -+/* bond_3ad_get_tx_dev - Calculate egress interface for a given packet, -+ * for a LAG that is configured in 802.3AD mode -+ * @skb: pointer to skb to be egressed -+ * @src_mac: pointer to source L2 address -+ * @dst_mac: pointer to destination L2 address -+ * @src: pointer to source L3 address -+ * @dst: pointer to destination L3 address -+ * @protocol: L3 protocol id from L2 header -+ * @bond_dev: pointer to bond master device -+ * -+ * If @skb is NULL, bond_xmit_hash is used to calculate hash using L2/L3 -+ * addresses. -+ * -+ * Returns: Either valid slave device, or NULL otherwise -+ */ -+struct net_device *bond_3ad_get_tx_dev(struct sk_buff *skb, u8 *src_mac, -+ u8 *dst_mac, void *src, -+ void *dst, u16 protocol, -+ struct net_device *bond_dev, -+ __be16 *layer4hdr) -+{ -+ struct bonding *bond = netdev_priv(bond_dev); -+ struct aggregator *agg; -+ struct ad_info ad_info; -+ struct list_head *iter; -+ struct slave *slave; -+ struct slave *first_ok_slave = NULL; -+ u32 hash = 0; -+ int slaves_in_agg; -+ int slave_agg_no = 0; -+ int agg_id; -+ -+ if (__bond_3ad_get_active_agg_info(bond, &ad_info)) { -+ pr_debug("%s: Error: __bond_3ad_get_active_agg_info failed\n", -+ bond_dev->name); -+ return NULL; -+ } -+ -+ slaves_in_agg = ad_info.ports; -+ agg_id = ad_info.aggregator_id; -+ -+ if (slaves_in_agg == 0) { -+ pr_debug("%s: Error: active aggregator is empty\n", -+ bond_dev->name); -+ return NULL; -+ } -+ -+ if (skb) { -+ hash = bond_xmit_hash(bond, skb); -+ slave_agg_no = hash % slaves_in_agg; -+ } else { -+ if (bond->params.xmit_policy != BOND_XMIT_POLICY_LAYER23 && -+ bond->params.xmit_policy != BOND_XMIT_POLICY_LAYER2 && -+ bond->params.xmit_policy != BOND_XMIT_POLICY_LAYER34) { -+ pr_debug("%s: Error: Unsupported hash policy for 802.3AD fast path\n", -+ bond_dev->name); -+ return NULL; -+ } -+ -+ hash = bond_xmit_hash_without_skb(src_mac, dst_mac, -+ src, dst, protocol, -+ bond_dev, layer4hdr); -+ slave_agg_no = hash % slaves_in_agg; -+ } -+ -+ bond_for_each_slave_rcu(bond, slave, iter) { -+ agg = SLAVE_AD_INFO(slave)->port.aggregator; -+ if (!agg || agg->aggregator_identifier != agg_id) -+ continue; -+ -+ if (slave_agg_no >= 0) { -+ if (!first_ok_slave && bond_slave_can_tx(slave)) -+ first_ok_slave = slave; -+ slave_agg_no--; -+ continue; -+ } -+ -+ if (bond_slave_can_tx(slave)) -+ return slave->dev; -+ } -+ -+ if (slave_agg_no >= 0) { -+ pr_err("%s: Error: Couldn't find a slave to tx on for aggregator ID %d\n", -+ bond_dev->name, agg_id); -+ return NULL; -+ } -+ -+ /* we couldn't find any suitable slave after the agg_no, so use the -+ * first suitable found, if found. -+ */ -+ if (first_ok_slave) -+ return first_ok_slave->dev; -+ -+ return NULL; -+} -+/* QCA NSS ECM bonding support - End */ -+ - int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond, - struct slave *slave) - { ---- a/drivers/net/bonding/bond_main.c -+++ b/drivers/net/bonding/bond_main.c -@@ -288,6 +288,21 @@ const char *bond_mode_name(int mode) - return names[mode]; - } - -+/* QCA NSS ECM bonding support */ -+int bond_get_id(struct net_device *bond_dev) -+{ -+ struct bonding *bond; -+ -+ if (!((bond_dev->priv_flags & IFF_BONDING) && -+ (bond_dev->flags & IFF_MASTER))) -+ return -EINVAL; -+ -+ bond = netdev_priv(bond_dev); -+ return bond->id; -+} -+EXPORT_SYMBOL(bond_get_id); -+/* QCA NSS ECM bonding support */ -+ - /** - * bond_dev_queue_xmit - Prepare skb for xmit. - * -@@ -1228,6 +1243,23 @@ void bond_change_active_slave(struct bon - if (BOND_MODE(bond) == BOND_MODE_8023AD) - bond_3ad_handle_link_change(new_active, BOND_LINK_UP); - -+ /* QCA NSS ECM bonding support - Start */ -+ if (bond->params.mode == BOND_MODE_XOR) { -+ struct bond_cb *lag_cb_main; -+ -+ rcu_read_lock(); -+ lag_cb_main = rcu_dereference(bond_cb); -+ if (lag_cb_main && -+ lag_cb_main->bond_cb_link_up) { -+ struct net_device *dev; -+ -+ dev = new_active->dev; -+ lag_cb_main->bond_cb_link_up(dev); -+ } -+ rcu_read_unlock(); -+ } -+ /* QCA NSS ECM bonding support - End */ -+ - if (bond_is_lb(bond)) - bond_alb_handle_link_change(bond, new_active, BOND_LINK_UP); - } else { -@@ -1872,6 +1904,7 @@ int bond_enslave(struct net_device *bond - const struct net_device_ops *slave_ops = slave_dev->netdev_ops; - struct slave *new_slave = NULL, *prev_slave; - struct sockaddr_storage ss; -+ struct bond_cb *lag_cb_main; /* QCA NSS ECM bonding support */ - int link_reporting; - int res = 0, i; - -@@ -2317,6 +2350,15 @@ int bond_enslave(struct net_device *bond - bond_is_active_slave(new_slave) ? "an active" : "a backup", - new_slave->link != BOND_LINK_DOWN ? "an up" : "a down"); - -+ /* QCA NSS ECM bonding support - Start */ -+ rcu_read_lock(); -+ lag_cb_main = rcu_dereference(bond_cb); -+ if (lag_cb_main && lag_cb_main->bond_cb_enslave) -+ lag_cb_main->bond_cb_enslave(slave_dev); -+ -+ rcu_read_unlock(); -+ /* QCA NSS ECM bonding support - End */ -+ - /* enslave is successful */ - bond_queue_slave_event(new_slave); - return 0; -@@ -2382,6 +2424,15 @@ err_undo_flags: - } - } - -+ /* QCA NSS ECM bonding support - Start */ -+ rcu_read_lock(); -+ lag_cb_main = rcu_dereference(bond_cb); -+ if (lag_cb_main && lag_cb_main->bond_cb_enslave) -+ lag_cb_main->bond_cb_enslave(slave_dev); -+ -+ rcu_read_unlock(); -+ /* QCA NSS ECM bonding support - End */ -+ - return res; - } - -@@ -2403,6 +2454,7 @@ static int __bond_release_one(struct net - struct bonding *bond = netdev_priv(bond_dev); - struct slave *slave, *oldcurrent; - struct sockaddr_storage ss; -+ struct bond_cb *lag_cb_main; /* QCA NSS ECM bonding support */ - int old_flags = bond_dev->flags; - netdev_features_t old_features = bond_dev->features; - -@@ -2425,6 +2477,15 @@ static int __bond_release_one(struct net - - bond_set_slave_inactive_flags(slave, BOND_SLAVE_NOTIFY_NOW); - -+ /* QCA NSS ECM bonding support - Start */ -+ rcu_read_lock(); -+ lag_cb_main = rcu_dereference(bond_cb); -+ if (lag_cb_main && lag_cb_main->bond_cb_release) -+ lag_cb_main->bond_cb_release(slave_dev); -+ -+ rcu_read_unlock(); -+ /* QCA NSS ECM bonding support - End */ -+ - bond_sysfs_slave_del(slave); - - /* recompute stats just before removing the slave */ -@@ -2747,6 +2808,8 @@ static void bond_miimon_commit(struct bo - struct slave *slave, *primary, *active; - bool do_failover = false; - struct list_head *iter; -+ struct net_device *slave_dev = NULL; /* QCA NSS ECM bonding support */ -+ struct bond_cb *lag_cb_main; /* QCA NSS ECM bonding support */ - - ASSERT_RTNL(); - -@@ -2786,6 +2849,12 @@ static void bond_miimon_commit(struct bo - bond_set_active_slave(slave); - } - -+ /* QCA NSS ECM bonding support - Start */ -+ if ((bond->params.mode == BOND_MODE_XOR) && -+ (!slave_dev)) -+ slave_dev = slave->dev; -+ /* QCA NSS ECM bonding support - End */ -+ - slave_info(bond->dev, slave->dev, "link status definitely up, %u Mbps %s duplex\n", - slave->speed == SPEED_UNKNOWN ? 0 : slave->speed, - slave->duplex ? "full" : "half"); -@@ -2834,6 +2903,16 @@ static void bond_miimon_commit(struct bo - unblock_netpoll_tx(); - } - -+ /* QCA NSS ECM bonding support - Start */ -+ rcu_read_lock(); -+ lag_cb_main = rcu_dereference(bond_cb); -+ -+ if (slave_dev && lag_cb_main && lag_cb_main->bond_cb_link_up) -+ lag_cb_main->bond_cb_link_up(slave_dev); -+ -+ rcu_read_unlock(); -+ /* QCA NSS ECM bonding support - End */ -+ - bond_set_carrier(bond); - } - -@@ -4086,8 +4165,219 @@ static inline u32 bond_eth_hash(struct s - return 0; - - ep = (struct ethhdr *)(data + mhoff); -- return ep->h_dest[5] ^ ep->h_source[5] ^ be16_to_cpu(ep->h_proto); -+ return ep->h_dest[5] ^ ep->h_source[5]; /* QCA NSS ECM bonding support */ -+} -+ -+/* QCA NSS ECM bonding support - Start */ -+/* Extract the appropriate headers based on bond's xmit policy */ -+static bool bond_flow_dissect_without_skb(struct bonding *bond, -+ u8 *src_mac, u8 *dst_mac, -+ void *psrc, void *pdst, -+ u16 protocol, __be16 *layer4hdr, -+ struct flow_keys *fk) -+{ -+ u32 *src = NULL; -+ u32 *dst = NULL; -+ -+ fk->ports.ports = 0; -+ src = (uint32_t *)psrc; -+ dst = (uint32_t *)pdst; -+ -+ if (protocol == htons(ETH_P_IP)) { -+ /* V4 addresses and address type*/ -+ fk->addrs.v4addrs.src = src[0]; -+ fk->addrs.v4addrs.dst = dst[0]; -+ fk->control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS; -+ } else if (protocol == htons(ETH_P_IPV6)) { -+ /* V6 addresses and address type*/ -+ memcpy(&fk->addrs.v6addrs.src, src, sizeof(struct in6_addr)); -+ memcpy(&fk->addrs.v6addrs.dst, dst, sizeof(struct in6_addr)); -+ fk->control.addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS; -+ } else { -+ return false; -+ } -+ if ((bond->params.xmit_policy == BOND_XMIT_POLICY_LAYER34) && -+ (layer4hdr)) -+ fk->ports.ports = *layer4hdr; -+ -+ return true; -+} -+ -+/* bond_xmit_hash_without_skb - Applies load balancing algorithm for a packet, -+ * to calculate hash for a given set of L2/L3 addresses. Does not -+ * calculate egress interface. -+ */ -+uint32_t bond_xmit_hash_without_skb(u8 *src_mac, u8 *dst_mac, -+ void *psrc, void *pdst, u16 protocol, -+ struct net_device *bond_dev, -+ __be16 *layer4hdr) -+{ -+ struct bonding *bond = netdev_priv(bond_dev); -+ struct flow_keys flow; -+ u32 hash = 0; -+ -+ if (bond->params.xmit_policy == BOND_XMIT_POLICY_LAYER2 || -+ !bond_flow_dissect_without_skb(bond, src_mac, dst_mac, psrc, -+ pdst, protocol, layer4hdr, &flow)) -+ return (dst_mac[5] ^ src_mac[5]); -+ -+ if (bond->params.xmit_policy == BOND_XMIT_POLICY_LAYER23) -+ hash = dst_mac[5] ^ src_mac[5]; -+ else if (layer4hdr) -+ hash = (__force u32)flow.ports.ports; -+ -+ hash ^= (__force u32)flow_get_u32_dst(&flow) ^ -+ (__force u32)flow_get_u32_src(&flow); -+ hash ^= (hash >> 16); -+ hash ^= (hash >> 8); -+ -+ return hash; -+} -+ -+/* bond_xor_get_tx_dev - Calculate egress interface for a given packet for a LAG -+ * that is configured in balance-xor mode -+ * @skb: pointer to skb to be egressed -+ * @src_mac: pointer to source L2 address -+ * @dst_mac: pointer to destination L2 address -+ * @src: pointer to source L3 address in network order -+ * @dst: pointer to destination L3 address in network order -+ * @protocol: L3 protocol -+ * @bond_dev: pointer to bond master device -+ * -+ * If @skb is NULL, bond_xmit_hash_without_skb is used to calculate hash using -+ * L2/L3 addresses. -+ * -+ * Returns: Either valid slave device, or NULL otherwise -+ */ -+static struct net_device *bond_xor_get_tx_dev(struct sk_buff *skb, -+ u8 *src_mac, u8 *dst_mac, -+ void *src, void *dst, -+ u16 protocol, -+ struct net_device *bond_dev, -+ __be16 *layer4hdr) -+{ -+ struct bonding *bond = netdev_priv(bond_dev); -+ int slave_cnt = READ_ONCE(bond->slave_cnt); -+ int slave_id = 0, i = 0; -+ u32 hash; -+ struct list_head *iter; -+ struct slave *slave; -+ -+ if (slave_cnt == 0) { -+ pr_debug("%s: Error: No slave is attached to the interface\n", -+ bond_dev->name); -+ return NULL; -+ } -+ -+ if (skb) { -+ hash = bond_xmit_hash(bond, skb); -+ slave_id = hash % slave_cnt; -+ } else { -+ if (bond->params.xmit_policy != BOND_XMIT_POLICY_LAYER23 && -+ bond->params.xmit_policy != BOND_XMIT_POLICY_LAYER2 && -+ bond->params.xmit_policy != BOND_XMIT_POLICY_LAYER34) { -+ pr_debug("%s: Error: Unsupported hash policy for balance-XOR fast path\n", -+ bond_dev->name); -+ return NULL; -+ } -+ -+ hash = bond_xmit_hash_without_skb(src_mac, dst_mac, src, -+ dst, protocol, bond_dev, -+ layer4hdr); -+ slave_id = hash % slave_cnt; -+ } -+ -+ i = slave_id; -+ -+ /* Here we start from the slave with slave_id */ -+ bond_for_each_slave_rcu(bond, slave, iter) { -+ if (--i < 0) { -+ if (bond_slave_can_tx(slave)) -+ return slave->dev; -+ } -+ } -+ -+ /* Here we start from the first slave up to slave_id */ -+ i = slave_id; -+ bond_for_each_slave_rcu(bond, slave, iter) { -+ if (--i < 0) -+ break; -+ if (bond_slave_can_tx(slave)) -+ return slave->dev; -+ } -+ -+ return NULL; -+} -+ -+/* bond_get_tx_dev - Calculate egress interface for a given packet. -+ * -+ * Supports 802.3AD and balance-xor modes -+ * -+ * @skb: pointer to skb to be egressed, if valid -+ * @src_mac: pointer to source L2 address -+ * @dst_mac: pointer to destination L2 address -+ * @src: pointer to source L3 address in network order -+ * @dst: pointer to destination L3 address in network order -+ * @protocol: L3 protocol id from L2 header -+ * @bond_dev: pointer to bond master device -+ * -+ * Returns: Either valid slave device, or NULL for un-supported LAG modes -+ */ -+struct net_device *bond_get_tx_dev(struct sk_buff *skb, uint8_t *src_mac, -+ u8 *dst_mac, void *src, -+ void *dst, u16 protocol, -+ struct net_device *bond_dev, -+ __be16 *layer4hdr) -+{ -+ struct bonding *bond; -+ -+ if (!bond_dev) -+ return NULL; -+ -+ if (!((bond_dev->priv_flags & IFF_BONDING) && -+ (bond_dev->flags & IFF_MASTER))) -+ return NULL; -+ -+ bond = netdev_priv(bond_dev); -+ -+ switch (bond->params.mode) { -+ case BOND_MODE_XOR: -+ return bond_xor_get_tx_dev(skb, src_mac, dst_mac, -+ src, dst, protocol, -+ bond_dev, layer4hdr); -+ case BOND_MODE_8023AD: -+ return bond_3ad_get_tx_dev(skb, src_mac, dst_mac, -+ src, dst, protocol, -+ bond_dev, layer4hdr); -+ default: -+ return NULL; -+ } - } -+EXPORT_SYMBOL(bond_get_tx_dev); -+ -+/* In bond_xmit_xor() , we determine the output device by using a pre- -+ * determined xmit_hash_policy(), If the selected device is not enabled, -+ * find the next active slave. -+ */ -+static int bond_xmit_xor(struct sk_buff *skb, struct net_device *dev) -+{ -+ struct bonding *bond = netdev_priv(dev); -+ struct net_device *outdev; -+ -+ outdev = bond_xor_get_tx_dev(skb, NULL, NULL, NULL, -+ NULL, 0, dev, NULL); -+ if (!outdev) -+ goto out; -+ -+ bond_dev_queue_xmit(bond, skb, outdev); -+ goto final; -+out: -+ /* no suitable interface, frame not sent */ -+ dev_kfree_skb(skb); -+final: -+ return NETDEV_TX_OK; -+} -+/* QCA NSS ECM bonding support - End */ - - static bool bond_flow_ip(struct sk_buff *skb, struct flow_keys *fk, const void *data, - int hlen, __be16 l2_proto, int *nhoff, int *ip_proto, bool l34) -@@ -5216,15 +5506,18 @@ static netdev_tx_t bond_3ad_xor_xmit(str - struct net_device *dev) - { - struct bonding *bond = netdev_priv(dev); -- struct bond_up_slave *slaves; -- struct slave *slave; -+ /* QCA NSS ECM bonding support - Start */ -+ struct net_device *outdev = NULL; - -- slaves = rcu_dereference(bond->usable_slaves); -- slave = bond_xmit_3ad_xor_slave_get(bond, skb, slaves); -- if (likely(slave)) -- return bond_dev_queue_xmit(bond, skb, slave->dev); -+ outdev = bond_3ad_get_tx_dev(skb, NULL, NULL, NULL, -+ NULL, 0, dev, NULL); -+ if (!outdev) { -+ dev_kfree_skb(skb); -+ return NETDEV_TX_OK; -+ } - -- return bond_tx_drop(dev, skb); -+ return bond_dev_queue_xmit(bond, skb, outdev); -+ /* QCA NSS ECM bonding support - End */ - } - - /* in broadcast mode, we send everything to all usable interfaces. */ -@@ -5474,8 +5767,9 @@ static netdev_tx_t __bond_start_xmit(str - return bond_xmit_roundrobin(skb, dev); - case BOND_MODE_ACTIVEBACKUP: - return bond_xmit_activebackup(skb, dev); -- case BOND_MODE_8023AD: - case BOND_MODE_XOR: -+ return bond_xmit_xor(skb, dev); /* QCA NSS ECM bonding support */ -+ case BOND_MODE_8023AD: - return bond_3ad_xor_xmit(skb, dev); - case BOND_MODE_BROADCAST: - return bond_xmit_broadcast(skb, dev); ---- a/include/net/bond_3ad.h -+++ b/include/net/bond_3ad.h -@@ -302,8 +302,15 @@ int bond_3ad_lacpdu_recv(const struct sk - struct slave *slave); - int bond_3ad_set_carrier(struct bonding *bond); - void bond_3ad_update_lacp_rate(struct bonding *bond); -+/* QCA NSS ECM bonding support */ -+struct net_device *bond_3ad_get_tx_dev(struct sk_buff *skb, uint8_t *src_mac, -+ uint8_t *dst_mac, void *src, -+ void *dst, uint16_t protocol, -+ struct net_device *bond_dev, -+ __be16 *layer4hdr); -+/* QCA NSS ECM bonding support */ -+ - void bond_3ad_update_ad_actor_settings(struct bonding *bond); - int bond_3ad_stats_fill(struct sk_buff *skb, struct bond_3ad_stats *stats); - size_t bond_3ad_stats_size(void); - #endif /* _NET_BOND_3AD_H */ -- ---- a/include/net/bonding.h -+++ b/include/net/bonding.h -@@ -90,6 +90,8 @@ - #define BOND_XFRM_FEATURES (NETIF_F_HW_ESP | NETIF_F_HW_ESP_TX_CSUM | \ - NETIF_F_GSO_ESP) - -+extern struct bond_cb __rcu *bond_cb; /* QCA NSS ECM bonding support */ -+ - #ifdef CONFIG_NET_POLL_CONTROLLER - extern atomic_t netpoll_block_tx; - -@@ -653,6 +655,7 @@ struct bond_net { - - int bond_rcv_validate(const struct sk_buff *skb, struct bonding *bond, struct slave *slave); - netdev_tx_t bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev); -+int bond_get_id(struct net_device *bond_dev); /* QCA NSS ECM bonding support */ - int bond_create(struct net *net, const char *name); - int bond_create_sysfs(struct bond_net *net); - void bond_destroy_sysfs(struct bond_net *net); -@@ -684,6 +687,13 @@ struct bond_vlan_tag *bond_verify_device - int level); - int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave); - void bond_slave_arr_work_rearm(struct bonding *bond, unsigned long delay); -+/* QCA NSS ECM bonding support - Start */ -+uint32_t bond_xmit_hash_without_skb(uint8_t *src_mac, uint8_t *dst_mac, -+ void *psrc, void *pdst, uint16_t protocol, -+ struct net_device *bond_dev, -+ __be16 *layer4hdr); -+/* QCA NSS ECM bonding support - End */ -+ - void bond_work_init_all(struct bonding *bond); - - #ifdef CONFIG_PROC_FS -@@ -788,4 +798,18 @@ static inline netdev_tx_t bond_tx_drop(s - return NET_XMIT_DROP; - } - -+/* QCA NSS ECM bonding support - Start */ -+struct bond_cb { -+ void (*bond_cb_link_up)(struct net_device *slave); -+ void (*bond_cb_link_down)(struct net_device *slave); -+ void (*bond_cb_enslave)(struct net_device *slave); -+ void (*bond_cb_release)(struct net_device *slave); -+ void (*bond_cb_delete_by_slave)(struct net_device *slave); -+ void (*bond_cb_delete_by_mac)(uint8_t *mac_addr); -+}; -+ -+extern int bond_register_cb(struct bond_cb *cb); -+extern void bond_unregister_cb(void); -+/* QCA NSS ECM bonding support - End */ -+ - #endif /* _NET_BONDING_H */ diff --git a/target/linux/qualcommax/patches-6.6/0600-5-qca-nss-ecm-support-macvlan.patch b/target/linux/qualcommax/patches-6.6/0600-5-qca-nss-ecm-support-macvlan.patch deleted file mode 100644 index 29f7e96d791..00000000000 --- a/target/linux/qualcommax/patches-6.6/0600-5-qca-nss-ecm-support-macvlan.patch +++ /dev/null @@ -1,96 +0,0 @@ ---- a/include/linux/if_macvlan.h -+++ b/include/linux/if_macvlan.h -@@ -15,6 +15,13 @@ struct macvlan_port; - #define MACVLAN_MC_FILTER_BITS 8 - #define MACVLAN_MC_FILTER_SZ (1 << MACVLAN_MC_FILTER_BITS) - -+/* QCA NSS ECM Support - Start */ -+/* -+ * Callback for updating interface statistics for macvlan flows offloaded from host CPU. -+ */ -+typedef void (*macvlan_offload_stats_update_cb_t)(struct net_device *dev, struct rtnl_link_stats64 *stats, bool update_mcast_rx_stats); -+/* QCA NSS ECM Support - End */ -+ - struct macvlan_dev { - struct net_device *dev; - struct list_head list; -@@ -35,6 +42,7 @@ struct macvlan_dev { - #ifdef CONFIG_NET_POLL_CONTROLLER - struct netpoll *netpoll; - #endif -+ macvlan_offload_stats_update_cb_t offload_stats_update; /* QCA NSS ECM support */ - }; - - static inline void macvlan_count_rx(const struct macvlan_dev *vlan, -@@ -107,4 +115,26 @@ static inline int macvlan_release_l2fw_o - macvlan->accel_priv = NULL; - return dev_uc_add(macvlan->lowerdev, dev->dev_addr); - } -+ -+/* QCA NSS ECM Support - Start */ -+#if IS_ENABLED(CONFIG_MACVLAN) -+static inline void -+macvlan_offload_stats_update(struct net_device *dev, -+ struct rtnl_link_stats64 *stats, -+ bool update_mcast_rx_stats) -+{ -+ struct macvlan_dev *macvlan = netdev_priv(dev); -+ -+ macvlan->offload_stats_update(dev, stats, update_mcast_rx_stats); -+} -+ -+static inline enum -+macvlan_mode macvlan_get_mode(struct net_device *dev) -+{ -+ struct macvlan_dev *macvlan = netdev_priv(dev); -+ -+ return macvlan->mode; -+} -+#endif -+/* QCA NSS ECM Support - End */ - #endif /* _LINUX_IF_MACVLAN_H */ ---- a/drivers/net/macvlan.c -+++ b/drivers/net/macvlan.c -@@ -960,6 +960,34 @@ static void macvlan_uninit(struct net_de - macvlan_port_destroy(port->dev); - } - -+/* QCA NSS ECM Support - Start */ -+/* Update macvlan statistics processed by offload engines */ -+static void macvlan_dev_update_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *offl_stats, -+ bool update_mcast_rx_stats) -+{ -+ struct vlan_pcpu_stats *stats; -+ struct macvlan_dev *macvlan; -+ -+ /* Is this a macvlan? */ -+ if (!netif_is_macvlan(dev)) -+ return; -+ -+ macvlan = netdev_priv(dev); -+ stats = this_cpu_ptr(macvlan->pcpu_stats); -+ u64_stats_update_begin(&stats->syncp); -+ u64_stats_add(&stats->rx_packets, offl_stats->rx_packets); -+ u64_stats_add(&stats->rx_bytes, offl_stats->rx_bytes); -+ u64_stats_add(&stats->tx_packets, offl_stats->tx_packets); -+ u64_stats_add(&stats->tx_bytes, offl_stats->tx_bytes); -+ /* Update multicast statistics */ -+ if (unlikely(update_mcast_rx_stats)) { -+ u64_stats_add(&stats->rx_multicast, offl_stats->rx_packets); -+ } -+ u64_stats_update_end(&stats->syncp); -+} -+/* QCA NSS ECM Support - End */ -+ - static void macvlan_dev_get_stats64(struct net_device *dev, - struct rtnl_link_stats64 *stats) - { -@@ -1506,6 +1534,7 @@ int macvlan_common_newlink(struct net *s - vlan->dev = dev; - vlan->port = port; - vlan->set_features = MACVLAN_FEATURES; -+ vlan->offload_stats_update = macvlan_dev_update_stats; /* QCA NSS ECM Support */ - - vlan->mode = MACVLAN_MODE_VEPA; - if (data && data[IFLA_MACVLAN_MODE]) diff --git a/target/linux/qualcommax/patches-6.6/0600-6-qca-nss-ecm-support-netfilter-DSCPREMARK.patch b/target/linux/qualcommax/patches-6.6/0600-6-qca-nss-ecm-support-netfilter-DSCPREMARK.patch deleted file mode 100644 index 27650731a69..00000000000 --- a/target/linux/qualcommax/patches-6.6/0600-6-qca-nss-ecm-support-netfilter-DSCPREMARK.patch +++ /dev/null @@ -1,154 +0,0 @@ ---- a/net/netfilter/Kconfig -+++ b/net/netfilter/Kconfig -@@ -174,6 +174,13 @@ config NF_CONNTRACK_TIMEOUT - - If unsure, say `N'. - -+config NF_CONNTRACK_DSCPREMARK_EXT -+ bool 'Connection tracking extension for dscp remark target' -+ depends on NETFILTER_ADVANCED -+ help -+ This option enables support for connection tracking extension -+ for dscp remark. -+ - config NF_CONNTRACK_TIMESTAMP - bool 'Connection tracking timestamping' - depends on NETFILTER_ADVANCED ---- a/include/net/netfilter/nf_conntrack_extend.h -+++ b/include/net/netfilter/nf_conntrack_extend.h -@@ -31,6 +31,10 @@ enum nf_ct_ext_id { - #if IS_ENABLED(CONFIG_NET_ACT_CT) - NF_CT_EXT_ACT_CT, - #endif -+#ifdef CONFIG_NF_CONNTRACK_DSCPREMARK_EXT -+ NF_CT_EXT_DSCPREMARK, /* QCA NSS ECM support */ -+#endif -+ - NF_CT_EXT_NUM, - }; - ---- a/net/netfilter/nf_conntrack_extend.c -+++ b/net/netfilter/nf_conntrack_extend.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - #include - - #define NF_CT_EXT_PREALLOC 128u /* conntrack events are on by default */ -@@ -54,6 +55,9 @@ static const u8 nf_ct_ext_type_len[NF_CT - #if IS_ENABLED(CONFIG_NET_ACT_CT) - [NF_CT_EXT_ACT_CT] = sizeof(struct nf_conn_act_ct_ext), - #endif -+#ifdef CONFIG_NF_CONNTRACK_DSCPREMARK_EXT -+ [NF_CT_EXT_DSCPREMARK] = sizeof(struct nf_ct_dscpremark_ext), -+#endif - }; - - static __always_inline unsigned int total_extension_size(void) -@@ -86,6 +90,9 @@ static __always_inline unsigned int tota - #if IS_ENABLED(CONFIG_NET_ACT_CT) - + sizeof(struct nf_conn_act_ct_ext) - #endif -+#ifdef CONFIG_NF_CONNTRACK_DSCPREMARK_EXT -+ + sizeof(struct nf_ct_dscpremark_ext) -+#endif - ; - } - ---- a/net/netfilter/Makefile -+++ b/net/netfilter/Makefile -@@ -15,6 +15,7 @@ nf_conntrack-$(CONFIG_NF_CONNTRACK_OVS) - nf_conntrack-$(CONFIG_NF_CT_PROTO_DCCP) += nf_conntrack_proto_dccp.o - nf_conntrack-$(CONFIG_NF_CT_PROTO_SCTP) += nf_conntrack_proto_sctp.o - nf_conntrack-$(CONFIG_NF_CT_PROTO_GRE) += nf_conntrack_proto_gre.o -+nf_conntrack-$(CONFIG_NF_CONNTRACK_DSCPREMARK_EXT) += nf_conntrack_dscpremark_ext.o - ifeq ($(CONFIG_NF_CONNTRACK),m) - nf_conntrack-$(CONFIG_DEBUG_INFO_BTF_MODULES) += nf_conntrack_bpf.o - else ifeq ($(CONFIG_NF_CONNTRACK),y) ---- a/net/netfilter/nf_conntrack_core.c -+++ b/net/netfilter/nf_conntrack_core.c -@@ -45,6 +45,9 @@ - #include - #include - #include -+#ifdef CONFIG_NF_CONNTRACK_DSCPREMARK_EXT -+#include -+#endif - #include - #include - #include -@@ -1740,6 +1743,9 @@ init_conntrack(struct net *net, struct n - nf_ct_acct_ext_add(ct, GFP_ATOMIC); - nf_ct_tstamp_ext_add(ct, GFP_ATOMIC); - nf_ct_labels_ext_add(ct); -+#ifdef CONFIG_NF_CONNTRACK_DSCPREMARK_EXT -+ nf_ct_dscpremark_ext_add(ct, GFP_ATOMIC); -+#endif - - #ifdef CONFIG_NF_CONNTRACK_EVENTS - ecache = tmpl ? nf_ct_ecache_find(tmpl) : NULL; ---- a/net/netfilter/xt_DSCP.c -+++ b/net/netfilter/xt_DSCP.c -@@ -15,6 +15,9 @@ - - #include - #include -+#ifdef CONFIG_NF_CONNTRACK_DSCPREMARK_EXT -+#include -+#endif - - MODULE_AUTHOR("Harald Welte "); - MODULE_DESCRIPTION("Xtables: DSCP/TOS field modification"); -@@ -31,6 +34,10 @@ dscp_tg(struct sk_buff *skb, const struc - { - const struct xt_DSCP_info *dinfo = par->targinfo; - u_int8_t dscp = ipv4_get_dsfield(ip_hdr(skb)) >> XT_DSCP_SHIFT; -+#ifdef CONFIG_NF_CONNTRACK_DSCPREMARK_EXT -+ struct nf_conn *ct; -+ enum ip_conntrack_info ctinfo; -+#endif - - if (dscp != dinfo->dscp) { - if (skb_ensure_writable(skb, sizeof(struct iphdr))) -@@ -39,6 +46,13 @@ dscp_tg(struct sk_buff *skb, const struc - ipv4_change_dsfield(ip_hdr(skb), XT_DSCP_ECN_MASK, - dinfo->dscp << XT_DSCP_SHIFT); - -+#ifdef CONFIG_NF_CONNTRACK_DSCPREMARK_EXT -+ ct = nf_ct_get(skb, &ctinfo); -+ if (!ct) -+ return XT_CONTINUE; -+ -+ nf_conntrack_dscpremark_ext_set_dscp_rule_valid(ct); -+#endif - } - return XT_CONTINUE; - } -@@ -48,13 +62,24 @@ dscp_tg6(struct sk_buff *skb, const stru - { - const struct xt_DSCP_info *dinfo = par->targinfo; - u_int8_t dscp = ipv6_get_dsfield(ipv6_hdr(skb)) >> XT_DSCP_SHIFT; -- -+#ifdef CONFIG_NF_CONNTRACK_DSCPREMARK_EXT -+ struct nf_conn *ct; -+ enum ip_conntrack_info ctinfo; -+#endif - if (dscp != dinfo->dscp) { - if (skb_ensure_writable(skb, sizeof(struct ipv6hdr))) - return NF_DROP; - - ipv6_change_dsfield(ipv6_hdr(skb), XT_DSCP_ECN_MASK, - dinfo->dscp << XT_DSCP_SHIFT); -+ -+#ifdef CONFIG_NF_CONNTRACK_DSCPREMARK_EXT -+ ct = nf_ct_get(skb, &ctinfo); -+ if (!ct) -+ return XT_CONTINUE; -+ -+ nf_conntrack_dscpremark_ext_set_dscp_rule_valid(ct); -+#endif - } - return XT_CONTINUE; - } diff --git a/target/linux/qualcommax/patches-6.6/0600-7-qca-nss-ecm-fix-IPv6-user-route-change-event-calls.patch b/target/linux/qualcommax/patches-6.6/0600-7-qca-nss-ecm-fix-IPv6-user-route-change-event-calls.patch deleted file mode 100644 index baef78525a3..00000000000 --- a/target/linux/qualcommax/patches-6.6/0600-7-qca-nss-ecm-fix-IPv6-user-route-change-event-calls.patch +++ /dev/null @@ -1,87 +0,0 @@ -From ce18a6fdff6a39a01111d74f513d2ef66142047c Mon Sep 17 00:00:00 2001 -From: Murat Sezgin -Date: Wed, 5 Aug 2020 13:21:27 -0700 -Subject: [PATCH 246/281] net:ipv6: Fix IPv6 user route change event calls - -These events should be called only when the route table is -changed by the userspace. So, we should call them in the -ioctl and the netlink message handler function. - -Change-Id: If7ec615014cfc79d5fa72878e49eaf99c2560c32 -Signed-off-by: Murat Sezgin ---- - net/ipv6/route.c | 31 +++++++++++++++++++++---------- - 1 file changed, 21 insertions(+), 10 deletions(-) - ---- a/net/ipv6/route.c -+++ b/net/ipv6/route.c -@@ -3871,10 +3871,6 @@ int ip6_route_add(struct fib6_config *cf - return PTR_ERR(rt); - - err = __ip6_ins_rt(rt, &cfg->fc_nlinfo, extack); -- if (!err) -- atomic_notifier_call_chain(&ip6route_chain, -- RTM_NEWROUTE, rt); -- - fib6_info_release(rt); - - return err; -@@ -3896,9 +3892,6 @@ static int __ip6_del_rt(struct fib6_info - err = fib6_del(rt, info); - spin_unlock_bh(&table->tb6_lock); - -- if (!err) -- atomic_notifier_call_chain(&ip6route_chain, -- RTM_DELROUTE, rt); - out: - fib6_info_release(rt); - return err; -@@ -4507,6 +4500,10 @@ int ipv6_route_ioctl(struct net *net, un - break; - } - rtnl_unlock(); -+ if (!err) -+ atomic_notifier_call_chain(&ip6route_chain, -+ (cmd == SIOCADDRT) ? RTM_NEWROUTE : RTM_DELROUTE, &cfg); -+ - return err; - } - -@@ -5525,11 +5522,17 @@ static int inet6_rtm_delroute(struct sk_ - } - - if (cfg.fc_mp) -- return ip6_route_multipath_del(&cfg, extack); -+ err = ip6_route_multipath_del(&cfg, extack); - else { - cfg.fc_delete_all_nh = 1; -- return ip6_route_del(&cfg, extack); -+ err = ip6_route_del(&cfg, extack); - } -+ -+ if (!err) -+ atomic_notifier_call_chain(&ip6route_chain, -+ RTM_DELROUTE, &cfg); -+ -+ return err; - } - - static int inet6_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, -@@ -5546,9 +5549,15 @@ static int inet6_rtm_newroute(struct sk_ - cfg.fc_metric = IP6_RT_PRIO_USER; - - if (cfg.fc_mp) -- return ip6_route_multipath_add(&cfg, extack); -+ err = ip6_route_multipath_add(&cfg, extack); - else -- return ip6_route_add(&cfg, GFP_KERNEL, extack); -+ err = ip6_route_add(&cfg, GFP_KERNEL, extack); -+ -+ if (!err) -+ atomic_notifier_call_chain(&ip6route_chain, -+ RTM_NEWROUTE, &cfg); -+ -+ return err; - } - - /* add the overhead of this fib6_nh to nexthop_len */ diff --git a/target/linux/qualcommax/patches-6.6/0601-1-qca-add-nss-bridge-mgr-support.patch b/target/linux/qualcommax/patches-6.6/0601-1-qca-add-nss-bridge-mgr-support.patch deleted file mode 100644 index dcfd78d5932..00000000000 --- a/target/linux/qualcommax/patches-6.6/0601-1-qca-add-nss-bridge-mgr-support.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 3c17a0e1112be70071e98d5208da5b55dcec20a6 Mon Sep 17 00:00:00 2001 -From: Simon Casey -Date: Wed, 2 Feb 2022 19:37:29 +0100 -Subject: [PATCH] Update 607-qca-add-add-nss-bridge-mgr-support.patch for kernel 5.15 - ---- - include/linux/if_bridge.h | 4 ++++ - net/bridge/br_fdb.c | 25 +++++++++++++++++++++---- - 2 files changed, 25 insertions(+), 4 deletions(-) - ---- a/include/linux/if_bridge.h -+++ b/include/linux/if_bridge.h -@@ -254,4 +254,8 @@ typedef struct net_bridge_port *br_get_d - extern br_get_dst_hook_t __rcu *br_get_dst_hook; - /* QCA NSS ECM support - End */ - -+/* QCA NSS bridge-mgr support - Start */ -+extern struct net_device *br_fdb_bridge_dev_get_and_hold(struct net_bridge *br); -+/* QCA NSS bridge-mgr support - End */ -+ - #endif ---- a/net/bridge/br_fdb.c -+++ b/net/bridge/br_fdb.c -@@ -576,7 +576,7 @@ void br_fdb_cleanup(struct work_struct * - unsigned long delay = hold_time(br); - unsigned long work_delay = delay; - unsigned long now = jiffies; -- u8 mac_addr[6]; /* QCA NSS ECM support */ -+ struct br_fdb_event fdb_event; /* QCA NSS bridge-mgr support */ - - /* this part is tricky, in order to avoid blocking learning and - * consequently forwarding, we rely on rcu to delete objects with -@@ -604,12 +604,13 @@ void br_fdb_cleanup(struct work_struct * - } else { - spin_lock_bh(&br->hash_lock); - if (!hlist_unhashed(&f->fdb_node)) { -- ether_addr_copy(mac_addr, f->key.addr.addr); -+ memset(&fdb_event, 0, sizeof(fdb_event)); -+ ether_addr_copy(fdb_event.addr, f->key.addr.addr); - fdb_delete(br, f, true); - /* QCA NSS ECM support - Start */ - atomic_notifier_call_chain( - &br_fdb_update_notifier_list, 0, -- (void *)mac_addr); -+ (void *)&fdb_event); - /* QCA NSS ECM support - End */ - } - spin_unlock_bh(&br->hash_lock); -@@ -907,10 +908,21 @@ static bool __fdb_mark_active(struct net - test_and_clear_bit(BR_FDB_NOTIFY_INACTIVE, &fdb->flags)); - } - -+/* QCA NSS bridge-mgr support - Start */ -+/* Get the bridge device */ -+struct net_device *br_fdb_bridge_dev_get_and_hold(struct net_bridge *br) -+{ -+ dev_hold(br->dev); -+ return br->dev; -+} -+EXPORT_SYMBOL_GPL(br_fdb_bridge_dev_get_and_hold); -+/* QCA NSS bridge-mgr support - End */ -+ - void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, - const unsigned char *addr, u16 vid, unsigned long flags) - { - struct net_bridge_fdb_entry *fdb; -+ struct br_fdb_event fdb_event; /* QCA NSS bridge-mgr support */ - - /* some users want to always flood. */ - if (hold_time(br) == 0) -@@ -936,6 +948,12 @@ void br_fdb_update(struct net_bridge *br - if (unlikely(source != READ_ONCE(fdb->dst) && - !test_bit(BR_FDB_STICKY, &fdb->flags))) { - br_switchdev_fdb_notify(br, fdb, RTM_DELNEIGH); -+ /* QCA NSS bridge-mgr support - Start */ -+ ether_addr_copy(fdb_event.addr, addr); -+ fdb_event.br = br; -+ fdb_event.orig_dev = fdb->dst->dev; -+ fdb_event.dev = source->dev; -+ /* QCA NSS bridge-mgr support - End */ - WRITE_ONCE(fdb->dst, source); - fdb_modified = true; - /* Take over HW learned entry */ -@@ -952,7 +970,7 @@ void br_fdb_update(struct net_bridge *br - /* QCA NSS ECM support - Start */ - atomic_notifier_call_chain( - &br_fdb_update_notifier_list, -- 0, (void *)addr); -+ 0, (void *)&fdb_event); - /* QCA NSS ECM support - End */ - } - diff --git a/target/linux/qualcommax/patches-6.6/0602-1-qca-nss-drv-add-qdisc-support.patch b/target/linux/qualcommax/patches-6.6/0602-1-qca-nss-drv-add-qdisc-support.patch deleted file mode 100644 index 2926faacefe..00000000000 --- a/target/linux/qualcommax/patches-6.6/0602-1-qca-nss-drv-add-qdisc-support.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/include/uapi/linux/pkt_cls.h -+++ b/include/uapi/linux/pkt_cls.h -@@ -139,6 +139,7 @@ enum tca_id { - TCA_ID_MPLS, - TCA_ID_CT, - TCA_ID_GATE, -+ TCA_ID_MIRRED_NSS, /* QCA NSS Qdisc IGS Support */ - /* other actions go here */ - __TCA_ID_MAX = 255 - }; -@@ -817,4 +818,14 @@ enum { - TCF_EM_OPND_LT - }; - -+/* QCA NSS Qdisc Support - Start */ -+#define _TC_MAKE32(x) ((x)) -+#define _TC_MAKEMASK1(n) (_TC_MAKE32(1) << _TC_MAKE32(n)) -+ -+#define TC_NCLS _TC_MAKEMASK1(8) -+#define TC_NCLS_NSS _TC_MAKEMASK1(12) -+#define SET_TC_NCLS_NSS(v) ( TC_NCLS_NSS | ((v) & ~TC_NCLS_NSS)) -+#define CLR_TC_NCLS_NSS(v) ( (v) & ~TC_NCLS_NSS) -+/* QCA NSS Qdisc Support - End */ -+ - #endif diff --git a/target/linux/qualcommax/patches-6.6/0603-1-qca-nss-clients-add-qdisc-support.patch b/target/linux/qualcommax/patches-6.6/0603-1-qca-nss-clients-add-qdisc-support.patch deleted file mode 100644 index 82d9af7952a..00000000000 --- a/target/linux/qualcommax/patches-6.6/0603-1-qca-nss-clients-add-qdisc-support.patch +++ /dev/null @@ -1,463 +0,0 @@ ---- a/include/linux/timer.h -+++ b/include/linux/timer.h -@@ -17,6 +17,7 @@ struct timer_list { - unsigned long expires; - void (*function)(struct timer_list *); - u32 flags; -+ unsigned long cust_data; - - #ifdef CONFIG_LOCKDEP - struct lockdep_map lockdep_map; ---- a/drivers/net/ifb.c -+++ b/drivers/net/ifb.c -@@ -151,6 +151,31 @@ resched: - - } - -+void ifb_update_offload_stats(struct net_device *dev, struct pcpu_sw_netstats *offload_stats) -+{ -+ struct ifb_dev_private *dp; -+ struct ifb_q_private *txp; -+ -+ if (!dev || !offload_stats) { -+ return; -+ } -+ -+ if (!(dev->priv_flags_ext & IFF_EXT_IFB)) { -+ return; -+ } -+ -+ dp = netdev_priv(dev); -+ txp = dp->tx_private; -+ -+ u64_stats_update_begin(&txp->rx_stats.sync); -+ txp->rx_stats.packets += u64_stats_read(&offload_stats->rx_packets); -+ txp->rx_stats.bytes += u64_stats_read(&offload_stats->rx_bytes); -+ txp->tx_stats.packets += u64_stats_read(&offload_stats->tx_packets); -+ txp->tx_stats.bytes += u64_stats_read(&offload_stats->tx_bytes); -+ u64_stats_update_end(&txp->rx_stats.sync); -+} -+EXPORT_SYMBOL(ifb_update_offload_stats); -+ - static void ifb_stats64(struct net_device *dev, - struct rtnl_link_stats64 *stats) - { -@@ -326,6 +351,7 @@ static void ifb_setup(struct net_device - dev->flags |= IFF_NOARP; - dev->flags &= ~IFF_MULTICAST; - dev->priv_flags &= ~IFF_TX_SKB_SHARING; -+ dev->priv_flags_ext |= IFF_EXT_IFB; /* Mark the device as an IFB device. */ - netif_keep_dst(dev); - eth_hw_addr_random(dev); - dev->needs_free_netdev = true; ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -4693,6 +4693,15 @@ void dev_uc_flush(struct net_device *dev - void dev_uc_init(struct net_device *dev); - - /** -+ * ifb_update_offload_stats - Update the IFB interface stats -+ * @dev: IFB device to update the stats -+ * @offload_stats: per CPU stats structure -+ * -+ * Allows update of IFB stats when flows are offloaded to an accelerator. -+ **/ -+void ifb_update_offload_stats(struct net_device *dev, struct pcpu_sw_netstats *offload_stats); -+ -+/** - * __dev_uc_sync - Synchonize device's unicast list - * @dev: device to sync - * @sync: function to call if address should be added -@@ -5219,6 +5228,11 @@ static inline bool netif_is_failover_sla - return dev->priv_flags & IFF_FAILOVER_SLAVE; - } - -+static inline bool netif_is_ifb_dev(const struct net_device *dev) -+{ -+ return dev->priv_flags_ext & IFF_EXT_IFB; -+} -+ - /* This device needs to keep skb dst for qdisc enqueue or ndo_start_xmit() */ - static inline void netif_keep_dst(struct net_device *dev) - { ---- a/include/uapi/linux/pkt_sched.h -+++ b/include/uapi/linux/pkt_sched.h -@@ -1306,4 +1306,248 @@ enum { - - #define TCA_ETS_MAX (__TCA_ETS_MAX - 1) - -+/* QCA NSS Clients Support - Start */ -+enum { -+ TCA_NSS_ACCEL_MODE_NSS_FW, -+ TCA_NSS_ACCEL_MODE_PPE, -+ TCA_NSS_ACCEL_MODE_MAX -+}; -+ -+/* NSSFIFO section */ -+ -+enum { -+ TCA_NSSFIFO_UNSPEC, -+ TCA_NSSFIFO_PARMS, -+ __TCA_NSSFIFO_MAX -+}; -+ -+#define TCA_NSSFIFO_MAX (__TCA_NSSFIFO_MAX - 1) -+ -+struct tc_nssfifo_qopt { -+ __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */ -+ __u8 set_default; /* Sets qdisc to be the default qdisc for enqueue */ -+ __u8 accel_mode; /* Dictates which data plane offloads the qdisc */ -+}; -+ -+/* NSSWRED section */ -+ -+enum { -+ TCA_NSSWRED_UNSPEC, -+ TCA_NSSWRED_PARMS, -+ __TCA_NSSWRED_MAX -+}; -+ -+#define TCA_NSSWRED_MAX (__TCA_NSSWRED_MAX - 1) -+#define NSSWRED_CLASS_MAX 6 -+struct tc_red_alg_parameter { -+ __u32 min; /* qlen_avg < min: pkts are all enqueued */ -+ __u32 max; /* qlen_avg > max: pkts are all dropped */ -+ __u32 probability;/* Drop probability at qlen_avg = max */ -+ __u32 exp_weight_factor;/* exp_weight_factor for calculate qlen_avg */ -+}; -+ -+struct tc_nsswred_traffic_class { -+ __u32 limit; /* Queue length */ -+ __u32 weight_mode_value; /* Weight mode value */ -+ struct tc_red_alg_parameter rap;/* Parameters for RED alg */ -+}; -+ -+/* -+ * Weight modes for WRED -+ */ -+enum tc_nsswred_weight_modes { -+ TC_NSSWRED_WEIGHT_MODE_DSCP = 0,/* Weight mode is DSCP */ -+ TC_NSSWRED_WEIGHT_MODES, /* Must be last */ -+}; -+ -+struct tc_nsswred_qopt { -+ __u32 limit; /* Queue length */ -+ enum tc_nsswred_weight_modes weight_mode; -+ /* Weight mode */ -+ __u32 traffic_classes; /* How many traffic classes: DPs */ -+ __u32 def_traffic_class; /* Default traffic if no match: def_DP */ -+ __u32 traffic_id; /* The traffic id to be configured: DP */ -+ __u32 weight_mode_value; /* Weight mode value */ -+ struct tc_red_alg_parameter rap;/* RED algorithm parameters */ -+ struct tc_nsswred_traffic_class tntc[NSSWRED_CLASS_MAX]; -+ /* Traffic settings for dumpping */ -+ __u8 ecn; /* Setting ECN bit or dropping */ -+ __u8 set_default; /* Sets qdisc to be the default for enqueue */ -+ __u8 accel_mode; /* Dictates which data plane offloads the qdisc */ -+}; -+ -+/* NSSCODEL section */ -+ -+enum { -+ TCA_NSSCODEL_UNSPEC, -+ TCA_NSSCODEL_PARMS, -+ __TCA_NSSCODEL_MAX -+}; -+ -+#define TCA_NSSCODEL_MAX (__TCA_NSSCODEL_MAX - 1) -+ -+struct tc_nsscodel_qopt { -+ __u32 target; /* Acceptable queueing delay */ -+ __u32 limit; /* Max number of packets that can be held in the queue */ -+ __u32 interval; /* Monitoring interval */ -+ __u32 flows; /* Number of flow buckets */ -+ __u32 quantum; /* Weight (in bytes) used for DRR of flow buckets */ -+ __u8 ecn; /* 0 - disable ECN, 1 - enable ECN */ -+ __u8 set_default; /* Sets qdisc to be the default qdisc for enqueue */ -+ __u8 accel_mode; /* Dictates which data plane offloads the qdisc */ -+}; -+ -+struct tc_nsscodel_xstats { -+ __u32 peak_queue_delay; /* Peak delay experienced by a dequeued packet */ -+ __u32 peak_drop_delay; /* Peak delay experienced by a dropped packet */ -+}; -+ -+/* NSSFQ_CODEL section */ -+ -+struct tc_nssfq_codel_xstats { -+ __u32 new_flow_count; /* Total number of new flows seen */ -+ __u32 new_flows_len; /* Current number of new flows */ -+ __u32 old_flows_len; /* Current number of old flows */ -+ __u32 ecn_mark; /* Number of packets marked with ECN */ -+ __u32 drop_overlimit; /* Number of packets dropped due to overlimit */ -+ __u32 maxpacket; /* The largest packet seen so far in the queue */ -+}; -+ -+/* NSSTBL section */ -+ -+enum { -+ TCA_NSSTBL_UNSPEC, -+ TCA_NSSTBL_PARMS, -+ __TCA_NSSTBL_MAX -+}; -+ -+#define TCA_NSSTBL_MAX (__TCA_NSSTBL_MAX - 1) -+ -+struct tc_nsstbl_qopt { -+ __u32 burst; /* Maximum burst size */ -+ __u32 rate; /* Limiting rate of TBF */ -+ __u32 peakrate; /* Maximum rate at which TBF is allowed to send */ -+ __u32 mtu; /* Max size of packet, or minumim burst size */ -+ __u8 accel_mode; /* Dictates which data plane offloads the qdisc */ -+}; -+ -+/* NSSPRIO section */ -+ -+#define TCA_NSSPRIO_MAX_BANDS 256 -+ -+enum { -+ TCA_NSSPRIO_UNSPEC, -+ TCA_NSSPRIO_PARMS, -+ __TCA_NSSPRIO_MAX -+}; -+ -+#define TCA_NSSPRIO_MAX (__TCA_NSSPRIO_MAX - 1) -+ -+struct tc_nssprio_qopt { -+ __u32 bands; /* Number of bands */ -+ __u8 accel_mode; /* Dictates which data plane offloads the qdisc */ -+}; -+ -+/* NSSBF section */ -+ -+enum { -+ TCA_NSSBF_UNSPEC, -+ TCA_NSSBF_CLASS_PARMS, -+ TCA_NSSBF_QDISC_PARMS, -+ __TCA_NSSBF_MAX -+}; -+ -+#define TCA_NSSBF_MAX (__TCA_NSSBF_MAX - 1) -+ -+struct tc_nssbf_class_qopt { -+ __u32 burst; /* Maximum burst size */ -+ __u32 rate; /* Allowed bandwidth for this class */ -+ __u32 mtu; /* MTU of the associated interface */ -+ __u32 quantum; /* Quantum allocation for DRR */ -+}; -+ -+struct tc_nssbf_qopt { -+ __u16 defcls; /* Default class value */ -+ __u8 accel_mode; /* Dictates which data plane offloads the qdisc */ -+}; -+ -+/* NSSWRR section */ -+ -+enum { -+ TCA_NSSWRR_UNSPEC, -+ TCA_NSSWRR_CLASS_PARMS, -+ TCA_NSSWRR_QDISC_PARMS, -+ __TCA_NSSWRR_MAX -+}; -+ -+#define TCA_NSSWRR_MAX (__TCA_NSSWRR_MAX - 1) -+ -+struct tc_nsswrr_class_qopt { -+ __u32 quantum; /* Weight associated to this class */ -+}; -+ -+struct tc_nsswrr_qopt { -+ __u8 accel_mode; /* Dictates which data plane offloads the qdisc */ -+}; -+ -+/* NSSWFQ section */ -+ -+enum { -+ TCA_NSSWFQ_UNSPEC, -+ TCA_NSSWFQ_CLASS_PARMS, -+ TCA_NSSWFQ_QDISC_PARMS, -+ __TCA_NSSWFQ_MAX -+}; -+ -+#define TCA_NSSWFQ_MAX (__TCA_NSSWFQ_MAX - 1) -+ -+struct tc_nsswfq_class_qopt { -+ __u32 quantum; /* Weight associated to this class */ -+}; -+ -+struct tc_nsswfq_qopt { -+ __u8 accel_mode; /* Dictates which data plane offloads the qdisc */ -+}; -+ -+/* NSSHTB section */ -+ -+enum { -+ TCA_NSSHTB_UNSPEC, -+ TCA_NSSHTB_CLASS_PARMS, -+ TCA_NSSHTB_QDISC_PARMS, -+ __TCA_NSSHTB_MAX -+}; -+ -+#define TCA_NSSHTB_MAX (__TCA_NSSHTB_MAX - 1) -+ -+struct tc_nsshtb_class_qopt { -+ __u32 burst; /* Allowed burst size */ -+ __u32 rate; /* Allowed bandwidth for this class */ -+ __u32 cburst; /* Maximum burst size */ -+ __u32 crate; /* Maximum bandwidth for this class */ -+ __u32 quantum; /* Quantum allocation for DRR */ -+ __u32 priority; /* Priority value associated with this class */ -+ __u32 overhead; /* Overhead in bytes per packet */ -+}; -+ -+struct tc_nsshtb_qopt { -+ __u32 r2q; /* Rate to quantum ratio */ -+ __u8 accel_mode; /* Dictates which data plane offloads the qdisc */ -+}; -+ -+/* NSSBLACKHOLE section */ -+ -+enum { -+ TCA_NSSBLACKHOLE_UNSPEC, -+ TCA_NSSBLACKHOLE_PARMS, -+ __TCA_NSSBLACKHOLE_MAX -+}; -+ -+#define TCA_NSSBLACKHOLE_MAX (__TCA_NSSBLACKHOLE_MAX - 1) -+ -+struct tc_nssblackhole_qopt { -+ __u8 set_default; /* Sets qdisc to be the default qdisc for enqueue */ -+ __u8 accel_mode; /* Dictates which data plane offloads the qdisc */ -+}; -+/* QCA NSS Clients Support - End */ - #endif ---- a/net/sched/sch_api.c -+++ b/net/sched/sch_api.c -@@ -314,6 +314,7 @@ struct Qdisc *qdisc_lookup(struct net_de - out: - return q; - } -+EXPORT_SYMBOL(qdisc_lookup); - - struct Qdisc *qdisc_lookup_rcu(struct net_device *dev, u32 handle) - { -@@ -2390,4 +2391,26 @@ static int __init pktsched_init(void) - return 0; - } - -+/* QCA NSS Qdisc Support - Start */ -+bool tcf_destroy(struct tcf_proto *tp, bool force) -+{ -+ tp->ops->destroy(tp, force, NULL); -+ module_put(tp->ops->owner); -+ kfree_rcu(tp, rcu); -+ -+ return true; -+} -+ -+void tcf_destroy_chain(struct tcf_proto __rcu **fl) -+{ -+ struct tcf_proto *tp; -+ -+ while ((tp = rtnl_dereference(*fl)) != NULL) { -+ RCU_INIT_POINTER(*fl, tp->next); -+ tcf_destroy(tp, true); -+ } -+} -+EXPORT_SYMBOL(tcf_destroy_chain); -+/* QCA NSS Qdisc Support - End */ -+ - subsys_initcall(pktsched_init); ---- a/net/sched/sch_generic.c -+++ b/net/sched/sch_generic.c -@@ -1074,6 +1074,7 @@ static void __qdisc_destroy(struct Qdisc - - call_rcu(&qdisc->rcu, qdisc_free_cb); - } -+EXPORT_SYMBOL(qdisc_destroy); - - void qdisc_destroy(struct Qdisc *qdisc) - { ---- a/include/net/sch_generic.h -+++ b/include/net/sch_generic.h -@@ -94,6 +94,7 @@ struct Qdisc { - #define TCQ_F_INVISIBLE 0x80 /* invisible by default in dump */ - #define TCQ_F_NOLOCK 0x100 /* qdisc does not require locking */ - #define TCQ_F_OFFLOADED 0x200 /* qdisc is offloaded to HW */ -+#define TCQ_F_NSS 0x1000 /* NSS qdisc flag. */ - u32 limit; - const struct Qdisc_ops *ops; - struct qdisc_size_table __rcu *stab; -@@ -752,6 +753,42 @@ static inline bool skb_skip_tc_classify( - return false; - } - -+/* QCA NSS Qdisc Support - Start */ -+/* -+ * Set skb classify bit field. -+ */ -+static inline void skb_set_tc_classify_offload(struct sk_buff *skb) -+{ -+#ifdef CONFIG_NET_CLS_ACT -+ skb->tc_skip_classify_offload = 1; -+#endif -+} -+ -+/* -+ * Clear skb classify bit field. -+ */ -+static inline void skb_clear_tc_classify_offload(struct sk_buff *skb) -+{ -+#ifdef CONFIG_NET_CLS_ACT -+ skb->tc_skip_classify_offload = 0; -+#endif -+} -+ -+/* -+ * Skip skb processing if sent from ifb dev. -+ */ -+static inline bool skb_skip_tc_classify_offload(struct sk_buff *skb) -+{ -+#ifdef CONFIG_NET_CLS_ACT -+ if (skb->tc_skip_classify_offload) { -+ skb_clear_tc_classify_offload(skb); -+ return true; -+ } -+#endif -+ return false; -+} -+/* QCA NSS Qdisc Support - End */ -+ - /* Reset all TX qdiscs greater than index of a device. */ - static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i) - { -@@ -1324,4 +1361,9 @@ static inline void qdisc_synchronize(con - msleep(1); - } - -+/* QCA NSS Qdisc Support - Start */ -+void qdisc_destroy(struct Qdisc *qdisc); -+void tcf_destroy_chain(struct tcf_proto __rcu **fl); -+/* QCA NSS Qdisc Support - End */ -+ - #endif ---- a/include/linux/skbuff.h -+++ b/include/linux/skbuff.h -@@ -762,6 +762,7 @@ typedef unsigned char *sk_buff_data_t; - * @offload_fwd_mark: Packet was L2-forwarded in hardware - * @offload_l3_fwd_mark: Packet was L3-forwarded in hardware - * @tc_skip_classify: do not classify packet. set by IFB device -+ * @tc_skip_classify_offload: do not classify packet set by offload IFB device - * @tc_at_ingress: used within tc_classify to distinguish in/egress - * @redirected: packet was redirected by packet classifier - * @from_ingress: packet was redirected from the ingress path -@@ -940,6 +941,9 @@ struct sk_buff { - __u8 tc_at_ingress:1; /* See TC_AT_INGRESS_MASK */ - __u8 tc_skip_classify:1; - #endif -+#ifdef CONFIG_NET_CLS_ACT -+ __u8 tc_skip_classify_offload:1; /* QCA NSS Qdisc Support */ -+#endif - __u8 remcsum_offload:1; - __u8 csum_complete_sw:1; - __u8 csum_level:2; diff --git a/target/linux/qualcommax/patches-6.6/0603-2-qca-nss-clients-add-l2tp-support.patch b/target/linux/qualcommax/patches-6.6/0603-2-qca-nss-clients-add-l2tp-support.patch deleted file mode 100644 index 95ae02b7ee5..00000000000 --- a/target/linux/qualcommax/patches-6.6/0603-2-qca-nss-clients-add-l2tp-support.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- a/net/l2tp/l2tp_core.c -+++ b/net/l2tp/l2tp_core.c -@@ -403,6 +403,31 @@ err_tlock: - } - EXPORT_SYMBOL_GPL(l2tp_session_register); - -+void l2tp_stats_update(struct l2tp_tunnel *tunnel, -+ struct l2tp_session *session, -+ struct l2tp_stats *stats) -+{ -+ atomic_long_add(atomic_long_read(&stats->rx_packets), -+ &tunnel->stats.rx_packets); -+ atomic_long_add(atomic_long_read(&stats->rx_bytes), -+ &tunnel->stats.rx_bytes); -+ atomic_long_add(atomic_long_read(&stats->tx_packets), -+ &tunnel->stats.tx_packets); -+ atomic_long_add(atomic_long_read(&stats->tx_bytes), -+ &tunnel->stats.tx_bytes); -+ -+ atomic_long_add(atomic_long_read(&stats->rx_packets), -+ &session->stats.rx_packets); -+ atomic_long_add(atomic_long_read(&stats->rx_bytes), -+ &session->stats.rx_bytes); -+ atomic_long_add(atomic_long_read(&stats->tx_packets), -+ &session->stats.tx_packets); -+ atomic_long_add(atomic_long_read(&stats->tx_bytes), -+ &session->stats.tx_bytes); -+} -+EXPORT_SYMBOL_GPL(l2tp_stats_update); -+ -+ - /***************************************************************************** - * Receive data handling - *****************************************************************************/ ---- a/net/l2tp/l2tp_core.h -+++ b/net/l2tp/l2tp_core.h -@@ -232,6 +232,9 @@ struct l2tp_session *l2tp_session_get_nt - struct l2tp_session *l2tp_session_get_by_ifname(const struct net *net, - const char *ifname); - -+void l2tp_stats_update(struct l2tp_tunnel *tunnel, struct l2tp_session *session, -+ struct l2tp_stats *stats); -+ - /* Tunnel and session lifetime management. - * Creation of a new instance is a two-step process: create, then register. - * Destruction is triggered using the *_delete functions, and completes asynchronously. diff --git a/target/linux/qualcommax/patches-6.6/0603-3-qca-nss-clients-add-PPTP-support.patch b/target/linux/qualcommax/patches-6.6/0603-3-qca-nss-clients-add-PPTP-support.patch deleted file mode 100644 index 2c431a5d257..00000000000 --- a/target/linux/qualcommax/patches-6.6/0603-3-qca-nss-clients-add-PPTP-support.patch +++ /dev/null @@ -1,478 +0,0 @@ ---- a/include/linux/if_pppox.h -+++ b/include/linux/if_pppox.h -@@ -36,6 +36,7 @@ struct pptp_opt { - u32 ack_sent, ack_recv; - u32 seq_sent, seq_recv; - int ppp_flags; -+ bool pptp_offload_mode; - }; - #include - -@@ -100,8 +101,40 @@ struct pppoe_channel_ops { - int (*get_addressing)(struct ppp_channel *, struct pppoe_opt *); - }; - -+/* PPTP client callback */ -+typedef int (*pptp_gre_seq_offload_callback_t)(struct sk_buff *skb, -+ struct net_device *pptp_dev); -+ - /* Return PPPoE channel specific addressing information */ - extern int pppoe_channel_addressing_get(struct ppp_channel *chan, - struct pppoe_opt *addressing); - -+/* Lookup PPTP session info and return PPTP session using sip, dip and local call id */ -+extern int pptp_session_find_by_src_callid(struct pptp_opt *opt, __be16 src_call_id, -+ __be32 daddr, __be32 saddr); -+ -+/* Lookup PPTP session info and return PPTP session using dip and peer call id */ -+extern int pptp_session_find(struct pptp_opt *opt, __be16 peer_call_id, -+ __be32 peer_ip_addr); -+ -+/* Return PPTP session information given the channel */ -+extern void pptp_channel_addressing_get(struct pptp_opt *opt, -+ struct ppp_channel *chan); -+ -+/* Enable the PPTP session offload flag */ -+extern int pptp_session_enable_offload_mode(__be16 peer_call_id, -+ __be32 peer_ip_addr); -+ -+/* Disable the PPTP session offload flag */ -+extern int pptp_session_disable_offload_mode(__be16 peer_call_id, -+ __be32 peer_ip_addr); -+ -+/* Register the PPTP GRE packets sequence number offload callback */ -+extern int -+pptp_register_gre_seq_offload_callback(pptp_gre_seq_offload_callback_t -+ pptp_client_cb); -+ -+/* Unregister the PPTP GRE packets sequence number offload callback */ -+extern void pptp_unregister_gre_seq_offload_callback(void); -+ - #endif /* !(__LINUX_IF_PPPOX_H) */ ---- a/drivers/net/ppp/ppp_generic.c -+++ b/drivers/net/ppp/ppp_generic.c -@@ -2988,6 +2988,20 @@ char *ppp_dev_name(struct ppp_channel *c - return name; - } - -+/* Return the PPP net device index */ -+int ppp_dev_index(struct ppp_channel *chan) -+{ -+ struct channel *pch = chan->ppp; -+ int ifindex = 0; -+ -+ if (pch) { -+ read_lock_bh(&pch->upl); -+ if (pch->ppp && pch->ppp->dev) -+ ifindex = pch->ppp->dev->ifindex; -+ read_unlock_bh(&pch->upl); -+ } -+ return ifindex; -+} - - /* - * Disconnect a channel from the generic layer. -@@ -3696,6 +3710,28 @@ void ppp_update_stats(struct net_device - ppp_recv_unlock(ppp); - } - -+/* Returns true if Compression is enabled on PPP device -+ */ -+bool ppp_is_cp_enabled(struct net_device *dev) -+{ -+ struct ppp *ppp; -+ bool flag = false; -+ -+ if (!dev) -+ return false; -+ -+ if (dev->type != ARPHRD_PPP) -+ return false; -+ -+ ppp = netdev_priv(dev); -+ ppp_lock(ppp); -+ flag = !!(ppp->xstate & SC_COMP_RUN) || !!(ppp->rstate & SC_DECOMP_RUN); -+ ppp_unlock(ppp); -+ -+ return flag; -+} -+EXPORT_SYMBOL(ppp_is_cp_enabled); -+ - /* Returns >0 if the device is a multilink PPP netdevice, 0 if not or < 0 if - * the device is not PPP. - */ -@@ -3887,6 +3923,7 @@ EXPORT_SYMBOL(ppp_unregister_channel); - EXPORT_SYMBOL(ppp_channel_index); - EXPORT_SYMBOL(ppp_unit_number); - EXPORT_SYMBOL(ppp_dev_name); -+EXPORT_SYMBOL(ppp_dev_index); - EXPORT_SYMBOL(ppp_input); - EXPORT_SYMBOL(ppp_input_error); - EXPORT_SYMBOL(ppp_output_wakeup); ---- a/include/linux/ppp_channel.h -+++ b/include/linux/ppp_channel.h -@@ -84,6 +84,9 @@ extern void ppp_unregister_channel(struc - /* Get the channel number for a channel */ - extern int ppp_channel_index(struct ppp_channel *); - -+/* Get the device index associated with a channel, or 0, if none */ -+extern int ppp_dev_index(struct ppp_channel *); -+ - /* Get the unit number associated with a channel, or -1 if none */ - extern int ppp_unit_number(struct ppp_channel *); - -@@ -116,6 +119,7 @@ extern int ppp_hold_channels(struct net_ - /* Test if ppp xmit lock is locked */ - extern bool ppp_is_xmit_locked(struct net_device *dev); - -+bool ppp_is_cp_enabled(struct net_device *dev); - /* Test if the ppp device is a multi-link ppp device */ - extern int ppp_is_multilink(struct net_device *dev); - ---- a/drivers/net/ppp/pptp.c -+++ b/drivers/net/ppp/pptp.c -@@ -50,6 +50,8 @@ static struct proto pptp_sk_proto __read - static const struct ppp_channel_ops pptp_chan_ops; - static const struct proto_ops pptp_ops; - -+static pptp_gre_seq_offload_callback_t __rcu pptp_gre_offload_xmit_cb; -+ - static struct pppox_sock *lookup_chan(u16 call_id, __be32 s_addr) - { - struct pppox_sock *sock; -@@ -91,6 +93,79 @@ static int lookup_chan_dst(u16 call_id, - return i < MAX_CALLID; - } - -+/* Search a pptp session based on local call id, local and remote ip address */ -+static int lookup_session_src(struct pptp_opt *opt, u16 call_id, __be32 daddr, __be32 saddr) -+{ -+ struct pppox_sock *sock; -+ int i = 1; -+ -+ rcu_read_lock(); -+ for_each_set_bit_from(i, callid_bitmap, MAX_CALLID) { -+ sock = rcu_dereference(callid_sock[i]); -+ if (!sock) -+ continue; -+ -+ if (sock->proto.pptp.src_addr.call_id == call_id && -+ sock->proto.pptp.dst_addr.sin_addr.s_addr == daddr && -+ sock->proto.pptp.src_addr.sin_addr.s_addr == saddr) { -+ sock_hold(sk_pppox(sock)); -+ memcpy(opt, &sock->proto.pptp, sizeof(struct pptp_opt)); -+ sock_put(sk_pppox(sock)); -+ rcu_read_unlock(); -+ return 0; -+ } -+ } -+ rcu_read_unlock(); -+ return -EINVAL; -+} -+ -+/* Search a pptp session based on peer call id and peer ip address */ -+static int lookup_session_dst(struct pptp_opt *opt, u16 call_id, __be32 d_addr) -+{ -+ struct pppox_sock *sock; -+ int i = 1; -+ -+ rcu_read_lock(); -+ for_each_set_bit_from(i, callid_bitmap, MAX_CALLID) { -+ sock = rcu_dereference(callid_sock[i]); -+ if (!sock) -+ continue; -+ -+ if (sock->proto.pptp.dst_addr.call_id == call_id && -+ sock->proto.pptp.dst_addr.sin_addr.s_addr == d_addr) { -+ sock_hold(sk_pppox(sock)); -+ memcpy(opt, &sock->proto.pptp, sizeof(struct pptp_opt)); -+ sock_put(sk_pppox(sock)); -+ rcu_read_unlock(); -+ return 0; -+ } -+ } -+ rcu_read_unlock(); -+ return -EINVAL; -+} -+ -+/* If offload mode set then this function sends all packets to -+ * offload module instead of network stack -+ */ -+static int pptp_client_skb_xmit(struct sk_buff *skb, -+ struct net_device *pptp_dev) -+{ -+ pptp_gre_seq_offload_callback_t pptp_gre_offload_cb_f; -+ int ret; -+ -+ rcu_read_lock(); -+ pptp_gre_offload_cb_f = rcu_dereference(pptp_gre_offload_xmit_cb); -+ -+ if (!pptp_gre_offload_cb_f) { -+ rcu_read_unlock(); -+ return -1; -+ } -+ -+ ret = pptp_gre_offload_cb_f(skb, pptp_dev); -+ rcu_read_unlock(); -+ return ret; -+} -+ - static int add_chan(struct pppox_sock *sock, - struct pptp_addr *sa) - { -@@ -136,7 +211,7 @@ static struct rtable *pptp_route_output( - struct net *net; - - net = sock_net(sk); -- flowi4_init_output(fl4, sk->sk_bound_dev_if, sk->sk_mark, 0, -+ flowi4_init_output(fl4, 0, sk->sk_mark, 0, - RT_SCOPE_UNIVERSE, IPPROTO_GRE, 0, - po->proto.pptp.dst_addr.sin_addr.s_addr, - po->proto.pptp.src_addr.sin_addr.s_addr, -@@ -163,8 +238,11 @@ static int pptp_xmit(struct ppp_channel - - struct rtable *rt; - struct net_device *tdev; -+ struct net_device *pptp_dev; - struct iphdr *iph; - int max_headroom; -+ int pptp_ifindex; -+ int ret; - - if (sk_pppox(po)->sk_state & PPPOX_DEAD) - goto tx_error; -@@ -258,7 +336,32 @@ static int pptp_xmit(struct ppp_channel - ip_select_ident(net, skb, NULL); - ip_send_check(iph); - -- ip_local_out(net, skb->sk, skb); -+ pptp_ifindex = ppp_dev_index(chan); -+ -+ /* set incoming interface as the ppp interface */ -+ if (skb->skb_iif) -+ skb->skb_iif = pptp_ifindex; -+ -+ /* If the PPTP GRE seq number offload module is not enabled yet -+ * then sends all PPTP GRE packets through linux network stack -+ */ -+ if (!opt->pptp_offload_mode) { -+ ip_local_out(net, skb->sk, skb); -+ return 1; -+ } -+ -+ pptp_dev = dev_get_by_index(&init_net, pptp_ifindex); -+ if (!pptp_dev) -+ goto tx_error; -+ -+ /* If PPTP offload module is enabled then forward all PPTP GRE -+ * packets to PPTP GRE offload module -+ */ -+ ret = pptp_client_skb_xmit(skb, pptp_dev); -+ dev_put(pptp_dev); -+ if (ret < 0) -+ goto tx_error; -+ - return 1; - - tx_error: -@@ -314,6 +417,13 @@ static int pptp_rcv_core(struct sock *sk - goto drop; - - payload = skb->data + headersize; -+ -+ /* If offload is enabled, we expect the offload module -+ * to handle PPTP GRE sequence number checks -+ */ -+ if (opt->pptp_offload_mode) -+ goto allow_packet; -+ - /* check for expected sequence number */ - if (seq < opt->seq_recv + 1 || WRAPPED(opt->seq_recv, seq)) { - if ((payload[0] == PPP_ALLSTATIONS) && (payload[1] == PPP_UI) && -@@ -371,6 +481,7 @@ static int pptp_rcv(struct sk_buff *skb) - if (po) { - skb_dst_drop(skb); - nf_reset_ct(skb); -+ skb->skb_iif = ppp_dev_index(&po->chan); - return sk_receive_skb(sk_pppox(po), skb, 0); - } - drop: -@@ -473,7 +584,7 @@ static int pptp_connect(struct socket *s - - opt->dst_addr = sp->sa_addr.pptp; - sk->sk_state |= PPPOX_CONNECTED; -- -+ opt->pptp_offload_mode = false; - end: - release_sock(sk); - return error; -@@ -603,9 +714,169 @@ static int pptp_ppp_ioctl(struct ppp_cha - return err; - } - -+/* pptp_channel_addressing_get() -+ * Return PPTP channel specific addressing information. -+ */ -+void pptp_channel_addressing_get(struct pptp_opt *opt, struct ppp_channel *chan) -+{ -+ struct sock *sk; -+ struct pppox_sock *po; -+ -+ if (!opt) -+ return; -+ -+ sk = (struct sock *)chan->private; -+ if (!sk) -+ return; -+ -+ sock_hold(sk); -+ -+ /* This is very unlikely, but check the socket is connected state */ -+ if (unlikely(sock_flag(sk, SOCK_DEAD) || -+ !(sk->sk_state & PPPOX_CONNECTED))) { -+ sock_put(sk); -+ return; -+ } -+ -+ po = pppox_sk(sk); -+ memcpy(opt, &po->proto.pptp, sizeof(struct pptp_opt)); -+ sock_put(sk); -+} -+EXPORT_SYMBOL(pptp_channel_addressing_get); -+ -+/* pptp_session_find() -+ * Search and return a PPTP session info based on peer callid and IP -+ * address. The function accepts the parameters in network byte order. -+ */ -+int pptp_session_find(struct pptp_opt *opt, __be16 peer_call_id, -+ __be32 peer_ip_addr) -+{ -+ if (!opt) -+ return -EINVAL; -+ -+ return lookup_session_dst(opt, ntohs(peer_call_id), peer_ip_addr); -+} -+EXPORT_SYMBOL(pptp_session_find); -+ -+/* pptp_session_find_by_src_callid() -+ * Search and return a PPTP session info based on src callid and IP -+ * address. The function accepts the parameters in network byte order. -+ */ -+int pptp_session_find_by_src_callid(struct pptp_opt *opt, __be16 src_call_id, -+ __be32 daddr, __be32 saddr) -+{ -+ if (!opt) -+ return -EINVAL; -+ -+ return lookup_session_src(opt, ntohs(src_call_id), daddr, saddr); -+} -+EXPORT_SYMBOL(pptp_session_find_by_src_callid); -+ -+ /* Function to change the offload mode true/false for a PPTP session */ -+static int pptp_set_offload_mode(bool accel_mode, -+ __be16 peer_call_id, __be32 peer_ip_addr) -+{ -+ struct pppox_sock *sock; -+ int i = 1; -+ -+ rcu_read_lock(); -+ for_each_set_bit_from(i, callid_bitmap, MAX_CALLID) { -+ sock = rcu_dereference(callid_sock[i]); -+ if (!sock) -+ continue; -+ -+ if (sock->proto.pptp.dst_addr.call_id == peer_call_id && -+ sock->proto.pptp.dst_addr.sin_addr.s_addr == peer_ip_addr) { -+ sock_hold(sk_pppox(sock)); -+ sock->proto.pptp.pptp_offload_mode = accel_mode; -+ sock_put(sk_pppox(sock)); -+ rcu_read_unlock(); -+ return 0; -+ } -+ } -+ rcu_read_unlock(); -+ return -EINVAL; -+} -+ -+/* Enable the PPTP session offload flag */ -+int pptp_session_enable_offload_mode(__be16 peer_call_id, __be32 peer_ip_addr) -+{ -+ return pptp_set_offload_mode(true, peer_call_id, peer_ip_addr); -+} -+EXPORT_SYMBOL(pptp_session_enable_offload_mode); -+ -+/* Disable the PPTP session offload flag */ -+int pptp_session_disable_offload_mode(__be16 peer_call_id, __be32 peer_ip_addr) -+{ -+ return pptp_set_offload_mode(false, peer_call_id, peer_ip_addr); -+} -+EXPORT_SYMBOL(pptp_session_disable_offload_mode); -+ -+/* Register the offload callback function on behalf of the module which -+ * will own the sequence and acknowledgment number updates for all -+ * PPTP GRE packets. All PPTP GRE packets are then transmitted to this -+ * module after encapsulation in order to ensure the correct seq/ack -+ * fields are set in the packets before transmission. This is required -+ * when PPTP flows are offloaded to acceleration engines, in-order to -+ * ensure consistency in sequence and ack numbers between PPTP control -+ * (PPP LCP) and data packets -+ */ -+int pptp_register_gre_seq_offload_callback(pptp_gre_seq_offload_callback_t -+ pptp_gre_offload_cb) -+{ -+ pptp_gre_seq_offload_callback_t pptp_gre_offload_cb_f; -+ -+ rcu_read_lock(); -+ pptp_gre_offload_cb_f = rcu_dereference(pptp_gre_offload_xmit_cb); -+ -+ if (pptp_gre_offload_cb_f) { -+ rcu_read_unlock(); -+ return -1; -+ } -+ -+ rcu_assign_pointer(pptp_gre_offload_xmit_cb, pptp_gre_offload_cb); -+ rcu_read_unlock(); -+ return 0; -+} -+EXPORT_SYMBOL(pptp_register_gre_seq_offload_callback); -+ -+/* Unregister the PPTP GRE packets sequence number offload callback */ -+void pptp_unregister_gre_seq_offload_callback(void) -+{ -+ rcu_assign_pointer(pptp_gre_offload_xmit_cb, NULL); -+} -+EXPORT_SYMBOL(pptp_unregister_gre_seq_offload_callback); -+ -+/* pptp_hold_chan() */ -+static void pptp_hold_chan(struct ppp_channel *chan) -+{ -+ struct sock *sk = (struct sock *)chan->private; -+ -+ sock_hold(sk); -+} -+ -+/* pptp_release_chan() */ -+static void pptp_release_chan(struct ppp_channel *chan) -+{ -+ struct sock *sk = (struct sock *)chan->private; -+ -+ sock_put(sk); -+} -+ -+/* pptp_get_channel_protocol() -+ * Return the protocol type of the PPTP over PPP protocol -+ */ -+static int pptp_get_channel_protocol(struct ppp_channel *chan) -+{ -+ return PX_PROTO_PPTP; -+} -+ - static const struct ppp_channel_ops pptp_chan_ops = { - .start_xmit = pptp_xmit, - .ioctl = pptp_ppp_ioctl, -+ .get_channel_protocol = pptp_get_channel_protocol, -+ .hold = pptp_hold_chan, -+ .release = pptp_release_chan, - }; - - static struct proto pptp_sk_proto __read_mostly = { diff --git a/target/linux/qualcommax/patches-6.6/0603-4-qca-nss-clients-add-iptunnel-support.patch b/target/linux/qualcommax/patches-6.6/0603-4-qca-nss-clients-add-iptunnel-support.patch deleted file mode 100644 index 86c9688adea..00000000000 --- a/target/linux/qualcommax/patches-6.6/0603-4-qca-nss-clients-add-iptunnel-support.patch +++ /dev/null @@ -1,77 +0,0 @@ ---- a/include/net/ip6_tunnel.h -+++ b/include/net/ip6_tunnel.h -@@ -36,6 +36,7 @@ struct __ip6_tnl_parm { - __u8 proto; /* tunnel protocol */ - __u8 encap_limit; /* encapsulation limit for tunnel */ - __u8 hop_limit; /* hop limit for tunnel */ -+ __u8 draft03; /* FMR using draft03 of map-e - QCA NSS Clients Support */ - bool collect_md; - __be32 flowinfo; /* traffic class and flowlabel for tunnel */ - __u32 flags; /* tunnel flags */ ---- a/include/net/ip_tunnels.h -+++ b/include/net/ip_tunnels.h -@@ -592,4 +592,9 @@ static inline void ip_tunnel_info_opts_s - - #endif /* CONFIG_INET */ - -+/* QCA NSS Clients Support - Start */ -+void ipip6_update_offload_stats(struct net_device *dev, void *ptr); -+void ip6_update_offload_stats(struct net_device *dev, void *ptr); -+/* QCA NSS Clients Support - End */ -+ - #endif /* __NET_IP_TUNNELS_H */ ---- a/net/ipv6/ip6_tunnel.c -+++ b/net/ipv6/ip6_tunnel.c -@@ -2414,6 +2414,26 @@ nla_put_failure: - return -EMSGSIZE; - } - -+/* QCA NSS Client Support - Start */ -+/* -+ * Update offload stats -+ */ -+void ip6_update_offload_stats(struct net_device *dev, void *ptr) -+{ -+ struct pcpu_sw_netstats *tstats = per_cpu_ptr(dev->tstats, 0); -+ const struct pcpu_sw_netstats *offload_stats = -+ (struct pcpu_sw_netstats *)ptr; -+ -+ u64_stats_update_begin(&tstats->syncp); -+ u64_stats_add(&tstats->tx_packets, u64_stats_read(&offload_stats->tx_packets)); -+ u64_stats_add(&tstats->tx_bytes, u64_stats_read(&offload_stats->tx_bytes)); -+ u64_stats_add(&tstats->rx_packets, u64_stats_read(&offload_stats->rx_packets)); -+ u64_stats_add(&tstats->rx_bytes, u64_stats_read(&offload_stats->rx_bytes)); -+ u64_stats_update_end(&tstats->syncp); -+} -+EXPORT_SYMBOL(ip6_update_offload_stats); -+/* QCA NSS Client Support - End */ -+ - struct net *ip6_tnl_get_link_net(const struct net_device *dev) - { - struct ip6_tnl *tunnel = netdev_priv(dev); ---- a/net/ipv6/sit.c -+++ b/net/ipv6/sit.c -@@ -1734,6 +1734,23 @@ nla_put_failure: - return -EMSGSIZE; - } - -+/* QCA NSS Clients Support - Start */ -+void ipip6_update_offload_stats(struct net_device *dev, void *ptr) -+{ -+ struct pcpu_sw_netstats *tstats = per_cpu_ptr(dev->tstats, 0); -+ const struct pcpu_sw_netstats *offload_stats = -+ (struct pcpu_sw_netstats *)ptr; -+ -+ u64_stats_update_begin(&tstats->syncp); -+ u64_stats_add(&tstats->tx_packets, u64_stats_read(&offload_stats->tx_packets)); -+ u64_stats_add(&tstats->tx_bytes, u64_stats_read(&offload_stats->tx_bytes)); -+ u64_stats_add(&tstats->rx_packets, u64_stats_read(&offload_stats->rx_packets)); -+ u64_stats_add(&tstats->rx_bytes, u64_stats_read(&offload_stats->rx_bytes)); -+ u64_stats_update_end(&tstats->syncp); -+} -+EXPORT_SYMBOL(ipip6_update_offload_stats); -+/* QCA NSS Clients Support - End */ -+ - static const struct nla_policy ipip6_policy[IFLA_IPTUN_MAX + 1] = { - [IFLA_IPTUN_LINK] = { .type = NLA_U32 }, - [IFLA_IPTUN_LOCAL] = { .type = NLA_U32 }, diff --git a/target/linux/qualcommax/patches-6.6/0603-5-qca-nss-clients-add-vxlan-support.patch b/target/linux/qualcommax/patches-6.6/0603-5-qca-nss-clients-add-vxlan-support.patch deleted file mode 100644 index b80d57bdff4..00000000000 --- a/target/linux/qualcommax/patches-6.6/0603-5-qca-nss-clients-add-vxlan-support.patch +++ /dev/null @@ -1,103 +0,0 @@ ---- a/drivers/net/vxlan/vxlan_core.c -+++ b/drivers/net/vxlan/vxlan_core.c -@@ -29,6 +29,20 @@ - #include - #include - -+ATOMIC_NOTIFIER_HEAD(vxlan_fdb_notifier_list); -+ -+void vxlan_fdb_register_notify(struct notifier_block *nb) -+{ -+ atomic_notifier_chain_register(&vxlan_fdb_notifier_list, nb); -+} -+EXPORT_SYMBOL(vxlan_fdb_register_notify); -+ -+void vxlan_fdb_unregister_notify(struct notifier_block *nb) -+{ -+ atomic_notifier_chain_unregister(&vxlan_fdb_notifier_list, nb); -+} -+EXPORT_SYMBOL(vxlan_fdb_unregister_notify); -+ - #if IS_ENABLED(CONFIG_IPV6) - #include - #include -@@ -260,6 +274,7 @@ static void __vxlan_fdb_notify(struct vx - { - struct net *net = dev_net(vxlan->dev); - struct sk_buff *skb; -+ struct vxlan_fdb_event vfe; - int err = -ENOBUFS; - - skb = nlmsg_new(vxlan_nlmsg_size(), GFP_ATOMIC); -@@ -275,6 +290,10 @@ static void __vxlan_fdb_notify(struct vx - } - - rtnl_notify(skb, net, 0, RTNLGRP_NEIGH, NULL, GFP_ATOMIC); -+ vfe.dev = vxlan->dev; -+ vfe.rdst = rd; -+ ether_addr_copy(vfe.eth_addr, fdb->eth_addr); -+ atomic_notifier_call_chain(&vxlan_fdb_notifier_list, type, (void *)&vfe); - return; - errout: - if (err < 0) -@@ -441,6 +460,18 @@ static struct vxlan_fdb *vxlan_find_mac( - return f; - } - -+/* Find and update age of fdb entry corresponding to MAC. */ -+void vxlan_fdb_update_mac(struct vxlan_dev *vxlan, const u8 *mac, uint32_t vni) -+{ -+ u32 hash_index; -+ -+ hash_index = fdb_head_index(vxlan, mac, vni); -+ spin_lock_bh(&vxlan->hash_lock[hash_index]); -+ vxlan_find_mac(vxlan, mac, vni); -+ spin_unlock_bh(&vxlan->hash_lock[hash_index]); -+} -+EXPORT_SYMBOL(vxlan_fdb_update_mac); -+ - /* caller should hold vxlan->hash_lock */ - static struct vxlan_rdst *vxlan_fdb_find_rdst(struct vxlan_fdb *f, - union vxlan_addr *ip, __be16 port, -@@ -2600,6 +2631,9 @@ void vxlan_xmit_one(struct sk_buff *skb, - goto out_unlock; - } - -+ /* Reset the skb_iif to Tunnels interface index */ -+ skb->skb_iif = dev->ifindex; -+ - tos = ip_tunnel_ecn_encap(tos, old_iph, skb); - ttl = ttl ? : ip4_dst_hoplimit(&rt->dst); - err = vxlan_build_skb(skb, ndst, sizeof(struct iphdr), -@@ -2671,6 +2705,9 @@ void vxlan_xmit_one(struct sk_buff *skb, - if (err < 0) - goto tx_error; - -+ /* Reset the skb_iif to Tunnels interface index */ -+ skb->skb_iif = dev->ifindex; -+ - udp_tunnel6_xmit_skb(ndst, sock6->sock->sk, skb, dev, - &local_ip.sin6.sin6_addr, - &dst->sin6.sin6_addr, tos, ttl, ---- a/include/net/vxlan.h -+++ b/include/net/vxlan.h -@@ -352,6 +352,19 @@ struct vxlan_dev { - VXLAN_F_VNIFILTER | \ - VXLAN_F_LOCALBYPASS) - -+/* -+ * Application data for fdb notifier event -+ */ -+struct vxlan_fdb_event { -+ struct net_device *dev; -+ struct vxlan_rdst *rdst; -+ u8 eth_addr[ETH_ALEN]; -+}; -+ -+extern void vxlan_fdb_register_notify(struct notifier_block *nb); -+extern void vxlan_fdb_unregister_notify(struct notifier_block *nb); -+extern void vxlan_fdb_update_mac(struct vxlan_dev *vxlan, const u8 *mac, uint32_t vni); -+ - struct net_device *vxlan_dev_create(struct net *net, const char *name, - u8 name_assign_type, struct vxlan_config *conf); - diff --git a/target/linux/qualcommax/patches-6.6/0603-6-qca-nss-clients-add-l2tp-offloading-support.patch b/target/linux/qualcommax/patches-6.6/0603-6-qca-nss-clients-add-l2tp-offloading-support.patch deleted file mode 100644 index 1cc92442e93..00000000000 --- a/target/linux/qualcommax/patches-6.6/0603-6-qca-nss-clients-add-l2tp-offloading-support.patch +++ /dev/null @@ -1,368 +0,0 @@ ---- a/include/linux/ppp_channel.h -+++ b/include/linux/ppp_channel.h -@@ -61,6 +61,51 @@ struct ppp_channel { - }; - - #ifdef __KERNEL__ -+/* Call this to obtain the underlying protocol of the PPP channel, -+ * e.g. PX_PROTO_OE -+ */ -+extern int ppp_channel_get_protocol(struct ppp_channel *); -+ -+/* Call this to hold a channel */ -+extern bool ppp_channel_hold(struct ppp_channel *); -+ -+/* Call this to release a hold you have upon a channel */ -+extern void ppp_channel_release(struct ppp_channel *); -+ -+/* Release hold on PPP channels */ -+extern void ppp_release_channels(struct ppp_channel *channels[], -+ unsigned int chan_sz); -+ -+/* Test if ppp xmit lock is locked */ -+extern bool ppp_is_xmit_locked(struct net_device *dev); -+ -+/* Call this get protocol version */ -+extern int ppp_channel_get_proto_version(struct ppp_channel *); -+ -+/* Get the device index associated with a channel, or 0, if none */ -+extern int ppp_dev_index(struct ppp_channel *); -+ -+/* Hold PPP channels for the PPP device */ -+extern int ppp_hold_channels(struct net_device *dev, -+ struct ppp_channel *channels[], -+ unsigned int chan_sz); -+extern int __ppp_hold_channels(struct net_device *dev, -+ struct ppp_channel *channels[], -+ unsigned int chan_sz); -+ -+/* Test if the ppp device is a multi-link ppp device */ -+extern int ppp_is_multilink(struct net_device *dev); -+extern int __ppp_is_multilink(struct net_device *dev); -+ -+/* Update statistics of the PPP net_device by incrementing related -+ * statistics field value with corresponding parameter -+ */ -+extern void ppp_update_stats(struct net_device *dev, unsigned long rx_packets, -+ unsigned long rx_bytes, unsigned long tx_packets, -+ unsigned long tx_bytes, unsigned long rx_errors, -+ unsigned long tx_errors, unsigned long rx_dropped, -+ unsigned long tx_dropped); -+ - /* Called by the channel when it can send some more data. */ - extern void ppp_output_wakeup(struct ppp_channel *); - -@@ -148,5 +193,17 @@ extern void ppp_update_stats(struct net_ - * that ppp_unregister_channel returns. - */ - -+/* QCA NSS Clients Support - Start */ -+/* PPP channel connection event types */ -+#define PPP_CHANNEL_DISCONNECT 0 -+#define PPP_CHANNEL_CONNECT 1 -+ -+/* Register the PPP channel connect notifier */ -+extern void ppp_channel_connection_register_notify(struct notifier_block *nb); -+ -+/* Unregister the PPP channel connect notifier */ -+extern void ppp_channel_connection_unregister_notify(struct notifier_block *nb); -+/* QCA NSS Clients Support - End */ -+ - #endif /* __KERNEL__ */ - #endif ---- a/include/linux/if_pppol2tp.h -+++ b/include/linux/if_pppol2tp.h -@@ -12,4 +12,30 @@ - #include - #include - -+/* QCA NSS ECM support - Start */ -+/* -+ * Holds L2TP channel info -+ */ -+struct pppol2tp_common_addr { -+ int tunnel_version; /* v2 or v3 */ -+ __u32 local_tunnel_id, remote_tunnel_id; /* tunnel id */ -+ __u32 local_session_id, remote_session_id; /* session id */ -+ struct sockaddr_in local_addr, remote_addr; /* ip address and port */ -+}; -+ -+/* -+ * L2TP channel operations -+ */ -+struct pppol2tp_channel_ops { -+ struct ppp_channel_ops ops; /* ppp channel ops */ -+}; -+ -+/* -+ * exported function which calls pppol2tp channel's get addressing -+ * function -+ */ -+extern int pppol2tp_channel_addressing_get(struct ppp_channel *, -+ struct pppol2tp_common_addr *); -+/* QCA NSS ECM support - End */ -+ - #endif ---- a/net/l2tp/l2tp_ppp.c -+++ b/net/l2tp/l2tp_ppp.c -@@ -123,9 +123,17 @@ struct pppol2tp_session { - }; - - static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb); -- --static const struct ppp_channel_ops pppol2tp_chan_ops = { -- .start_xmit = pppol2tp_xmit, -+static int pppol2tp_get_channel_protocol(struct ppp_channel *); -+static int pppol2tp_get_channel_protocol_ver(struct ppp_channel *); -+static void pppol2tp_hold_chan(struct ppp_channel *); -+static void pppol2tp_release_chan(struct ppp_channel *); -+ -+static const struct pppol2tp_channel_ops pppol2tp_chan_ops = { -+ .ops.start_xmit = pppol2tp_xmit, -+ .ops.get_channel_protocol = pppol2tp_get_channel_protocol, -+ .ops.get_channel_protocol_ver = pppol2tp_get_channel_protocol_ver, -+ .ops.hold = pppol2tp_hold_chan, -+ .ops.release = pppol2tp_release_chan, - }; - - static const struct proto_ops pppol2tp_ops; -@@ -373,6 +381,13 @@ static int pppol2tp_xmit(struct ppp_chan - skb->data[0] = PPP_ALLSTATIONS; - skb->data[1] = PPP_UI; - -+ /* QCA NSS ECM support - start */ -+ /* set incoming interface as the ppp interface */ -+ if ((skb->protocol == htons(ETH_P_IP)) || -+ (skb->protocol == htons(ETH_P_IPV6))) -+ skb->skb_iif = ppp_dev_index(chan); -+ /* QCA NSS ECM support - End */ -+ - local_bh_disable(); - l2tp_xmit_skb(session, skb); - local_bh_enable(); -@@ -818,7 +833,7 @@ static int pppol2tp_connect(struct socke - po->chan.hdrlen = PPPOL2TP_L2TP_HDR_SIZE_NOSEQ; - - po->chan.private = sk; -- po->chan.ops = &pppol2tp_chan_ops; -+ po->chan.ops = (struct ppp_channel_ops *)&pppol2tp_chan_ops.ops; - po->chan.mtu = pppol2tp_tunnel_mtu(tunnel); - - error = ppp_register_net_channel(sock_net(sk), &po->chan); -@@ -1732,6 +1747,109 @@ static void __exit pppol2tp_exit(void) - unregister_pernet_device(&pppol2tp_net_ops); - } - -+/* QCA NSS ECM support - Start */ -+/* pppol2tp_hold_chan() */ -+static void pppol2tp_hold_chan(struct ppp_channel *chan) -+{ -+ struct sock *sk = (struct sock *)chan->private; -+ -+ sock_hold(sk); -+} -+ -+/* pppol2tp_release_chan() */ -+static void pppol2tp_release_chan(struct ppp_channel *chan) -+{ -+ struct sock *sk = (struct sock *)chan->private; -+ -+ sock_put(sk); -+} -+ -+/* pppol2tp_get_channel_protocol() -+ * Return the protocol type of the L2TP over PPP protocol -+ */ -+static int pppol2tp_get_channel_protocol(struct ppp_channel *chan) -+{ -+ return PX_PROTO_OL2TP; -+} -+ -+/* pppol2tp_get_channel_protocol_ver() -+ * Return the protocol version of the L2TP over PPP protocol -+ */ -+static int pppol2tp_get_channel_protocol_ver(struct ppp_channel *chan) -+{ -+ struct sock *sk; -+ struct l2tp_session *session; -+ struct l2tp_tunnel *tunnel; -+ int version = 0; -+ -+ if (chan && chan->private) -+ sk = (struct sock *)chan->private; -+ else -+ return -1; -+ -+ /* Get session and tunnel contexts from the socket */ -+ session = pppol2tp_sock_to_session(sk); -+ if (!session) -+ return -1; -+ -+ tunnel = session->tunnel; -+ if (!tunnel) { -+ sock_put(sk); -+ return -1; -+ } -+ -+ version = tunnel->version; -+ -+ sock_put(sk); -+ -+ return version; -+} -+ -+/* pppol2tp_get_addressing() */ -+static int pppol2tp_get_addressing(struct ppp_channel *chan, -+ struct pppol2tp_common_addr *addr) -+{ -+ struct sock *sk = (struct sock *)chan->private; -+ struct l2tp_session *session; -+ struct l2tp_tunnel *tunnel; -+ struct inet_sock *isk = NULL; -+ int err = -ENXIO; -+ -+ /* Get session and tunnel contexts from the socket */ -+ session = pppol2tp_sock_to_session(sk); -+ if (!session) -+ return err; -+ -+ tunnel = session->tunnel; -+ if (!tunnel) { -+ sock_put(sk); -+ return err; -+ } -+ isk = inet_sk(tunnel->sock); -+ -+ addr->local_tunnel_id = tunnel->tunnel_id; -+ addr->remote_tunnel_id = tunnel->peer_tunnel_id; -+ addr->local_session_id = session->session_id; -+ addr->remote_session_id = session->peer_session_id; -+ -+ addr->local_addr.sin_port = isk->inet_sport; -+ addr->remote_addr.sin_port = isk->inet_dport; -+ addr->local_addr.sin_addr.s_addr = isk->inet_saddr; -+ addr->remote_addr.sin_addr.s_addr = isk->inet_daddr; -+ -+ sock_put(sk); -+ return 0; -+} -+ -+/* pppol2tp_channel_addressing_get() */ -+int pppol2tp_channel_addressing_get(struct ppp_channel *chan, -+ struct pppol2tp_common_addr *addr) -+{ -+ return pppol2tp_get_addressing(chan, addr); -+} -+EXPORT_SYMBOL(pppol2tp_channel_addressing_get); -+/* QCA NSS ECM support - End */ -+ - module_init(pppol2tp_init); - module_exit(pppol2tp_exit); - ---- a/drivers/net/ppp/ppp_generic.c -+++ b/drivers/net/ppp/ppp_generic.c -@@ -3758,6 +3758,32 @@ int ppp_is_multilink(struct net_device * - } - EXPORT_SYMBOL(ppp_is_multilink); - -+/* __ppp_is_multilink() -+ * Returns >0 if the device is a multilink PPP netdevice, 0 if not or < 0 -+ * if the device is not PPP. Caller should acquire ppp_lock before calling -+ * this function -+ */ -+int __ppp_is_multilink(struct net_device *dev) -+{ -+ struct ppp *ppp; -+ unsigned int flags; -+ -+ if (!dev) -+ return -1; -+ -+ if (dev->type != ARPHRD_PPP) -+ return -1; -+ -+ ppp = netdev_priv(dev); -+ flags = ppp->flags; -+ -+ if (flags & SC_MULTILINK) -+ return 1; -+ -+ return 0; -+} -+EXPORT_SYMBOL(__ppp_is_multilink); -+ - /* ppp_channel_get_protocol() - * Call this to obtain the underlying protocol of the PPP channel, - * e.g. PX_PROTO_OE -@@ -3896,6 +3922,59 @@ int ppp_hold_channels(struct net_device - } - EXPORT_SYMBOL(ppp_hold_channels); - -+/* __ppp_hold_channels() -+ * Returns the PPP channels of the PPP device, storing each one into -+ * channels[]. -+ * -+ * channels[] has chan_sz elements. -+ * This function returns the number of channels stored, up to chan_sz. -+ * It will return < 0 if the device is not PPP. -+ * -+ * You MUST release the channels using ppp_release_channels(). -+ */ -+int __ppp_hold_channels(struct net_device *dev, struct ppp_channel *channels[], -+ unsigned int chan_sz) -+{ -+ struct ppp *ppp; -+ int c; -+ struct channel *pch; -+ -+ if (!dev) -+ return -1; -+ -+ if (dev->type != ARPHRD_PPP) -+ return -1; -+ -+ ppp = netdev_priv(dev); -+ -+ c = 0; -+ list_for_each_entry(pch, &ppp->channels, clist) { -+ struct ppp_channel *chan; -+ -+ if (!pch->chan) { -+ /* Channel is going / gone away */ -+ continue; -+ } -+ -+ if (c == chan_sz) { -+ /* No space to record channel */ -+ return c; -+ } -+ -+ /* Hold the channel, if supported */ -+ chan = pch->chan; -+ if (!chan->ops->hold) -+ continue; -+ -+ chan->ops->hold(chan); -+ -+ /* Record the channel */ -+ channels[c++] = chan; -+ } -+ return c; -+} -+EXPORT_SYMBOL(__ppp_hold_channels); -+ - /* ppp_release_channels() - * Releases channels - */ ---- a/net/l2tp/l2tp_core.h -+++ b/net/l2tp/l2tp_core.h -@@ -235,6 +235,9 @@ struct l2tp_session *l2tp_session_get_by - void l2tp_stats_update(struct l2tp_tunnel *tunnel, struct l2tp_session *session, - struct l2tp_stats *stats); - -+void l2tp_stats_update(struct l2tp_tunnel *tunnel, struct l2tp_session *session, -+ struct l2tp_stats *stats); -+ - /* Tunnel and session lifetime management. - * Creation of a new instance is a two-step process: create, then register. - * Destruction is triggered using the *_delete functions, and completes asynchronously. diff --git a/target/linux/qualcommax/patches-6.6/0603-7-qca-nss-clients-iptunnel-lock-this-cpu.patch b/target/linux/qualcommax/patches-6.6/0603-7-qca-nss-clients-iptunnel-lock-this-cpu.patch deleted file mode 100644 index 9c80e643474..00000000000 --- a/target/linux/qualcommax/patches-6.6/0603-7-qca-nss-clients-iptunnel-lock-this-cpu.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/net/ipv6/ip6_tunnel.c -+++ b/net/ipv6/ip6_tunnel.c -@@ -2420,7 +2420,7 @@ nla_put_failure: - */ - void ip6_update_offload_stats(struct net_device *dev, void *ptr) - { -- struct pcpu_sw_netstats *tstats = per_cpu_ptr(dev->tstats, 0); -+ struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats); - const struct pcpu_sw_netstats *offload_stats = - (struct pcpu_sw_netstats *)ptr; - ---- a/net/ipv6/sit.c -+++ b/net/ipv6/sit.c -@@ -1737,7 +1737,7 @@ nla_put_failure: - /* QCA NSS Clients Support - Start */ - void ipip6_update_offload_stats(struct net_device *dev, void *ptr) - { -- struct pcpu_sw_netstats *tstats = per_cpu_ptr(dev->tstats, 0); -+ struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats); - const struct pcpu_sw_netstats *offload_stats = - (struct pcpu_sw_netstats *)ptr; - diff --git a/target/linux/qualcommax/patches-6.6/0603-8-qca-nss-clients-add-tls-mgr-support.patch b/target/linux/qualcommax/patches-6.6/0603-8-qca-nss-clients-add-tls-mgr-support.patch deleted file mode 100644 index 0499e237f6b..00000000000 --- a/target/linux/qualcommax/patches-6.6/0603-8-qca-nss-clients-add-tls-mgr-support.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- /dev/null -+++ b/include/uapi/linux/tlshdr.h -@@ -0,0 +1,21 @@ -+#ifndef _UAPI_LINUX_TLSHDR_H -+#define _UAPI_LINUX_TLSHDR_H -+ -+#include -+ -+struct tlshdr { -+ __u8 type; -+ __be16 version; -+ __be16 len; -+} __attribute__((packed)); -+ -+#define TLSHDR_REC_TYPE_CCS 20 /* TLS packet is change cipher specification */ -+#define TLSHDR_REC_TYPE_ALERT 21 /* TLS packet is Alert */ -+#define TLSHDR_REC_TYPE_HANDSHAKE 22 /* TLS packet is Handshake */ -+#define TLSHDR_REC_TYPE_DATA 23 /* TLS packet is Application data */ -+ -+#define TLSHDR_VERSION_1_1 0x0302 /* TLS Header Version(tls 1.1) */ -+#define TLSHDR_VERSION_1_2 0x0303 /* TLS Header Version(tls 1.2) */ -+#define TLSHDR_VERSION_1_3 0x0304 /* TLS Header Version(tls 1.3) */ -+ -+#endif /* _UAPI_LINUX_TLSHDR_H */ diff --git a/target/linux/qualcommax/patches-6.6/0604-1-qca-add-mcs-support.patch b/target/linux/qualcommax/patches-6.6/0604-1-qca-add-mcs-support.patch deleted file mode 100644 index bbac5a709c4..00000000000 --- a/target/linux/qualcommax/patches-6.6/0604-1-qca-add-mcs-support.patch +++ /dev/null @@ -1,876 +0,0 @@ ---- a/include/linux/if_bridge.h -+++ b/include/linux/if_bridge.h -@@ -258,4 +258,17 @@ extern br_get_dst_hook_t __rcu *br_get_d - extern struct net_device *br_fdb_bridge_dev_get_and_hold(struct net_bridge *br); - /* QCA NSS bridge-mgr support - End */ - -+/* QCA qca-mcs support - Start */ -+typedef struct net_bridge_port *br_get_dst_hook_t(const struct net_bridge_port *src, -+ struct sk_buff **skb); -+extern br_get_dst_hook_t __rcu *br_get_dst_hook; -+ -+typedef int (br_multicast_handle_hook_t)(const struct net_bridge_port *src, -+ struct sk_buff *skb); -+extern br_multicast_handle_hook_t __rcu *br_multicast_handle_hook; -+ -+typedef void (br_notify_hook_t)(int group, int event, const void *ptr); -+extern br_notify_hook_t __rcu *br_notify_hook; -+/* QCA qca-mcs support - End */ -+ - #endif ---- a/net/bridge/br_fdb.c -+++ b/net/bridge/br_fdb.c -@@ -239,6 +239,8 @@ static void fdb_notify(struct net_bridge - kfree_skb(skb); - goto errout; - } -+ -+ __br_notify(RTNLGRP_NEIGH, type, fdb); /* QCA qca-mcs support */ - rtnl_notify(skb, net, 0, RTNLGRP_NEIGH, NULL, GFP_ATOMIC); - return; - errout: -@@ -305,6 +307,7 @@ struct net_bridge_fdb_entry *br_fdb_find - { - return fdb_find_rcu(&br->fdb_hash_tbl, addr, vid); - } -+EXPORT_SYMBOL_GPL(br_fdb_find_rcu); /* QCA qca-mcs support */ - - /* When a static FDB entry is added, the mac address from the entry is - * added to the bridge private HW address list and all required ports ---- a/net/bridge/br_private.h -+++ b/net/bridge/br_private.h -@@ -907,6 +907,7 @@ void br_manage_promisc(struct net_bridge - int nbp_backup_change(struct net_bridge_port *p, struct net_device *backup_dev); - - /* br_input.c */ -+int br_pass_frame_up(struct sk_buff *skb, bool promisc); /* QCA qca-mcs support */ - int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb); - rx_handler_func_t *br_get_rx_handler(const struct net_device *dev); - -@@ -2269,4 +2270,14 @@ struct nd_msg *br_is_nd_neigh_msg(struct - bool br_is_neigh_suppress_enabled(const struct net_bridge_port *p, u16 vid); - #define __br_get(__hook, __default, __args ...) \ - (__hook ? (__hook(__args)) : (__default)) /* QCA NSS ECM support */ -+ -+/* QCA qca-mcs support - Start */ -+static inline void __br_notify(int group, int type, const void *data) -+{ -+ br_notify_hook_t *notify_hook = rcu_dereference(br_notify_hook); -+ -+ if (notify_hook) -+ notify_hook(group, type, data); -+} -+/* QCA qca-mcs support - End */ - #endif ---- a/net/bridge/br_netlink.c -+++ b/net/bridge/br_netlink.c -@@ -657,6 +657,7 @@ void br_info_notify(int event, const str - kfree_skb(skb); - goto errout; - } -+ __br_notify(RTNLGRP_LINK, event, port); /* QCA qca-mcs support */ - rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); - return; - errout: ---- a/net/bridge/br.c -+++ b/net/bridge/br.c -@@ -472,6 +472,12 @@ static void __exit br_deinit(void) - br_fdb_fini(); - } - -+/* QCA qca-mcs support - Start */ -+/* Hook for bridge event notifications */ -+br_notify_hook_t __rcu *br_notify_hook __read_mostly; -+EXPORT_SYMBOL_GPL(br_notify_hook); -+/* QCA qca-mcs support - End */ -+ - module_init(br_init) - module_exit(br_deinit) - MODULE_LICENSE("GPL"); ---- a/net/bridge/br_device.c -+++ b/net/bridge/br_device.c -@@ -89,6 +89,13 @@ netdev_tx_t br_dev_xmit(struct sk_buff * - if (is_broadcast_ether_addr(dest)) { - br_flood(br, skb, BR_PKT_BROADCAST, false, true, vid); - } else if (is_multicast_ether_addr(dest)) { -+ /* QCA qca-mcs support - Start */ -+ br_multicast_handle_hook_t *multicast_handle_hook = -+ rcu_dereference(br_multicast_handle_hook); -+ if (!__br_get(multicast_handle_hook, true, NULL, skb)) -+ goto out; -+ /* QCA qca-mcs support - End */ -+ - if (unlikely(netpoll_tx_running(dev))) { - br_flood(br, skb, BR_PKT_MULTICAST, false, true, vid); - goto out; ---- a/net/bridge/br_input.c -+++ b/net/bridge/br_input.c -@@ -30,7 +30,17 @@ br_netif_receive_skb(struct net *net, st - return netif_receive_skb(skb); - } - --static int br_pass_frame_up(struct sk_buff *skb, bool promisc) -+/* QCA qca-mcs support - Start */ -+/* Hook for external Multicast handler */ -+br_multicast_handle_hook_t __rcu *br_multicast_handle_hook __read_mostly; -+EXPORT_SYMBOL_GPL(br_multicast_handle_hook); -+ -+/* Hook for external forwarding logic */ -+br_get_dst_hook_t __rcu *br_get_dst_hook __read_mostly; -+EXPORT_SYMBOL_GPL(br_get_dst_hook); -+/* QCA qca-mcs support - End */ -+ -+int br_pass_frame_up(struct sk_buff *skb, bool promisc) - { - struct net_device *indev, *brdev = BR_INPUT_SKB_CB(skb)->brdev; - struct net_bridge *br = netdev_priv(brdev); -@@ -71,6 +81,7 @@ static int br_pass_frame_up(struct sk_bu - dev_net(indev), NULL, skb, indev, NULL, - br_netif_receive_skb); - } -+EXPORT_SYMBOL_GPL(br_pass_frame_up); /* QCA qca-mcs support */ - - /* note: already called with rcu_read_lock */ - int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb) -@@ -84,6 +95,11 @@ int br_handle_frame_finish(struct net *n - struct net_bridge_mcast *brmctx; - struct net_bridge_vlan *vlan; - struct net_bridge *br; -+ /* QCA qca-mcs support - Start */ -+ br_multicast_handle_hook_t *multicast_handle_hook; -+ struct net_bridge_port *pdst = NULL; -+ br_get_dst_hook_t *get_dst_hook = rcu_dereference(br_get_dst_hook); -+ /* QCA qca-mcs support - End */ - bool promisc; - u16 vid = 0; - u8 state; -@@ -180,6 +196,12 @@ int br_handle_frame_finish(struct net *n - - switch (pkt_type) { - case BR_PKT_MULTICAST: -+ /* QCA qca-mcs support - Start */ -+ multicast_handle_hook = rcu_dereference(br_multicast_handle_hook); -+ if (!__br_get(multicast_handle_hook, true, p, skb)) -+ goto out; -+ /* QCA qca-mcs support - End */ -+ - mdst = br_mdb_get(brmctx, skb, vid); - if ((mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb)) && - br_multicast_querier_exists(brmctx, eth_hdr(skb), mdst)) { -@@ -195,8 +217,15 @@ int br_handle_frame_finish(struct net *n - } - break; - case BR_PKT_UNICAST: -- dst = br_fdb_find_rcu(br, eth_hdr(skb)->h_dest, vid); -- break; -+ /* QCA qca-mcs support - Start */ -+ pdst = __br_get(get_dst_hook, NULL, p, &skb); -+ if (pdst) { -+ if (!skb) -+ goto out; -+ } else { -+ /* QCA qca-mcs support - End */ -+ dst = br_fdb_find_rcu(br, eth_hdr(skb)->h_dest, vid); -+ } - default: - break; - } -@@ -211,6 +240,13 @@ int br_handle_frame_finish(struct net *n - dst->used = now; - br_forward(dst->dst, skb, local_rcv, false); - } else { -+ /* QCA qca-mcs support - Start */ -+ if (pdst) { -+ br_forward(pdst, skb, local_rcv, false); -+ goto out; -+ } -+ /* QCA qca-mcs support - End */ -+ - if (!mcast_hit) - br_flood(br, skb, pkt_type, local_rcv, false, vid); - else ---- a/include/linux/mroute.h -+++ b/include/linux/mroute.h -@@ -92,4 +92,44 @@ struct rtmsg; - int ipmr_get_route(struct net *net, struct sk_buff *skb, - __be32 saddr, __be32 daddr, - struct rtmsg *rtm, u32 portid); -+ -+/* QCA ECM qca-mcs support - Start */ -+#define IPMR_MFC_EVENT_UPDATE 1 -+#define IPMR_MFC_EVENT_DELETE 2 -+ -+/* -+ * Callback to registered modules in the event of updates to a multicast group -+ */ -+typedef void (*ipmr_mfc_event_offload_callback_t)(__be32 origin, __be32 group, -+ u32 max_dest_dev, -+ u32 dest_dev_idx[], -+ u8 op); -+ -+/* -+ * Register the callback used to inform offload modules when updates occur to -+ * MFC. The callback is registered by offload modules -+ */ -+extern bool ipmr_register_mfc_event_offload_callback( -+ ipmr_mfc_event_offload_callback_t mfc_offload_cb); -+ -+/* -+ * De-Register the callback used to inform offload modules when updates occur -+ * to MFC -+ */ -+extern void ipmr_unregister_mfc_event_offload_callback(void); -+ -+/* -+ * Find the destination interface list, given a multicast group and source -+ */ -+extern int ipmr_find_mfc_entry(struct net *net, __be32 origin, __be32 group, -+ u32 max_dst_cnt, u32 dest_dev[]); -+ -+/* -+ * Out-of-band multicast statistics update for flows that are offloaded from -+ * Linux -+ */ -+extern int ipmr_mfc_stats_update(struct net *net, __be32 origin, __be32 group, -+ u64 pkts_in, u64 bytes_in, -+ u64 pkts_out, u64 bytes_out); -+/* QCA ECM qca-mcs support - End */ - #endif ---- a/include/linux/mroute6.h -+++ b/include/linux/mroute6.h -@@ -137,4 +137,47 @@ static inline int ip6mr_sk_ioctl(struct - return 1; - } - #endif -+ -+/* QCA qca-mcs support - Start */ -+#define IP6MR_MFC_EVENT_UPDATE 1 -+#define IP6MR_MFC_EVENT_DELETE 2 -+ -+/* -+ * Callback to registered modules in the event of updates to a multicast group -+ */ -+typedef void (*ip6mr_mfc_event_offload_callback_t)(struct in6_addr *origin, -+ struct in6_addr *group, -+ u32 max_dest_dev, -+ u32 dest_dev_idx[], -+ uint8_t op); -+ -+/* -+ * Register the callback used to inform offload modules when updates occur -+ * to MFC. The callback is registered by offload modules -+ */ -+extern bool ip6mr_register_mfc_event_offload_callback( -+ ip6mr_mfc_event_offload_callback_t mfc_offload_cb); -+ -+/* -+ * De-Register the callback used to inform offload modules when updates occur -+ * to MFC -+ */ -+extern void ip6mr_unregister_mfc_event_offload_callback(void); -+ -+/* -+ * Find the destination interface list given a multicast group and source -+ */ -+extern int ip6mr_find_mfc_entry(struct net *net, struct in6_addr *origin, -+ struct in6_addr *group, u32 max_dst_cnt, -+ u32 dest_dev[]); -+ -+/* -+ * Out-of-band multicast statistics update for flows that are offloaded from -+ * Linux -+ */ -+extern int ip6mr_mfc_stats_update(struct net *net, struct in6_addr *origin, -+ struct in6_addr *group, uint64_t pkts_in, -+ uint64_t bytes_in, uint64_t pkts_out, -+ uint64_t bytes_out); -+/* QCA qca-mcs support - End */ - #endif ---- a/net/ipv4/ipmr.c -+++ b/net/ipv4/ipmr.c -@@ -89,6 +89,9 @@ static struct net_device *vif_dev_read(c - /* Special spinlock for queue of unresolved entries */ - static DEFINE_SPINLOCK(mfc_unres_lock); - -+/* spinlock for offload */ -+static DEFINE_SPINLOCK(lock); /* QCA ECM qca-mcs support */ -+ - /* We return to original Alan's scheme. Hash table of resolved - * entries is changed only in process context and protected - * with weak lock mrt_lock. Queue of unresolved entries is protected -@@ -112,6 +115,9 @@ static void mroute_netlink_event(struct - static void igmpmsg_netlink_event(const struct mr_table *mrt, struct sk_buff *pkt); - static void mroute_clean_tables(struct mr_table *mrt, int flags); - static void ipmr_expire_process(struct timer_list *t); -+static struct mfc_cache *ipmr_cache_find(struct mr_table *mrt, __be32 origin, -+ __be32 mcastgrp); -+static ipmr_mfc_event_offload_callback_t __rcu ipmr_mfc_event_offload_callback; /* QCA ECM qca-mcs support */ - - #ifdef CONFIG_IP_MROUTE_MULTIPLE_TABLES - #define ipmr_for_each_table(mrt, net) \ -@@ -223,6 +229,80 @@ static int ipmr_rule_fill(struct fib_rul - return 0; - } - -+/* QCA ECM qca-mcs support - Start */ -+/* ipmr_sync_entry_update() -+ * Call the registered offload callback to report an update to a multicast -+ * route entry. The callback receives the list of destination interfaces and -+ * the interface count -+ */ -+static void ipmr_sync_entry_update(struct mr_table *mrt, -+ struct mfc_cache *cache) -+{ -+ int vifi, dest_if_count = 0; -+ u32 dest_dev[MAXVIFS]; -+ __be32 origin; -+ __be32 group; -+ ipmr_mfc_event_offload_callback_t offload_update_cb_f; -+ -+ memset(dest_dev, 0, sizeof(dest_dev)); -+ -+ origin = cache->mfc_origin; -+ group = cache->mfc_mcastgrp; -+ -+ spin_lock(&mrt_lock); -+ for (vifi = 0; vifi < cache->_c.mfc_un.res.maxvif; vifi++) { -+ if (!((cache->_c.mfc_un.res.ttls[vifi] > 0) && -+ (cache->_c.mfc_un.res.ttls[vifi] < 255))) { -+ continue; -+ } -+ if (dest_if_count == MAXVIFS) { -+ spin_unlock(&mrt_lock); -+ return; -+ } -+ -+ if (!VIF_EXISTS(mrt, vifi)) { -+ spin_unlock(&mrt_lock); -+ return; -+ } -+ dest_dev[dest_if_count] = mrt->vif_table[vifi].dev->ifindex; -+ dest_if_count++; -+ } -+ spin_unlock(&mrt_lock); -+ -+ rcu_read_lock(); -+ offload_update_cb_f = rcu_dereference(ipmr_mfc_event_offload_callback); -+ -+ if (!offload_update_cb_f) { -+ rcu_read_unlock(); -+ return; -+ } -+ -+ offload_update_cb_f(group, origin, dest_if_count, dest_dev, -+ IPMR_MFC_EVENT_UPDATE); -+ rcu_read_unlock(); -+} -+ -+/* ipmr_sync_entry_delete() -+ * Call the registered offload callback to inform of a multicast route entry -+ * delete event -+ */ -+static void ipmr_sync_entry_delete(u32 origin, u32 group) -+{ -+ ipmr_mfc_event_offload_callback_t offload_update_cb_f; -+ -+ rcu_read_lock(); -+ offload_update_cb_f = rcu_dereference(ipmr_mfc_event_offload_callback); -+ -+ if (!offload_update_cb_f) { -+ rcu_read_unlock(); -+ return; -+ } -+ -+ offload_update_cb_f(group, origin, 0, NULL, IPMR_MFC_EVENT_DELETE); -+ rcu_read_unlock(); -+} -+/* QCA ECM qca-mcs support - End */ -+ - static const struct fib_rules_ops __net_initconst ipmr_rules_ops_template = { - .family = RTNL_FAMILY_IPMR, - .rule_size = sizeof(struct ipmr_rule), -@@ -236,6 +316,156 @@ static const struct fib_rules_ops __net_ - .owner = THIS_MODULE, - }; - -+/* QCA ECM qca-mcs support - Start */ -+/* ipmr_register_mfc_event_offload_callback() -+ * Register the IPv4 Multicast update offload callback with IPMR -+ */ -+bool ipmr_register_mfc_event_offload_callback( -+ ipmr_mfc_event_offload_callback_t mfc_offload_cb) -+{ -+ ipmr_mfc_event_offload_callback_t offload_update_cb_f; -+ -+ rcu_read_lock(); -+ offload_update_cb_f = rcu_dereference(ipmr_mfc_event_offload_callback); -+ -+ if (offload_update_cb_f) { -+ rcu_read_unlock(); -+ return false; -+ } -+ rcu_read_unlock(); -+ -+ spin_lock(&lock); -+ rcu_assign_pointer(ipmr_mfc_event_offload_callback, mfc_offload_cb); -+ spin_unlock(&lock); -+ synchronize_rcu(); -+ return true; -+} -+EXPORT_SYMBOL(ipmr_register_mfc_event_offload_callback); -+ -+/* ipmr_unregister_mfc_event_offload_callback() -+ * De-register the IPv4 Multicast update offload callback with IPMR -+ */ -+void ipmr_unregister_mfc_event_offload_callback(void) -+{ -+ spin_lock(&lock); -+ rcu_assign_pointer(ipmr_mfc_event_offload_callback, NULL); -+ spin_unlock(&lock); -+ synchronize_rcu(); -+} -+EXPORT_SYMBOL(ipmr_unregister_mfc_event_offload_callback); -+ -+/* ipmr_find_mfc_entry() -+ * Returns destination interface list for a particular multicast flow, and -+ * the number of interfaces in the list -+ */ -+int ipmr_find_mfc_entry(struct net *net, __be32 origin, __be32 group, -+ u32 max_dest_cnt, u32 dest_dev[]) -+{ -+ int vifi, dest_if_count = 0; -+ struct mr_table *mrt; -+ struct mfc_cache *cache; -+ -+ mrt = ipmr_get_table(net, RT_TABLE_DEFAULT); -+ if (!mrt) -+ return -ENOENT; -+ -+ rcu_read_lock(); -+ cache = ipmr_cache_find(mrt, origin, group); -+ if (!cache) { -+ rcu_read_unlock(); -+ return -ENOENT; -+ } -+ -+ spin_lock(&mrt_lock); -+ for (vifi = 0; vifi < cache->_c.mfc_un.res.maxvif; vifi++) { -+ if (!((cache->_c.mfc_un.res.ttls[vifi] > 0) && -+ (cache->_c.mfc_un.res.ttls[vifi] < 255))) { -+ continue; -+ } -+ -+ /* We have another valid destination interface entry. Check if -+ * the number of the destination interfaces for the route is -+ * exceeding the size of the array given to us -+ */ -+ if (dest_if_count == max_dest_cnt) { -+ spin_unlock(&mrt_lock); -+ rcu_read_unlock(); -+ return -EINVAL; -+ } -+ -+ if (!VIF_EXISTS(mrt, vifi)) { -+ spin_unlock(&mrt_lock); -+ rcu_read_unlock(); -+ return -EINVAL; -+ } -+ -+ dest_dev[dest_if_count] = mrt->vif_table[vifi].dev->ifindex; -+ dest_if_count++; -+ } -+ spin_unlock(&mrt_lock); -+ rcu_read_unlock(); -+ -+ return dest_if_count; -+} -+EXPORT_SYMBOL(ipmr_find_mfc_entry); -+ -+/* ipmr_mfc_stats_update() -+ * Update the MFC/VIF statistics for offloaded flows -+ */ -+int ipmr_mfc_stats_update(struct net *net, __be32 origin, __be32 group, -+ u64 pkts_in, u64 bytes_in, -+ u64 pkts_out, u64 bytes_out) -+{ -+ int vif, vifi; -+ struct mr_table *mrt; -+ struct mfc_cache *cache; -+ -+ mrt = ipmr_get_table(net, RT_TABLE_DEFAULT); -+ if (!mrt) -+ return -ENOENT; -+ -+ rcu_read_lock(); -+ cache = ipmr_cache_find(mrt, origin, group); -+ if (!cache) { -+ rcu_read_unlock(); -+ return -ENOENT; -+ } -+ -+ vif = cache->_c.mfc_parent; -+ -+ spin_lock(&mrt_lock); -+ if (!VIF_EXISTS(mrt, vif)) { -+ spin_unlock(&mrt_lock); -+ rcu_read_unlock(); -+ return -EINVAL; -+ } -+ -+ mrt->vif_table[vif].pkt_in += pkts_in; -+ mrt->vif_table[vif].bytes_in += bytes_in; -+ cache->_c.mfc_un.res.pkt += pkts_out; -+ cache->_c.mfc_un.res.bytes += bytes_out; -+ -+ for (vifi = cache->_c.mfc_un.res.minvif; -+ vifi < cache->_c.mfc_un.res.maxvif; vifi++) { -+ if ((cache->_c.mfc_un.res.ttls[vifi] > 0) && -+ (cache->_c.mfc_un.res.ttls[vifi] < 255)) { -+ if (!VIF_EXISTS(mrt, vifi)) { -+ spin_unlock(&mrt_lock); -+ rcu_read_unlock(); -+ return -EINVAL; -+ } -+ mrt->vif_table[vifi].pkt_out += pkts_out; -+ mrt->vif_table[vifi].bytes_out += bytes_out; -+ } -+ } -+ spin_unlock(&mrt_lock); -+ rcu_read_unlock(); -+ -+ return 0; -+} -+EXPORT_SYMBOL(ipmr_mfc_stats_update); -+/* QCA ECM qca-mcs support - End */ -+ - static int __net_init ipmr_rules_init(struct net *net) - { - struct fib_rules_ops *ops; -@@ -1191,6 +1421,10 @@ static int ipmr_mfc_delete(struct mr_tab - call_ipmr_mfc_entry_notifiers(net, FIB_EVENT_ENTRY_DEL, c, mrt->id); - mroute_netlink_event(mrt, c, RTM_DELROUTE); - mr_cache_put(&c->_c); -+ /* QCA ECM qca-mcs support - Start */ -+ /* Inform offload modules of the delete event */ -+ ipmr_sync_entry_delete(c->mfc_origin, c->mfc_mcastgrp); -+ /* QCA ECM qca-mcs support - End */ - - return 0; - } -@@ -1221,6 +1455,10 @@ static int ipmr_mfc_add(struct net *net, - call_ipmr_mfc_entry_notifiers(net, FIB_EVENT_ENTRY_REPLACE, c, - mrt->id); - mroute_netlink_event(mrt, c, RTM_NEWROUTE); -+ /* QCA ECM qca-mcs support - Start */ -+ /* Inform offload modules of the update event */ -+ ipmr_sync_entry_update(mrt, c); -+ /* QCA ECM qca-mcs support - End */ - return 0; - } - ---- a/net/ipv6/ip6mr.c -+++ b/net/ipv6/ip6mr.c -@@ -74,6 +74,9 @@ static struct net_device *vif_dev_read(c - /* Special spinlock for queue of unresolved entries */ - static DEFINE_SPINLOCK(mfc_unres_lock); - -+/* Spinlock for offload */ -+static DEFINE_SPINLOCK(lock); /* QCA qca-mcs support */ -+ - /* We return to original Alan's scheme. Hash table of resolved - entries is changed only in process context and protected - with weak lock mrt_lock. Queue of unresolved entries is protected -@@ -101,6 +104,13 @@ static int ip6mr_rtm_dumproute(struct sk - struct netlink_callback *cb); - static void mroute_clean_tables(struct mr_table *mrt, int flags); - static void ipmr_expire_process(struct timer_list *t); -+/* QCA qca-mcs support - Start */ -+static struct mfc6_cache *ip6mr_cache_find(struct mr_table *mrt, -+ const struct in6_addr *origin, -+ const struct in6_addr *mcastgrp); -+static ip6mr_mfc_event_offload_callback_t __rcu -+ ip6mr_mfc_event_offload_callback; -+/* QCA qca-mcs support - End */ - - #ifdef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES - #define ip6mr_for_each_table(mrt, net) \ -@@ -375,6 +385,84 @@ static struct mfc6_cache_cmp_arg ip6mr_m - .mf6c_mcastgrp = IN6ADDR_ANY_INIT, - }; - -+/* QCA qca-mcs support - Start */ -+/* ip6mr_sync_entry_update() -+ * Call the registered offload callback to report an update to a multicast -+ * route entry. The callback receives the list of destination interfaces and -+ * the interface count -+ */ -+static void ip6mr_sync_entry_update(struct mr_table *mrt, -+ struct mfc6_cache *cache) -+{ -+ int vifi, dest_if_count = 0; -+ u32 dest_dev[MAXMIFS]; -+ struct in6_addr mc_origin, mc_group; -+ ip6mr_mfc_event_offload_callback_t offload_update_cb_f; -+ -+ memset(dest_dev, 0, sizeof(dest_dev)); -+ -+ spin_lock(&mrt_lock); -+ -+ for (vifi = 0; vifi < cache->_c.mfc_un.res.maxvif; vifi++) { -+ if (!((cache->_c.mfc_un.res.ttls[vifi] > 0) && -+ (cache->_c.mfc_un.res.ttls[vifi] < 255))) { -+ continue; -+ } -+ -+ if (dest_if_count == MAXMIFS) { -+ spin_unlock(&mrt_lock); -+ return; -+ } -+ -+ if (!VIF_EXISTS(mrt, vifi)) { -+ spin_unlock(&mrt_lock); -+ return; -+ } -+ -+ dest_dev[dest_if_count] = mrt->vif_table[vifi].dev->ifindex; -+ dest_if_count++; -+ } -+ -+ memcpy(&mc_origin, &cache->mf6c_origin, sizeof(struct in6_addr)); -+ memcpy(&mc_group, &cache->mf6c_mcastgrp, sizeof(struct in6_addr)); -+ spin_unlock(&mrt_lock); -+ -+ rcu_read_lock(); -+ offload_update_cb_f = rcu_dereference(ip6mr_mfc_event_offload_callback); -+ -+ if (!offload_update_cb_f) { -+ rcu_read_unlock(); -+ return; -+ } -+ -+ offload_update_cb_f(&mc_group, &mc_origin, dest_if_count, dest_dev, -+ IP6MR_MFC_EVENT_UPDATE); -+ rcu_read_unlock(); -+} -+ -+/* ip6mr_sync_entry_delete() -+ * Call the registered offload callback to inform of a multicast route entry -+ * delete event -+ */ -+static void ip6mr_sync_entry_delete(struct in6_addr *mc_origin, -+ struct in6_addr *mc_group) -+{ -+ ip6mr_mfc_event_offload_callback_t offload_update_cb_f; -+ -+ rcu_read_lock(); -+ offload_update_cb_f = rcu_dereference(ip6mr_mfc_event_offload_callback); -+ -+ if (!offload_update_cb_f) { -+ rcu_read_unlock(); -+ return; -+ } -+ -+ offload_update_cb_f(mc_group, mc_origin, 0, NULL, -+ IP6MR_MFC_EVENT_DELETE); -+ rcu_read_unlock(); -+} -+/* QCA qca-mcs support - End */ -+ - static struct mr_table_ops ip6mr_mr_table_ops = { - .rht_params = &ip6mr_rht_params, - .cmparg_any = &ip6mr_mr_table_ops_cmparg_any, -@@ -697,6 +785,151 @@ static int call_ip6mr_mfc_entry_notifier - &mfc->_c, tb_id, &net->ipv6.ipmr_seq); - } - -+/* QCA qca-mcs support - Start */ -+/* ip6mr_register_mfc_event_offload_callback() -+ * Register the IPv6 multicast update callback for offload modules -+ */ -+bool ip6mr_register_mfc_event_offload_callback( -+ ip6mr_mfc_event_offload_callback_t mfc_offload_cb) -+{ -+ ip6mr_mfc_event_offload_callback_t offload_update_cb_f; -+ -+ rcu_read_lock(); -+ offload_update_cb_f = rcu_dereference(ip6mr_mfc_event_offload_callback); -+ -+ if (offload_update_cb_f) { -+ rcu_read_unlock(); -+ return false; -+ } -+ rcu_read_unlock(); -+ -+ spin_lock(&lock); -+ rcu_assign_pointer(ip6mr_mfc_event_offload_callback, mfc_offload_cb); -+ spin_unlock(&lock); -+ synchronize_rcu(); -+ return true; -+} -+EXPORT_SYMBOL(ip6mr_register_mfc_event_offload_callback); -+ -+/* ip6mr_unregister_mfc_event_offload_callback() -+ * De-register the IPv6 multicast update callback for offload modules -+ */ -+void ip6mr_unregister_mfc_event_offload_callback(void) -+{ -+ spin_lock(&lock); -+ rcu_assign_pointer(ip6mr_mfc_event_offload_callback, NULL); -+ spin_unlock(&lock); -+ synchronize_rcu(); -+} -+EXPORT_SYMBOL(ip6mr_unregister_mfc_event_offload_callback); -+ -+/* ip6mr_find_mfc_entry() -+ * Return the destination interface list for a particular multicast flow, and -+ * the number of interfaces in the list -+ */ -+int ip6mr_find_mfc_entry(struct net *net, struct in6_addr *origin, -+ struct in6_addr *group, u32 max_dest_cnt, -+ u32 dest_dev[]) -+{ -+ int vifi, dest_if_count = 0; -+ struct mr_table *mrt; -+ struct mfc6_cache *cache; -+ -+ mrt = ip6mr_get_table(net, RT6_TABLE_DFLT); -+ if (!mrt) -+ return -ENOENT; -+ -+ spin_lock(&mrt_lock); -+ cache = ip6mr_cache_find(mrt, origin, group); -+ if (!cache) { -+ spin_unlock(&mrt_lock); -+ return -ENOENT; -+ } -+ -+ for (vifi = 0; vifi < cache->_c.mfc_un.res.maxvif; vifi++) { -+ if (!((cache->_c.mfc_un.res.ttls[vifi] > 0) && -+ (cache->_c.mfc_un.res.ttls[vifi] < 255))) { -+ continue; -+ } -+ -+ /* We have another valid destination interface entry. Check if -+ * the number of the destination interfaces for the route is -+ * exceeding the size of the array given to us -+ */ -+ if (dest_if_count == max_dest_cnt) { -+ spin_unlock(&mrt_lock); -+ return -EINVAL; -+ } -+ -+ if (!VIF_EXISTS(mrt, vifi)) { -+ spin_unlock(&mrt_lock); -+ return -EINVAL; -+ } -+ -+ dest_dev[dest_if_count] = mrt->vif_table[vifi].dev->ifindex; -+ dest_if_count++; -+ } -+ spin_unlock(&mrt_lock); -+ -+ return dest_if_count; -+} -+EXPORT_SYMBOL(ip6mr_find_mfc_entry); -+ -+/* ip6mr_mfc_stats_update() -+ * Update the MFC/VIF statistics for offloaded flows -+ */ -+int ip6mr_mfc_stats_update(struct net *net, struct in6_addr *origin, -+ struct in6_addr *group, u64 pkts_in, -+ u64 bytes_in, uint64_t pkts_out, -+ u64 bytes_out) -+{ -+ int vif, vifi; -+ struct mr_table *mrt; -+ struct mfc6_cache *cache; -+ -+ mrt = ip6mr_get_table(net, RT6_TABLE_DFLT); -+ -+ if (!mrt) -+ return -ENOENT; -+ -+ spin_lock(&mrt_lock); -+ cache = ip6mr_cache_find(mrt, origin, group); -+ if (!cache) { -+ spin_unlock(&mrt_lock); -+ return -ENOENT; -+ } -+ -+ vif = cache->_c.mfc_parent; -+ -+ if (!VIF_EXISTS(mrt, vif)) { -+ spin_unlock(&mrt_lock); -+ return -EINVAL; -+ } -+ -+ mrt->vif_table[vif].pkt_in += pkts_in; -+ mrt->vif_table[vif].bytes_in += bytes_in; -+ cache->_c.mfc_un.res.pkt += pkts_out; -+ cache->_c.mfc_un.res.bytes += bytes_out; -+ -+ for (vifi = cache->_c.mfc_un.res.minvif; -+ vifi < cache->_c.mfc_un.res.maxvif; vifi++) { -+ if ((cache->_c.mfc_un.res.ttls[vifi] > 0) && -+ (cache->_c.mfc_un.res.ttls[vifi] < 255)) { -+ if (!VIF_EXISTS(mrt, vifi)) { -+ spin_unlock(&mrt_lock); -+ return -EINVAL; -+ } -+ mrt->vif_table[vifi].pkt_out += pkts_out; -+ mrt->vif_table[vifi].bytes_out += bytes_out; -+ } -+ } -+ -+ spin_unlock(&mrt_lock); -+ return 0; -+} -+EXPORT_SYMBOL(ip6mr_mfc_stats_update); -+/* QCA qca-mcs support - End */ -+ - /* Delete a VIF entry */ - static int mif6_delete(struct mr_table *mrt, int vifi, int notify, - struct list_head *head) -@@ -1221,6 +1454,7 @@ static int ip6mr_mfc_delete(struct mr_ta - int parent) - { - struct mfc6_cache *c; -+ struct in6_addr mc_origin, mc_group; /* QCA qca-mcs support */ - - /* The entries are added/deleted only under RTNL */ - rcu_read_lock(); -@@ -1229,6 +1463,11 @@ static int ip6mr_mfc_delete(struct mr_ta - rcu_read_unlock(); - if (!c) - return -ENOENT; -+ -+ /* QCA qca-mcs support - Start */ -+ memcpy(&mc_origin, &c->mf6c_origin, sizeof(struct in6_addr)); -+ memcpy(&mc_group, &c->mf6c_mcastgrp, sizeof(struct in6_addr)); -+ /* QCA qca-mcs support - End */ - rhltable_remove(&mrt->mfc_hash, &c->_c.mnode, ip6mr_rht_params); - list_del_rcu(&c->_c.list); - -@@ -1236,6 +1475,11 @@ static int ip6mr_mfc_delete(struct mr_ta - FIB_EVENT_ENTRY_DEL, c, mrt->id); - mr6_netlink_event(mrt, c, RTM_DELROUTE); - mr_cache_put(&c->_c); -+ /* QCA qca-mcs support - Start */ -+ /* Inform offload modules of the delete event */ -+ ip6mr_sync_entry_delete(&mc_origin, &mc_group); -+ /* QCA qca-mcs support - End */ -+ - return 0; - } - -@@ -1457,6 +1701,10 @@ static int ip6mr_mfc_add(struct net *net - call_ip6mr_mfc_entry_notifiers(net, FIB_EVENT_ENTRY_REPLACE, - c, mrt->id); - mr6_netlink_event(mrt, c, RTM_NEWROUTE); -+ /* QCA qca-mcs support - Start */ -+ /* Inform offload modules of the update event */ -+ ip6mr_sync_entry_update(mrt, c); -+ /* QCA qca-mcs support - End */ - return 0; - } - diff --git a/target/linux/qualcommax/patches-6.6/0605-1-qca-nss-cfi-support.patch b/target/linux/qualcommax/patches-6.6/0605-1-qca-nss-cfi-support.patch deleted file mode 100644 index 23d5089631e..00000000000 --- a/target/linux/qualcommax/patches-6.6/0605-1-qca-nss-cfi-support.patch +++ /dev/null @@ -1,127 +0,0 @@ ---- a/crypto/authenc.c -+++ b/crypto/authenc.c -@@ -415,6 +415,8 @@ static int crypto_authenc_create(struct - enc->base.cra_driver_name) >= CRYPTO_MAX_ALG_NAME) - goto err_free_inst; - -+ inst->alg.base.cra_flags |= (auth_base->cra_flags | -+ enc->base.cra_flags) & CRYPTO_ALG_NOSUPP_SG; - inst->alg.base.cra_priority = enc->base.cra_priority * 10 + - auth_base->cra_priority; - inst->alg.base.cra_blocksize = enc->base.cra_blocksize; ---- a/include/linux/crypto.h -+++ b/include/linux/crypto.h -@@ -86,6 +86,11 @@ - #define CRYPTO_NOLOAD 0x00008000 - - /* -+ * Set this flag if algorithm does not support SG list transforms -+ */ -+#define CRYPTO_ALG_NOSUPP_SG 0x0000c000 -+ -+/* - * The algorithm may allocate memory during request processing, i.e. during - * encryption, decryption, or hashing. Users can request an algorithm with this - * flag unset if they can't handle memory allocation failures. ---- a/net/ipv4/esp4.c -+++ b/net/ipv4/esp4.c -@@ -3,6 +3,7 @@ - - #include - #include -+#include - #include - #include - #include -@@ -657,6 +658,7 @@ static int esp_output(struct xfrm_state - struct ip_esp_hdr *esph; - struct crypto_aead *aead; - struct esp_info esp; -+ bool nosupp_sg; - - esp.inplace = true; - -@@ -668,6 +670,11 @@ static int esp_output(struct xfrm_state - aead = x->data; - alen = crypto_aead_authsize(aead); - -+ nosupp_sg = crypto_tfm_alg_type(&aead->base) & CRYPTO_ALG_NOSUPP_SG; -+ if (nosupp_sg && skb_linearize(skb)) { -+ return -ENOMEM; -+ } -+ - esp.tfclen = 0; - if (x->tfcpad) { - struct xfrm_dst *dst = (struct xfrm_dst *)skb_dst(skb); -@@ -889,6 +896,7 @@ static int esp_input(struct xfrm_state * - u8 *iv; - struct scatterlist *sg; - int err = -EINVAL; -+ bool nosupp_sg; - - if (!pskb_may_pull(skb, sizeof(struct ip_esp_hdr) + ivlen)) - goto out; -@@ -896,6 +904,12 @@ static int esp_input(struct xfrm_state * - if (elen <= 0) - goto out; - -+ nosupp_sg = crypto_tfm_alg_type(&aead->base) & CRYPTO_ALG_NOSUPP_SG; -+ if (nosupp_sg && skb_linearize(skb)) { -+ err = -ENOMEM; -+ goto out; -+ } -+ - assoclen = sizeof(struct ip_esp_hdr); - seqhilen = 0; - ---- a/net/ipv6/esp6.c -+++ b/net/ipv6/esp6.c -@@ -15,6 +15,7 @@ - - #include - #include -+#include - #include - #include - #include -@@ -695,6 +696,7 @@ static int esp6_output(struct xfrm_state - struct ip_esp_hdr *esph; - struct crypto_aead *aead; - struct esp_info esp; -+ bool nosupp_sg; - - esp.inplace = true; - -@@ -706,6 +708,11 @@ static int esp6_output(struct xfrm_state - aead = x->data; - alen = crypto_aead_authsize(aead); - -+ nosupp_sg = crypto_tfm_alg_type(&aead->base) & CRYPTO_ALG_NOSUPP_SG; -+ if (nosupp_sg && skb_linearize(skb)) { -+ return -ENOMEM; -+ } -+ - esp.tfclen = 0; - if (x->tfcpad) { - struct xfrm_dst *dst = (struct xfrm_dst *)skb_dst(skb); -@@ -933,6 +940,7 @@ static int esp6_input(struct xfrm_state - __be32 *seqhi; - u8 *iv; - struct scatterlist *sg; -+ bool nosupp_sg; - - if (!pskb_may_pull(skb, sizeof(struct ip_esp_hdr) + ivlen)) { - ret = -EINVAL; -@@ -944,6 +952,12 @@ static int esp6_input(struct xfrm_state - goto out; - } - -+ nosupp_sg = crypto_tfm_alg_type(&aead->base) & CRYPTO_ALG_NOSUPP_SG; -+ if (nosupp_sg && skb_linearize(skb)) { -+ ret = -ENOMEM; -+ goto out; -+ } -+ - assoclen = sizeof(struct ip_esp_hdr); - seqhilen = 0; - diff --git a/target/linux/qualcommax/patches-6.6/0606-1-qca-nss-ecm-bridge-Fixes-for-Bridge-VLAN-Filtering.patch b/target/linux/qualcommax/patches-6.6/0606-1-qca-nss-ecm-bridge-Fixes-for-Bridge-VLAN-Filtering.patch deleted file mode 100644 index b4d5f89dd55..00000000000 --- a/target/linux/qualcommax/patches-6.6/0606-1-qca-nss-ecm-bridge-Fixes-for-Bridge-VLAN-Filtering.patch +++ /dev/null @@ -1,341 +0,0 @@ -From 7732ede3f72eebb8742e17e61e07e9286c442aec Mon Sep 17 00:00:00 2001 -From: Vishnu Vardhan Bantanahal -Date: Mon, 15 May 2023 17:56:04 +0530 -Subject: [PATCH 277/281] bridge: Fixes for Bridge VLAN Filtering - -1. Fix function to check for bridge master status while checking -for Bridge VLAN filter feature is enabled on bridge slave ports. -2. Disable default PVID for bridges during device registration in -the system. -Change-Id: Ibea6559c1b0700a2300b60e20d57b7818e23a8a8 -Signed-off-by: Vishnu Vardhan Bantanahal - -bridge: Fix Bridge VLAN stats update -This patch fixes Bridge VLAN stats update for both bridge master -and bridge slave. -Change-Id: Ia26f4c71e83e27dd83336815cda5c05c8c3f24ff -Signed-off-by: Vishnu Vardhan Bantanahal - -bridge: Add bridge VLAN filter APIs for offload for 6.1 Kernel - -Change-Id: I54e44c26664f86ae024f54605a032713a9a3eee5 -Signed-off-by: Vishnu Vardhan Bantanahal ---- - include/linux/if_bridge.h | 29 +++++- - include/linux/netdevice.h | 2 +- - net/bridge/br.c | 4 + - net/bridge/br_if.c | 11 ++- - net/bridge/br_private.h | 1 + - net/bridge/br_vlan.c | 186 +++++++++++++++++++++++++++++++++++++- - net/core/dev.c | 2 +- - 7 files changed, 227 insertions(+), 8 deletions(-) - ---- a/include/linux/if_bridge.h -+++ b/include/linux/if_bridge.h -@@ -128,6 +128,12 @@ int br_vlan_get_info_rcu(const struct ne - bool br_mst_enabled(const struct net_device *dev); - int br_mst_get_info(const struct net_device *dev, u16 msti, unsigned long *vids); - int br_mst_get_state(const struct net_device *dev, u16 msti, u8 *state); -+ -+extern struct net_device *br_fdb_find_vid_by_mac(struct net_device *dev, u8 *mac, u16 *vid); -+extern int br_vlan_get_tag_skb(const struct sk_buff *skb, u16 *vid); -+extern int br_dev_is_vlan_filter_enabled(struct net_device *dev); -+extern int br_vlan_update_stats(struct net_device* dev, u32 vid, u64 rx_bytes, u64 rx_packets, u64 tx_bytes, u64 tx_packets); -+extern int br_vlan_get_info_rcu(const struct net_device *dev, u16 vid, struct bridge_vlan_info *p_vinfo); - #else - static inline bool br_vlan_enabled(const struct net_device *dev) - { -@@ -149,8 +155,27 @@ static inline int br_vlan_get_pvid_rcu(c - return -EINVAL; - } - --static inline int br_vlan_get_info(const struct net_device *dev, u16 vid, -- struct bridge_vlan_info *p_vinfo) -+static inline int br_vlan_get_info(const struct net_device *dev, u16 vid, struct bridge_vlan_info *p_vinfo) -+{ -+ return -EINVAL; -+} -+ -+static inline struct net_device *br_fdb_find_vid_by_mac(struct net_device *dev, u8 *mac, u16 *vid) -+{ -+ return NULL; -+} -+ -+static inline int br_vlan_get_tag_skb(const struct sk_buff *skb, u16 *vid) -+{ -+ return -EINVAL; -+} -+ -+static inline int br_dev_is_vlan_filter_enabled(const struct net_device *dev) -+{ -+ return -EINVAL; -+} -+ -+static inline int br_vlan_update_stats(struct net_device* dev, u32 vid, u64 rx_bytes, u64 rx_packets, u64 tx_bytes, u64 tx_packets) - { - return -EINVAL; - } ---- a/net/bridge/br.c -+++ b/net/bridge/br.c -@@ -42,6 +42,10 @@ static int br_device_event(struct notifi - return notifier_from_errno(err); - - if (event == NETDEV_REGISTER) { -+#if IS_ENABLED(CONFIG_BRIDGE_VLAN_FILTERING) -+ br_vlan_disable_default_pvid(netdev_priv(dev)); -+#endif -+ - /* register of bridge completed, add sysfs entries */ - err = br_sysfs_addbr(dev); - if (err) ---- a/net/bridge/br_if.c -+++ b/net/bridge/br_if.c -@@ -800,9 +800,12 @@ struct net_device *br_port_dev_get(struc - struct sk_buff *skb, - unsigned int cookie) - { -+#if !IS_ENABLED(CONFIG_BRIDGE_VLAN_FILTERING) - struct net_bridge_fdb_entry *fdbe; - struct net_bridge *br; -+#endif - struct net_device *netdev = NULL; -+ u16 __maybe_unused vid; - - /* Is this a bridge? */ - if (!(dev->priv_flags & IFF_EBRIDGE)) -@@ -831,14 +834,20 @@ struct net_device *br_port_dev_get(struc - * determine the port to use - fall back to using FDB - */ - -+#if IS_ENABLED(CONFIG_BRIDGE_VLAN_FILTERING) -+ /* Lookup the fdb entry and get reference to the port dev. -+ * dev_hold() is done as part of br_fdb_find_vid_by_mac() -+ */ -+ netdev = br_fdb_find_vid_by_mac(dev, addr, &vid); -+#else - br = netdev_priv(dev); -- -- /* Lookup the fdb entry and get reference to the port dev */ - fdbe = br_fdb_find_rcu(br, addr, 0); - if (fdbe && fdbe->dst) { - netdev = fdbe->dst->dev; /* port device */ - dev_hold(netdev); - } -+#endif -+ - out: - rcu_read_unlock(); - return netdev; ---- a/net/bridge/br_private.h -+++ b/net/bridge/br_private.h -@@ -1563,6 +1563,7 @@ void br_vlan_fill_forward_path_pvid(stru - int br_vlan_fill_forward_path_mode(struct net_bridge *br, - struct net_bridge_port *dst, - struct net_device_path *path); -+void br_vlan_disable_default_pvid(struct net_bridge *br); - - static inline struct net_bridge_vlan_group *br_vlan_group( - const struct net_bridge *br) ---- a/net/bridge/br_vlan.c -+++ b/net/bridge/br_vlan.c -@@ -933,8 +933,190 @@ int br_vlan_get_proto(const struct net_d - } - EXPORT_SYMBOL_GPL(br_vlan_get_proto); - -+/* -+ * br_vlan_get_tag_skb() -+ * Returns VLAN tag is its found valid in skb. -+ */ -+int br_vlan_get_tag_skb(const struct sk_buff *skb, u16 *vid) -+{ -+ return br_vlan_get_tag(skb, vid); -+ -+} -+EXPORT_SYMBOL_GPL(br_vlan_get_tag_skb); -+ -+/* -+ * br_dev_is_vlan_filter_enabled() -+ * Caller should ensure to hold rcu_lock() -+ * Returns 0, when device(port or bridge device) has a valid bridge -+ * vlan filter configuration and returns error otherwise. -+ */ -+int br_dev_is_vlan_filter_enabled(struct net_device *dev) -+{ -+ struct net_bridge_port *p; -+ struct net_bridge_vlan_group *vg = NULL; -+ struct net_device *master = NULL; -+ -+ if (!dev) { -+ return -ENODEV; -+ } -+ -+ if (netif_is_bridge_master(dev)) { -+ /* -+ * Its a bridge device -+ */ -+ if (!br_vlan_enabled(dev)) { -+ return -ENOENT; -+ } -+ -+ vg = br_vlan_group(netdev_priv(dev)); -+ } else if (dev->priv_flags & IFF_BRIDGE_PORT) { -+ /* -+ * It's a bridge port -+ */ -+ master = netdev_master_upper_dev_get_rcu(dev); -+ if (!master) { -+ return -EINVAL; -+ } -+ -+ if (!br_vlan_enabled(master)) { -+ return -ENOENT; -+ } -+ -+ p = br_port_get_rcu(dev); -+ if (p) -+ vg = nbp_vlan_group(p); -+ } else { -+ /* -+ * Neither a bridge device or port -+ */ -+ return -EINVAL; -+ } -+ -+ if (vg != NULL && vg->num_vlans) { -+ return 0; -+ } -+ -+ return -ENXIO; -+} -+EXPORT_SYMBOL_GPL(br_dev_is_vlan_filter_enabled); -+ -+/* -+ * br_fdb_find_vid_by_mac() -+ * Caller ensures to ensure rcu_lock() is taken. -+ * Returns 0 in case of lookup was performed. -+ * Look up the bridge fdb table for the mac-address & find associated -+ * VLAN id associated with it. -+ * vid is non-zero for succesfull lookup, otherwise 0. -+ * We dev_hold() on the returned device, caller will release this hold. -+ */ -+struct net_device *br_fdb_find_vid_by_mac(struct net_device *dev, u8 *mac, u16 *vid) -+{ -+ struct net_bridge *br; -+ struct net_bridge_fdb_entry *f; -+ struct net_device *netdev = NULL; -+ -+ if (!mac) { -+ return NULL; -+ } -+ -+ if (!dev || !netif_is_bridge_master(dev)) { -+ return NULL; -+ } -+ -+ br = netdev_priv(dev); -+ if (!br) { -+ return NULL; -+ } -+ -+ hlist_for_each_entry_rcu(f, &br->fdb_list, fdb_node) { -+ if (ether_addr_equal(f->key.addr.addr, mac)) { -+ *vid = f->key.vlan_id; -+ if (f->dst) { -+ netdev = f->dst->dev; -+ dev_hold(netdev); -+ break; -+ } -+ } -+ } -+ return netdev; -+} -+EXPORT_SYMBOL_GPL(br_fdb_find_vid_by_mac); -+ -+/* -+ * br_vlan_update_stats() -+ * Update bridge VLAN filter statistics. -+ */ -+int br_vlan_update_stats(struct net_device *dev, u32 vid, u64 rx_bytes, u64 rx_packets, u64 tx_bytes, u64 tx_packets) -+{ -+ struct net_bridge_port *p; -+ struct net_bridge_vlan *v; -+ struct pcpu_sw_netstats *stats; -+ const struct net_bridge *br; -+ struct net_bridge_vlan_group *vg; -+ struct net_device *brdev; -+ -+ if (!dev) { -+ return -ENODEV; -+ } -+ -+ if (!netif_is_bridge_port(dev) && !netif_is_bridge_master(dev)) { -+ return -EINVAL; -+ } -+ -+ rcu_read_lock(); -+ -+ brdev = dev; -+ if (!netif_is_bridge_master(dev)) { -+ brdev = netdev_master_upper_dev_get_rcu(dev); -+ if (!brdev) { -+ rcu_read_unlock(); -+ return -EPERM; -+ } -+ } -+ -+ br = netdev_priv(brdev); -+ if (!br || !br_opt_get(br, BROPT_VLAN_STATS_ENABLED)) { -+ rcu_read_unlock(); -+ return -EINVAL; -+ } -+ -+ p = br_port_get_rcu(dev); -+ if (p) { -+ vg = nbp_vlan_group_rcu(p); -+ } else if (netif_is_bridge_master(dev)) { -+ vg = br_vlan_group(netdev_priv(dev)); -+ } else { -+ rcu_read_unlock(); -+ return -EINVAL; -+ } -+ -+ -+ if (!vg) { -+ rcu_read_unlock(); -+ return -ENXIO; -+ } -+ -+ v = br_vlan_find(vg, vid); -+ if (!v || !br_vlan_should_use(v)) { -+ rcu_read_unlock(); -+ return -ENOENT; -+ } -+ -+ stats = this_cpu_ptr(v->stats); -+ u64_stats_update_begin(&stats->syncp); -+ u64_stats_add(&stats->rx_bytes, rx_bytes); -+ u64_stats_add(&stats->rx_packets, rx_packets); -+ u64_stats_add(&stats->tx_bytes, tx_bytes); -+ u64_stats_add(&stats->tx_packets, tx_packets); -+ u64_stats_update_end(&stats->syncp); -+ -+ rcu_read_unlock(); -+ return 0; -+} -+EXPORT_SYMBOL_GPL(br_vlan_update_stats); -+ - int __br_vlan_set_proto(struct net_bridge *br, __be16 proto, -- struct netlink_ext_ack *extack) -+ struct netlink_ext_ack *extack) - { - struct switchdev_attr attr = { - .orig_dev = br->dev, -@@ -1068,7 +1250,7 @@ static bool vlan_default_pvid(struct net - return false; - } - --static void br_vlan_disable_default_pvid(struct net_bridge *br) -+void br_vlan_disable_default_pvid(struct net_bridge *br) - { - struct net_bridge_port *p; - u16 pvid = br->default_pvid; diff --git a/target/linux/qualcommax/patches-6.6/0901-arm64-dts-qcom-ipq5018-add-watchdog.patch b/target/linux/qualcommax/patches-6.6/0901-arm64-dts-qcom-ipq5018-add-watchdog.patch deleted file mode 100644 index 7f92ce61d6e..00000000000 --- a/target/linux/qualcommax/patches-6.6/0901-arm64-dts-qcom-ipq5018-add-watchdog.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 9cbaee8379e620f82112002f973adde19679df31 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 16 Aug 2023 18:14:00 +0200 -Subject: arm64: dts: qcom: ipq5018: add watchdog - -Add the required DT node for watchdog operation. - -Signed-off-by: Robert Marko -Reviewed-by: Konrad Dybcio -Link: https://lore.kernel.org/r/20230816161455.3310629-2-robimarko@gmail.com -Signed-off-by: Bjorn Andersson ---- - arch/arm64/boot/dts/qcom/ipq5018.dtsi | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi -@@ -182,6 +182,13 @@ - }; - }; - -+ watchdog: watchdog@b017000 { -+ compatible = "qcom,apss-wdt-ipq5018", "qcom,kpss-wdt"; -+ reg = <0x0b017000 0x40>; -+ interrupts = ; -+ clocks = <&sleep_clk>; -+ }; -+ - timer@b120000 { - compatible = "arm,armv7-timer-mem"; - reg = <0x0b120000 0x1000>; diff --git a/target/linux/qualcommax/patches-6.6/0902-firmware-qcom_scm-disable-SDI-if-required.patch b/target/linux/qualcommax/patches-6.6/0902-firmware-qcom_scm-disable-SDI-if-required.patch deleted file mode 100644 index b08bd214e0f..00000000000 --- a/target/linux/qualcommax/patches-6.6/0902-firmware-qcom_scm-disable-SDI-if-required.patch +++ /dev/null @@ -1,83 +0,0 @@ -From ff4aa3bc98258a240b9bbab53fd8d2fb8184c485 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 16 Aug 2023 18:45:39 +0200 -Subject: firmware: qcom_scm: disable SDI if required - -IPQ5018 has SDI (Secure Debug Image) enabled by TZ by default, and that -means that WDT being asserted or just trying to reboot will hang the board -in the debug mode and only pulling the power and repowering will help. -Some IPQ4019 boards like Google WiFI have it enabled as well. - -Luckily, SDI can be disabled via an SCM call. - -So, lets use the boolean DT property to identify boards that have SDI -enabled by default and use the SCM call to disable SDI during SCM probe. -It is important to disable it as soon as possible as we might have a WDT -assertion at any time which would then leave the board in debug mode, -thus disabling it during SCM removal is not enough. - -Signed-off-by: Robert Marko -Reviewed-by: Guru Das Srinagesh -Link: https://lore.kernel.org/r/20230816164641.3371878-2-robimarko@gmail.com -Signed-off-by: Bjorn Andersson ---- - drivers/firmware/qcom_scm.c | 30 ++++++++++++++++++++++++++++++ - drivers/firmware/qcom_scm.h | 1 + - 2 files changed, 31 insertions(+) - ---- a/drivers/firmware/qcom_scm.c -+++ b/drivers/firmware/qcom_scm.c -@@ -410,6 +410,29 @@ int qcom_scm_set_remote_state(u32 state, - } - EXPORT_SYMBOL_GPL(qcom_scm_set_remote_state); - -+static int qcom_scm_disable_sdi(void) -+{ -+ int ret; -+ struct qcom_scm_desc desc = { -+ .svc = QCOM_SCM_SVC_BOOT, -+ .cmd = QCOM_SCM_BOOT_SDI_CONFIG, -+ .args[0] = 1, /* Disable watchdog debug */ -+ .args[1] = 0, /* Disable SDI */ -+ .arginfo = QCOM_SCM_ARGS(2), -+ .owner = ARM_SMCCC_OWNER_SIP, -+ }; -+ struct qcom_scm_res res; -+ -+ ret = qcom_scm_clk_enable(); -+ if (ret) -+ return ret; -+ ret = qcom_scm_call(__scm->dev, &desc, &res); -+ -+ qcom_scm_clk_disable(); -+ -+ return ret ? : res.result[0]; -+} -+ - static int __qcom_scm_set_dload_mode(struct device *dev, bool enable) - { - struct qcom_scm_desc desc = { -@@ -1473,6 +1496,13 @@ static int qcom_scm_probe(struct platfor - - __get_convention(); - -+ -+ /* -+ * Disable SDI if indicated by DT that it is enabled by default. -+ */ -+ if (of_property_read_bool(pdev->dev.of_node, "qcom,sdi-enabled")) -+ qcom_scm_disable_sdi(); -+ - /* - * If requested enable "download mode", from this point on warmboot - * will cause the boot stages to enter download mode, unless ---- a/drivers/firmware/qcom_scm.h -+++ b/drivers/firmware/qcom_scm.h -@@ -80,6 +80,7 @@ extern int scm_legacy_call(struct device - #define QCOM_SCM_SVC_BOOT 0x01 - #define QCOM_SCM_BOOT_SET_ADDR 0x01 - #define QCOM_SCM_BOOT_TERMINATE_PC 0x02 -+#define QCOM_SCM_BOOT_SDI_CONFIG 0x09 - #define QCOM_SCM_BOOT_SET_DLOAD_MODE 0x10 - #define QCOM_SCM_BOOT_SET_ADDR_MC 0x11 - #define QCOM_SCM_BOOT_SET_REMOTE_STATE 0x0a diff --git a/target/linux/qualcommax/patches-6.6/0904-phy-qcom-m31-Add-compatible-phy-init-sequence-for-IP.patch b/target/linux/qualcommax/patches-6.6/0904-phy-qcom-m31-Add-compatible-phy-init-sequence-for-IP.patch deleted file mode 100644 index fa06d96d39e..00000000000 --- a/target/linux/qualcommax/patches-6.6/0904-phy-qcom-m31-Add-compatible-phy-init-sequence-for-IP.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 68320e35f8cb1987b4ad34347fc7033832da99e3 Mon Sep 17 00:00:00 2001 -From: Nitheesh Sekar -Date: Mon, 4 Sep 2023 12:06:33 +0530 -Subject: phy: qcom-m31: Add compatible, phy init sequence for IPQ5018 - -Add phy init sequence and compatible string for IPQ5018 -chipset. - -Signed-off-by: Nitheesh Sekar -Link: https://lore.kernel.org/r/20230904063635.24975-3-quic_nsekar@quicinc.com -Signed-off-by: Vinod Koul ---- - drivers/phy/qualcomm/phy-qcom-m31.c | 51 +++++++++++++++++++++++++++++ - 1 file changed, 51 insertions(+) - ---- a/drivers/phy/qualcomm/phy-qcom-m31.c -+++ b/drivers/phy/qualcomm/phy-qcom-m31.c -@@ -82,6 +82,50 @@ struct m31_priv_data { - unsigned int nregs; - }; - -+static const struct m31_phy_regs m31_ipq5018_regs[] = { -+ { -+ .off = USB_PHY_CFG0, -+ .val = UTMI_PHY_OVERRIDE_EN -+ }, -+ { -+ .off = USB_PHY_UTMI_CTRL5, -+ .val = POR_EN, -+ .delay = 15 -+ }, -+ { -+ .off = USB_PHY_FSEL_SEL, -+ .val = FREQ_SEL -+ }, -+ { -+ .off = USB_PHY_HS_PHY_CTRL_COMMON0, -+ .val = COMMONONN | FSEL | RETENABLEN -+ }, -+ { -+ .off = USB_PHY_REFCLK_CTRL, -+ .val = CLKCORE -+ }, -+ { -+ .off = USB_PHY_UTMI_CTRL5, -+ .val = POR_EN -+ }, -+ { -+ .off = USB_PHY_HS_PHY_CTRL2, -+ .val = USB2_SUSPEND_N_SEL | USB2_SUSPEND_N | USB2_UTMI_CLK_EN -+ }, -+ { -+ .off = USB_PHY_UTMI_CTRL5, -+ .val = 0x0 -+ }, -+ { -+ .off = USB_PHY_HS_PHY_CTRL2, -+ .val = USB2_SUSPEND_N | USB2_UTMI_CLK_EN -+ }, -+ { -+ .off = USB_PHY_CFG0, -+ .val = 0x0 -+ }, -+}; -+ - static struct m31_phy_regs m31_ipq5332_regs[] = { - { - USB_PHY_CFG0, -@@ -267,6 +311,12 @@ static int m31usb_phy_probe(struct platf - return PTR_ERR_OR_ZERO(phy_provider); - } - -+static const struct m31_priv_data m31_ipq5018_data = { -+ .ulpi_mode = false, -+ .regs = m31_ipq5018_regs, -+ .nregs = ARRAY_SIZE(m31_ipq5018_regs), -+}; -+ - static const struct m31_priv_data m31_ipq5332_data = { - .ulpi_mode = false, - .regs = m31_ipq5332_regs, -@@ -274,6 +324,7 @@ static const struct m31_priv_data m31_ip - }; - - static const struct of_device_id m31usb_phy_id_table[] = { -+ { .compatible = "qcom,ipq5018-usb-hsphy", .data = &m31_ipq5018_data }, - { .compatible = "qcom,ipq5332-usb-hsphy", .data = &m31_ipq5332_data }, - { }, - }; diff --git a/target/linux/qualcommax/patches-6.6/0905-arm64-dts-qcom-ipq5018-Add-USB-related-nodes.patch b/target/linux/qualcommax/patches-6.6/0905-arm64-dts-qcom-ipq5018-Add-USB-related-nodes.patch deleted file mode 100644 index 5ee1042f4c1..00000000000 --- a/target/linux/qualcommax/patches-6.6/0905-arm64-dts-qcom-ipq5018-Add-USB-related-nodes.patch +++ /dev/null @@ -1,86 +0,0 @@ -From e7166f2774aafefd29ff26ffbbb7f6d40ac8ea1c Mon Sep 17 00:00:00 2001 -From: Nitheesh Sekar -Date: Mon, 4 Sep 2023 12:06:34 +0530 -Subject: arm64: dts: qcom: ipq5018: Add USB related nodes - -Add USB phy and controller nodes. - -Co-developed-by: Amandeep Singh -Signed-off-by: Amandeep Singh -Signed-off-by: Nitheesh Sekar -Link: https://lore.kernel.org/r/20230904063635.24975-4-quic_nsekar@quicinc.com -Signed-off-by: Bjorn Andersson ---- - arch/arm64/boot/dts/qcom/ipq5018.dtsi | 54 +++++++++++++++++++++++++++ - 1 file changed, 54 insertions(+) - ---- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi -@@ -94,6 +94,19 @@ - #size-cells = <1>; - ranges = <0 0 0 0xffffffff>; - -+ usbphy0: phy@5b000 { -+ compatible = "qcom,ipq5018-usb-hsphy"; -+ reg = <0x0005b000 0x120>; -+ -+ clocks = <&gcc GCC_USB0_PHY_CFG_AHB_CLK>; -+ -+ resets = <&gcc GCC_QUSB2_0_PHY_BCR>; -+ -+ #phy-cells = <0>; -+ -+ status = "disabled"; -+ }; -+ - tlmm: pinctrl@1000000 { - compatible = "qcom,ipq5018-tlmm"; - reg = <0x01000000 0x300000>; -@@ -156,6 +169,47 @@ - status = "disabled"; - }; - -+ usb: usb@8af8800 { -+ compatible = "qcom,ipq5018-dwc3", "qcom,dwc3"; -+ reg = <0x08af8800 0x400>; -+ -+ interrupts = ; -+ interrupt-names = "hs_phy_irq"; -+ -+ clocks = <&gcc GCC_USB0_MASTER_CLK>, -+ <&gcc GCC_SYS_NOC_USB0_AXI_CLK>, -+ <&gcc GCC_USB0_SLEEP_CLK>, -+ <&gcc GCC_USB0_MOCK_UTMI_CLK>; -+ clock-names = "core", -+ "iface", -+ "sleep", -+ "mock_utmi"; -+ -+ resets = <&gcc GCC_USB0_BCR>; -+ -+ qcom,select-utmi-as-pipe-clk; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ ranges; -+ -+ status = "disabled"; -+ -+ usb_dwc: usb@8a00000 { -+ compatible = "snps,dwc3"; -+ reg = <0x08a00000 0xe000>; -+ clocks = <&gcc GCC_USB0_MOCK_UTMI_CLK>; -+ clock-names = "ref"; -+ interrupts = ; -+ phy-names = "usb2-phy"; -+ phys = <&usbphy0>; -+ tx-fifo-resize; -+ snps,is-utmi-l1-suspend; -+ snps,hird-threshold = /bits/ 8 <0x0>; -+ snps,dis_u2_susphy_quirk; -+ snps,dis_u3_susphy_quirk; -+ }; -+ }; -+ - intc: interrupt-controller@b000000 { - compatible = "qcom,msm-qgic2"; - reg = <0x0b000000 0x1000>, /* GICD */ diff --git a/target/linux/qualcommax/patches-6.6/0906-arm64-dts-qcom-ipq5018-Enable-USB.patch b/target/linux/qualcommax/patches-6.6/0906-arm64-dts-qcom-ipq5018-Enable-USB.patch deleted file mode 100644 index 05306360e5d..00000000000 --- a/target/linux/qualcommax/patches-6.6/0906-arm64-dts-qcom-ipq5018-Enable-USB.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 80a438775aa398751229bcaed15459f3acdb645f Mon Sep 17 00:00:00 2001 -From: Nitheesh Sekar -Date: Mon, 4 Sep 2023 12:06:35 +0530 -Subject: arm64: dts: qcom: ipq5018: Enable USB - -Enable USB2 in host mode. - -Reviewed-by: Dmitry Baryshkov -Co-developed-by: Amandeep Singh -Signed-off-by: Amandeep Singh -Signed-off-by: Nitheesh Sekar -Link: https://lore.kernel.org/r/20230904063635.24975-5-quic_nsekar@quicinc.com -Signed-off-by: Bjorn Andersson ---- - arch/arm64/boot/dts/qcom/ipq5018-rdp432-c2.dts | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - ---- a/arch/arm64/boot/dts/qcom/ipq5018-rdp432-c2.dts -+++ b/arch/arm64/boot/dts/qcom/ipq5018-rdp432-c2.dts -@@ -67,6 +67,18 @@ - }; - }; - -+&usb { -+ status = "okay"; -+}; -+ -+&usb_dwc { -+ dr_mode = "host"; -+}; -+ -+&usbphy0 { -+ status = "okay"; -+}; -+ - &xo_board_clk { - clock-frequency = <24000000>; - }; diff --git a/target/linux/qualcommax/patches-6.6/0907-arm64-dts-qcom-ipq5018-add-QUP1-SPI-controller.patch b/target/linux/qualcommax/patches-6.6/0907-arm64-dts-qcom-ipq5018-add-QUP1-SPI-controller.patch deleted file mode 100644 index 8d8ce49756f..00000000000 --- a/target/linux/qualcommax/patches-6.6/0907-arm64-dts-qcom-ipq5018-add-QUP1-SPI-controller.patch +++ /dev/null @@ -1,56 +0,0 @@ -From a1f42e08f0f04b72a6597f080db4bfbb3737910c Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 4 Oct 2023 21:12:30 +0200 -Subject: arm64: dts: qcom: ipq5018: add QUP1 SPI controller - -Add the required BAM and QUP nodes for the QUP1 SPI controller on IPQ5018. - -Signed-off-by: Robert Marko -Reviewed-by: Kathiravan Thirumoorthy -Link: https://lore.kernel.org/r/20231004191303.331055-1-robimarko@gmail.com -[bjorn: Padded address to 8 digits, fixed node sort order] -Signed-off-by: Bjorn Andersson ---- - arch/arm64/boot/dts/qcom/ipq5018.dtsi | 24 ++++++++++++++++++++++++ - 1 file changed, 24 insertions(+) - ---- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi -@@ -159,6 +159,16 @@ - status = "disabled"; - }; - -+ blsp_dma: dma-controller@7884000 { -+ compatible = "qcom,bam-v1.7.0"; -+ reg = <0x07884000 0x1d000>; -+ interrupts = ; -+ clocks = <&gcc GCC_BLSP1_AHB_CLK>; -+ clock-names = "bam_clk"; -+ #dma-cells = <1>; -+ qcom,ee = <0>; -+ }; -+ - blsp1_uart1: serial@78af000 { - compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm"; - reg = <0x078af000 0x200>; -@@ -169,6 +179,20 @@ - status = "disabled"; - }; - -+ blsp1_spi1: spi@78b5000 { -+ compatible = "qcom,spi-qup-v2.2.1"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <0x078b5000 0x600>; -+ interrupts = ; -+ clocks = <&gcc GCC_BLSP1_QUP1_SPI_APPS_CLK>, -+ <&gcc GCC_BLSP1_AHB_CLK>; -+ clock-names = "core", "iface"; -+ dmas = <&blsp_dma 4>, <&blsp_dma 5>; -+ dma-names = "tx", "rx"; -+ status = "disabled"; -+ }; -+ - usb: usb@8af8800 { - compatible = "qcom,ipq5018-dwc3", "qcom,dwc3"; - reg = <0x08af8800 0x400>; diff --git a/target/linux/qualcommax/patches-6.6/0908-clk-qcom-apss-ipq-pll-add-support-for-IPQ5018.patch b/target/linux/qualcommax/patches-6.6/0908-clk-qcom-apss-ipq-pll-add-support-for-IPQ5018.patch deleted file mode 100644 index f47c359b696..00000000000 --- a/target/linux/qualcommax/patches-6.6/0908-clk-qcom-apss-ipq-pll-add-support-for-IPQ5018.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 50492f929486c044b43cb3e2c0e040aa9b61ea2b Mon Sep 17 00:00:00 2001 -From: Gokul Sriram Palanisamy -Date: Mon, 25 Sep 2023 15:58:25 +0530 -Subject: clk: qcom: apss-ipq-pll: add support for IPQ5018 - -IPQ5018 APSS PLL is of type Stromer. Reuse Stromer Plus PLL offsets, -add configuration values and the compatible. - -Co-developed-by: Sricharan Ramabadhran -Signed-off-by: Sricharan Ramabadhran -Signed-off-by: Gokul Sriram Palanisamy -Reviewed-by: Dmitry Baryshkov -Link: https://lore.kernel.org/r/20230925102826.405446-3-quic_gokulsri@quicinc.com -Signed-off-by: Bjorn Andersson ---- - drivers/clk/qcom/apss-ipq-pll.c | 21 +++++++++++++++++++++ - 1 file changed, 21 insertions(+) - ---- a/drivers/clk/qcom/apss-ipq-pll.c -+++ b/drivers/clk/qcom/apss-ipq-pll.c -@@ -73,6 +73,20 @@ static struct clk_alpha_pll ipq_pll_stro - }, - }; - -+static const struct alpha_pll_config ipq5018_pll_config = { -+ .l = 0x32, -+ .config_ctl_val = 0x4001075b, -+ .config_ctl_hi_val = 0x304, -+ .main_output_mask = BIT(0), -+ .aux_output_mask = BIT(1), -+ .early_output_mask = BIT(3), -+ .alpha_en_mask = BIT(24), -+ .status_val = 0x3, -+ .status_mask = GENMASK(10, 8), -+ .lock_det = BIT(2), -+ .test_ctl_hi_val = 0x00400003, -+}; -+ - static const struct alpha_pll_config ipq5332_pll_config = { - .l = 0x2d, - .config_ctl_val = 0x4001075b, -@@ -129,6 +143,12 @@ struct apss_pll_data { - const struct alpha_pll_config *pll_config; - }; - -+static const struct apss_pll_data ipq5018_pll_data = { -+ .pll_type = CLK_ALPHA_PLL_TYPE_STROMER_PLUS, -+ .pll = &ipq_pll_stromer_plus, -+ .pll_config = &ipq5018_pll_config, -+}; -+ - static struct apss_pll_data ipq5332_pll_data = { - .pll_type = CLK_ALPHA_PLL_TYPE_STROMER_PLUS, - .pll = &ipq_pll_stromer_plus, -@@ -195,6 +215,7 @@ static int apss_ipq_pll_probe(struct pla - } - - static const struct of_device_id apss_ipq_pll_match_table[] = { -+ { .compatible = "qcom,ipq5018-a53pll", .data = &ipq5018_pll_data }, - { .compatible = "qcom,ipq5332-a53pll", .data = &ipq5332_pll_data }, - { .compatible = "qcom,ipq6018-a53pll", .data = &ipq6018_pll_data }, - { .compatible = "qcom,ipq8074-a53pll", .data = &ipq8074_pll_data }, diff --git a/target/linux/qualcommax/patches-6.6/0909-clk-qcom-apss-ipq-pll-use-stromer-ops-for-IPQ5018-to.patch b/target/linux/qualcommax/patches-6.6/0909-clk-qcom-apss-ipq-pll-use-stromer-ops-for-IPQ5018-to.patch deleted file mode 100644 index 5a182955323..00000000000 --- a/target/linux/qualcommax/patches-6.6/0909-clk-qcom-apss-ipq-pll-use-stromer-ops-for-IPQ5018-to.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 5fce38e2a1a97900989d9fedebcf5a4dacdaee30 Mon Sep 17 00:00:00 2001 -From: Gabor Juhos -Date: Fri, 15 Mar 2024 17:16:41 +0100 -Subject: clk: qcom: apss-ipq-pll: use stromer ops for IPQ5018 to fix boot - failure - -Booting v6.8 results in a hang on various IPQ5018 based boards. -Investigating the problem showed that the hang happens when the -clk_alpha_pll_stromer_plus_set_rate() function tries to write -into the PLL_MODE register of the APSS PLL. - -Checking the downstream code revealed that it uses [1] stromer -specific operations for IPQ5018, whereas in the current code -the stromer plus specific operations are used. - -The ops in the 'ipq_pll_stromer_plus' clock definition can't be -changed since that is needed for IPQ5332, so add a new alpha pll -clock declaration which uses the correct stromer ops and use this -new clock for IPQ5018 to avoid the boot failure. - -Also, change pll_type in 'ipq5018_pll_data' to -CLK_ALPHA_PLL_TYPE_STROMER to better reflect that it is a Stromer -PLL and change the apss_ipq_pll_probe() function accordingly. - -1. https://git.codelinaro.org/clo/qsdk/oss/kernel/linux-ipq-5.4/-/blob/NHSS.QSDK.12.4/drivers/clk/qcom/apss-ipq5018.c#L67 - -Cc: stable@vger.kernel.org -Fixes: 50492f929486 ("clk: qcom: apss-ipq-pll: add support for IPQ5018") -Signed-off-by: Gabor Juhos -Tested-by: Kathiravan Thirumoorthy -Reviewed-by: Kathiravan Thirumoorthy -Link: https://lore.kernel.org/r/20240315-apss-ipq-pll-ipq5018-hang-v2-1-6fe30ada2009@gmail.com -Signed-off-by: Bjorn Andersson ---- - drivers/clk/qcom/apss-ipq-pll.c | 30 +++++++++++++++++++++++++++--- - 1 file changed, 27 insertions(+), 3 deletions(-) - ---- a/drivers/clk/qcom/apss-ipq-pll.c -+++ b/drivers/clk/qcom/apss-ipq-pll.c -@@ -55,6 +55,29 @@ static struct clk_alpha_pll ipq_pll_huay - }, - }; - -+static struct clk_alpha_pll ipq_pll_stromer = { -+ .offset = 0x0, -+ /* -+ * Reuse CLK_ALPHA_PLL_TYPE_STROMER_PLUS register offsets. -+ * Although this is a bit confusing, but the offset values -+ * are correct nevertheless. -+ */ -+ .regs = ipq_pll_offsets[CLK_ALPHA_PLL_TYPE_STROMER_PLUS], -+ .flags = SUPPORTS_DYNAMIC_UPDATE, -+ .clkr = { -+ .enable_reg = 0x0, -+ .enable_mask = BIT(0), -+ .hw.init = &(const struct clk_init_data) { -+ .name = "a53pll", -+ .parent_data = &(const struct clk_parent_data) { -+ .fw_name = "xo", -+ }, -+ .num_parents = 1, -+ .ops = &clk_alpha_pll_stromer_ops, -+ }, -+ }, -+}; -+ - static struct clk_alpha_pll ipq_pll_stromer_plus = { - .offset = 0x0, - .regs = ipq_pll_offsets[CLK_ALPHA_PLL_TYPE_STROMER_PLUS], -@@ -144,8 +167,8 @@ struct apss_pll_data { - }; - - static const struct apss_pll_data ipq5018_pll_data = { -- .pll_type = CLK_ALPHA_PLL_TYPE_STROMER_PLUS, -- .pll = &ipq_pll_stromer_plus, -+ .pll_type = CLK_ALPHA_PLL_TYPE_STROMER, -+ .pll = &ipq_pll_stromer, - .pll_config = &ipq5018_pll_config, - }; - -@@ -203,7 +226,8 @@ static int apss_ipq_pll_probe(struct pla - - if (data->pll_type == CLK_ALPHA_PLL_TYPE_HUAYRA) - clk_alpha_pll_configure(data->pll, regmap, data->pll_config); -- else if (data->pll_type == CLK_ALPHA_PLL_TYPE_STROMER_PLUS) -+ else if (data->pll_type == CLK_ALPHA_PLL_TYPE_STROMER || -+ data->pll_type == CLK_ALPHA_PLL_TYPE_STROMER_PLUS) - clk_stromer_pll_configure(data->pll, regmap, data->pll_config); - - ret = devm_clk_register_regmap(dev, &data->pll->clkr); diff --git a/target/linux/qualcommax/patches-6.6/0910-clk-qcom-apss-ipq-pll-reuse-Stromer-reg-offsets-from.patch b/target/linux/qualcommax/patches-6.6/0910-clk-qcom-apss-ipq-pll-reuse-Stromer-reg-offsets-from.patch deleted file mode 100644 index d6018670f04..00000000000 --- a/target/linux/qualcommax/patches-6.6/0910-clk-qcom-apss-ipq-pll-reuse-Stromer-reg-offsets-from.patch +++ /dev/null @@ -1,72 +0,0 @@ -From ac3ee364a7312517edf71b1857c0f272919f2374 Mon Sep 17 00:00:00 2001 -From: Gabor Juhos -Date: Thu, 28 Mar 2024 10:23:10 +0100 -Subject: clk: qcom: apss-ipq-pll: reuse Stromer reg offsets from - 'clk_alpha_pll_regs' - -The register offset array defined locally for the -CLK_ALPHA_PLL_TYPE_STROMER_PLUS is the same as the -entry defined for CLK_ALPHA_PLL_TYPE_STROMER in the -'clk_alpha_pll_regs' array. - -To avoid code duplication, remove the local definition -and use the global one instead. - -No functional changes. - -Reviewed-by: Dmitry Baryshkov -Reviewed-by: Konrad Dybcio -Signed-off-by: Gabor Juhos -Link: https://lore.kernel.org/r/20240328-apss-ipq-pll-cleanup-v4-1-eddbf617f0c8@gmail.com -Signed-off-by: Bjorn Andersson ---- - drivers/clk/qcom/apss-ipq-pll.c | 24 ++++++------------------ - 1 file changed, 6 insertions(+), 18 deletions(-) - ---- a/drivers/clk/qcom/apss-ipq-pll.c -+++ b/drivers/clk/qcom/apss-ipq-pll.c -@@ -24,17 +24,6 @@ static const u8 ipq_pll_offsets[][PLL_OF - [PLL_OFF_TEST_CTL] = 0x30, - [PLL_OFF_TEST_CTL_U] = 0x34, - }, -- [CLK_ALPHA_PLL_TYPE_STROMER_PLUS] = { -- [PLL_OFF_L_VAL] = 0x08, -- [PLL_OFF_ALPHA_VAL] = 0x10, -- [PLL_OFF_ALPHA_VAL_U] = 0x14, -- [PLL_OFF_USER_CTL] = 0x18, -- [PLL_OFF_USER_CTL_U] = 0x1c, -- [PLL_OFF_CONFIG_CTL] = 0x20, -- [PLL_OFF_STATUS] = 0x28, -- [PLL_OFF_TEST_CTL] = 0x30, -- [PLL_OFF_TEST_CTL_U] = 0x34, -- }, - }; - - static struct clk_alpha_pll ipq_pll_huayra = { -@@ -57,12 +46,7 @@ static struct clk_alpha_pll ipq_pll_huay - - static struct clk_alpha_pll ipq_pll_stromer = { - .offset = 0x0, -- /* -- * Reuse CLK_ALPHA_PLL_TYPE_STROMER_PLUS register offsets. -- * Although this is a bit confusing, but the offset values -- * are correct nevertheless. -- */ -- .regs = ipq_pll_offsets[CLK_ALPHA_PLL_TYPE_STROMER_PLUS], -+ .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_STROMER], - .flags = SUPPORTS_DYNAMIC_UPDATE, - .clkr = { - .enable_reg = 0x0, -@@ -80,7 +64,11 @@ static struct clk_alpha_pll ipq_pll_stro - - static struct clk_alpha_pll ipq_pll_stromer_plus = { - .offset = 0x0, -- .regs = ipq_pll_offsets[CLK_ALPHA_PLL_TYPE_STROMER_PLUS], -+ /* -+ * The register offsets of the Stromer Plus PLL used in IPQ5332 -+ * are the same as the Stromer PLL's offsets. -+ */ -+ .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_STROMER], - .flags = SUPPORTS_DYNAMIC_UPDATE, - .clkr = { - .enable_reg = 0x0, diff --git a/target/linux/qualcommax/patches-6.6/0911-arm64-dts-qcom-ipq5018-add-mdio-node.patch b/target/linux/qualcommax/patches-6.6/0911-arm64-dts-qcom-ipq5018-add-mdio-node.patch deleted file mode 100644 index 09257c8e2f8..00000000000 --- a/target/linux/qualcommax/patches-6.6/0911-arm64-dts-qcom-ipq5018-add-mdio-node.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 26890ef30e083d149b9f8ba61f4f64721627d0de Mon Sep 17 00:00:00 2001 -From: hzy -Date: Mon, 22 Apr 2024 21:50:05 +0800 -Subject: [PATCH 1/2] arm64: dts: qcom: ipq5018: add mdio node - -Signed-off-by: hzy ---- - arch/arm64/boot/dts/qcom/ipq5018.dtsi | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - ---- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi -@@ -107,6 +107,26 @@ - status = "disabled"; - }; - -+ mdio0: mdio@88000 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ compatible = "qcom,ipq5018-mdio", "qcom,qca-mdio"; -+ reg = <0x88000 0x64>, <0x19475C4 0x4>; -+ clocks = <&gcc GCC_MDIO0_AHB_CLK>; -+ clock-names = "gcc_mdio_ahb_clk"; -+ status = "disabled"; -+ }; -+ -+ mdio1: mdio@90000 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ compatible = "qcom,ipq5018-mdio"; -+ reg = <0x90000 0x64>; -+ clocks = <&gcc GCC_MDIO1_AHB_CLK>; -+ clock-names = "gcc_mdio_ahb_clk"; -+ status = "disabled"; -+ }; -+ - tlmm: pinctrl@1000000 { - compatible = "qcom,ipq5018-tlmm"; - reg = <0x01000000 0x300000>; diff --git a/target/linux/qualcommax/patches-6.6/0911-arm64-dts-qcom-ipq8074-add-ramoops.patch b/target/linux/qualcommax/patches-6.6/0911-arm64-dts-qcom-ipq8074-add-ramoops.patch deleted file mode 100644 index 4da27793e55..00000000000 --- a/target/linux/qualcommax/patches-6.6/0911-arm64-dts-qcom-ipq8074-add-ramoops.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -198,6 +198,13 @@ - no-map; - reg = <0x0 0x51000000 0x0 0x100000>; - }; -+ -+ ramoops_region: ramoops@51200000 { -+ compatible = "ramoops"; -+ reg = <0x0 0x51200000 0x0 0x100000>; -+ no-map; -+ record-size = <0x1000>; -+ }; - }; - - firmware { diff --git a/target/linux/qualcommax/patches-6.6/0911-clk-qcom-apss-ipq-pll-move-Huayra-register-map-to-cl.patch b/target/linux/qualcommax/patches-6.6/0911-clk-qcom-apss-ipq-pll-move-Huayra-register-map-to-cl.patch deleted file mode 100644 index 7ea56c89d48..00000000000 --- a/target/linux/qualcommax/patches-6.6/0911-clk-qcom-apss-ipq-pll-move-Huayra-register-map-to-cl.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 35a99c6ffa1e9bd8d31ddd3098e6fad7ba884928 Mon Sep 17 00:00:00 2001 -From: Gabor Juhos -Date: Thu, 28 Mar 2024 10:23:11 +0100 -Subject: clk: qcom: apss-ipq-pll: move Huayra register map to - 'clk_alpha_pll_regs' - -Move the locally defined Huayra register map to 'clk_alpha_pll_regs' -in order to allow using that by other drivers, like the clk-cbf-8996. - -No functional changes. - -Reviewed-by: Dmitry Baryshkov -Reviewed-by: Konrad Dybcio -Signed-off-by: Gabor Juhos -Link: https://lore.kernel.org/r/20240328-apss-ipq-pll-cleanup-v4-2-eddbf617f0c8@gmail.com -Signed-off-by: Bjorn Andersson ---- - drivers/clk/qcom/apss-ipq-pll.c | 20 +------------------- - drivers/clk/qcom/clk-alpha-pll.c | 10 ++++++++++ - drivers/clk/qcom/clk-alpha-pll.h | 1 + - 3 files changed, 12 insertions(+), 19 deletions(-) - ---- a/drivers/clk/qcom/apss-ipq-pll.c -+++ b/drivers/clk/qcom/apss-ipq-pll.c -@@ -8,27 +8,9 @@ - - #include "clk-alpha-pll.h" - --/* -- * Even though APSS PLL type is of existing one (like Huayra), its offsets -- * are different from the one mentioned in the clk-alpha-pll.c, since the -- * PLL is specific to APSS, so lets the define the same. -- */ --static const u8 ipq_pll_offsets[][PLL_OFF_MAX_REGS] = { -- [CLK_ALPHA_PLL_TYPE_HUAYRA] = { -- [PLL_OFF_L_VAL] = 0x08, -- [PLL_OFF_ALPHA_VAL] = 0x10, -- [PLL_OFF_USER_CTL] = 0x18, -- [PLL_OFF_CONFIG_CTL] = 0x20, -- [PLL_OFF_CONFIG_CTL_U] = 0x24, -- [PLL_OFF_STATUS] = 0x28, -- [PLL_OFF_TEST_CTL] = 0x30, -- [PLL_OFF_TEST_CTL_U] = 0x34, -- }, --}; -- - static struct clk_alpha_pll ipq_pll_huayra = { - .offset = 0x0, -- .regs = ipq_pll_offsets[CLK_ALPHA_PLL_TYPE_HUAYRA], -+ .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_HUAYRA_APSS], - .flags = SUPPORTS_DYNAMIC_UPDATE, - .clkr = { - .enable_reg = 0x0, ---- a/drivers/clk/qcom/clk-alpha-pll.c -+++ b/drivers/clk/qcom/clk-alpha-pll.c -@@ -82,6 +82,16 @@ const u8 clk_alpha_pll_regs[][PLL_OFF_MA - [PLL_OFF_TEST_CTL_U] = 0x20, - [PLL_OFF_STATUS] = 0x24, - }, -+ [CLK_ALPHA_PLL_TYPE_HUAYRA_APSS] = { -+ [PLL_OFF_L_VAL] = 0x08, -+ [PLL_OFF_ALPHA_VAL] = 0x10, -+ [PLL_OFF_USER_CTL] = 0x18, -+ [PLL_OFF_CONFIG_CTL] = 0x20, -+ [PLL_OFF_CONFIG_CTL_U] = 0x24, -+ [PLL_OFF_STATUS] = 0x28, -+ [PLL_OFF_TEST_CTL] = 0x30, -+ [PLL_OFF_TEST_CTL_U] = 0x34, -+ }, - [CLK_ALPHA_PLL_TYPE_BRAMMO] = { - [PLL_OFF_L_VAL] = 0x04, - [PLL_OFF_ALPHA_VAL] = 0x08, ---- a/drivers/clk/qcom/clk-alpha-pll.h -+++ b/drivers/clk/qcom/clk-alpha-pll.h -@@ -15,6 +15,7 @@ - enum { - CLK_ALPHA_PLL_TYPE_DEFAULT, - CLK_ALPHA_PLL_TYPE_HUAYRA, -+ CLK_ALPHA_PLL_TYPE_HUAYRA_APSS, - CLK_ALPHA_PLL_TYPE_BRAMMO, - CLK_ALPHA_PLL_TYPE_FABIA, - CLK_ALPHA_PLL_TYPE_TRION, diff --git a/target/linux/qualcommax/patches-6.6/0912-arm64-dts-qcom-ipq5018-add-ge_phy-node.patch b/target/linux/qualcommax/patches-6.6/0912-arm64-dts-qcom-ipq5018-add-ge_phy-node.patch deleted file mode 100644 index 1d0068eac8e..00000000000 --- a/target/linux/qualcommax/patches-6.6/0912-arm64-dts-qcom-ipq5018-add-ge_phy-node.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 35c05ef3a6616e8fb2e97a590ce1221a10df404a Mon Sep 17 00:00:00 2001 -From: hzy -Date: Mon, 22 Apr 2024 21:50:34 +0800 -Subject: [PATCH 2/2] arm64: dts: qcom: ipq5018: add ge_phy node - -Signed-off-by: hzy ---- - arch/arm64/boot/dts/qcom/ipq5018.dtsi | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi -@@ -115,6 +115,10 @@ - clocks = <&gcc GCC_MDIO0_AHB_CLK>; - clock-names = "gcc_mdio_ahb_clk"; - status = "disabled"; -+ -+ ge_phy: ethernet-phy@7 { -+ reg = <7>; -+ }; - }; - - mdio1: mdio@90000 { diff --git a/target/linux/qualcommax/patches-6.6/0912-arm64-dts-qcom-ipq6018-add-ramoops.patch b/target/linux/qualcommax/patches-6.6/0912-arm64-dts-qcom-ipq6018-add-ramoops.patch deleted file mode 100644 index 4873f3cac75..00000000000 --- a/target/linux/qualcommax/patches-6.6/0912-arm64-dts-qcom-ipq6018-add-ramoops.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi -@@ -223,6 +223,13 @@ - reg = <0x0 0x4ab00000 0x0 0x5500000>; - no-map; - }; -+ -+ ramoops_region: ramoops@50000000 { -+ compatible = "ramoops"; -+ reg = <0x0 0x50000000 0x0 0x100000>; -+ no-map; -+ record-size = <0x1000>; -+ }; - }; - - smem { diff --git a/target/linux/qualcommax/patches-6.6/0912-clk-qcom-apss-ipq-pll-constify-match-data-structures.patch b/target/linux/qualcommax/patches-6.6/0912-clk-qcom-apss-ipq-pll-constify-match-data-structures.patch deleted file mode 100644 index d702bd11b99..00000000000 --- a/target/linux/qualcommax/patches-6.6/0912-clk-qcom-apss-ipq-pll-constify-match-data-structures.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 07570342d305d90c1c5dba6d336fb4c8301aef45 Mon Sep 17 00:00:00 2001 -From: Gabor Juhos -Date: Thu, 28 Mar 2024 10:23:12 +0100 -Subject: clk: qcom: apss-ipq-pll: constify match data structures - -The match data structures are used only by the apss_ipq_pll_probe() -function and are never modified so mark those as constant. - -No functional changes. - -Reviewed-by: Dmitry Baryshkov -Reviewed-by: Konrad Dybcio -Signed-off-by: Gabor Juhos -Link: https://lore.kernel.org/r/20240328-apss-ipq-pll-cleanup-v4-3-eddbf617f0c8@gmail.com -Signed-off-by: Bjorn Andersson ---- - drivers/clk/qcom/apss-ipq-pll.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - ---- a/drivers/clk/qcom/apss-ipq-pll.c -+++ b/drivers/clk/qcom/apss-ipq-pll.c -@@ -142,25 +142,25 @@ static const struct apss_pll_data ipq501 - .pll_config = &ipq5018_pll_config, - }; - --static struct apss_pll_data ipq5332_pll_data = { -+static const struct apss_pll_data ipq5332_pll_data = { - .pll_type = CLK_ALPHA_PLL_TYPE_STROMER_PLUS, - .pll = &ipq_pll_stromer_plus, - .pll_config = &ipq5332_pll_config, - }; - --static struct apss_pll_data ipq8074_pll_data = { -+static const struct apss_pll_data ipq8074_pll_data = { - .pll_type = CLK_ALPHA_PLL_TYPE_HUAYRA, - .pll = &ipq_pll_huayra, - .pll_config = &ipq8074_pll_config, - }; - --static struct apss_pll_data ipq6018_pll_data = { -+static const struct apss_pll_data ipq6018_pll_data = { - .pll_type = CLK_ALPHA_PLL_TYPE_HUAYRA, - .pll = &ipq_pll_huayra, - .pll_config = &ipq6018_pll_config, - }; - --static struct apss_pll_data ipq9574_pll_data = { -+static const struct apss_pll_data ipq9574_pll_data = { - .pll_type = CLK_ALPHA_PLL_TYPE_HUAYRA, - .pll = &ipq_pll_huayra, - .pll_config = &ipq9574_pll_config, diff --git a/target/linux/qualcommax/patches-6.6/0913-clk-qcom-apss-ipq-pll-constify-clk_init_data-structu.patch b/target/linux/qualcommax/patches-6.6/0913-clk-qcom-apss-ipq-pll-constify-clk_init_data-structu.patch deleted file mode 100644 index e3ad6eda7d1..00000000000 --- a/target/linux/qualcommax/patches-6.6/0913-clk-qcom-apss-ipq-pll-constify-clk_init_data-structu.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 4a941e436432104ce5ed75bf8c5ba2c8463b089c Mon Sep 17 00:00:00 2001 -From: Gabor Juhos -Date: Thu, 28 Mar 2024 10:23:13 +0100 -Subject: clk: qcom: apss-ipq-pll: constify clk_init_data structures - -The clk_init_data structures are never modified, so add const -qualifier to the ones where it is missing. - -No functional changes. - -Reviewed-by: Dmitry Baryshkov -Reviewed-by: Konrad Dybcio -Signed-off-by: Gabor Juhos -Link: https://lore.kernel.org/r/20240328-apss-ipq-pll-cleanup-v4-4-eddbf617f0c8@gmail.com -Signed-off-by: Bjorn Andersson ---- - drivers/clk/qcom/apss-ipq-pll.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/clk/qcom/apss-ipq-pll.c -+++ b/drivers/clk/qcom/apss-ipq-pll.c -@@ -15,7 +15,7 @@ static struct clk_alpha_pll ipq_pll_huay - .clkr = { - .enable_reg = 0x0, - .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data){ -+ .hw.init = &(const struct clk_init_data) { - .name = "a53pll", - .parent_data = &(const struct clk_parent_data) { - .fw_name = "xo", -@@ -55,7 +55,7 @@ static struct clk_alpha_pll ipq_pll_stro - .clkr = { - .enable_reg = 0x0, - .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data){ -+ .hw.init = &(const struct clk_init_data) { - .name = "a53pll", - .parent_data = &(const struct clk_parent_data) { - .fw_name = "xo", diff --git a/target/linux/qualcommax/patches-6.6/0913-net-dsa-qca8k-always-enable-SGMII-auto-negotiation.patch b/target/linux/qualcommax/patches-6.6/0913-net-dsa-qca8k-always-enable-SGMII-auto-negotiation.patch deleted file mode 100644 index 050bb8dca40..00000000000 --- a/target/linux/qualcommax/patches-6.6/0913-net-dsa-qca8k-always-enable-SGMII-auto-negotiation.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 125af38177669263e17e230581b95e0c2857aae5 Mon Sep 17 00:00:00 2001 -From: hzy -Date: Mon, 22 Apr 2024 22:05:56 +0800 -Subject: [PATCH] net: dsa: qca8k: always enable SGMII auto-negotiation - -fixed-link can't work well without this - -Signed-off-by: hzy ---- - drivers/net/dsa/qca/qca8k-8xxx.c | 9 ++++----- - 1 file changed, 4 insertions(+), 5 deletions(-) - ---- a/drivers/net/dsa/qca/qca8k-8xxx.c -+++ b/drivers/net/dsa/qca/qca8k-8xxx.c -@@ -1545,11 +1545,10 @@ static int qca8k_pcs_config(struct phyli - return -EINVAL; - } - -- /* Enable/disable SerDes auto-negotiation as necessary */ -- val = neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED ? -- 0 : QCA8K_PWS_SERDES_AEN_DIS; -- -- ret = qca8k_rmw(priv, QCA8K_REG_PWS, QCA8K_PWS_SERDES_AEN_DIS, val); -+ /* Enable SerDes auto-negotiation always. -+ * So fixed-link can work. -+ */ -+ ret = qca8k_rmw(priv, QCA8K_REG_PWS, QCA8K_PWS_SERDES_AEN_DIS, 0); - if (ret) - return ret; - diff --git a/target/linux/qualcommax/patches-6.6/0914-clk-qcom-apss-ipq-pll-fix-PLL-rate-for-IPQ5018.patch b/target/linux/qualcommax/patches-6.6/0914-clk-qcom-apss-ipq-pll-fix-PLL-rate-for-IPQ5018.patch deleted file mode 100644 index eab033be4aa..00000000000 --- a/target/linux/qualcommax/patches-6.6/0914-clk-qcom-apss-ipq-pll-fix-PLL-rate-for-IPQ5018.patch +++ /dev/null @@ -1,38 +0,0 @@ -From c55f7ee2ec239b6afd8639c7ac06493876deb0ea Mon Sep 17 00:00:00 2001 -From: Gabor Juhos -Date: Tue, 26 Mar 2024 14:34:11 +0100 -Subject: clk: qcom: apss-ipq-pll: fix PLL rate for IPQ5018 - -According to ipq5018.dtsi, the maximum supported rate by the -CPU is 1.008 GHz on the IPQ5018 platform, however the current -configuration of the PLL results in 1.2 GHz rate. - -Change the 'L' value in the PLL configuration to limit the -rate to 1.008 GHz. The downstream kernel also uses the same -value [1]. Also add a comment to indicate the desired -frequency. - -[1] https://git.codelinaro.org/clo/qsdk/oss/kernel/linux-ipq-5.4/-/blob/NHSS.QSDK.12.4/drivers/clk/qcom/apss-ipq5018.c?ref_type=heads#L151 - -Fixes: 50492f929486 ("clk: qcom: apss-ipq-pll: add support for IPQ5018") -Signed-off-by: Gabor Juhos -Reviewed-by: Konrad Dybcio -Link: https://lore.kernel.org/r/20240326-fix-ipq5018-apss-pll-rate-v1-1-82ab31c9da7e@gmail.com -Signed-off-by: Bjorn Andersson ---- - drivers/clk/qcom/apss-ipq-pll.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/clk/qcom/apss-ipq-pll.c -+++ b/drivers/clk/qcom/apss-ipq-pll.c -@@ -66,8 +66,9 @@ static struct clk_alpha_pll ipq_pll_stro - }, - }; - -+/* 1.008 GHz configuration */ - static const struct alpha_pll_config ipq5018_pll_config = { -- .l = 0x32, -+ .l = 0x2a, - .config_ctl_val = 0x4001075b, - .config_ctl_hi_val = 0x304, - .main_output_mask = BIT(0), diff --git a/target/linux/qualcommax/patches-6.6/0915-arm64-dts-qcom-ipq5018-enable-the-CPUFreq-support.patch b/target/linux/qualcommax/patches-6.6/0915-arm64-dts-qcom-ipq5018-enable-the-CPUFreq-support.patch deleted file mode 100644 index 9350a9939b2..00000000000 --- a/target/linux/qualcommax/patches-6.6/0915-arm64-dts-qcom-ipq5018-enable-the-CPUFreq-support.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 3e4b53e04281ed3d9c7a4329c027097265c04d54 Mon Sep 17 00:00:00 2001 -From: Gokul Sriram Palanisamy -Date: Mon, 25 Sep 2023 15:58:26 +0530 -Subject: arm64: dts: qcom: ipq5018: enable the CPUFreq support - -Add the APCS, A53 PLL, cpu-opp-table nodes to set -the CPU frequency at 800MHz (idle) or 1.008GHz. - -Co-developed-by: Sricharan Ramabadhran -Signed-off-by: Sricharan Ramabadhran -Signed-off-by: Gokul Sriram Palanisamy -Reviewed-by: Dmitry Baryshkov -Reviewed-by: Krzysztof Kozlowski -Link: https://lore.kernel.org/r/20230925102826.405446-4-quic_gokulsri@quicinc.com -Signed-off-by: Bjorn Andersson ---- - arch/arm64/boot/dts/qcom/ipq5018.dtsi | 40 +++++++++++++++++++++++++++ - 1 file changed, 40 insertions(+) - ---- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi -@@ -5,6 +5,7 @@ - * Copyright (c) 2023 The Linux Foundation. All rights reserved. - */ - -+#include - #include - #include - #include -@@ -36,6 +37,8 @@ - reg = <0x0>; - enable-method = "psci"; - next-level-cache = <&L2_0>; -+ clocks = <&apcs_glb APCS_ALIAS0_CORE_CLK>; -+ operating-points-v2 = <&cpu_opp_table>; - }; - - CPU1: cpu@1 { -@@ -44,6 +47,8 @@ - reg = <0x1>; - enable-method = "psci"; - next-level-cache = <&L2_0>; -+ clocks = <&apcs_glb APCS_ALIAS0_CORE_CLK>; -+ operating-points-v2 = <&cpu_opp_table>; - }; - - L2_0: l2-cache { -@@ -54,6 +59,23 @@ - }; - }; - -+ cpu_opp_table: opp-table-cpu { -+ compatible = "operating-points-v2"; -+ opp-shared; -+ -+ opp-800000000 { -+ opp-hz = /bits/ 64 <800000000>; -+ opp-microvolt = <1100000>; -+ clock-latency-ns = <200000>; -+ }; -+ -+ opp-1008000000 { -+ opp-hz = /bits/ 64 <1008000000>; -+ opp-microvolt = <1100000>; -+ clock-latency-ns = <200000>; -+ }; -+ }; -+ - firmware { - scm { - compatible = "qcom,scm-ipq5018", "qcom,scm"; -@@ -291,6 +313,24 @@ - clocks = <&sleep_clk>; - }; - -+ apcs_glb: mailbox@b111000 { -+ compatible = "qcom,ipq5018-apcs-apps-global", -+ "qcom,ipq6018-apcs-apps-global"; -+ reg = <0x0b111000 0x1000>; -+ #clock-cells = <1>; -+ clocks = <&a53pll>, <&xo_board_clk>, <&gcc GPLL0>; -+ clock-names = "pll", "xo", "gpll0"; -+ #mbox-cells = <1>; -+ }; -+ -+ a53pll: clock@b116000 { -+ compatible = "qcom,ipq5018-a53pll"; -+ reg = <0x0b116000 0x40>; -+ #clock-cells = <0>; -+ clocks = <&xo_board_clk>; -+ clock-names = "xo"; -+ }; -+ - timer@b120000 { - compatible = "arm,armv7-timer-mem"; - reg = <0x0b120000 0x1000>; diff --git a/target/linux/qualcommax/patches-6.6/0916-arm64-dts-qcom-ipq5018-add-few-more-reserved-memory-.patch b/target/linux/qualcommax/patches-6.6/0916-arm64-dts-qcom-ipq5018-add-few-more-reserved-memory-.patch deleted file mode 100644 index 1319c18c82e..00000000000 --- a/target/linux/qualcommax/patches-6.6/0916-arm64-dts-qcom-ipq5018-add-few-more-reserved-memory-.patch +++ /dev/null @@ -1,65 +0,0 @@ -From a427dd16e61f3d145bc24f0ed09692fc25931250 Mon Sep 17 00:00:00 2001 -From: Kathiravan Thirumoorthy -Date: Wed, 25 Oct 2023 22:12:12 +0530 -Subject: arm64: dts: qcom: ipq5018: add few more reserved memory regions - -Like all other IPQ SoCs, bootloader will collect the system RAM contents -upon crash for the post morterm analysis. If we don't reserve the memory -region used by bootloader, obviously linux will consume it and upon next -boot on crash, bootloader will be loaded in the same region, which will -lead to loose some of the data, sometimes we may miss out critical -information. So lets reserve the region used by the bootloader. - -Similarly SBL copies some data into the reserved region and it will be -used in the crash scenario. So reserve 1MB for SBL as well. - -While at it, enable the SMEM support along with TCSR mutex. - -Signed-off-by: Kathiravan Thirumoorthy -Reviewed-by: Konrad Dybcio -Link: https://lore.kernel.org/r/20231025-ipq5018-misc-v1-1-7d14fde97fe7@quicinc.com -Signed-off-by: Bjorn Andersson ---- - arch/arm64/boot/dts/qcom/ipq5018.dtsi | 24 ++++++++++++++++++++++++ - 1 file changed, 24 insertions(+) - ---- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi -@@ -104,6 +104,24 @@ - #size-cells = <2>; - ranges; - -+ bootloader@4a800000 { -+ reg = <0x0 0x4a800000 0x0 0x200000>; -+ no-map; -+ }; -+ -+ sbl@4aa00000 { -+ reg = <0x0 0x4aa00000 0x0 0x100000>; -+ no-map; -+ }; -+ -+ smem@4ab00000 { -+ compatible = "qcom,smem"; -+ reg = <0x0 0x4ab00000 0x0 0x100000>; -+ no-map; -+ -+ hwlocks = <&tcsr_mutex 3>; -+ }; -+ - tz_region: tz@4ac00000 { - reg = <0x0 0x4ac00000 0x0 0x200000>; - no-map; -@@ -188,6 +206,12 @@ - #power-domain-cells = <1>; - }; - -+ tcsr_mutex: hwlock@1905000 { -+ compatible = "qcom,tcsr-mutex"; -+ reg = <0x01905000 0x20000>; -+ #hwlock-cells = <1>; -+ }; -+ - sdhc_1: mmc@7804000 { - compatible = "qcom,ipq5018-sdhci", "qcom,sdhci-msm-v5"; - reg = <0x7804000 0x1000>; diff --git a/target/linux/qualcommax/patches-6.6/0980-2-Revert-crypto-api-disallow-identical-driver-names.patch b/target/linux/qualcommax/patches-6.6/0980-2-Revert-crypto-api-disallow-identical-driver-names.patch deleted file mode 100644 index 3f7f58dfee5..00000000000 --- a/target/linux/qualcommax/patches-6.6/0980-2-Revert-crypto-api-disallow-identical-driver-names.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/crypto/algapi.c -+++ b/crypto/algapi.c -@@ -341,7 +341,6 @@ __crypto_register_alg(struct crypto_alg - } - - if (!strcmp(q->cra_driver_name, alg->cra_name) || -- !strcmp(q->cra_driver_name, alg->cra_driver_name) || - !strcmp(q->cra_name, alg->cra_driver_name)) - goto err; - } diff --git a/target/linux/qualcommax/patches-6.6/0980-3-mtd-silence-UBI-NAND-warnings.patch b/target/linux/qualcommax/patches-6.6/0980-3-mtd-silence-UBI-NAND-warnings.patch deleted file mode 100644 index 646e683dc8d..00000000000 --- a/target/linux/qualcommax/patches-6.6/0980-3-mtd-silence-UBI-NAND-warnings.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/drivers/mtd/mtdblock.c -+++ b/drivers/mtd/mtdblock.c -@@ -261,10 +261,6 @@ static int mtdblock_open(struct mtd_blkt - return 0; - } - -- if (mtd_type_is_nand(mbd->mtd)) -- pr_warn_ratelimited("%s: MTD device '%s' is NAND, please consider using UBI block devices instead.\n", -- mbd->tr->name, mbd->mtd->name); -- - /* OK, it's not open. Create cache info for it */ - mtdblk->count = 1; - mutex_init(&mtdblk->cache_mutex); diff --git a/target/linux/qualcommax/patches-6.6/0981-1-qca-skb_recycler-support.patch b/target/linux/qualcommax/patches-6.6/0981-1-qca-skb_recycler-support.patch deleted file mode 100644 index d10a0e69f0e..00000000000 --- a/target/linux/qualcommax/patches-6.6/0981-1-qca-skb_recycler-support.patch +++ /dev/null @@ -1,431 +0,0 @@ ---- a/include/linux/cpuhotplug.h -+++ b/include/linux/cpuhotplug.h -@@ -94,6 +94,7 @@ enum cpuhp_state { - CPUHP_RADIX_DEAD, - CPUHP_PAGE_ALLOC, - CPUHP_NET_DEV_DEAD, -+ CPUHP_SKB_RECYCLER_DEAD, - CPUHP_PCI_XGENE_DEAD, - CPUHP_IOMMU_IOVA_DEAD, - CPUHP_LUSTRE_CFS_DEAD, ---- a/include/linux/skbuff.h -+++ b/include/linux/skbuff.h -@@ -1059,6 +1059,10 @@ struct sk_buff { - /* only useable after checking ->active_extensions != 0 */ - struct skb_ext *extensions; - #endif -+ -+#ifdef CONFIG_DEBUG_OBJECTS_SKBUFF -+ void *free_addr; -+#endif - }; - - /* if you move pkt_type around you also must adapt those constants */ -@@ -1244,7 +1248,7 @@ static inline void kfree_skb_list(struct - kfree_skb_list_reason(segs, SKB_DROP_REASON_NOT_SPECIFIED); - } - --#ifdef CONFIG_TRACEPOINTS -+#ifdef CONFIG_SKB_RECYCLER - void consume_skb(struct sk_buff *skb); - #else - static inline void consume_skb(struct sk_buff *skb) -@@ -1256,6 +1260,9 @@ static inline void consume_skb(struct sk - void __consume_stateless_skb(struct sk_buff *skb); - void __kfree_skb(struct sk_buff *skb); - extern struct kmem_cache *skbuff_cache; -+extern void kfree_skbmem(struct sk_buff *skb); -+extern void skb_release_data(struct sk_buff *skb, enum skb_drop_reason reason, -+ bool napi_safe); - - void kfree_skb_partial(struct sk_buff *skb, bool head_stolen); - bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from, ---- a/net/Kconfig -+++ b/net/Kconfig -@@ -369,6 +369,52 @@ config NET_FLOW_LIMIT - with many clients some protection against DoS by a single (spoofed) - flow that greatly exceeds average workload. - -+config SKB_RECYCLER -+ bool "Generic skb recycling" -+ default y -+ help -+ SKB_RECYCLER is used to implement RX-to-RX skb recycling. -+ This config enables the recycling scheme for bridging and -+ routing workloads. It can reduce skbuff freeing or -+ reallocation overhead. -+ -+config SKB_RECYCLER_MULTI_CPU -+ bool "Cross-CPU recycling for CPU-locked workloads" -+ depends on SMP && SKB_RECYCLER -+ default n -+ -+config SKB_RECYCLER_PREALLOC -+ bool "Enable preallocation of SKBs" -+ depends on SKB_RECYCLER -+ default n -+ help -+ Preallocates SKBs in recycling lists and the number of -+ SKBs are configured through CONFIG_SKB_RECYCLE_MAX_PREALLOC_SKBS. -+ This needs SKB_RECYCLER to be enabled. -+ The number of preallocated SKBs can be passed using -+ SKB_RECYCLE_MAX_PREALLOC_SKBS. -+ -+config SKB_RECYCLE_MAX_PREALLOC_SKBS -+ int "Number of SKBs to be preallocated" -+ depends on SKB_RECYCLER_PREALLOC -+ default 16384 -+ help -+ Number of SKBs each of 4K size to be preallocated for recycling -+ -+config SKB_RECYCLE_SIZE -+ int "Minimum size for a recycled buffer" -+ depends on SKB_RECYCLER -+ default 2304 -+ help -+ Minimum size for a recycled buffer -+ -+config ALLOC_SKB_PAGE_FRAG_DISABLE -+ bool "Disable page fragment based skbuff payload allocations" -+ depends on !SKB_RECYCLER -+ default n -+ help -+ Disable page fragment based allocations for skbuff payloads. -+ - menu "Network testing" - - config NET_PKTGEN ---- a/net/core/Makefile -+++ b/net/core/Makefile -@@ -41,3 +41,4 @@ obj-$(CONFIG_NET_SOCK_MSG) += skmsg.o - obj-$(CONFIG_BPF_SYSCALL) += sock_map.o - obj-$(CONFIG_BPF_SYSCALL) += bpf_sk_storage.o - obj-$(CONFIG_OF) += of_net.o -+obj-$(CONFIG_SKB_RECYCLER) += skbuff_recycle.o ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -6043,10 +6043,16 @@ static int process_backlog(struct napi_s - - napi->weight = READ_ONCE(dev_rx_weight); - while (again) { -- struct sk_buff *skb; -+ struct sk_buff *skb, *next_skb; - - while ((skb = __skb_dequeue(&sd->process_queue))) { - rcu_read_lock(); -+ -+ next_skb = skb_peek(&sd->process_queue); -+ if (likely(next_skb)) { -+ prefetch(next_skb->data); -+ } -+ - __netif_receive_skb(skb); - rcu_read_unlock(); - input_queue_head_incr(sd); ---- a/net/core/skbuff.c -+++ b/net/core/skbuff.c -@@ -87,6 +87,38 @@ - - #include "dev.h" - #include "sock_destructor.h" -+#include "skbuff_recycle.h" -+ -+struct kmem_cache *skb_data_cache; -+struct kmem_cache *skb_data_cache_2100; -+/* -+ * For low memory profile, NSS_SKB_FIXED_SIZE_2K is enabled and -+ * CONFIG_SKB_RECYCLER is disabled. For premium and enterprise profile -+ * CONFIG_SKB_RECYCLER is enabled and NSS_SKB_FIXED_SIZE_2K is disabled. -+ * Irrespective of NSS_SKB_FIXED_SIZE_2K enabled/disabled, the -+ * CONFIG_SKB_RECYCLER and __LP64__ determines the value of SKB_DATA_CACHE_SIZE -+ */ -+#if defined(CONFIG_SKB_RECYCLER) -+/* -+ * Both caches are kept same size when recycler is enabled so that all the -+ * skbs could be recycled. 2688 for 64bit arch, 2624 for 32bit arch -+ */ -+#define SKB_DATA_CACHE_SIZE (SKB_DATA_ALIGN(SKB_RECYCLE_SIZE + NET_SKB_PAD) + SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) -+#define SKB_DATA_CACHE_SIZE_2100 SKB_DATA_CACHE_SIZE -+#else -+/* -+ * DATA CACHE is 2368 for 64bit arch, 2176 for 32bit arch -+ * DATA_CACHE_2100 is 2496 for 64bit arch, 2432 for 32bit arch -+ * DATA CACHE size should always be lesser than that of DATA_CACHE_2100 size -+ */ -+#if defined(__LP64__) -+#define SKB_DATA_CACHE_SIZE (SKB_DATA_ALIGN(1984 + NET_SKB_PAD) + SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) -+#define SKB_DATA_CACHE_SIZE_2100 (SKB_DATA_ALIGN(2100 + NET_SKB_PAD) + SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) -+#else -+#define SKB_DATA_CACHE_SIZE (SKB_DATA_ALIGN(1856 + NET_SKB_PAD) + SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) -+#define SKB_DATA_CACHE_SIZE_2100 (SKB_DATA_ALIGN(2100 + NET_SKB_PAD) + SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) -+#endif -+#endif - - struct kmem_cache *skbuff_cache __ro_after_init; - static struct kmem_cache *skbuff_fclone_cache __ro_after_init; -@@ -551,21 +583,31 @@ static void *kmalloc_reserve(unsigned in - bool *pfmemalloc) - { - bool ret_pfmemalloc = false; -- size_t obj_size; -+ unsigned int obj_size = *size; - void *obj; - - obj_size = SKB_HEAD_ALIGN(*size); -- if (obj_size <= SKB_SMALL_HEAD_CACHE_SIZE && -- !(flags & KMALLOC_NOT_NORMAL_BITS)) { -- obj = kmem_cache_alloc_node(skb_small_head_cache, -- flags | __GFP_NOMEMALLOC | __GFP_NOWARN, -- node); -- *size = SKB_SMALL_HEAD_CACHE_SIZE; -+ if (obj_size > SZ_2K && obj_size <= SKB_DATA_CACHE_SIZE) { -+ obj = kmem_cache_alloc_node(skb_data_cache, -+ flags | __GFP_NOMEMALLOC | __GFP_NOWARN, -+ node); -+ *size = SKB_DATA_CACHE_SIZE; -+ if (obj || !(gfp_pfmemalloc_allowed(flags))) -+ goto out; -+ /* Try again but now we are using pfmemalloc reserves */ -+ ret_pfmemalloc = true; -+ obj = kmem_cache_alloc_node(skb_data_cache, flags, node); -+ goto out; -+ } else if (obj_size > SZ_2K && obj_size <= SKB_DATA_CACHE_SIZE_2100) { -+ obj = kmem_cache_alloc_node(skb_data_cache_2100, -+ flags | __GFP_NOMEMALLOC | __GFP_NOWARN, -+ node); -+ *size = SKB_DATA_CACHE_SIZE_2100; - if (obj || !(gfp_pfmemalloc_allowed(flags))) - goto out; - /* Try again but now we are using pfmemalloc reserves */ - ret_pfmemalloc = true; -- obj = kmem_cache_alloc_node(skb_small_head_cache, flags, node); -+ obj = kmem_cache_alloc_node(skb_data_cache_2100, flags, node); - goto out; - } - -@@ -648,10 +690,12 @@ struct sk_buff *__alloc_skb(unsigned int - * aligned memory blocks, unless SLUB/SLAB debug is enabled. - * Both skb->head and skb_shared_info are cache line aligned. - */ -+ size = SKB_DATA_ALIGN(size); -+ size += SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); - data = kmalloc_reserve(&size, gfp_mask, node, &pfmemalloc); - if (unlikely(!data)) - goto nodata; -- /* kmalloc_size_roundup() might give us more room than requested. -+ /* kmalloc_reserve(size) might give us more room than requested. - * Put skb_shared_info exactly at the end of allocated zone, - * to allow max possible filling before reallocation. - */ -@@ -686,7 +730,7 @@ EXPORT_SYMBOL(__alloc_skb); - /** - * __netdev_alloc_skb - allocate an skbuff for rx on a specific device - * @dev: network device to receive on -- * @len: length to allocate -+ * @length: length to allocate - * @gfp_mask: get_free_pages mask, passed to alloc_skb - * - * Allocate a new &sk_buff and assign it a usage count of one. The -@@ -696,29 +740,53 @@ EXPORT_SYMBOL(__alloc_skb); - * - * %NULL is returned if there is no free memory. - */ --struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int len, -- gfp_t gfp_mask) -+struct sk_buff *__netdev_alloc_skb(struct net_device *dev, -+ unsigned int length, gfp_t gfp_mask) - { -- struct page_frag_cache *nc; - struct sk_buff *skb; -+ unsigned int len = length; -+ -+#ifdef CONFIG_SKB_RECYCLER -+ skb = skb_recycler_alloc(dev, length, true); -+ if (likely(skb)) -+ return skb; -+ -+ len = SKB_RECYCLE_SIZE; -+ if (unlikely(length > SKB_RECYCLE_SIZE)) -+ len = length; -+ -+ skb = __alloc_skb(len + NET_SKB_PAD, gfp_mask, -+ SKB_ALLOC_RX, NUMA_NO_NODE); -+ if (!skb) -+ goto skb_fail; -+ goto skb_success; -+#else -+ struct page_frag_cache *nc; - bool pfmemalloc; -+ bool page_frag_alloc_enable = true; - void *data; - - len += NET_SKB_PAD; - -+ -+#ifdef CONFIG_ALLOC_SKB_PAGE_FRAG_DISABLE -+ page_frag_alloc_enable = false; -+#endif - /* If requested length is either too small or too big, - * we use kmalloc() for skb->head allocation. - */ - if (len <= SKB_WITH_OVERHEAD(1024) || - len > SKB_WITH_OVERHEAD(PAGE_SIZE) || -- (gfp_mask & (__GFP_DIRECT_RECLAIM | GFP_DMA))) { -+ (gfp_mask & (__GFP_DIRECT_RECLAIM | GFP_DMA)) || -+ !page_frag_alloc_enable) { - skb = __alloc_skb(len, gfp_mask, SKB_ALLOC_RX, NUMA_NO_NODE); - if (!skb) - goto skb_fail; - goto skb_success; - } - -- len = SKB_HEAD_ALIGN(len); -+ len += SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); -+ len = SKB_DATA_ALIGN(len); - - if (sk_memalloc_socks()) - gfp_mask |= __GFP_MEMALLOC; -@@ -747,6 +815,7 @@ struct sk_buff *__netdev_alloc_skb(struc - if (pfmemalloc) - skb->pfmemalloc = 1; - skb->head_frag = 1; -+#endif - - skb_success: - skb_reserve(skb, NET_SKB_PAD); -@@ -817,7 +886,8 @@ struct sk_buff *__napi_alloc_skb(struct - data = page_frag_alloc_1k(&nc->page_small, gfp_mask); - pfmemalloc = NAPI_SMALL_PAGE_PFMEMALLOC(nc->page_small); - } else { -- len = SKB_HEAD_ALIGN(len); -+ len += SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); -+ len = SKB_DATA_ALIGN(len); - - data = page_frag_alloc(&nc->page, len, gfp_mask); - pfmemalloc = nc->page.pfmemalloc; -@@ -975,7 +1045,7 @@ static void skb_free_head(struct sk_buff - } - } - --static void skb_release_data(struct sk_buff *skb, enum skb_drop_reason reason, -+void skb_release_data(struct sk_buff *skb, enum skb_drop_reason reason, - bool napi_safe) - { - struct skb_shared_info *shinfo = skb_shinfo(skb); -@@ -1018,7 +1088,7 @@ exit: - /* - * Free an skbuff by memory without cleaning the state. - */ --static void kfree_skbmem(struct sk_buff *skb) -+void kfree_skbmem(struct sk_buff *skb) - { - struct sk_buff_fclones *fclones; - -@@ -1282,7 +1352,6 @@ void skb_tx_error(struct sk_buff *skb) - } - EXPORT_SYMBOL(skb_tx_error); - --#ifdef CONFIG_TRACEPOINTS - /** - * consume_skb - free an skbuff - * @skb: buffer to free -@@ -1291,13 +1360,48 @@ EXPORT_SYMBOL(skb_tx_error); - * Functions identically to kfree_skb, but kfree_skb assumes that the frame - * is being dropped after a failure and notes that - */ -+#ifdef CONFIG_SKB_RECYCLER - void consume_skb(struct sk_buff *skb) - { - if (!skb_unref(skb)) - return; -+ prefetch(&skb->destructor); -+ -+ /*Tian: Not sure if we need to continue using this since -+ * since unref does the work in 5.4 -+ */ -+ -+ /* -+ if (likely(atomic_read(&skb->users) == 1)) -+ smp_rmb(); -+ else if (likely(!atomic_dec_and_test(&skb->users))) -+ return; -+ */ - -+ /* If possible we'd like to recycle any skb rather than just free it, -+ * but in order to do that we need to release any head state too. -+ * We don't want to do this later because we'll be in a pre-emption -+ * disabled state. -+ */ -+ skb_release_head_state(skb); -+ -+ /* Can we recycle this skb? If we can then it will be much faster -+ * for us to recycle this one later than to allocate a new one -+ * from scratch. -+ */ -+ if (likely(skb->head) && likely(skb_recycler_consume(skb))) -+ return; -+ -+#ifdef CONFIG_TRACEPOINTS - trace_consume_skb(skb, __builtin_return_address(0)); -- __kfree_skb(skb); -+#endif -+ /* We're not recycling so now we need to do the rest of what we would -+ * have done in __kfree_skb (above and beyond the skb_release_head_state -+ * that we already did). -+ */ -+ if (likely(skb->head)) -+ skb_release_data(skb, SKB_CONSUMED, false); -+ kfree_skbmem(skb); - } - EXPORT_SYMBOL(consume_skb); - #endif -@@ -2112,6 +2216,8 @@ int pskb_expand_head(struct sk_buff *skb - - if (skb_pfmemalloc(skb)) - gfp_mask |= __GFP_MEMALLOC; -+ size = SKB_DATA_ALIGN(size); -+ size += SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); - - data = kmalloc_reserve(&size, gfp_mask, NUMA_NO_NODE, NULL); - if (!data) -@@ -4865,6 +4971,14 @@ static void skb_extensions_init(void) {} - - void __init skb_init(void) - { -+ skb_data_cache = kmem_cache_create_usercopy("skb_data_cache", -+ SKB_DATA_CACHE_SIZE, -+ 0, SLAB_PANIC, 0, SKB_DATA_CACHE_SIZE, -+ NULL); -+ skb_data_cache_2100 = kmem_cache_create_usercopy("skb_data_cache_2100", -+ SKB_DATA_CACHE_SIZE_2100, -+ 0, SLAB_PANIC, 0, SKB_DATA_CACHE_SIZE, -+ NULL); - skbuff_cache = kmem_cache_create_usercopy("skbuff_head_cache", - sizeof(struct sk_buff), - 0, -@@ -4890,6 +5004,7 @@ void __init skb_init(void) - SKB_SMALL_HEAD_HEADROOM, - NULL); - skb_extensions_init(); -+ skb_recycler_init(); - } - - static int -@@ -6393,6 +6508,8 @@ static int pskb_carve_inside_header(stru - if (skb_pfmemalloc(skb)) - gfp_mask |= __GFP_MEMALLOC; - -+ size = SKB_DATA_ALIGN(size); -+ size += SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); - data = kmalloc_reserve(&size, gfp_mask, NUMA_NO_NODE, NULL); - if (!data) - return -ENOMEM; -@@ -6509,6 +6626,8 @@ static int pskb_carve_inside_nonlinear(s - if (skb_pfmemalloc(skb)) - gfp_mask |= __GFP_MEMALLOC; - -+ size = SKB_DATA_ALIGN(size); -+ size += SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); - data = kmalloc_reserve(&size, gfp_mask, NUMA_NO_NODE, NULL); - if (!data) - return -ENOMEM; diff --git a/target/linux/qualcommax/patches-6.6/0982-1-arm64-dts-qcom-disable-swiotlb-for-64mb-savings.patch b/target/linux/qualcommax/patches-6.6/0982-1-arm64-dts-qcom-disable-swiotlb-for-64mb-savings.patch deleted file mode 100644 index 70808a29b87..00000000000 --- a/target/linux/qualcommax/patches-6.6/0982-1-arm64-dts-qcom-disable-swiotlb-for-64mb-savings.patch +++ /dev/null @@ -1,242 +0,0 @@ ---- a/arch/arm64/boot/dts/qcom/ipq6010-wax214.dts -+++ b/arch/arm64/boot/dts/qcom/ipq6010-wax214.dts -@@ -25,7 +25,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_1"; -+ bootargs-append = " root=/dev/ubiblock0_1 coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq6018-fap650.dts -+++ b/arch/arm64/boot/dts/qcom/ipq6018-fap650.dts -@@ -30,7 +30,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_1"; -+ bootargs-append = " root=/dev/ubiblock0_1 coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts -@@ -27,7 +27,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_1"; -+ bootargs-append = " root=/dev/ubiblock0_1 coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq8070-rm2-6.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8070-rm2-6.dts -@@ -33,7 +33,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_1"; -+ bootargs-append = " root=/dev/ubiblock0_1 coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi -@@ -20,7 +20,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_0"; -+ bootargs-append = " root=/dev/ubiblock0_0 coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts -@@ -30,7 +30,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_1"; -+ bootargs-append = " root=/dev/ubiblock0_1 coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts -@@ -25,7 +25,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_0"; -+ bootargs-append = " root=/dev/ubiblock0_0 coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq8072-aw1000.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8072-aw1000.dts -@@ -35,7 +35,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_1"; -+ bootargs-append = " root=/dev/ubiblock0_1 coherent_pool=2M swiotlb=noforce"; - }; - - gpio-export { ---- a/arch/arm64/boot/dts/qcom/ipq8072-ax880.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8072-ax880.dts -@@ -30,7 +30,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_1"; -+ bootargs-append = " root=/dev/ubiblock0_1 coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts -@@ -26,7 +26,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_0"; -+ bootargs-append = " root=/dev/ubiblock0_0 coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq8072-dl-wrx36.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8072-dl-wrx36.dts -@@ -32,7 +32,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_1"; -+ bootargs-append = " root=/dev/ubiblock0_1 coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq8072-mx5300.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8072-mx5300.dts -@@ -33,7 +33,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_0 rootfstype=squashfs ro"; -+ bootargs-append = " root=/dev/ubiblock0_0 rootfstype=squashfs ro coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq8072-mx8500.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8072-mx8500.dts -@@ -25,7 +25,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_0 rootfstype=squashfs ro"; -+ bootargs-append = " root=/dev/ubiblock0_0 rootfstype=squashfs ro coherent_pool=2M swiotlb=noforce"; - }; - - gpio_export { ---- a/arch/arm64/boot/dts/qcom/ipq8072-wax218.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8072-wax218.dts -@@ -27,7 +27,7 @@ - * Netgear's U-Boot adds "ubi.mtd=rootfs root=mtd:ubi_rootfs" - * That fails to create a UBI block device, so add it here. - */ -- bootargs-append = " ubi.block=0,rootfs root=/dev/ubiblock0_1"; -+ bootargs-append = " ubi.block=0,rootfs root=/dev/ubiblock0_1 coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq8072-wax620.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8072-wax620.dts -@@ -30,7 +30,7 @@ - * Netgear's U-Boot adds "ubi.mtd=rootfs root=mtd:ubi_rootfs" - * That fails to create a UBI block device, so add it here. - */ -- bootargs-append = " root=/dev/ubiblock0_1"; -+ bootargs-append = " root=/dev/ubiblock0_1 coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq8072-wpq873.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8072-wpq873.dts -@@ -31,7 +31,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_1"; -+ bootargs-append = " root=/dev/ubiblock0_1 coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq8072-zbt-z800ax.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8072-zbt-z800ax.dts -@@ -33,7 +33,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_1"; -+ bootargs-append = " root=/dev/ubiblock0_1 coherent_pool=2M swiotlb=noforce"; - }; - - gpio-export { ---- a/arch/arm64/boot/dts/qcom/ipq8074-rax120v2.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8074-rax120v2.dts -@@ -25,7 +25,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " ubi.mtd=rootfs root=/dev/ubiblock0_0"; -+ bootargs-append = " ubi.mtd=rootfs root=/dev/ubiblock0_0 coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq8074-sxk80.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq8074-sxk80.dtsi -@@ -26,7 +26,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " ubi.mtd=rootfs root=/dev/ubiblock0_0"; -+ bootargs-append = " ubi.mtd=rootfs root=/dev/ubiblock0_0 coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq8074-wax630.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8074-wax630.dts -@@ -29,7 +29,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_1"; -+ bootargs-append = " root=/dev/ubiblock0_1 coherent_pool=2M swiotlb=noforce"; - }; - - keys { ---- a/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts -+++ b/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts -@@ -25,7 +25,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " ubi.mtd=user_property root=/dev/ubiblock1_0"; -+ bootargs-append = " ubi.mtd=user_property root=/dev/ubiblock1_0 coherent_pool=2M swiotlb=noforce"; - }; - - leds { ---- a/arch/arm64/boot/dts/qcom/ipq8174-mx4200.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq8174-mx4200.dtsi -@@ -30,7 +30,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -- bootargs-append = " root=/dev/ubiblock0_0"; -+ bootargs-append = " root=/dev/ubiblock0_0 coherent_pool=2M swiotlb=noforce"; - }; - - keys { diff --git a/target/linux/qualcommax/patches-6.6/1903-arch-arm64-dts-ipq5018-add-qpic_bam-nand-support.patch b/target/linux/qualcommax/patches-6.6/1903-arch-arm64-dts-ipq5018-add-qpic_bam-nand-support.patch deleted file mode 100644 index 9f404859225..00000000000 --- a/target/linux/qualcommax/patches-6.6/1903-arch-arm64-dts-ipq5018-add-qpic_bam-nand-support.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 662aaa584de6c65e97e5db30b4a825dd0e9719ce Mon Sep 17 00:00:00 2001 -From: JiaY-shi -Date: Mon, 24 Jun 2024 17:08:58 +0800 -Subject: [PATCH 2/2] arch: arm64: dts: ipq5018 add qpic_bam & nand support - ---- - arch/arm64/boot/dts/qcom/ipq5018.dtsi | 40 +++++++++++++++++++++++++++ - 1 file changed, 40 insertions(+) - ---- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi -@@ -263,6 +263,46 @@ - status = "disabled"; - }; - -+ qpic_bam: dma@7984000 { -+ compatible = "qcom,bam-v1.7.0"; -+ reg = <0x7984000 0x1c000>; -+ interrupts = ; -+ clocks = <&gcc GCC_QPIC_AHB_CLK>; -+ clock-names = "bam_clk"; -+ #dma-cells = <1>; -+ qcom,ee = <0>; -+ status = "disabled"; -+ }; -+ -+ nand: qpic-nand@79b0000 { -+ compatible = "qcom,ipq5018-nand"; -+ reg = <0x79b0000 0x10000>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ clocks = <&gcc GCC_QPIC_CLK>, -+ <&gcc GCC_QPIC_AHB_CLK>, -+ <&gcc GCC_QPIC_IO_MACRO_CLK>; -+ clock-names = "core", "aon", "io_macro"; -+ -+ dmas = <&qpic_bam 0>, -+ <&qpic_bam 1>, -+ <&qpic_bam 2>, -+ <&qpic_bam 3>; -+ dma-names = "tx", "rx", "cmd", "sts"; -+ status = "disabled"; -+ -+ nandcs@0 { -+ compatible = "qcom,nandcs"; -+ reg = <0>; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ -+ nand-ecc-strength = <4>; -+ nand-ecc-step-size = <512>; -+ nand-bus-width = <8>; -+ }; -+ }; -+ - usb: usb@8af8800 { - compatible = "qcom,ipq5018-dwc3", "qcom,dwc3"; - reg = <0x08af8800 0x400>; diff --git a/target/linux/qualcommax/patches-6.6/2000-drivers-pinctrl-qcom-add-ipq6000-support.patch b/target/linux/qualcommax/patches-6.6/2000-drivers-pinctrl-qcom-add-ipq6000-support.patch deleted file mode 100644 index 2536c2dde4b..00000000000 --- a/target/linux/qualcommax/patches-6.6/2000-drivers-pinctrl-qcom-add-ipq6000-support.patch +++ /dev/null @@ -1,1116 +0,0 @@ -From 192ce4f2a695c1d6ed72ac1a1b69f125ada9d4c3 Mon Sep 17 00:00:00 2001 -From: JiaY-shi -Date: Tue, 28 Nov 2023 23:31:57 +0800 -Subject: [PATCH] drivers: pinctrl: qcom: add ipq6000 support - ---- - drivers/pinctrl/qcom/Makefile | 1 + - drivers/pinctrl/qcom/pinctrl-ipq6000.c | 1092 ++++++++++++++++++++++++ - 2 files changed, 1093 insertions(+) - create mode 100644 drivers/pinctrl/qcom/pinctrl-ipq6000.c - ---- a/drivers/pinctrl/qcom/Makefile -+++ b/drivers/pinctrl/qcom/Makefile -@@ -8,6 +8,7 @@ obj-$(CONFIG_PINCTRL_IPQ5018) += pinctrl - obj-$(CONFIG_PINCTRL_IPQ8064) += pinctrl-ipq8064.o - obj-$(CONFIG_PINCTRL_IPQ5332) += pinctrl-ipq5332.o - obj-$(CONFIG_PINCTRL_IPQ8074) += pinctrl-ipq8074.o -+obj-$(CONFIG_PINCTRL_IPQ6018) += pinctrl-ipq6000.o - obj-$(CONFIG_PINCTRL_IPQ6018) += pinctrl-ipq6018.o - obj-$(CONFIG_PINCTRL_IPQ9574) += pinctrl-ipq9574.o - obj-$(CONFIG_PINCTRL_MSM8226) += pinctrl-msm8226.o ---- /dev/null -+++ b/drivers/pinctrl/qcom/pinctrl-ipq6000.c -@@ -0,0 +1,1092 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* -+ * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. -+ */ -+ -+#include -+#include -+#include -+ -+#include "pinctrl-msm.h" -+ -+#define REG_SIZE 0x1000 -+#define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9) \ -+ { \ -+ .grp = PINCTRL_PINGROUP("gpio" #id, \ -+ gpio##id##_pins, \ -+ ARRAY_SIZE(gpio##id##_pins)), \ -+ .funcs = (int[]){ \ -+ msm_mux_gpio, /* gpio mode */ \ -+ msm_mux_##f1, \ -+ msm_mux_##f2, \ -+ msm_mux_##f3, \ -+ msm_mux_##f4, \ -+ msm_mux_##f5, \ -+ msm_mux_##f6, \ -+ msm_mux_##f7, \ -+ msm_mux_##f8, \ -+ msm_mux_##f9 \ -+ }, \ -+ .nfuncs = 10, \ -+ .ctl_reg = REG_SIZE * id, \ -+ .io_reg = 0x4 + REG_SIZE * id, \ -+ .intr_cfg_reg = 0x8 + REG_SIZE * id, \ -+ .intr_status_reg = 0xc + REG_SIZE * id, \ -+ .intr_target_reg = 0x8 + REG_SIZE * id, \ -+ .mux_bit = 2, \ -+ .pull_bit = 0, \ -+ .drv_bit = 6, \ -+ .oe_bit = 9, \ -+ .in_bit = 0, \ -+ .out_bit = 1, \ -+ .intr_enable_bit = 0, \ -+ .intr_status_bit = 0, \ -+ .intr_target_bit = 5, \ -+ .intr_target_kpss_val = 3, \ -+ .intr_raw_status_bit = 4, \ -+ .intr_polarity_bit = 1, \ -+ .intr_detection_bit = 2, \ -+ .intr_detection_width = 2, \ -+ } -+ -+static const struct pinctrl_pin_desc ipq6018_pins[] = { -+ PINCTRL_PIN(0, "GPIO_0"), -+ PINCTRL_PIN(1, "GPIO_1"), -+ PINCTRL_PIN(2, "GPIO_2"), -+ PINCTRL_PIN(3, "GPIO_3"), -+ PINCTRL_PIN(4, "GPIO_4"), -+ PINCTRL_PIN(5, "GPIO_5"), -+ PINCTRL_PIN(6, "GPIO_6"), -+ PINCTRL_PIN(7, "GPIO_7"), -+ PINCTRL_PIN(8, "GPIO_8"), -+ PINCTRL_PIN(9, "GPIO_9"), -+ PINCTRL_PIN(10, "GPIO_10"), -+ PINCTRL_PIN(11, "GPIO_11"), -+ PINCTRL_PIN(12, "GPIO_12"), -+ PINCTRL_PIN(13, "GPIO_13"), -+ PINCTRL_PIN(14, "GPIO_14"), -+ PINCTRL_PIN(15, "GPIO_15"), -+ PINCTRL_PIN(16, "GPIO_16"), -+ PINCTRL_PIN(17, "GPIO_17"), -+ PINCTRL_PIN(18, "GPIO_18"), -+ PINCTRL_PIN(19, "GPIO_19"), -+ -+ PINCTRL_PIN(21, "GPIO_21"), -+ PINCTRL_PIN(22, "GPIO_22"), -+ PINCTRL_PIN(23, "GPIO_23"), -+ PINCTRL_PIN(24, "GPIO_24"), -+ PINCTRL_PIN(25, "GPIO_25"), -+ PINCTRL_PIN(26, "GPIO_26"), -+ PINCTRL_PIN(27, "GPIO_27"), -+ PINCTRL_PIN(28, "GPIO_28"), -+ PINCTRL_PIN(29, "GPIO_29"), -+ PINCTRL_PIN(30, "GPIO_30"), -+ PINCTRL_PIN(31, "GPIO_31"), -+ PINCTRL_PIN(32, "GPIO_32"), -+ PINCTRL_PIN(33, "GPIO_33"), -+ PINCTRL_PIN(34, "GPIO_34"), -+ PINCTRL_PIN(35, "GPIO_35"), -+ PINCTRL_PIN(36, "GPIO_36"), -+ PINCTRL_PIN(37, "GPIO_37"), -+ PINCTRL_PIN(38, "GPIO_38"), -+ PINCTRL_PIN(39, "GPIO_39"), -+ PINCTRL_PIN(40, "GPIO_40"), -+ PINCTRL_PIN(41, "GPIO_41"), -+ PINCTRL_PIN(42, "GPIO_42"), -+ PINCTRL_PIN(43, "GPIO_43"), -+ PINCTRL_PIN(44, "GPIO_44"), -+ PINCTRL_PIN(45, "GPIO_45"), -+ PINCTRL_PIN(46, "GPIO_46"), -+ PINCTRL_PIN(47, "GPIO_47"), -+ PINCTRL_PIN(48, "GPIO_48"), -+ PINCTRL_PIN(49, "GPIO_49"), -+ PINCTRL_PIN(50, "GPIO_50"), -+ PINCTRL_PIN(51, "GPIO_51"), -+ PINCTRL_PIN(52, "GPIO_52"), -+ PINCTRL_PIN(53, "GPIO_53"), -+ PINCTRL_PIN(54, "GPIO_54"), -+ PINCTRL_PIN(55, "GPIO_55"), -+ PINCTRL_PIN(56, "GPIO_56"), -+ PINCTRL_PIN(57, "GPIO_57"), -+ PINCTRL_PIN(58, "GPIO_58"), -+ PINCTRL_PIN(59, "GPIO_59"), -+ PINCTRL_PIN(60, "GPIO_60"), -+ PINCTRL_PIN(61, "GPIO_61"), -+ PINCTRL_PIN(62, "GPIO_62"), -+ PINCTRL_PIN(63, "GPIO_63"), -+ PINCTRL_PIN(64, "GPIO_64"), -+ PINCTRL_PIN(65, "GPIO_65"), -+ PINCTRL_PIN(66, "GPIO_66"), -+ PINCTRL_PIN(67, "GPIO_67"), -+ PINCTRL_PIN(68, "GPIO_68"), -+ PINCTRL_PIN(69, "GPIO_69"), -+ PINCTRL_PIN(70, "GPIO_70"), -+ PINCTRL_PIN(71, "GPIO_71"), -+ PINCTRL_PIN(72, "GPIO_72"), -+ PINCTRL_PIN(73, "GPIO_73"), -+ PINCTRL_PIN(74, "GPIO_74"), -+ PINCTRL_PIN(75, "GPIO_75"), -+ PINCTRL_PIN(76, "GPIO_76"), -+ PINCTRL_PIN(77, "GPIO_77"), -+ PINCTRL_PIN(78, "GPIO_78"), -+ PINCTRL_PIN(79, "GPIO_79"), -+}; -+ -+#define DECLARE_MSM_GPIO_PINS(pin) \ -+ static const unsigned int gpio##pin##_pins[] = { pin } -+DECLARE_MSM_GPIO_PINS(0); -+DECLARE_MSM_GPIO_PINS(1); -+DECLARE_MSM_GPIO_PINS(2); -+DECLARE_MSM_GPIO_PINS(3); -+DECLARE_MSM_GPIO_PINS(4); -+DECLARE_MSM_GPIO_PINS(5); -+DECLARE_MSM_GPIO_PINS(6); -+DECLARE_MSM_GPIO_PINS(7); -+DECLARE_MSM_GPIO_PINS(8); -+DECLARE_MSM_GPIO_PINS(9); -+DECLARE_MSM_GPIO_PINS(10); -+DECLARE_MSM_GPIO_PINS(11); -+DECLARE_MSM_GPIO_PINS(12); -+DECLARE_MSM_GPIO_PINS(13); -+DECLARE_MSM_GPIO_PINS(14); -+DECLARE_MSM_GPIO_PINS(15); -+DECLARE_MSM_GPIO_PINS(16); -+DECLARE_MSM_GPIO_PINS(17); -+DECLARE_MSM_GPIO_PINS(18); -+DECLARE_MSM_GPIO_PINS(19); -+ -+DECLARE_MSM_GPIO_PINS(21); -+DECLARE_MSM_GPIO_PINS(22); -+DECLARE_MSM_GPIO_PINS(23); -+DECLARE_MSM_GPIO_PINS(24); -+DECLARE_MSM_GPIO_PINS(25); -+DECLARE_MSM_GPIO_PINS(26); -+DECLARE_MSM_GPIO_PINS(27); -+DECLARE_MSM_GPIO_PINS(28); -+DECLARE_MSM_GPIO_PINS(29); -+DECLARE_MSM_GPIO_PINS(30); -+DECLARE_MSM_GPIO_PINS(31); -+DECLARE_MSM_GPIO_PINS(32); -+DECLARE_MSM_GPIO_PINS(33); -+DECLARE_MSM_GPIO_PINS(34); -+DECLARE_MSM_GPIO_PINS(35); -+DECLARE_MSM_GPIO_PINS(36); -+DECLARE_MSM_GPIO_PINS(37); -+DECLARE_MSM_GPIO_PINS(38); -+DECLARE_MSM_GPIO_PINS(39); -+DECLARE_MSM_GPIO_PINS(40); -+DECLARE_MSM_GPIO_PINS(41); -+DECLARE_MSM_GPIO_PINS(42); -+DECLARE_MSM_GPIO_PINS(43); -+DECLARE_MSM_GPIO_PINS(44); -+DECLARE_MSM_GPIO_PINS(45); -+DECLARE_MSM_GPIO_PINS(46); -+DECLARE_MSM_GPIO_PINS(47); -+DECLARE_MSM_GPIO_PINS(48); -+DECLARE_MSM_GPIO_PINS(49); -+DECLARE_MSM_GPIO_PINS(50); -+DECLARE_MSM_GPIO_PINS(51); -+DECLARE_MSM_GPIO_PINS(52); -+DECLARE_MSM_GPIO_PINS(53); -+DECLARE_MSM_GPIO_PINS(54); -+DECLARE_MSM_GPIO_PINS(55); -+DECLARE_MSM_GPIO_PINS(56); -+DECLARE_MSM_GPIO_PINS(57); -+DECLARE_MSM_GPIO_PINS(58); -+DECLARE_MSM_GPIO_PINS(59); -+DECLARE_MSM_GPIO_PINS(60); -+DECLARE_MSM_GPIO_PINS(61); -+DECLARE_MSM_GPIO_PINS(62); -+DECLARE_MSM_GPIO_PINS(63); -+DECLARE_MSM_GPIO_PINS(64); -+DECLARE_MSM_GPIO_PINS(65); -+DECLARE_MSM_GPIO_PINS(66); -+DECLARE_MSM_GPIO_PINS(67); -+DECLARE_MSM_GPIO_PINS(68); -+DECLARE_MSM_GPIO_PINS(69); -+DECLARE_MSM_GPIO_PINS(70); -+DECLARE_MSM_GPIO_PINS(71); -+DECLARE_MSM_GPIO_PINS(72); -+DECLARE_MSM_GPIO_PINS(73); -+DECLARE_MSM_GPIO_PINS(74); -+DECLARE_MSM_GPIO_PINS(75); -+DECLARE_MSM_GPIO_PINS(76); -+DECLARE_MSM_GPIO_PINS(77); -+DECLARE_MSM_GPIO_PINS(78); -+DECLARE_MSM_GPIO_PINS(79); -+ -+enum ipq6018_functions { -+ msm_mux_atest_char, -+ msm_mux_atest_char0, -+ msm_mux_atest_char1, -+ -+ msm_mux_atest_char3, -+ msm_mux_audio0, -+ msm_mux_audio1, -+ msm_mux_audio2, -+ msm_mux_audio3, -+ msm_mux_audio_rxbclk, -+ msm_mux_audio_rxfsync, -+ msm_mux_audio_rxmclk, -+ msm_mux_audio_rxmclkin, -+ msm_mux_audio_txbclk, -+ msm_mux_audio_txfsync, -+ msm_mux_audio_txmclk, -+ msm_mux_audio_txmclkin, -+ msm_mux_blsp0_i2c, -+ msm_mux_blsp0_spi, -+ msm_mux_blsp0_uart, -+ msm_mux_blsp1_i2c, -+ msm_mux_blsp1_spi, -+ msm_mux_blsp1_uart, -+ msm_mux_blsp2_i2c, -+ msm_mux_blsp2_spi, -+ msm_mux_blsp2_uart, -+ msm_mux_blsp3_i2c, -+ msm_mux_blsp3_spi, -+ msm_mux_blsp3_uart, -+ msm_mux_blsp4_i2c, -+ msm_mux_blsp4_spi, -+ msm_mux_blsp4_uart, -+ msm_mux_blsp5_i2c, -+ msm_mux_blsp5_uart, -+ msm_mux_burn0, -+ msm_mux_burn1, -+ msm_mux_cri_trng, -+ msm_mux_cri_trng0, -+ msm_mux_cri_trng1, -+ msm_mux_cxc0, -+ msm_mux_cxc1, -+ msm_mux_dbg_out, -+ msm_mux_gcc_plltest, -+ msm_mux_gcc_tlmm, -+ msm_mux_gpio, -+ msm_mux_lpass_aud, -+ msm_mux_lpass_aud0, -+ msm_mux_lpass_aud1, -+ msm_mux_lpass_aud2, -+ msm_mux_lpass_pcm, -+ msm_mux_lpass_pdm, -+ msm_mux_mac00, -+ msm_mux_mac01, -+ msm_mux_mac10, -+ msm_mux_mac11, -+ msm_mux_mac12, -+ msm_mux_mac13, -+ msm_mux_mac20, -+ msm_mux_mac21, -+ msm_mux_mdc, -+ msm_mux_mdio, -+ msm_mux_pcie0_clk, -+ msm_mux_pcie0_rst, -+ msm_mux_pcie0_wake, -+ msm_mux_prng_rosc, -+ msm_mux_pta1_0, -+ msm_mux_pta1_1, -+ msm_mux_pta1_2, -+ msm_mux_pta2_0, -+ msm_mux_pta2_1, -+ msm_mux_pta2_2, -+ msm_mux_pwm00, -+ msm_mux_pwm01, -+ msm_mux_pwm02, -+ msm_mux_pwm03, -+ msm_mux_pwm04, -+ msm_mux_pwm10, -+ msm_mux_pwm11, -+ msm_mux_pwm12, -+ msm_mux_pwm13, -+ msm_mux_pwm14, -+ -+ msm_mux_pwm21, -+ msm_mux_pwm22, -+ msm_mux_pwm23, -+ msm_mux_pwm24, -+ msm_mux_pwm30, -+ msm_mux_pwm31, -+ msm_mux_pwm32, -+ msm_mux_pwm33, -+ msm_mux_qdss_cti_trig_in_a0, -+ msm_mux_qdss_cti_trig_in_a1, -+ msm_mux_qdss_cti_trig_out_a0, -+ msm_mux_qdss_cti_trig_out_a1, -+ msm_mux_qdss_cti_trig_in_b0, -+ msm_mux_qdss_cti_trig_in_b1, -+ msm_mux_qdss_cti_trig_out_b0, -+ msm_mux_qdss_cti_trig_out_b1, -+ msm_mux_qdss_traceclk_a, -+ msm_mux_qdss_tracectl_a, -+ msm_mux_qdss_tracedata_a, -+ msm_mux_qdss_traceclk_b, -+ msm_mux_qdss_tracectl_b, -+ msm_mux_qdss_tracedata_b, -+ msm_mux_qpic_pad, -+ msm_mux_rx0, -+ msm_mux_rx1, -+ msm_mux_rx_swrm, -+ msm_mux_rx_swrm0, -+ msm_mux_rx_swrm1, -+ msm_mux_sd_card, -+ msm_mux_sd_write, -+ msm_mux_tsens_max, -+ msm_mux_tx_swrm, -+ msm_mux_tx_swrm0, -+ msm_mux_tx_swrm1, -+ msm_mux_tx_swrm2, -+ msm_mux_wci20, -+ msm_mux_wci21, -+ msm_mux_wci22, -+ msm_mux_wci23, -+ msm_mux_wsa_swrm, -+ msm_mux__, -+}; -+ -+static const char * const blsp3_uart_groups[] = { -+ "gpio73", "gpio74", "gpio75", "gpio76", -+}; -+ -+static const char * const blsp3_i2c_groups[] = { -+ "gpio73", "gpio74", -+}; -+ -+static const char * const blsp3_spi_groups[] = { -+ "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", "gpio78", "gpio79", -+}; -+ -+static const char * const wci20_groups[] = { -+ "gpio0", "gpio2", -+}; -+ -+static const char * const qpic_pad_groups[] = { -+ "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio9", "gpio10", -+ "gpio11", "gpio17", "gpio15", "gpio12", "gpio13", "gpio14", "gpio5", -+ "gpio6", "gpio7", "gpio8", -+}; -+ -+static const char * const burn0_groups[] = { -+ "gpio0", -+}; -+ -+static const char * const mac12_groups[] = { -+ "gpio1", "gpio11", -+}; -+ -+static const char * const qdss_tracectl_b_groups[] = { -+ "gpio1", -+}; -+ -+static const char * const burn1_groups[] = { -+ "gpio1", -+}; -+ -+static const char * const qdss_traceclk_b_groups[] = { -+ "gpio0", -+}; -+ -+static const char * const qdss_tracedata_b_groups[] = { -+ "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", -+ "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", -+ "gpio17", -+}; -+ -+static const char * const mac01_groups[] = { -+ "gpio3", "gpio4", -+}; -+ -+static const char * const mac21_groups[] = { -+ "gpio5", "gpio6", -+}; -+ -+static const char * const atest_char_groups[] = { -+ "gpio9", -+}; -+ -+static const char * const cxc0_groups[] = { -+ "gpio9", "gpio16", -+}; -+ -+static const char * const mac13_groups[] = { -+ "gpio9", "gpio16", -+}; -+ -+static const char * const dbg_out_groups[] = { -+ "gpio9", -+}; -+ -+static const char * const wci22_groups[] = { -+ "gpio11", "gpio17", -+}; -+ -+static const char * const pwm00_groups[] = { -+ "gpio18", -+}; -+ -+static const char * const atest_char0_groups[] = { -+ "gpio18", -+}; -+ -+static const char * const wci23_groups[] = { -+ "gpio18", "gpio19", -+}; -+ -+static const char * const mac11_groups[] = { -+ "gpio18", "gpio19", -+}; -+ -+static const char * const pwm10_groups[] = { -+ "gpio19", -+}; -+ -+static const char * const atest_char1_groups[] = { -+ "gpio19", -+}; -+ -+static const char * const pwm30_groups[] = { -+ "gpio21", -+}; -+ -+static const char * const atest_char3_groups[] = { -+ "gpio21", -+}; -+ -+static const char * const audio_txmclk_groups[] = { -+ "gpio22", -+}; -+ -+static const char * const audio_txmclkin_groups[] = { -+ "gpio22", -+}; -+ -+static const char * const pwm02_groups[] = { -+ "gpio22", -+}; -+ -+static const char * const tx_swrm0_groups[] = { -+ "gpio22", -+}; -+ -+static const char * const qdss_cti_trig_out_b0_groups[] = { -+ "gpio22", -+}; -+ -+static const char * const audio_txbclk_groups[] = { -+ "gpio23", -+}; -+ -+static const char * const pwm12_groups[] = { -+ "gpio23", -+}; -+ -+static const char * const wsa_swrm_groups[] = { -+ "gpio23", "gpio24", -+}; -+ -+static const char * const tx_swrm1_groups[] = { -+ "gpio23", -+}; -+ -+static const char * const qdss_cti_trig_in_b0_groups[] = { -+ "gpio23", -+}; -+ -+static const char * const audio_txfsync_groups[] = { -+ "gpio24", -+}; -+ -+static const char * const pwm22_groups[] = { -+ "gpio24", -+}; -+ -+static const char * const tx_swrm2_groups[] = { -+ "gpio24", -+}; -+ -+static const char * const qdss_cti_trig_out_b1_groups[] = { -+ "gpio24", -+}; -+ -+static const char * const audio0_groups[] = { -+ "gpio25", "gpio32", -+}; -+ -+static const char * const pwm32_groups[] = { -+ "gpio25", -+}; -+ -+static const char * const tx_swrm_groups[] = { -+ "gpio25", -+}; -+ -+static const char * const qdss_cti_trig_in_b1_groups[] = { -+ "gpio25", -+}; -+ -+static const char * const audio1_groups[] = { -+ "gpio26", "gpio33", -+}; -+ -+static const char * const pwm04_groups[] = { -+ "gpio26", -+}; -+ -+static const char * const audio2_groups[] = { -+ "gpio27", -+}; -+ -+static const char * const pwm14_groups[] = { -+ "gpio27", -+}; -+ -+static const char * const audio3_groups[] = { -+ "gpio28", -+}; -+ -+static const char * const pwm24_groups[] = { -+ "gpio28", -+}; -+ -+static const char * const audio_rxmclk_groups[] = { -+ "gpio29", -+}; -+ -+static const char * const audio_rxmclkin_groups[] = { -+ "gpio29", -+}; -+ -+static const char * const pwm03_groups[] = { -+ "gpio29", -+}; -+ -+static const char * const lpass_pdm_groups[] = { -+ "gpio29", "gpio30", "gpio31", "gpio32", -+}; -+ -+static const char * const lpass_aud_groups[] = { -+ "gpio29", -+}; -+ -+static const char * const qdss_cti_trig_in_a1_groups[] = { -+ "gpio29", -+}; -+ -+static const char * const audio_rxbclk_groups[] = { -+ "gpio30", -+}; -+ -+static const char * const pwm13_groups[] = { -+ "gpio30", -+}; -+ -+static const char * const lpass_aud0_groups[] = { -+ "gpio30", -+}; -+ -+static const char * const rx_swrm_groups[] = { -+ "gpio30", -+}; -+ -+static const char * const qdss_cti_trig_out_a1_groups[] = { -+ "gpio30", -+}; -+ -+static const char * const audio_rxfsync_groups[] = { -+ "gpio31", -+}; -+ -+static const char * const pwm23_groups[] = { -+ "gpio31", -+}; -+ -+static const char * const lpass_aud1_groups[] = { -+ "gpio31", -+}; -+ -+static const char * const rx_swrm0_groups[] = { -+ "gpio31", -+}; -+ -+static const char * const qdss_cti_trig_in_a0_groups[] = { -+ "gpio31", -+}; -+ -+static const char * const pwm33_groups[] = { -+ "gpio32", -+}; -+ -+static const char * const lpass_aud2_groups[] = { -+ "gpio32", -+}; -+ -+static const char * const rx_swrm1_groups[] = { -+ "gpio32", -+}; -+ -+static const char * const qdss_cti_trig_out_a0_groups[] = { -+ "gpio32", -+}; -+ -+static const char * const lpass_pcm_groups[] = { -+ "gpio34", "gpio35", "gpio36", "gpio37", -+}; -+ -+static const char * const mac10_groups[] = { -+ "gpio34", "gpio35", -+}; -+ -+static const char * const mac00_groups[] = { -+ "gpio34", "gpio35", -+}; -+ -+static const char * const mac20_groups[] = { -+ "gpio36", "gpio37", -+}; -+ -+static const char * const blsp0_uart_groups[] = { -+ "gpio38", "gpio39", "gpio40", "gpio41", -+}; -+ -+static const char * const blsp0_i2c_groups[] = { -+ "gpio38", "gpio39", -+}; -+ -+static const char * const blsp0_spi_groups[] = { -+ "gpio38", "gpio39", "gpio40", "gpio41", -+}; -+ -+static const char * const blsp2_uart_groups[] = { -+ "gpio42", "gpio43", "gpio44", "gpio45", -+}; -+ -+static const char * const blsp2_i2c_groups[] = { -+ "gpio42", "gpio43", -+}; -+ -+static const char * const blsp2_spi_groups[] = { -+ "gpio42", "gpio43", "gpio44", "gpio45", -+}; -+ -+static const char * const blsp5_i2c_groups[] = { -+ "gpio46", "gpio47", -+}; -+ -+static const char * const blsp5_uart_groups[] = { -+ "gpio48", "gpio49", -+}; -+ -+static const char * const qdss_traceclk_a_groups[] = { -+ "gpio48", -+}; -+ -+static const char * const qdss_tracectl_a_groups[] = { -+ "gpio49", -+}; -+ -+static const char * const pwm01_groups[] = { -+ "gpio50", -+}; -+ -+static const char * const pta1_1_groups[] = { -+ "gpio51", -+}; -+ -+static const char * const pwm11_groups[] = { -+ "gpio51", -+}; -+ -+static const char * const rx1_groups[] = { -+ "gpio51", -+}; -+ -+static const char * const pta1_2_groups[] = { -+ "gpio52", -+}; -+ -+static const char * const pwm21_groups[] = { -+ "gpio52", -+}; -+ -+static const char * const pta1_0_groups[] = { -+ "gpio53", -+}; -+ -+static const char * const pwm31_groups[] = { -+ "gpio53", -+}; -+ -+static const char * const prng_rosc_groups[] = { -+ "gpio53", -+}; -+ -+static const char * const blsp4_uart_groups[] = { -+ "gpio55", "gpio56", "gpio57", "gpio58", -+}; -+ -+static const char * const blsp4_i2c_groups[] = { -+ "gpio55", "gpio56", -+}; -+ -+static const char * const blsp4_spi_groups[] = { -+ "gpio55", "gpio56", "gpio57", "gpio58", -+}; -+ -+static const char * const pcie0_clk_groups[] = { -+ "gpio59", -+}; -+ -+static const char * const cri_trng0_groups[] = { -+ "gpio59", -+}; -+ -+static const char * const pcie0_rst_groups[] = { -+ "gpio60", -+}; -+ -+static const char * const cri_trng1_groups[] = { -+ "gpio60", -+}; -+ -+static const char * const pcie0_wake_groups[] = { -+ "gpio61", -+}; -+ -+static const char * const cri_trng_groups[] = { -+ "gpio61", -+}; -+ -+static const char * const sd_card_groups[] = { -+ "gpio62", -+}; -+ -+static const char * const sd_write_groups[] = { -+ "gpio63", -+}; -+ -+static const char * const rx0_groups[] = { -+ "gpio63", -+}; -+ -+static const char * const tsens_max_groups[] = { -+ "gpio63", -+}; -+ -+static const char * const mdc_groups[] = { -+ "gpio64", -+}; -+ -+static const char * const qdss_tracedata_a_groups[] = { -+ "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70", -+ "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", -+ "gpio78", "gpio79", -+}; -+ -+static const char * const mdio_groups[] = { -+ "gpio65", -+}; -+ -+static const char * const pta2_0_groups[] = { -+ "gpio66", -+}; -+ -+static const char * const wci21_groups[] = { -+ "gpio66", "gpio68", -+}; -+ -+static const char * const cxc1_groups[] = { -+ "gpio66", "gpio68", -+}; -+ -+static const char * const pta2_1_groups[] = { -+ "gpio67", -+}; -+ -+static const char * const pta2_2_groups[] = { -+ "gpio68", -+}; -+ -+static const char * const blsp1_uart_groups[] = { -+ "gpio69", "gpio70", "gpio71", "gpio72", -+}; -+ -+static const char * const blsp1_i2c_groups[] = { -+ "gpio69", "gpio70", -+}; -+ -+static const char * const blsp1_spi_groups[] = { -+ "gpio69", "gpio70", "gpio71", "gpio72", -+}; -+ -+static const char * const gcc_plltest_groups[] = { -+ "gpio69", "gpio71", -+}; -+ -+static const char * const gcc_tlmm_groups[] = { -+ "gpio70", -+}; -+ -+static const char * const gpio_groups[] = { -+ "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", -+ "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", -+ "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio21", -+ "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", -+ "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", -+ "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", -+ "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49", -+ "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", -+ "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", -+ "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70", -+ "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", -+ "gpio78", "gpio79", -+}; -+ -+static const struct pinfunction ipq6018_functions[] = { -+ MSM_PIN_FUNCTION(atest_char), -+ MSM_PIN_FUNCTION(atest_char0), -+ MSM_PIN_FUNCTION(atest_char1), -+ -+ MSM_PIN_FUNCTION(atest_char3), -+ MSM_PIN_FUNCTION(audio0), -+ MSM_PIN_FUNCTION(audio1), -+ MSM_PIN_FUNCTION(audio2), -+ MSM_PIN_FUNCTION(audio3), -+ MSM_PIN_FUNCTION(audio_rxbclk), -+ MSM_PIN_FUNCTION(audio_rxfsync), -+ MSM_PIN_FUNCTION(audio_rxmclk), -+ MSM_PIN_FUNCTION(audio_rxmclkin), -+ MSM_PIN_FUNCTION(audio_txbclk), -+ MSM_PIN_FUNCTION(audio_txfsync), -+ MSM_PIN_FUNCTION(audio_txmclk), -+ MSM_PIN_FUNCTION(audio_txmclkin), -+ MSM_PIN_FUNCTION(blsp0_i2c), -+ MSM_PIN_FUNCTION(blsp0_spi), -+ MSM_PIN_FUNCTION(blsp0_uart), -+ MSM_PIN_FUNCTION(blsp1_i2c), -+ MSM_PIN_FUNCTION(blsp1_spi), -+ MSM_PIN_FUNCTION(blsp1_uart), -+ MSM_PIN_FUNCTION(blsp2_i2c), -+ MSM_PIN_FUNCTION(blsp2_spi), -+ MSM_PIN_FUNCTION(blsp2_uart), -+ MSM_PIN_FUNCTION(blsp3_i2c), -+ MSM_PIN_FUNCTION(blsp3_spi), -+ MSM_PIN_FUNCTION(blsp3_uart), -+ MSM_PIN_FUNCTION(blsp4_i2c), -+ MSM_PIN_FUNCTION(blsp4_spi), -+ MSM_PIN_FUNCTION(blsp4_uart), -+ MSM_PIN_FUNCTION(blsp5_i2c), -+ MSM_PIN_FUNCTION(blsp5_uart), -+ MSM_PIN_FUNCTION(burn0), -+ MSM_PIN_FUNCTION(burn1), -+ MSM_PIN_FUNCTION(cri_trng), -+ MSM_PIN_FUNCTION(cri_trng0), -+ MSM_PIN_FUNCTION(cri_trng1), -+ MSM_PIN_FUNCTION(cxc0), -+ MSM_PIN_FUNCTION(cxc1), -+ MSM_PIN_FUNCTION(dbg_out), -+ MSM_PIN_FUNCTION(gcc_plltest), -+ MSM_PIN_FUNCTION(gcc_tlmm), -+ MSM_PIN_FUNCTION(gpio), -+ MSM_PIN_FUNCTION(lpass_aud), -+ MSM_PIN_FUNCTION(lpass_aud0), -+ MSM_PIN_FUNCTION(lpass_aud1), -+ MSM_PIN_FUNCTION(lpass_aud2), -+ MSM_PIN_FUNCTION(lpass_pcm), -+ MSM_PIN_FUNCTION(lpass_pdm), -+ MSM_PIN_FUNCTION(mac00), -+ MSM_PIN_FUNCTION(mac01), -+ MSM_PIN_FUNCTION(mac10), -+ MSM_PIN_FUNCTION(mac11), -+ MSM_PIN_FUNCTION(mac12), -+ MSM_PIN_FUNCTION(mac13), -+ MSM_PIN_FUNCTION(mac20), -+ MSM_PIN_FUNCTION(mac21), -+ MSM_PIN_FUNCTION(mdc), -+ MSM_PIN_FUNCTION(mdio), -+ MSM_PIN_FUNCTION(pcie0_clk), -+ MSM_PIN_FUNCTION(pcie0_rst), -+ MSM_PIN_FUNCTION(pcie0_wake), -+ MSM_PIN_FUNCTION(prng_rosc), -+ MSM_PIN_FUNCTION(pta1_0), -+ MSM_PIN_FUNCTION(pta1_1), -+ MSM_PIN_FUNCTION(pta1_2), -+ MSM_PIN_FUNCTION(pta2_0), -+ MSM_PIN_FUNCTION(pta2_1), -+ MSM_PIN_FUNCTION(pta2_2), -+ MSM_PIN_FUNCTION(pwm00), -+ MSM_PIN_FUNCTION(pwm01), -+ MSM_PIN_FUNCTION(pwm02), -+ MSM_PIN_FUNCTION(pwm03), -+ MSM_PIN_FUNCTION(pwm04), -+ MSM_PIN_FUNCTION(pwm10), -+ MSM_PIN_FUNCTION(pwm11), -+ MSM_PIN_FUNCTION(pwm12), -+ MSM_PIN_FUNCTION(pwm13), -+ MSM_PIN_FUNCTION(pwm14), -+ -+ MSM_PIN_FUNCTION(pwm21), -+ MSM_PIN_FUNCTION(pwm22), -+ MSM_PIN_FUNCTION(pwm23), -+ MSM_PIN_FUNCTION(pwm24), -+ MSM_PIN_FUNCTION(pwm30), -+ MSM_PIN_FUNCTION(pwm31), -+ MSM_PIN_FUNCTION(pwm32), -+ MSM_PIN_FUNCTION(pwm33), -+ MSM_PIN_FUNCTION(qdss_cti_trig_in_a0), -+ MSM_PIN_FUNCTION(qdss_cti_trig_in_a1), -+ MSM_PIN_FUNCTION(qdss_cti_trig_out_a0), -+ MSM_PIN_FUNCTION(qdss_cti_trig_out_a1), -+ MSM_PIN_FUNCTION(qdss_cti_trig_in_b0), -+ MSM_PIN_FUNCTION(qdss_cti_trig_in_b1), -+ MSM_PIN_FUNCTION(qdss_cti_trig_out_b0), -+ MSM_PIN_FUNCTION(qdss_cti_trig_out_b1), -+ MSM_PIN_FUNCTION(qdss_traceclk_a), -+ MSM_PIN_FUNCTION(qdss_tracectl_a), -+ MSM_PIN_FUNCTION(qdss_tracedata_a), -+ MSM_PIN_FUNCTION(qdss_traceclk_b), -+ MSM_PIN_FUNCTION(qdss_tracectl_b), -+ MSM_PIN_FUNCTION(qdss_tracedata_b), -+ MSM_PIN_FUNCTION(qpic_pad), -+ MSM_PIN_FUNCTION(rx0), -+ MSM_PIN_FUNCTION(rx1), -+ MSM_PIN_FUNCTION(rx_swrm), -+ MSM_PIN_FUNCTION(rx_swrm0), -+ MSM_PIN_FUNCTION(rx_swrm1), -+ MSM_PIN_FUNCTION(sd_card), -+ MSM_PIN_FUNCTION(sd_write), -+ MSM_PIN_FUNCTION(tsens_max), -+ MSM_PIN_FUNCTION(tx_swrm), -+ MSM_PIN_FUNCTION(tx_swrm0), -+ MSM_PIN_FUNCTION(tx_swrm1), -+ MSM_PIN_FUNCTION(tx_swrm2), -+ MSM_PIN_FUNCTION(wci20), -+ MSM_PIN_FUNCTION(wci21), -+ MSM_PIN_FUNCTION(wci22), -+ MSM_PIN_FUNCTION(wci23), -+ MSM_PIN_FUNCTION(wsa_swrm), -+}; -+ -+static const struct msm_pingroup ipq6018_groups[] = { -+ PINGROUP(0, qpic_pad, wci20, qdss_traceclk_b, _, burn0, _, _, _, _), -+ PINGROUP(1, qpic_pad, mac12, qdss_tracectl_b, _, burn1, _, _, _, _), -+ PINGROUP(2, qpic_pad, wci20, qdss_tracedata_b, _, _, _, _, _, _), -+ PINGROUP(3, qpic_pad, mac01, qdss_tracedata_b, _, _, _, _, _, _), -+ PINGROUP(4, qpic_pad, mac01, qdss_tracedata_b, _, _, _, _, _, _), -+ PINGROUP(5, qpic_pad, mac21, qdss_tracedata_b, _, _, _, _, _, _), -+ PINGROUP(6, qpic_pad, mac21, qdss_tracedata_b, _, _, _, _, _, _), -+ PINGROUP(7, qpic_pad, qdss_tracedata_b, _, _, _, _, _, _, _), -+ PINGROUP(8, qpic_pad, qdss_tracedata_b, _, _, _, _, _, _, _), -+ PINGROUP(9, qpic_pad, atest_char, cxc0, mac13, dbg_out, qdss_tracedata_b, _, _, _), -+ PINGROUP(10, qpic_pad, qdss_tracedata_b, _, _, _, _, _, _, _), -+ PINGROUP(11, qpic_pad, wci22, mac12, qdss_tracedata_b, _, _, _, _, _), -+ PINGROUP(12, qpic_pad, qdss_tracedata_b, _, _, _, _, _, _, _), -+ PINGROUP(13, qpic_pad, qdss_tracedata_b, _, _, _, _, _, _, _), -+ PINGROUP(14, qpic_pad, qdss_tracedata_b, _, _, _, _, _, _, _), -+ PINGROUP(15, qpic_pad, qdss_tracedata_b, _, _, _, _, _, _, _), -+ PINGROUP(16, qpic_pad, cxc0, mac13, qdss_tracedata_b, _, _, _, _, _), -+ PINGROUP(17, qpic_pad, qdss_tracedata_b, wci22, _, _, _, _, _, _), -+ PINGROUP(18, pwm00, atest_char0, wci23, mac11, _, _, _, _, _), -+ PINGROUP(19, pwm10, atest_char1, wci23, mac11, _, _, _, _, _), -+ -+ PINGROUP(21, pwm30, atest_char3, _, _, _, _, _, _, _), -+ PINGROUP(22, audio_txmclk, audio_txmclkin, pwm02, tx_swrm0, _, qdss_cti_trig_out_b0, _, _, _), -+ PINGROUP(23, audio_txbclk, pwm12, wsa_swrm, tx_swrm1, _, qdss_cti_trig_in_b0, _, _, _), -+ PINGROUP(24, audio_txfsync, pwm22, wsa_swrm, tx_swrm2, _, qdss_cti_trig_out_b1, _, _, _), -+ PINGROUP(25, audio0, pwm32, tx_swrm, _, qdss_cti_trig_in_b1, _, _, _, _), -+ PINGROUP(26, audio1, pwm04, _, _, _, _, _, _, _), -+ PINGROUP(27, audio2, pwm14, _, _, _, _, _, _, _), -+ PINGROUP(28, audio3, pwm24, _, _, _, _, _, _, _), -+ PINGROUP(29, audio_rxmclk, audio_rxmclkin, pwm03, lpass_pdm, lpass_aud, qdss_cti_trig_in_a1, _, _, _), -+ PINGROUP(30, audio_rxbclk, pwm13, lpass_pdm, lpass_aud0, rx_swrm, _, qdss_cti_trig_out_a1, _, _), -+ PINGROUP(31, audio_rxfsync, pwm23, lpass_pdm, lpass_aud1, rx_swrm0, _, qdss_cti_trig_in_a0, _, _), -+ PINGROUP(32, audio0, pwm33, lpass_pdm, lpass_aud2, rx_swrm1, _, qdss_cti_trig_out_a0, _, _), -+ PINGROUP(33, audio1, _, _, _, _, _, _, _, _), -+ PINGROUP(34, lpass_pcm, mac10, mac00, _, _, _, _, _, _), -+ PINGROUP(35, lpass_pcm, mac10, mac00, _, _, _, _, _, _), -+ PINGROUP(36, lpass_pcm, mac20, _, _, _, _, _, _, _), -+ PINGROUP(37, lpass_pcm, mac20, _, _, _, _, _, _, _), -+ PINGROUP(38, blsp0_uart, blsp0_i2c, blsp0_spi, _, _, _, _, _, _), -+ PINGROUP(39, blsp0_uart, blsp0_i2c, blsp0_spi, _, _, _, _, _, _), -+ PINGROUP(40, blsp0_uart, blsp0_spi, _, _, _, _, _, _, _), -+ PINGROUP(41, blsp0_uart, blsp0_spi, _, _, _, _, _, _, _), -+ PINGROUP(42, blsp2_uart, blsp2_i2c, blsp2_spi, _, _, _, _, _, _), -+ PINGROUP(43, blsp2_uart, blsp2_i2c, blsp2_spi, _, _, _, _, _, _), -+ PINGROUP(44, blsp2_uart, blsp2_spi, _, _, _, _, _, _, _), -+ PINGROUP(45, blsp2_uart, blsp2_spi, _, _, _, _, _, _, _), -+ PINGROUP(46, blsp5_i2c, _, _, _, _, _, _, _, _), -+ PINGROUP(47, blsp5_i2c, _, _, _, _, _, _, _, _), -+ PINGROUP(48, blsp5_uart, _, qdss_traceclk_a, _, _, _, _, _, _), -+ PINGROUP(49, blsp5_uart, _, qdss_tracectl_a, _, _, _, _, _, _), -+ PINGROUP(50, pwm01, _, _, _, _, _, _, _, _), -+ PINGROUP(51, pta1_1, pwm11, _, rx1, _, _, _, _, _), -+ PINGROUP(52, pta1_2, pwm21, _, _, _, _, _, _, _), -+ PINGROUP(53, pta1_0, pwm31, prng_rosc, _, _, _, _, _, _), -+ PINGROUP(54, _, _, _, _, _, _, _, _, _), -+ PINGROUP(55, blsp4_uart, blsp4_i2c, blsp4_spi, _, _, _, _, _, _), -+ PINGROUP(56, blsp4_uart, blsp4_i2c, blsp4_spi, _, _, _, _, _, _), -+ PINGROUP(57, blsp4_uart, blsp4_spi, _, _, _, _, _, _, _), -+ PINGROUP(58, blsp4_uart, blsp4_spi, _, _, _, _, _, _, _), -+ PINGROUP(59, pcie0_clk, _, _, cri_trng0, _, _, _, _, _), -+ PINGROUP(60, pcie0_rst, _, _, cri_trng1, _, _, _, _, _), -+ PINGROUP(61, pcie0_wake, _, _, cri_trng, _, _, _, _, _), -+ PINGROUP(62, sd_card, _, _, _, _, _, _, _, _), -+ PINGROUP(63, sd_write, rx0, _, tsens_max, _, _, _, _, _), -+ PINGROUP(64, mdc, _, qdss_tracedata_a, _, _, _, _, _, _), -+ PINGROUP(65, mdio, _, qdss_tracedata_a, _, _, _, _, _, _), -+ PINGROUP(66, pta2_0, wci21, cxc1, qdss_tracedata_a, _, _, _, _, _), -+ PINGROUP(67, pta2_1, qdss_tracedata_a, _, _, _, _, _, _, _), -+ PINGROUP(68, pta2_2, wci21, cxc1, qdss_tracedata_a, _, _, _, _, _), -+ PINGROUP(69, blsp1_uart, blsp1_i2c, blsp1_spi, gcc_plltest, qdss_tracedata_a, _, _, _, _), -+ PINGROUP(70, blsp1_uart, blsp1_i2c, blsp1_spi, gcc_tlmm, qdss_tracedata_a, _, _, _, _), -+ PINGROUP(71, blsp1_uart, blsp1_spi, gcc_plltest, qdss_tracedata_a, _, _, _, _, _), -+ PINGROUP(72, blsp1_uart, blsp1_spi, qdss_tracedata_a, _, _, _, _, _, _), -+ PINGROUP(73, blsp3_uart, blsp3_i2c, blsp3_spi, _, qdss_tracedata_a, _, _, _, _), -+ PINGROUP(74, blsp3_uart, blsp3_i2c, blsp3_spi, _, qdss_tracedata_a, _, _, _, _), -+ PINGROUP(75, blsp3_uart, blsp3_spi, _, qdss_tracedata_a, _, _, _, _, _), -+ PINGROUP(76, blsp3_uart, blsp3_spi, _, qdss_tracedata_a, _, _, _, _, _), -+ PINGROUP(77, blsp3_spi, _, qdss_tracedata_a, _, _, _, _, _, _), -+ PINGROUP(78, blsp3_spi, _, qdss_tracedata_a, _, _, _, _, _, _), -+ PINGROUP(79, blsp3_spi, _, qdss_tracedata_a, _, _, _, _, _, _), -+}; -+ -+static const struct msm_pinctrl_soc_data ipq6018_pinctrl = { -+ .pins = ipq6018_pins, -+ .npins = ARRAY_SIZE(ipq6018_pins), -+ .functions = ipq6018_functions, -+ .nfunctions = ARRAY_SIZE(ipq6018_functions), -+ .groups = ipq6018_groups, -+ .ngroups = ARRAY_SIZE(ipq6018_groups), -+ .ngpios = 79, -+}; -+ -+static int ipq6018_pinctrl_probe(struct platform_device *pdev) -+{ -+ return msm_pinctrl_probe(pdev, &ipq6018_pinctrl); -+} -+ -+static const struct of_device_id ipq6018_pinctrl_of_match[] = { -+ { .compatible = "qcom,ipq6000-pinctrl", }, -+ { }, -+}; -+ -+static struct platform_driver ipq6018_pinctrl_driver = { -+ .driver = { -+ .name = "ipq6000-pinctrl", -+ .of_match_table = ipq6018_pinctrl_of_match, -+ }, -+ .probe = ipq6018_pinctrl_probe, -+ .remove = msm_pinctrl_remove, -+}; -+ -+static int __init ipq6018_pinctrl_init(void) -+{ -+ return platform_driver_register(&ipq6018_pinctrl_driver); -+} -+arch_initcall(ipq6018_pinctrl_init); -+ -+static void __exit ipq6018_pinctrl_exit(void) -+{ -+ platform_driver_unregister(&ipq6018_pinctrl_driver); -+} -+module_exit(ipq6018_pinctrl_exit); -+ -+MODULE_DESCRIPTION("QTI ipq6000 pinctrl driver"); -+MODULE_LICENSE("GPL v2"); -+MODULE_DEVICE_TABLE(of, ipq6018_pinctrl_of_match); diff --git a/target/linux/qualcommax/patches-6.6/2000-mtd-nand-add-ipq5018-nand-support.patch b/target/linux/qualcommax/patches-6.6/2000-mtd-nand-add-ipq5018-nand-support.patch deleted file mode 100644 index 8622509c4ee..00000000000 --- a/target/linux/qualcommax/patches-6.6/2000-mtd-nand-add-ipq5018-nand-support.patch +++ /dev/null @@ -1,419 +0,0 @@ -From 6ee246291159ce8fa235aa4412941413e073c779 Mon Sep 17 00:00:00 2001 -From: Shi JiaYang -Date: Sun, 4 Aug 2024 13:19:32 +0800 -Subject: mtd: nand: add ipq5018 nand support - ---- - drivers/mtd/nand/raw/qcom_nandc.c | 191 ++++++++++++++++++++++++++++-- - 1 file changed, 178 insertions(+), 13 deletions(-) - ---- a/drivers/mtd/nand/raw/qcom_nandc.c -+++ b/drivers/mtd/nand/raw/qcom_nandc.c -@@ -35,13 +35,22 @@ - #define NAND_DEV_CMD0 0xa0 - #define NAND_DEV_CMD1 0xa4 - #define NAND_DEV_CMD2 0xa8 -+#define NAND_DEV_CMD3 0xd0 -+#define NAND_DEV_CMD4 0xd4 -+#define NAND_DEV_CMD5 0xd8 -+#define NAND_DEV_CMD6 0xdc -+#define NAND_DEV_CMD7 0xb0 -+#define NAND_DEV_CMD8 0xb4 -+#define NAND_DEV_CMD9 0xb8 - #define NAND_DEV_CMD_VLD 0xac -+#define NAND_FLASH_SPI_CFG 0xc0 -+#define NAND_SPI_NUM_ADDR_CYCLES 0xc4 -+#define NAND_SPI_BUSY_CHECK_WAIT_CNT 0xc8 - #define SFLASHC_BURST_CFG 0xe0 - #define NAND_ERASED_CW_DETECT_CFG 0xe8 - #define NAND_ERASED_CW_DETECT_STATUS 0xec - #define NAND_EBI2_ECC_BUF_CFG 0xf0 - #define FLASH_BUF_ACC 0x100 -- - #define NAND_CTRL 0xf00 - #define NAND_VERSION 0xf08 - #define NAND_READ_LOCATION_0 0xf20 -@@ -52,6 +61,7 @@ - #define NAND_READ_LOCATION_LAST_CW_1 0xf44 - #define NAND_READ_LOCATION_LAST_CW_2 0xf48 - #define NAND_READ_LOCATION_LAST_CW_3 0xf4c -+#define NAND_QSPI_MSTR_CONFIG 0xf60 - - /* dummy register offsets, used by write_reg_dma */ - #define NAND_DEV_CMD1_RESTORE 0xdead -@@ -189,6 +199,28 @@ - #define ECC_BCH_4BIT BIT(2) - #define ECC_BCH_8BIT BIT(3) - -+/* QSPI NAND config reg bits */ -+#define LOAD_CLK_CNTR_INIT_EN (1 << 28) -+#define CLK_CNTR_INIT_VAL_VEC 0x924 -+#define FEA_STATUS_DEV_ADDR 0xc0 -+#define SPI_CFG (1 << 0) -+ -+/* CMD register value for qspi nand */ -+#define CMD0_VAL 0x1080D8D8 -+#define CMD1_VAL 0xF00F3000 -+#define CMD2_VAL 0xF0FF709F -+#define CMD3_VAL 0x3F310015 -+#define CMD7_VAL 0x04061F0F -+#define CMD_VLD_VAL 0xd -+#define SPI_NUM_ADDR 0xDA4DB -+#define WAIT_CNT 0x10 -+ -+/* QSPI NAND CMD reg bits value */ -+#define SPI_WP (1 << 28) -+#define SPI_HOLD (1 << 27) -+#define SPI_TRANSFER_MODE_x1 (1 << 29) -+#define SPI_TRANSFER_MODE_x4 (3 << 29) -+ - #define nandc_set_read_loc_first(chip, reg, cw_offset, read_size, is_last_read_loc) \ - nandc_set_reg(chip, reg, \ - ((cw_offset) << READ_LOCATION_OFFSET) | \ -@@ -336,6 +368,9 @@ struct nandc_regs { - __le32 read_location_last1; - __le32 read_location_last2; - __le32 read_location_last3; -+ __le32 spi_cfg; -+ __le32 num_addr_cycle; -+ __le32 busy_wait_cnt; - - __le32 erased_cw_detect_cfg_clr; - __le32 erased_cw_detect_cfg_set; -@@ -396,6 +431,7 @@ struct qcom_nand_controller { - - struct clk *core_clk; - struct clk *aon_clk; -+ struct clk *iomacro_clk; - - struct nandc_regs *regs; - struct bam_transaction *bam_txn; -@@ -439,6 +475,7 @@ struct qcom_nand_controller { - - u32 cmd1, vld; - bool exec_opwrite; -+ u32 hw_version; - }; - - /* -@@ -553,6 +590,7 @@ struct qcom_nand_host { - * @is_qpic - whether NAND CTRL is part of qpic IP - * @qpic_v2 - flag to indicate QPIC IP version 2 - * @use_codeword_fixup - whether NAND has different layout for boot partitions -+ * @is_serial_nand - QSPI nand flag, whether QPIC support serial nand or not - */ - struct qcom_nandc_props { - u32 ecc_modes; -@@ -561,6 +599,7 @@ struct qcom_nandc_props { - bool is_qpic; - bool qpic_v2; - bool use_codeword_fixup; -+ bool is_serial_nand; - }; - - /* Frees the BAM transaction memory */ -@@ -743,6 +782,12 @@ static __le32 *offset_to_nandc_reg(struc - return ®s->read_location_last2; - case NAND_READ_LOCATION_LAST_CW_3: - return ®s->read_location_last3; -+ case NAND_FLASH_SPI_CFG: -+ return ®s->spi_cfg; -+ case NAND_SPI_NUM_ADDR_CYCLES: -+ return ®s->num_addr_cycle; -+ case NAND_SPI_BUSY_CHECK_WAIT_CNT: -+ return ®s->busy_wait_cnt; - default: - return NULL; - } -@@ -814,13 +859,18 @@ static void update_rw_regs(struct qcom_n - u32 cmd, cfg0, cfg1, ecc_bch_cfg; - struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip); - -+ cmd = (PAGE_ACC | LAST_PAGE); -+ -+ if (nandc->props->is_serial_nand) -+ cmd |= (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD); -+ - if (read) { - if (host->use_ecc) -- cmd = OP_PAGE_READ_WITH_ECC | PAGE_ACC | LAST_PAGE; -+ cmd |= OP_PAGE_READ_WITH_ECC; - else -- cmd = OP_PAGE_READ | PAGE_ACC | LAST_PAGE; -+ cmd |= OP_PAGE_READ; - } else { -- cmd = OP_PROGRAM_PAGE | PAGE_ACC | LAST_PAGE; -+ cmd |= OP_PROGRAM_PAGE; - } - - if (host->use_ecc) { -@@ -2371,6 +2421,9 @@ static int qcom_nand_attach_chip(struct - int cwperpage, bad_block_byte, ret; - bool wide_bus; - int ecc_mode = 1; -+ int num_addr_cycle = 5, dsbl_sts_aftr_write = 0; -+ int wr_rd_bsy_gap = 2, recovery_cycle = 7; -+ u32 version_reg; - - /* controller only supports 512 bytes data steps */ - ecc->size = NANDC_STEP_SIZE; -@@ -2378,6 +2431,23 @@ static int qcom_nand_attach_chip(struct - cwperpage = mtd->writesize / NANDC_STEP_SIZE; - - /* -+ * Read the required ecc strength from NAND device and overwrite the -+ * device tree ecc strength -+ */ -+ if (chip->base.ecc.requirements.strength >= 8) -+ ecc->strength = 8; -+ -+ /* Read QPIC version register */ -+ version_reg = (NAND_VERSION + 0x4000); -+ nandc->hw_version = nandc_read(nandc, version_reg); -+ pr_info("QPIC controller hw version Major:%d, Minor:%d\n", -+ ((nandc->hw_version & NAND_VERSION_MAJOR_MASK) -+ >> NAND_VERSION_MAJOR_SHIFT), -+ ((nandc->hw_version & NAND_VERSION_MINOR_MASK) -+ >> NAND_VERSION_MINOR_SHIFT)); -+ nandc->hw_version = ((nandc->hw_version & NAND_VERSION_MAJOR_MASK) -+ >> NAND_VERSION_MAJOR_SHIFT); -+ /* - * Each CW has 4 available OOB bytes which will be protected with ECC - * so remaining bytes can be used for ECC. - */ -@@ -2485,33 +2555,43 @@ static int qcom_nand_attach_chip(struct - host->cw_size = host->cw_data + ecc->bytes; - bad_block_byte = mtd->writesize - host->cw_size * (cwperpage - 1) + 1; - -+ /* For QSPI serial nand QPIC config register value got changed -+ * so configure the new value for qspi serial nand -+ */ -+ if (nandc->props->is_serial_nand) { -+ num_addr_cycle = 3; -+ dsbl_sts_aftr_write = 1; -+ wr_rd_bsy_gap = 20; -+ recovery_cycle = 0; -+ } -+ - host->cfg0 = (cwperpage - 1) << CW_PER_PAGE - | host->cw_data << UD_SIZE_BYTES -- | 0 << DISABLE_STATUS_AFTER_WRITE -- | 5 << NUM_ADDR_CYCLES -+ | dsbl_sts_aftr_write << DISABLE_STATUS_AFTER_WRITE -+ | num_addr_cycle << NUM_ADDR_CYCLES - | host->ecc_bytes_hw << ECC_PARITY_SIZE_BYTES_RS - | 0 << STATUS_BFR_READ - | 1 << SET_RD_MODE_AFTER_STATUS - | host->spare_bytes << SPARE_SIZE_BYTES; - -- host->cfg1 = 7 << NAND_RECOVERY_CYCLES -+ host->cfg1 = recovery_cycle << NAND_RECOVERY_CYCLES - | 0 << CS_ACTIVE_BSY - | bad_block_byte << BAD_BLOCK_BYTE_NUM - | 0 << BAD_BLOCK_IN_SPARE_AREA -- | 2 << WR_RD_BSY_GAP -+ | wr_rd_bsy_gap << WR_RD_BSY_GAP - | wide_bus << WIDE_FLASH - | host->bch_enabled << ENABLE_BCH_ECC; - - host->cfg0_raw = (cwperpage - 1) << CW_PER_PAGE - | host->cw_size << UD_SIZE_BYTES -- | 5 << NUM_ADDR_CYCLES -+ | num_addr_cycle << NUM_ADDR_CYCLES - | 0 << SPARE_SIZE_BYTES; - -- host->cfg1_raw = 7 << NAND_RECOVERY_CYCLES -+ host->cfg1_raw = recovery_cycle << NAND_RECOVERY_CYCLES - | 0 << CS_ACTIVE_BSY - | 17 << BAD_BLOCK_BYTE_NUM - | 1 << BAD_BLOCK_IN_SPARE_AREA -- | 2 << WR_RD_BSY_GAP -+ | wr_rd_bsy_gap << WR_RD_BSY_GAP - | wide_bus << WIDE_FLASH - | 1 << DEV0_CFG1_ECC_DISABLE; - -@@ -2551,6 +2631,8 @@ static int qcom_op_cmd_mapping(struct na - switch (opcode) { - case NAND_CMD_RESET: - cmd = OP_RESET_DEVICE; -+ if (nandc->props->is_serial_nand) -+ cmd |= (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1); - break; - case NAND_CMD_READID: - cmd = OP_FETCH_ID; -@@ -2763,6 +2845,17 @@ static int qcom_read_id_type_exec(struct - clear_read_regs(nandc); - clear_bam_transaction(nandc); - -+ if (nandc->props->is_serial_nand) { -+ q_op.cmd_reg |= (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1); -+ /* For spi nand read 2-bytes id only -+ * else if nandc->buf_count == 4; then the id value -+ * will repeat and the SLC device will be detect as MLC. -+ * by nand base layer -+ * so overwrite the nandc->buf_count == 2; -+ */ -+ nandc->buf_count = 2; -+ } -+ - nandc_set_reg(chip, NAND_FLASH_CMD, q_op.cmd_reg); - nandc_set_reg(chip, NAND_ADDR0, q_op.addr1_reg); - nandc_set_reg(chip, NAND_ADDR1, q_op.addr2_reg); -@@ -2785,6 +2878,15 @@ static int qcom_read_id_type_exec(struct - instr = q_op.data_instr; - op_id = q_op.data_instr_idx; - len = nand_subop_get_data_len(subop, op_id); -+ if (nandc->props->is_serial_nand) { -+ /* For spi nand read 2-bytes id only -+ * else if nandc->buf_count == 4; then the id value -+ * will repeat and the SLC device will be detect as MLC. -+ * by nand base layer -+ * so overwrite the nandc->buf_count == 2; -+ */ -+ len = 2; -+ } - - nandc_read_buffer_sync(nandc, true); - memcpy(instr->ctx.data.buf.in, nandc->reg_read_buf, len); -@@ -2809,6 +2911,11 @@ static int qcom_misc_cmd_type_exec(struc - goto wait_rdy; - } else if (q_op.cmd_reg == OP_BLOCK_ERASE) { - q_op.cmd_reg |= PAGE_ACC | LAST_PAGE; -+ if (nandc->props->is_serial_nand) { -+ q_op.cmd_reg |= (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1); -+ q_op.addr2_reg = (q_op.addr1_reg >> 16) & 0xffff; -+ q_op.addr1_reg <<= 16; -+ } - nandc_set_reg(chip, NAND_ADDR0, q_op.addr1_reg); - nandc_set_reg(chip, NAND_ADDR1, q_op.addr2_reg); - nandc_set_reg(chip, NAND_DEV0_CFG0, -@@ -2859,7 +2966,7 @@ static int qcom_param_page_type_exec(str - unsigned int op_id = 0; - unsigned int len = 0; - int ret; -- -+ printk(KERN_INFO "%s:%d %d\n", __func__,__LINE__, nandc->props->is_serial_nand); - ret = qcom_parse_instructions(chip, subop, &q_op); - if (ret) - return ret; -@@ -3254,6 +3361,34 @@ static int qcom_nand_host_parse_boot_par - return 0; - } - -+static void qspi_nand_init(struct qcom_nand_controller *nandc) -+{ -+ u32 spi_cfg_val = 0x0; -+ u32 reg = 0x0; -+ -+ spi_cfg_val |= (LOAD_CLK_CNTR_INIT_EN | (CLK_CNTR_INIT_VAL_VEC << 16) -+ | (FEA_STATUS_DEV_ADDR << 8) | SPI_CFG); -+ -+ reg = dev_cmd_reg_addr(nandc, NAND_FLASH_SPI_CFG); -+ nandc_write(nandc, reg, 0); -+ nandc_write(nandc, reg, spi_cfg_val); -+ spi_cfg_val &= ~LOAD_CLK_CNTR_INIT_EN; -+ nandc_write(nandc, reg, spi_cfg_val); -+ -+ reg = dev_cmd_reg_addr(nandc, NAND_DEV_CMD0); -+ nandc_write(nandc, reg, CMD0_VAL); -+ nandc_write(nandc, reg + 4, CMD1_VAL); -+ nandc_write(nandc, reg + 8, CMD2_VAL); -+ nandc_write(nandc, reg + 12, CMD_VLD_VAL); -+ nandc_write(nandc, reg + 16, CMD7_VAL); -+ reg = dev_cmd_reg_addr(nandc, NAND_DEV_CMD3); -+ nandc_write(nandc, reg, CMD3_VAL); -+ -+ reg = dev_cmd_reg_addr(nandc, NAND_SPI_NUM_ADDR_CYCLES); -+ nandc_write(nandc, reg, SPI_NUM_ADDR); -+ nandc_write(nandc, reg + 4, WAIT_CNT); -+} -+ - static int qcom_nand_host_init_and_register(struct qcom_nand_controller *nandc, - struct qcom_nand_host *host, - struct device_node *dn) -@@ -3295,6 +3430,9 @@ static int qcom_nand_host_init_and_regis - /* set up initial status value */ - host->status = NAND_STATUS_READY | NAND_STATUS_WP; - -+ if (nandc->props->is_serial_nand) -+ qspi_nand_init(nandc); -+ - ret = nand_scan(chip, 1); - if (ret) - return ret; -@@ -3399,6 +3537,12 @@ static int qcom_nandc_probe(struct platf - if (IS_ERR(nandc->aon_clk)) - return PTR_ERR(nandc->aon_clk); - -+ if (nandc->props->is_serial_nand) { -+ nandc->iomacro_clk = devm_clk_get(dev, "io_macro"); -+ if (IS_ERR(nandc->iomacro_clk)) -+ return PTR_ERR(nandc->iomacro_clk); -+ } -+ - ret = qcom_nandc_parse_dt(pdev); - if (ret) - return ret; -@@ -3426,6 +3570,12 @@ static int qcom_nandc_probe(struct platf - if (ret) - goto err_nandc_alloc; - -+ if (nandc->props->is_serial_nand) { -+ ret = clk_prepare_enable(nandc->iomacro_clk); -+ if (ret) -+ goto err_setup; -+ } -+ - ret = qcom_nandc_setup(nandc); - if (ret) - goto err_setup; -@@ -3477,6 +3627,7 @@ static const struct qcom_nandc_props ipq - .is_bam = false, - .use_codeword_fixup = true, - .dev_cmd_reg_start = 0x0, -+ .is_serial_nand = false, - }; - - static const struct qcom_nandc_props ipq4019_nandc_props = { -@@ -3484,6 +3635,7 @@ static const struct qcom_nandc_props ipq - .is_bam = true, - .is_qpic = true, - .dev_cmd_reg_start = 0x0, -+ .is_serial_nand = false, - }; - - static const struct qcom_nandc_props ipq8074_nandc_props = { -@@ -3491,6 +3643,15 @@ static const struct qcom_nandc_props ipq - .is_bam = true, - .is_qpic = true, - .dev_cmd_reg_start = 0x7000, -+ .is_serial_nand = false, -+}; -+ -+static const struct qcom_nandc_props ipq5018_nandc_props = { -+ .ecc_modes = (ECC_BCH_4BIT | ECC_BCH_8BIT), -+ .is_bam = true, -+ .qpic_v2 = true, -+ .dev_cmd_reg_start = 0x7000, -+ .is_serial_nand = true, - }; - - static const struct qcom_nandc_props sdx55_nandc_props = { -@@ -3526,6 +3687,10 @@ static const struct of_device_id qcom_na - .compatible = "qcom,sdx55-nand", - .data = &sdx55_nandc_props, - }, -+ { -+ .compatible = "qcom,ipq5018-nand", -+ .data = &ipq5018_nandc_props, -+ }, - {} - }; - MODULE_DEVICE_TABLE(of, qcom_nandc_of_match); -@@ -3542,4 +3707,4 @@ module_platform_driver(qcom_nandc_driver - - MODULE_AUTHOR("Archit Taneja "); - MODULE_DESCRIPTION("Qualcomm NAND Controller driver"); --MODULE_LICENSE("GPL v2"); -+MODULE_LICENSE("GPL v2"); -\ No newline at end of file diff --git a/target/linux/qualcommax/patches-6.6/2001-mtd-nand-add-W25N01GWZEIG-support.patch b/target/linux/qualcommax/patches-6.6/2001-mtd-nand-add-W25N01GWZEIG-support.patch deleted file mode 100644 index 6d89092b3ba..00000000000 --- a/target/linux/qualcommax/patches-6.6/2001-mtd-nand-add-W25N01GWZEIG-support.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 6d096fe3fdb5c1665a1ded5382d3e9d0f6a77a1e Mon Sep 17 00:00:00 2001 -From: Shi JiaYang -Date: Sat, 3 Aug 2024 12:03:12 +0800 -Subject: [PATCH] mtd: nand: add W25N01GWZEIG support - ---- - drivers/mtd/nand/raw/nand_ids.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/drivers/mtd/nand/raw/nand_ids.c -+++ b/drivers/mtd/nand/raw/nand_ids.c -@@ -67,6 +67,9 @@ struct nand_flash_dev nand_flash_ids[] = - {"TH58NVG3S0HBAI4 8G 3.3V 8-bit", - { .id = {0x98, 0xd3, 0x91, 0x26, 0x76} }, - SZ_4K, SZ_1K, SZ_256K, 0, 5, 256, NAND_ECC_INFO(8, SZ_512)}, -+ {"W25N01GWZEIG SPI NAND 1G 1.8V", -+ { .id = {0xef, 0xba} }, -+ SZ_2K, SZ_128, SZ_128K, 0, 2, 64, NAND_ECC_INFO(4, SZ_512)}, - - LEGACY_ID_NAND("NAND 4MiB 5V 8-bit", 0x6B, 4, SZ_8K, SP_OPTIONS), - LEGACY_ID_NAND("NAND 4MiB 3,3V 8-bit", 0xE3, 4, SZ_8K, SP_OPTIONS), diff --git a/target/linux/qualcommax/patches-6.6/2002-dt-bindings-clock-qcom-gcc-ipq5018-remove-q6-clocks-.patch b/target/linux/qualcommax/patches-6.6/2002-dt-bindings-clock-qcom-gcc-ipq5018-remove-q6-clocks-.patch deleted file mode 100644 index 2560b096f4a..00000000000 --- a/target/linux/qualcommax/patches-6.6/2002-dt-bindings-clock-qcom-gcc-ipq5018-remove-q6-clocks-.patch +++ /dev/null @@ -1,59 +0,0 @@ -From e3cfd427b543c637c4db849c5f0dfcfbb2f15d77 Mon Sep 17 00:00:00 2001 -From: Manikanta Mylavarapu -Date: Mon, 22 May 2023 03:58:43 +0530 -Subject: dt-bindings: clock: qcom: gcc-ipq5018: remove q6 clocks macros - -Since Q6 firmware takes care of bring up clocks in multipd -model, remove bring up clock macros. - -Signed-off-by: Manikanta Mylavarapu ---- - include/dt-bindings/clock/qcom,gcc-ipq5018.h | 21 -------------------- - 1 file changed, 21 deletions(-) - ---- a/include/dt-bindings/clock/qcom,gcc-ipq5018.h -+++ b/include/dt-bindings/clock/qcom,gcc-ipq5018.h -@@ -74,15 +74,8 @@ - #define GCC_PCIE1_AXI_S_CLK 65 - #define GCC_PCIE1_PIPE_CLK 66 - #define GCC_PRNG_AHB_CLK 67 --#define GCC_Q6_AXIM_CLK 68 --#define GCC_Q6_AXIM2_CLK 69 --#define GCC_Q6_AXIS_CLK 70 --#define GCC_Q6_AHB_CLK 71 --#define GCC_Q6_AHB_S_CLK 72 - #define GCC_Q6_TSCTR_1TO2_CLK 73 - #define GCC_Q6SS_ATBM_CLK 74 --#define GCC_Q6SS_PCLKDBG_CLK 75 --#define GCC_Q6SS_TRIG_CLK 76 - #define GCC_QDSS_AT_CLK 77 - #define GCC_QDSS_CFG_AHB_CLK 78 - #define GCC_QDSS_DAP_AHB_CLK 79 -@@ -109,7 +102,6 @@ - #define GCC_SYS_NOC_PCIE1_AXI_CLK 100 - #define GCC_SYS_NOC_QDSS_STM_AXI_CLK 101 - #define GCC_SYS_NOC_USB0_AXI_CLK 102 --#define GCC_SYS_NOC_WCSS_AHB_CLK 103 - #define GCC_UBI0_AXI_CLK 104 - #define GCC_UBI0_CFG_CLK 105 - #define GCC_UBI0_CORE_CLK 106 -@@ -127,19 +119,6 @@ - #define GCC_USB0_MOCK_UTMI_CLK 118 - #define GCC_USB0_PHY_CFG_AHB_CLK 119 - #define GCC_USB0_SLEEP_CLK 120 --#define GCC_WCSS_ACMT_CLK 121 --#define GCC_WCSS_AHB_S_CLK 122 --#define GCC_WCSS_AXI_M_CLK 123 --#define GCC_WCSS_AXI_S_CLK 124 --#define GCC_WCSS_DBG_IFC_APB_BDG_CLK 125 --#define GCC_WCSS_DBG_IFC_APB_CLK 126 --#define GCC_WCSS_DBG_IFC_ATB_BDG_CLK 127 --#define GCC_WCSS_DBG_IFC_ATB_CLK 128 --#define GCC_WCSS_DBG_IFC_DAPBUS_BDG_CLK 129 --#define GCC_WCSS_DBG_IFC_DAPBUS_CLK 130 --#define GCC_WCSS_DBG_IFC_NTS_BDG_CLK 131 --#define GCC_WCSS_DBG_IFC_NTS_CLK 132 --#define GCC_WCSS_ECAHB_CLK 133 - #define GCC_XO_CLK 134 - #define GCC_XO_CLK_SRC 135 - #define GMAC0_RX_CLK_SRC 136 diff --git a/target/linux/qualcommax/patches-6.6/2003-clk-qcom-ipq5018-remove-q6-bring-up-clocks.patch b/target/linux/qualcommax/patches-6.6/2003-clk-qcom-ipq5018-remove-q6-bring-up-clocks.patch deleted file mode 100644 index e194293485e..00000000000 --- a/target/linux/qualcommax/patches-6.6/2003-clk-qcom-ipq5018-remove-q6-bring-up-clocks.patch +++ /dev/null @@ -1,471 +0,0 @@ -From a2f5ed0c2ed9f4dc61a25c3283f130d46a803674 Mon Sep 17 00:00:00 2001 -From: Manikanta Mylavarapu -Date: Mon, 22 May 2023 03:58:45 +0530 -Subject: clk: qcom: ipq5018: remove q6 bring up clocks - -Since Q6 firmware takes care of it's bring up clocks -in multipd model, remove from gcc driver. - -Signed-off-by: Manikanta Mylavarapu ---- - drivers/clk/qcom/gcc-ipq5018.c | 414 --------------------------------- - 1 file changed, 414 deletions(-) - ---- a/drivers/clk/qcom/gcc-ipq5018.c -+++ b/drivers/clk/qcom/gcc-ipq5018.c -@@ -2218,159 +2218,6 @@ static struct clk_branch gcc_prng_ahb_cl - }, - }; - --static struct clk_branch gcc_q6_ahb_clk = { -- .halt_reg = 0x59138, -- .clkr = { -- .enable_reg = 0x59138, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_q6_ahb_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &wcss_ahb_clk_src.clkr.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_q6_ahb_s_clk = { -- .halt_reg = 0x5914c, -- .clkr = { -- .enable_reg = 0x5914c, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_q6_ahb_s_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &wcss_ahb_clk_src.clkr.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_q6_axim_clk = { -- .halt_reg = 0x5913c, -- .clkr = { -- .enable_reg = 0x5913c, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_q6_axim_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &q6_axi_clk_src.clkr.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_q6_axim2_clk = { -- .halt_reg = 0x59150, -- .clkr = { -- .enable_reg = 0x59150, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_q6_axim2_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &q6_axi_clk_src.clkr.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_q6_axis_clk = { -- .halt_reg = 0x59154, -- .clkr = { -- .enable_reg = 0x59154, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_q6_axis_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &system_noc_clk_src.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_q6_tsctr_1to2_clk = { -- .halt_reg = 0x59148, -- .clkr = { -- .enable_reg = 0x59148, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_q6_tsctr_1to2_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &qdss_tsctr_div2_clk_src.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_q6ss_atbm_clk = { -- .halt_reg = 0x59144, -- .clkr = { -- .enable_reg = 0x59144, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_q6ss_atbm_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &qdss_at_clk_src.clkr.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_q6ss_pclkdbg_clk = { -- .halt_reg = 0x59140, -- .clkr = { -- .enable_reg = 0x59140, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_q6ss_pclkdbg_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &qdss_dap_sync_clk_src.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_q6ss_trig_clk = { -- .halt_reg = 0x59128, -- .clkr = { -- .enable_reg = 0x59128, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_q6ss_trig_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &qdss_dap_sync_clk_src.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- - static struct clk_branch gcc_qdss_at_clk = { - .halt_reg = 0x29024, - .clkr = { -@@ -2796,23 +2643,6 @@ static struct clk_branch gcc_sys_noc_usb - }, - }; - --static struct clk_branch gcc_sys_noc_wcss_ahb_clk = { -- .halt_reg = 0x26034, -- .clkr = { -- .enable_reg = 0x26034, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_sys_noc_wcss_ahb_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &wcss_ahb_clk_src.clkr.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- - static struct clk_branch gcc_ubi0_axi_clk = { - .halt_reg = 0x68200, - .halt_check = BRANCH_HALT_DELAY, -@@ -3127,227 +2957,6 @@ static struct clk_branch gcc_usb0_pipe_c - }, - }; - --static struct clk_branch gcc_wcss_acmt_clk = { -- .halt_reg = 0x59064, -- .clkr = { -- .enable_reg = 0x59064, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_wcss_acmt_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &wcss_ahb_clk_src.clkr.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_wcss_ahb_s_clk = { -- .halt_reg = 0x59034, -- .clkr = { -- .enable_reg = 0x59034, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_wcss_ahb_s_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &wcss_ahb_clk_src.clkr.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_wcss_axi_m_clk = { -- .halt_reg = 0x5903c, -- .clkr = { -- .enable_reg = 0x5903c, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_wcss_axi_m_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &system_noc_clk_src.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_wcss_axi_s_clk = { -- .halt_reg = 0x59068, -- .clkr = { -- .enable_reg = 0x59068, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_wi_s_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &system_noc_clk_src.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_wcss_dbg_ifc_apb_bdg_clk = { -- .halt_reg = 0x59050, -- .clkr = { -- .enable_reg = 0x59050, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_wcss_dbg_ifc_apb_bdg_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &qdss_dap_sync_clk_src.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_wcss_dbg_ifc_apb_clk = { -- .halt_reg = 0x59040, -- .clkr = { -- .enable_reg = 0x59040, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_wcss_dbg_ifc_apb_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &qdss_dap_sync_clk_src.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_wcss_dbg_ifc_atb_bdg_clk = { -- .halt_reg = 0x59054, -- .clkr = { -- .enable_reg = 0x59054, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_wcss_dbg_ifc_atb_bdg_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &qdss_at_clk_src.clkr.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_wcss_dbg_ifc_atb_clk = { -- .halt_reg = 0x59044, -- .clkr = { -- .enable_reg = 0x59044, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_wcss_dbg_ifc_atb_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &qdss_at_clk_src.clkr.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_wcss_dbg_ifc_dapbus_bdg_clk = { -- .halt_reg = 0x59060, -- .clkr = { -- .enable_reg = 0x59060, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_wcss_dbg_ifc_dapbus_bdg_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &qdss_dap_sync_clk_src.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_wcss_dbg_ifc_dapbus_clk = { -- .halt_reg = 0x5905c, -- .clkr = { -- .enable_reg = 0x5905c, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_wcss_dbg_ifc_dapbus_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &qdss_dap_sync_clk_src.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_wcss_dbg_ifc_nts_bdg_clk = { -- .halt_reg = 0x59058, -- .clkr = { -- .enable_reg = 0x59058, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_wcss_dbg_ifc_nts_bdg_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &qdss_tsctr_div2_clk_src.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_wcss_dbg_ifc_nts_clk = { -- .halt_reg = 0x59048, -- .clkr = { -- .enable_reg = 0x59048, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_wcss_dbg_ifc_nts_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &qdss_tsctr_div2_clk_src.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- --static struct clk_branch gcc_wcss_ecahb_clk = { -- .halt_reg = 0x59038, -- .clkr = { -- .enable_reg = 0x59038, -- .enable_mask = BIT(0), -- .hw.init = &(struct clk_init_data) { -- .name = "gcc_wcss_ecahb_clk", -- .parent_hws = (const struct clk_hw *[]) { -- &wcss_ahb_clk_src.clkr.hw, -- }, -- .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT, -- .ops = &clk_branch2_ops, -- }, -- }, --}; -- - static struct clk_hw *gcc_ipq5018_hws[] = { - &gpll0_out_main_div2.hw, - &pcnoc_clk_src.hw, -@@ -3437,15 +3046,6 @@ static struct clk_regmap *gcc_ipq5018_cl - [GCC_PCIE1_AXI_S_BRIDGE_CLK] = &gcc_pcie1_axi_s_bridge_clk.clkr, - [GCC_PCIE1_AXI_S_CLK] = &gcc_pcie1_axi_s_clk.clkr, - [GCC_PRNG_AHB_CLK] = &gcc_prng_ahb_clk.clkr, -- [GCC_Q6_AXIM_CLK] = &gcc_q6_axim_clk.clkr, -- [GCC_Q6_AXIM2_CLK] = &gcc_q6_axim2_clk.clkr, -- [GCC_Q6_AXIS_CLK] = &gcc_q6_axis_clk.clkr, -- [GCC_Q6_AHB_CLK] = &gcc_q6_ahb_clk.clkr, -- [GCC_Q6_AHB_S_CLK] = &gcc_q6_ahb_s_clk.clkr, -- [GCC_Q6_TSCTR_1TO2_CLK] = &gcc_q6_tsctr_1to2_clk.clkr, -- [GCC_Q6SS_ATBM_CLK] = &gcc_q6ss_atbm_clk.clkr, -- [GCC_Q6SS_PCLKDBG_CLK] = &gcc_q6ss_pclkdbg_clk.clkr, -- [GCC_Q6SS_TRIG_CLK] = &gcc_q6ss_trig_clk.clkr, - [GCC_QDSS_AT_CLK] = &gcc_qdss_at_clk.clkr, - [GCC_QDSS_CFG_AHB_CLK] = &gcc_qdss_cfg_ahb_clk.clkr, - [GCC_QDSS_DAP_AHB_CLK] = &gcc_qdss_dap_ahb_clk.clkr, -@@ -3472,7 +3072,6 @@ static struct clk_regmap *gcc_ipq5018_cl - [GCC_SYS_NOC_PCIE1_AXI_CLK] = &gcc_sys_noc_pcie1_axi_clk.clkr, - [GCC_SYS_NOC_QDSS_STM_AXI_CLK] = &gcc_sys_noc_qdss_stm_axi_clk.clkr, - [GCC_SYS_NOC_USB0_AXI_CLK] = &gcc_sys_noc_usb0_axi_clk.clkr, -- [GCC_SYS_NOC_WCSS_AHB_CLK] = &gcc_sys_noc_wcss_ahb_clk.clkr, - [GCC_UBI0_AXI_CLK] = &gcc_ubi0_axi_clk.clkr, - [GCC_UBI0_CFG_CLK] = &gcc_ubi0_cfg_clk.clkr, - [GCC_UBI0_CORE_CLK] = &gcc_ubi0_core_clk.clkr, -@@ -3490,19 +3089,6 @@ static struct clk_regmap *gcc_ipq5018_cl - [GCC_USB0_MOCK_UTMI_CLK] = &gcc_usb0_mock_utmi_clk.clkr, - [GCC_USB0_PHY_CFG_AHB_CLK] = &gcc_usb0_phy_cfg_ahb_clk.clkr, - [GCC_USB0_SLEEP_CLK] = &gcc_usb0_sleep_clk.clkr, -- [GCC_WCSS_ACMT_CLK] = &gcc_wcss_acmt_clk.clkr, -- [GCC_WCSS_AHB_S_CLK] = &gcc_wcss_ahb_s_clk.clkr, -- [GCC_WCSS_AXI_M_CLK] = &gcc_wcss_axi_m_clk.clkr, -- [GCC_WCSS_AXI_S_CLK] = &gcc_wcss_axi_s_clk.clkr, -- [GCC_WCSS_DBG_IFC_APB_BDG_CLK] = &gcc_wcss_dbg_ifc_apb_bdg_clk.clkr, -- [GCC_WCSS_DBG_IFC_APB_CLK] = &gcc_wcss_dbg_ifc_apb_clk.clkr, -- [GCC_WCSS_DBG_IFC_ATB_BDG_CLK] = &gcc_wcss_dbg_ifc_atb_bdg_clk.clkr, -- [GCC_WCSS_DBG_IFC_ATB_CLK] = &gcc_wcss_dbg_ifc_atb_clk.clkr, -- [GCC_WCSS_DBG_IFC_DAPBUS_BDG_CLK] = &gcc_wcss_dbg_ifc_dapbus_bdg_clk.clkr, -- [GCC_WCSS_DBG_IFC_DAPBUS_CLK] = &gcc_wcss_dbg_ifc_dapbus_clk.clkr, -- [GCC_WCSS_DBG_IFC_NTS_BDG_CLK] = &gcc_wcss_dbg_ifc_nts_bdg_clk.clkr, -- [GCC_WCSS_DBG_IFC_NTS_CLK] = &gcc_wcss_dbg_ifc_nts_clk.clkr, -- [GCC_WCSS_ECAHB_CLK] = &gcc_wcss_ecahb_clk.clkr, - [GCC_XO_CLK] = &gcc_xo_clk.clkr, - [GCC_XO_CLK_SRC] = &gcc_xo_clk_src.clkr, - [GMAC0_RX_CLK_SRC] = &gmac0_rx_clk_src.clkr, diff --git a/target/linux/qualcommax/patches-6.6/2004-firmware-qcom_scm-ipq5018-Add-WCSS-AHB-pd-support.patch b/target/linux/qualcommax/patches-6.6/2004-firmware-qcom_scm-ipq5018-Add-WCSS-AHB-pd-support.patch deleted file mode 100644 index b302763ef88..00000000000 --- a/target/linux/qualcommax/patches-6.6/2004-firmware-qcom_scm-ipq5018-Add-WCSS-AHB-pd-support.patch +++ /dev/null @@ -1,164 +0,0 @@ -From 55195802c5aa10652b5f4010bfae49562c1efaf0 Mon Sep 17 00:00:00 2001 -From: Manikanta Mylavarapu -Date: Mon, 22 May 2023 03:58:47 +0530 -Subject: firmware: qcom_scm: ipq5018: Add WCSS AHB pd support - -Add support to power up, down & load userpd firmware. - -Signed-off-by: Manikanta Mylavarapu ---- - drivers/firmware/qcom_scm.c | 114 +++++++++++++++++++++++++ - drivers/firmware/qcom_scm.h | 6 ++ - include/linux/firmware/qcom/qcom_scm.h | 3 + - 3 files changed, 123 insertions(+) - ---- a/drivers/firmware/qcom_scm.c -+++ b/drivers/firmware/qcom_scm.c -@@ -676,6 +676,120 @@ disable_clk: - EXPORT_SYMBOL_GPL(qcom_scm_pas_shutdown); - - /** -+ * qti_scm_int_radio_powerup - Bring up WCSS AHB userpd -+ * -+ * @peripheral: peripheral id -+ * -+ * Return 0 on success. -+ */ -+int qti_scm_int_radio_powerup(u32 peripheral) -+{ -+ int ret; -+ struct qcom_scm_desc desc = { -+ .svc = QCOM_SCM_PD_LOAD_SVC_ID, -+ .cmd = QCOM_SCM_INT_RAD_PWR_UP_CMD_ID, -+ .arginfo = QCOM_SCM_ARGS(1), -+ .args[0] = peripheral, -+ .owner = ARM_SMCCC_OWNER_SIP, -+ }; -+ struct qcom_scm_res res; -+ -+ ret = qcom_scm_clk_enable(); -+ if (ret) -+ return ret; -+ -+ ret = qcom_scm_bw_enable(); -+ if (ret) -+ return ret; -+ -+ ret = qcom_scm_call(__scm->dev, &desc, &res); -+ qcom_scm_bw_disable(); -+ qcom_scm_clk_disable(); -+ -+ return ret ? : res.result[0]; -+} -+EXPORT_SYMBOL(qti_scm_int_radio_powerup); -+ -+/** -+ * qti_scm_int_radio_powerdown() - Shut down WCSS AHB userpd -+ * -+ * @peripheral: peripheral id -+ * -+ * Returns 0 on success. -+ */ -+int qti_scm_int_radio_powerdown(u32 peripheral) -+{ -+ int ret; -+ struct qcom_scm_desc desc = { -+ .svc = QCOM_SCM_PD_LOAD_SVC_ID, -+ .cmd = QCOM_SCM_INT_RAD_PWR_DN_CMD_ID, -+ .arginfo = QCOM_SCM_ARGS(1), -+ .args[0] = peripheral, -+ .owner = ARM_SMCCC_OWNER_SIP, -+ }; -+ struct qcom_scm_res res; -+ -+ ret = qcom_scm_clk_enable(); -+ if (ret) -+ return ret; -+ -+ ret = qcom_scm_bw_enable(); -+ if (ret) -+ return ret; -+ -+ ret = qcom_scm_call(__scm->dev, &desc, &res); -+ qcom_scm_bw_disable(); -+ qcom_scm_clk_disable(); -+ -+ return ret ? : res.result[0]; -+} -+EXPORT_SYMBOL(qti_scm_int_radio_powerdown); -+ -+/** -+ * qti_scm_pdseg_memcpy_v2() - copy userpd PIL segments data to dma blocks -+ * -+ * @peripheral: peripheral id -+ * @phno: program header no -+ * @dma: handle of dma region -+ * @seg_cnt: no of dma blocks -+ * -+ * Returns 0 if trustzone successfully loads userpd PIL segments from dma -+ * blocks to DDR -+ */ -+int qti_scm_pdseg_memcpy_v2(u32 peripheral, int phno, dma_addr_t dma, -+ int seg_cnt) -+{ -+ int ret; -+ struct qcom_scm_desc desc = { -+ .svc = QCOM_SCM_PD_LOAD_SVC_ID, -+ .cmd = QCOM_SCM_PD_LOAD_V2_CMD_ID, -+ .arginfo = QCOM_SCM_ARGS(4, QCOM_SCM_VAL, QCOM_SCM_VAL, -+ QCOM_SCM_RW, QCOM_SCM_VAL), -+ .args[0] = peripheral, -+ .args[1] = phno, -+ .args[2] = dma, -+ .args[3] = seg_cnt, -+ .owner = ARM_SMCCC_OWNER_SIP, -+ }; -+ struct qcom_scm_res res; -+ -+ ret = qcom_scm_clk_enable(); -+ if (ret) -+ return ret; -+ -+ ret = qcom_scm_bw_enable(); -+ if (ret) -+ return ret; -+ -+ ret = qcom_scm_call(__scm->dev, &desc, &res); -+ qcom_scm_bw_disable(); -+ qcom_scm_clk_disable(); -+ -+ return ret ? : res.result[0]; -+} -+EXPORT_SYMBOL(qti_scm_pdseg_memcpy_v2); -+ -+/** - * qcom_scm_pas_supported() - Check if the peripheral authentication service is - * available for the given peripherial - * @peripheral: peripheral id ---- a/drivers/firmware/qcom_scm.h -+++ b/drivers/firmware/qcom_scm.h -@@ -133,6 +133,12 @@ extern int scm_legacy_call(struct device - #define QCOM_SCM_SMMU_CONFIG_ERRATA1 0x03 - #define QCOM_SCM_SMMU_CONFIG_ERRATA1_CLIENT_ALL 0x02 - -+#define QCOM_SCM_PD_LOAD_SVC_ID 0x2 -+#define QCOM_SCM_PD_LOAD_CMD_ID 0x16 -+#define QCOM_SCM_PD_LOAD_V2_CMD_ID 0x19 -+#define QCOM_SCM_INT_RAD_PWR_UP_CMD_ID 0x17 -+#define QCOM_SCM_INT_RAD_PWR_DN_CMD_ID 0x18 -+ - #define QCOM_SCM_SVC_WAITQ 0x24 - #define QCOM_SCM_WAITQ_RESUME 0x02 - #define QCOM_SCM_WAITQ_GET_WQ_CTX 0x03 ---- a/include/linux/firmware/qcom/qcom_scm.h -+++ b/include/linux/firmware/qcom/qcom_scm.h -@@ -81,6 +81,9 @@ extern int qcom_scm_pas_mem_setup(u32 pe - extern int qcom_scm_pas_auth_and_reset(u32 peripheral); - extern int qcom_scm_pas_shutdown(u32 peripheral); - extern bool qcom_scm_pas_supported(u32 peripheral); -+int qti_scm_int_radio_powerup(u32 peripheral); -+int qti_scm_int_radio_powerdown(u32 peripheral); -+int qti_scm_pdseg_memcpy_v2(u32 peripheral, int phno, dma_addr_t dma, int seg_cnt); - - extern int qcom_scm_io_readl(phys_addr_t addr, unsigned int *val); - extern int qcom_scm_io_writel(phys_addr_t addr, unsigned int val); diff --git a/target/linux/qualcommax/patches-6.6/2005-remoteproc-qcom-q6v5-Add-multipd-interrupts-support.patch b/target/linux/qualcommax/patches-6.6/2005-remoteproc-qcom-q6v5-Add-multipd-interrupts-support.patch deleted file mode 100644 index 00d049e3ae4..00000000000 --- a/target/linux/qualcommax/patches-6.6/2005-remoteproc-qcom-q6v5-Add-multipd-interrupts-support.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 9c3679f72c72b59c81fc5c05da522fcbf5d15231 Mon Sep 17 00:00:00 2001 -From: Manikanta Mylavarapu -Date: Mon, 22 May 2023 03:58:48 +0530 -Subject: remoteproc: qcom: q6v5: Add multipd interrupts support - -In multipd model, root & user pd remoteproc's interrupts are -different. User pd needs additional interrupts like spawn. -Instead of going with qcom_q6v5_init(), we defined a new -function to register userpd rproc interrupts in mpd driver. -Since userpd rproc uses some of common interrupts like fatal, -ready, static is removed from ISR handler and used in userpd -interrupt registration. - -Signed-off-by: Manikanta Mylavarapu ---- - drivers/remoteproc/qcom_q6v5.c | 37 +++++++++++++++++++++++++++++++--- - drivers/remoteproc/qcom_q6v5.h | 11 ++++++++++ - 2 files changed, 45 insertions(+), 3 deletions(-) - ---- a/drivers/remoteproc/qcom_q6v5.c -+++ b/drivers/remoteproc/qcom_q6v5.c -@@ -112,7 +112,7 @@ static irqreturn_t q6v5_wdog_interrupt(i - return IRQ_HANDLED; - } - --static irqreturn_t q6v5_fatal_interrupt(int irq, void *data) -+irqreturn_t q6v5_fatal_interrupt(int irq, void *data) - { - struct qcom_q6v5 *q6v5 = data; - size_t len; -@@ -133,7 +133,7 @@ static irqreturn_t q6v5_fatal_interrupt( - return IRQ_HANDLED; - } - --static irqreturn_t q6v5_ready_interrupt(int irq, void *data) -+irqreturn_t q6v5_ready_interrupt(int irq, void *data) - { - struct qcom_q6v5 *q6v5 = data; - -@@ -177,7 +177,16 @@ static irqreturn_t q6v5_handover_interru - return IRQ_HANDLED; - } - --static irqreturn_t q6v5_stop_interrupt(int irq, void *data) -+irqreturn_t q6v5_spawn_interrupt(int irq, void *data) -+{ -+ struct qcom_q6v5 *q6v5 = data; -+ -+ complete(&q6v5->spawn_done); -+ -+ return IRQ_HANDLED; -+} -+ -+irqreturn_t q6v5_stop_interrupt(int irq, void *data) - { - struct qcom_q6v5 *q6v5 = data; - -@@ -215,6 +224,28 @@ int qcom_q6v5_request_stop(struct qcom_q - EXPORT_SYMBOL_GPL(qcom_q6v5_request_stop); - - /** -+ * qcom_q6v5_request_spawn() - request the remote processor to spawn -+ * @q6v5: reference to qcom_q6v5 context -+ * -+ * Return: 0 on success, negative errno on failure -+ */ -+int qcom_q6v5_request_spawn(struct qcom_q6v5 *q6v5) -+{ -+ int ret; -+ -+ ret = qcom_smem_state_update_bits(q6v5->spawn_state, -+ BIT(q6v5->spawn_bit), BIT(q6v5->spawn_bit)); -+ -+ ret = wait_for_completion_timeout(&q6v5->spawn_done, 5 * HZ); -+ -+ qcom_smem_state_update_bits(q6v5->spawn_state, -+ BIT(q6v5->spawn_bit), 0); -+ -+ return ret == 0 ? -ETIMEDOUT : 0; -+} -+EXPORT_SYMBOL_GPL(qcom_q6v5_request_spawn); -+ -+/** - * qcom_q6v5_panic() - panic handler to invoke a stop on the remote - * @q6v5: reference to qcom_q6v5 context - * ---- a/drivers/remoteproc/qcom_q6v5.h -+++ b/drivers/remoteproc/qcom_q6v5.h -@@ -18,21 +18,27 @@ struct qcom_q6v5 { - - struct qcom_smem_state *state; - struct qmp *qmp; -+ struct qcom_smem_state *shutdown_state; -+ struct qcom_smem_state *spawn_state; - - struct icc_path *path; - - unsigned stop_bit; -+ unsigned shutdown_bit; -+ unsigned spawn_bit; - - int wdog_irq; - int fatal_irq; - int ready_irq; - int handover_irq; - int stop_irq; -+ int spawn_irq; - - bool handover_issued; - - struct completion start_done; - struct completion stop_done; -+ struct completion spawn_done; - - int crash_reason; - -@@ -50,7 +56,12 @@ void qcom_q6v5_deinit(struct qcom_q6v5 * - int qcom_q6v5_prepare(struct qcom_q6v5 *q6v5); - int qcom_q6v5_unprepare(struct qcom_q6v5 *q6v5); - int qcom_q6v5_request_stop(struct qcom_q6v5 *q6v5, struct qcom_sysmon *sysmon); -+int qcom_q6v5_request_spawn(struct qcom_q6v5 *q6v5); - int qcom_q6v5_wait_for_start(struct qcom_q6v5 *q6v5, int timeout); - unsigned long qcom_q6v5_panic(struct qcom_q6v5 *q6v5); -+irqreturn_t q6v5_fatal_interrupt(int irq, void *data); -+irqreturn_t q6v5_ready_interrupt(int irq, void *data); -+irqreturn_t q6v5_spawn_interrupt(int irq, void *data); -+irqreturn_t q6v5_stop_interrupt(int irq, void *data); - - #endif diff --git a/target/linux/qualcommax/patches-6.6/2006-remoteproc-qcom-Add-Hexagon-based-multipd-rproc-driv.patch b/target/linux/qualcommax/patches-6.6/2006-remoteproc-qcom-Add-Hexagon-based-multipd-rproc-driv.patch deleted file mode 100644 index 5a5ea906a83..00000000000 --- a/target/linux/qualcommax/patches-6.6/2006-remoteproc-qcom-Add-Hexagon-based-multipd-rproc-driv.patch +++ /dev/null @@ -1,1167 +0,0 @@ -From 78fb33c5e251332138f978c4861934fe1c7c8f8c Mon Sep 17 00:00:00 2001 -From: Manikanta Mylavarapu -Date: Mon, 22 May 2023 03:58:49 +0530 -Subject: remoteproc: qcom: Add Hexagon based multipd rproc driver - -It adds support to bring up remoteproc's on multipd model. -Pd means protection domain. It's similar to process in Linux. -Here QDSP6 processor runs each wifi radio functionality on a -separate process. One process can't access other process -resources, so this is termed as PD i.e protection domain. - -Here we have two pd's called root and user pd. We can correlate -Root pd as root and user pd as user in linux. Root pd has more -privileges than user pd. Root will provide services to user pd. - ->From remoteproc driver perspective, root pd corresponds to QDSP6 -processor bring up and user pd corresponds to Wifi radio (WCSS) -bring up. - -Here WCSS(user) PD is dependent on Q6(root) PD, so first -q6 pd should be up before wcss pd. After wcss pd goes down, -q6 pd should be turned off. - -IPQ5018, IPQ9574 supports multipd remoteproc driver. - -Signed-off-by: Manikanta Mylavarapu ---- - drivers/remoteproc/Kconfig | 20 + - drivers/remoteproc/Makefile | 1 + - drivers/remoteproc/qcom_common.h | 9 + - drivers/remoteproc/qcom_q6v5_mpd.c | 677 ++++++++++++++++++++++++++++ - drivers/soc/qcom/mdt_loader.c | 332 ++++++++++++++ - include/linux/soc/qcom/mdt_loader.h | 19 + - 6 files changed, 1058 insertions(+) - create mode 100644 drivers/remoteproc/qcom_q6v5_mpd.c - ---- a/drivers/remoteproc/Kconfig -+++ b/drivers/remoteproc/Kconfig -@@ -234,6 +234,26 @@ config QCOM_Q6V5_PAS - CDSP (Compute DSP), MPSS (Modem Peripheral SubSystem), and - SLPI (Sensor Low Power Island). - -+config QCOM_Q6V5_MPD -+ tristate "Qualcomm Hexagon based MPD model Peripheral Image Loader" -+ depends on OF && ARCH_QCOM -+ depends on QCOM_SMEM -+ depends on RPMSG_QCOM_SMD || RPMSG_QCOM_SMD=n -+ depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n -+ depends on QCOM_SYSMON || QCOM_SYSMON=n -+ depends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n -+ depends on QCOM_AOSS_QMP || QCOM_AOSS_QMP=n -+ select MFD_SYSCON -+ select QCOM_MDT_LOADER -+ select QCOM_PIL_INFO -+ select QCOM_Q6V5_COMMON -+ select QCOM_RPROC_COMMON -+ select QCOM_SCM -+ help -+ Say y here to support the Qualcomm Secure Peripheral Image Loader -+ for the Hexagon based MultiPD model remote processors on e.g. IPQ5018. -+ This is trustZone wireless subsystem. -+ - config QCOM_Q6V5_WCSS - tristate "Qualcomm Hexagon based WCSS Peripheral Image Loader" - depends on OF && ARCH_QCOM ---- a/drivers/remoteproc/Makefile -+++ b/drivers/remoteproc/Makefile -@@ -25,6 +25,7 @@ obj-$(CONFIG_QCOM_PIL_INFO) += qcom_pil - obj-$(CONFIG_QCOM_RPROC_COMMON) += qcom_common.o - obj-$(CONFIG_QCOM_Q6V5_COMMON) += qcom_q6v5.o - obj-$(CONFIG_QCOM_Q6V5_ADSP) += qcom_q6v5_adsp.o -+obj-$(CONFIG_QCOM_Q6V5_MPD) += qcom_q6v5_mpd.o - obj-$(CONFIG_QCOM_Q6V5_MSS) += qcom_q6v5_mss.o - obj-$(CONFIG_QCOM_Q6V5_PAS) += qcom_q6v5_pas.o - obj-$(CONFIG_QCOM_Q6V5_WCSS) += qcom_q6v5_wcss.o ---- a/drivers/remoteproc/qcom_common.h -+++ b/drivers/remoteproc/qcom_common.h -@@ -76,4 +76,13 @@ static inline bool qcom_sysmon_shutdown_ - } - #endif - -+#if IS_ENABLED(CONFIG_QCOM_Q6V5_MPD) -+s8 qcom_get_pd_asid(struct device_node *node); -+#else -+static inline s8 qcom_get_pd_asid(struct device_node *node) -+{ -+ return 0; -+} -+#endif -+ - #endif ---- /dev/null -+++ b/drivers/remoteproc/qcom_q6v5_mpd.c -@@ -0,0 +1,677 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* -+ * Copyright (C) 2016-2018 Linaro Ltd. -+ * Copyright (C) 2014 Sony Mobile Communications AB -+ * Copyright (c) 2012-2018, 2021 The Linux Foundation. All rights reserved. -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "qcom_common.h" -+#include "qcom_q6v5.h" -+ -+#include "remoteproc_internal.h" -+ -+#define WCSS_CRASH_REASON 421 -+#define WCSS_SMEM_HOST 1 -+ -+#define WCNSS_PAS_ID 6 -+#define MPD_WCNSS_PAS_ID 0xD -+ -+#define BUF_SIZE 35 -+ -+#define MAX_FIRMWARE 3 -+/** -+ * enum state - state of a wcss (private) -+ * @WCSS_NORMAL: subsystem is operating normally -+ * @WCSS_SHUTDOWN: subsystem has been shutdown -+ * -+ */ -+enum q6_wcss_state { -+ WCSS_NORMAL, -+ WCSS_SHUTDOWN, -+}; -+ -+enum { -+ Q6_IPQ, -+ WCSS_AHB_IPQ, -+ WCSS_PCIE_IPQ, -+}; -+ -+struct q6_wcss { -+ struct device *dev; -+ struct qcom_rproc_glink glink_subdev; -+ struct qcom_rproc_ssr ssr_subdev; -+ struct qcom_q6v5 q6; -+ phys_addr_t mem_phys; -+ phys_addr_t mem_reloc; -+ void *mem_region; -+ size_t mem_size; -+ int crash_reason_smem; -+ s8 pd_asid; -+ enum q6_wcss_state state; -+ const struct wcss_data *desc; -+ const char **firmware; -+}; -+ -+struct wcss_data { -+ int (*init_irq)(struct qcom_q6v5 *q6, struct platform_device *pdev, -+ struct rproc *rproc, int crash_reason, -+ const char *load_state, -+ void (*handover)(struct qcom_q6v5 *q6)); -+ int crash_reason_smem; -+ u32 version; -+ const char *ssr_name; -+ const struct rproc_ops *ops; -+ bool glink_subdev_required; -+ bool reset_seq; -+ u32 pasid; -+ int (*mdt_load_sec)(struct device *dev, const struct firmware *fw, -+ const char *fw_name, int pas_id, void *mem_region, -+ phys_addr_t mem_phys, size_t mem_size, -+ phys_addr_t *reloc_base); -+ int (*powerup_scm)(u32 peripheral); -+ int (*powerdown_scm)(u32 peripheral); -+}; -+ -+/** -+ * qcom_get_pd_asid() - get the pd asid number from DT node -+ * @node: device tree node -+ * -+ * Returns asid if node name has 'pd' string -+ */ -+s8 qcom_get_pd_asid(struct device_node *node) -+{ -+ char *str; -+ s8 pd_asid; -+ -+ if (!node) -+ return -EINVAL; -+ -+ str = strstr(node->name, "pd"); -+ if (!str) -+ return 0; -+ -+ str += strlen("pd") + 1; -+ return kstrtos8(str, 10, &pd_asid) ? -EINVAL : pd_asid; -+} -+EXPORT_SYMBOL(qcom_get_pd_asid); -+ -+static int q6_wcss_start(struct rproc *rproc) -+{ -+ struct q6_wcss *wcss = rproc->priv; -+ int ret; -+ struct device_node *upd_np; -+ struct platform_device *upd_pdev; -+ struct rproc *upd_rproc; -+ struct q6_wcss *upd_wcss; -+ const struct wcss_data *desc = wcss->desc; -+ -+ qcom_q6v5_prepare(&wcss->q6); -+ -+ ret = qcom_scm_pas_auth_and_reset(desc->pasid); -+ if (ret) { -+ dev_err(wcss->dev, "wcss_reset failed\n"); -+ return ret; -+ } -+ -+ ret = qcom_q6v5_wait_for_start(&wcss->q6, 5 * HZ); -+ if (ret == -ETIMEDOUT) -+ dev_err(wcss->dev, "start timed out\n"); -+ -+ /* On rootpd restart still user pd wcss state's -+ * initialized to WCSS_SHUTDOWN and it leads to -+ * user pd FW load (user pd fw load should happen -+ * only on user pd restart, not on root pd restart). -+ * So bring userpd wcss state to default value. -+ */ -+ for_each_available_child_of_node(wcss->dev->of_node, upd_np) { -+ upd_pdev = of_find_device_by_node(upd_np); -+ if (!upd_pdev) -+ continue; -+ upd_rproc = platform_get_drvdata(upd_pdev); -+ upd_wcss = upd_rproc->priv; -+ upd_wcss->state = WCSS_NORMAL; -+ } -+ return ret; -+} -+ -+static int q6_wcss_spawn_pd(struct rproc *rproc) -+{ -+ int ret; -+ struct q6_wcss *wcss = rproc->priv; -+ -+ ret = qcom_q6v5_request_spawn(&wcss->q6); -+ if (ret == -ETIMEDOUT) { -+ pr_err("%s spawn timedout\n", rproc->name); -+ return ret; -+ } -+ -+ ret = qcom_q6v5_wait_for_start(&wcss->q6, msecs_to_jiffies(10000)); -+ if (ret == -ETIMEDOUT) { -+ pr_err("%s start timedout\n", rproc->name); -+ wcss->q6.running = false; -+ return ret; -+ } -+ wcss->q6.running = true; -+ return ret; -+} -+ -+static int wcss_ahb_pcie_pd_start(struct rproc *rproc) -+{ -+ struct q6_wcss *wcss = rproc->priv; -+ const struct wcss_data *desc = wcss->desc; -+ int ret; -+ -+ if (!desc->reset_seq) -+ return 0; -+ -+ if (desc->powerup_scm) { -+ ret = desc->powerup_scm(desc->pasid); -+ if (ret) { -+ dev_err(wcss->dev, "failed to power up pd\n"); -+ return ret; -+ } -+ } -+ -+ ret = q6_wcss_spawn_pd(rproc); -+ if (ret) -+ return ret; -+ -+ wcss->state = WCSS_NORMAL; -+ return ret; -+} -+ -+static int q6_wcss_stop(struct rproc *rproc) -+{ -+ struct q6_wcss *wcss = rproc->priv; -+ const struct wcss_data *desc = wcss->desc; -+ int ret; -+ -+ ret = qcom_scm_pas_shutdown(desc->pasid); -+ if (ret) { -+ dev_err(wcss->dev, "not able to shutdown\n"); -+ return ret; -+ } -+ qcom_q6v5_unprepare(&wcss->q6); -+ -+ return 0; -+} -+ -+static int wcss_ahb_pcie_pd_stop(struct rproc *rproc) -+{ -+ struct q6_wcss *wcss = rproc->priv; -+ struct rproc *rpd_rproc = dev_get_drvdata(wcss->dev->parent); -+ const struct wcss_data *desc = wcss->desc; -+ int ret; -+ -+ if (!desc->reset_seq) -+ goto shut_down_rpd; -+ -+ if (rproc->state != RPROC_CRASHED && wcss->q6.stop_bit) { -+ ret = qcom_q6v5_request_stop(&wcss->q6, NULL); -+ if (ret) { -+ dev_err(&rproc->dev, "pd not stopped\n"); -+ return ret; -+ } -+ } -+ -+ if (desc->powerdown_scm) { -+ ret = desc->powerdown_scm(desc->pasid); -+ if (ret) { -+ dev_err(wcss->dev, "failed to power down pd\n"); -+ return ret; -+ } -+ } -+ -+shut_down_rpd: -+ rproc_shutdown(rpd_rproc); -+ -+ wcss->state = WCSS_SHUTDOWN; -+ return 0; -+} -+ -+static void *q6_wcss_da_to_va(struct rproc *rproc, u64 da, size_t len, -+ bool *is_iomem) -+{ -+ struct q6_wcss *wcss = rproc->priv; -+ int offset; -+ -+ offset = da - wcss->mem_reloc; -+ if (offset < 0 || offset + len > wcss->mem_size) -+ return NULL; -+ -+ return wcss->mem_region + offset; -+} -+ -+static int q6_wcss_load(struct rproc *rproc, const struct firmware *fw) -+{ -+ struct q6_wcss *wcss = rproc->priv; -+ const struct firmware *fw_hdl; -+ int ret; -+ const struct wcss_data *desc = wcss->desc; -+ int loop; -+ -+ ret = qcom_mdt_load(wcss->dev, fw, rproc->firmware, -+ desc->pasid, wcss->mem_region, -+ wcss->mem_phys, wcss->mem_size, -+ &wcss->mem_reloc); -+ if (ret) -+ return ret; -+ -+ for (loop = 1; loop < MAX_FIRMWARE; loop++) { -+ if (!wcss->firmware[loop]) -+ continue; -+ -+ ret = request_firmware(&fw_hdl, wcss->firmware[loop], -+ wcss->dev); -+ if (ret) -+ continue; -+ -+ ret = qcom_mdt_load_no_init(wcss->dev, fw_hdl, -+ wcss->firmware[loop], 0, -+ wcss->mem_region, -+ wcss->mem_phys, -+ wcss->mem_size, -+ &wcss->mem_reloc); -+ -+ release_firmware(fw_hdl); -+ -+ if (ret) { -+ dev_err(wcss->dev, -+ "can't load %s ret:%d\n", wcss->firmware[loop], ret); -+ return ret; -+ } -+ } -+ return 0; -+} -+ -+/* This function load's userpd firmware. Since Userpd depends on rootpd -+ * first bring up root pd and then load. User pd firmware load is required -+ * only during user pd restart because root pd loads user pd FW pil segments -+ * during it's bringup. -+ */ -+static int wcss_ahb_pcie_pd_load(struct rproc *rproc, const struct firmware *fw) -+{ -+ struct q6_wcss *wcss = rproc->priv, *wcss_rpd; -+ struct rproc *rpd_rproc = dev_get_drvdata(wcss->dev->parent); -+ const struct wcss_data *desc = wcss->desc; -+ int ret; -+ -+ wcss_rpd = rpd_rproc->priv; -+ -+ /* Boot rootpd rproc */ -+ ret = rproc_boot(rpd_rproc); -+ if (ret || wcss->state == WCSS_NORMAL) -+ return ret; -+ -+ return desc->mdt_load_sec(wcss->dev, fw, rproc->firmware, -+ desc->pasid, wcss->mem_region, -+ wcss->mem_phys, wcss->mem_size, -+ &wcss->mem_reloc); -+} -+ -+static unsigned long q6_wcss_panic(struct rproc *rproc) -+{ -+ struct q6_wcss *wcss = rproc->priv; -+ -+ return qcom_q6v5_panic(&wcss->q6); -+} -+ -+static const struct rproc_ops wcss_ahb_pcie_ipq5018_ops = { -+ .start = wcss_ahb_pcie_pd_start, -+ .stop = wcss_ahb_pcie_pd_stop, -+ .load = wcss_ahb_pcie_pd_load, -+}; -+ -+static const struct rproc_ops q6_wcss_ipq5018_ops = { -+ .start = q6_wcss_start, -+ .stop = q6_wcss_stop, -+ .da_to_va = q6_wcss_da_to_va, -+ .load = q6_wcss_load, -+ .get_boot_addr = rproc_elf_get_boot_addr, -+ .panic = q6_wcss_panic, -+}; -+ -+static int q6_alloc_memory_region(struct q6_wcss *wcss) -+{ -+ struct reserved_mem *rmem = NULL; -+ struct device_node *node; -+ struct device *dev = wcss->dev; -+ const struct wcss_data *desc = wcss->desc; -+ -+ if (desc->version == Q6_IPQ) { -+ node = of_parse_phandle(dev->of_node, "memory-region", 0); -+ if (node) -+ rmem = of_reserved_mem_lookup(node); -+ -+ of_node_put(node); -+ -+ if (!rmem) { -+ dev_err(dev, "unable to acquire memory-region\n"); -+ return -EINVAL; -+ } -+ } else { -+ struct rproc *rpd_rproc = dev_get_drvdata(dev->parent); -+ struct q6_wcss *rpd_wcss = rpd_rproc->priv; -+ -+ wcss->mem_phys = rpd_wcss->mem_phys; -+ wcss->mem_reloc = rpd_wcss->mem_reloc; -+ wcss->mem_size = rpd_wcss->mem_size; -+ wcss->mem_region = rpd_wcss->mem_region; -+ return 0; -+ } -+ -+ wcss->mem_phys = rmem->base; -+ wcss->mem_reloc = rmem->base; -+ wcss->mem_size = rmem->size; -+ wcss->mem_region = devm_ioremap_wc(dev, wcss->mem_phys, wcss->mem_size); -+ if (!wcss->mem_region) { -+ dev_err(dev, "unable to map memory region: %pa+%pa\n", -+ &rmem->base, &rmem->size); -+ return -EBUSY; -+ } -+ -+ return 0; -+} -+ -+static int q6_get_inbound_irq(struct qcom_q6v5 *q6, -+ struct platform_device *pdev, -+ const char *int_name, -+ irqreturn_t (*handler)(int irq, void *data)) -+{ -+ int ret, irq; -+ char *interrupt, *tmp = (char *)int_name; -+ struct q6_wcss *wcss = q6->rproc->priv; -+ -+ irq = platform_get_irq_byname(pdev, int_name); -+ if (irq < 0) { -+ if (irq != -EPROBE_DEFER) -+ dev_err(&pdev->dev, -+ "failed to retrieve %s IRQ: %d\n", -+ int_name, irq); -+ return irq; -+ } -+ -+ if (!strcmp(int_name, "fatal")) { -+ q6->fatal_irq = irq; -+ } else if (!strcmp(int_name, "stop-ack")) { -+ q6->stop_irq = irq; -+ tmp = "stop_ack"; -+ } else if (!strcmp(int_name, "ready")) { -+ q6->ready_irq = irq; -+ } else if (!strcmp(int_name, "handover")) { -+ q6->handover_irq = irq; -+ } else if (!strcmp(int_name, "spawn-ack")) { -+ q6->spawn_irq = irq; -+ tmp = "spawn_ack"; -+ } else { -+ dev_err(&pdev->dev, "unknown interrupt\n"); -+ return -EINVAL; -+ } -+ -+ interrupt = devm_kzalloc(&pdev->dev, BUF_SIZE, GFP_KERNEL); -+ if (!interrupt) -+ return -ENOMEM; -+ -+ snprintf(interrupt, BUF_SIZE, "q6v5_wcss_userpd%d_%s", wcss->pd_asid, tmp); -+ -+ ret = devm_request_threaded_irq(&pdev->dev, irq, -+ NULL, handler, -+ IRQF_TRIGGER_RISING | IRQF_ONESHOT, -+ interrupt, q6); -+ if (ret) { -+ dev_err(&pdev->dev, "failed to acquire %s irq\n", interrupt); -+ return ret; -+ } -+ return 0; -+} -+ -+static int q6_get_outbound_irq(struct qcom_q6v5 *q6, -+ struct platform_device *pdev, -+ const char *int_name) -+{ -+ struct qcom_smem_state *tmp_state; -+ unsigned bit; -+ -+ tmp_state = qcom_smem_state_get(&pdev->dev, int_name, &bit); -+ if (IS_ERR(tmp_state)) { -+ dev_err(&pdev->dev, "failed to acquire %s state\n", int_name); -+ return PTR_ERR(tmp_state); -+ } -+ -+ if (!strcmp(int_name, "stop")) { -+ q6->state = tmp_state; -+ q6->stop_bit = bit; -+ } else if (!strcmp(int_name, "spawn")) { -+ q6->spawn_state = tmp_state; -+ q6->spawn_bit = bit; -+ } -+ -+ return 0; -+} -+ -+static int init_irq(struct qcom_q6v5 *q6, -+ struct platform_device *pdev, struct rproc *rproc, -+ int crash_reason, const char *load_state, -+ void (*handover)(struct qcom_q6v5 *q6)) -+{ -+ int ret; -+ -+ q6->rproc = rproc; -+ q6->dev = &pdev->dev; -+ q6->crash_reason = crash_reason; -+ q6->handover = handover; -+ -+ init_completion(&q6->start_done); -+ init_completion(&q6->stop_done); -+ init_completion(&q6->spawn_done); -+ -+ ret = q6_get_inbound_irq(q6, pdev, "fatal", -+ q6v5_fatal_interrupt); -+ if (ret) -+ return ret; -+ -+ ret = q6_get_inbound_irq(q6, pdev, "ready", -+ q6v5_ready_interrupt); -+ if (ret) -+ return ret; -+ -+ ret = q6_get_inbound_irq(q6, pdev, "stop-ack", -+ q6v5_stop_interrupt); -+ if (ret) -+ return ret; -+ -+ ret = q6_get_inbound_irq(q6, pdev, "spawn-ack", -+ q6v5_spawn_interrupt); -+ if (ret) -+ return ret; -+ -+ ret = q6_get_outbound_irq(q6, pdev, "stop"); -+ if (ret) -+ return ret; -+ -+ ret = q6_get_outbound_irq(q6, pdev, "spawn"); -+ if (ret) -+ return ret; -+ -+ return 0; -+} -+ -+static int q6_wcss_probe(struct platform_device *pdev) -+{ -+ const struct wcss_data *desc; -+ struct q6_wcss *wcss; -+ struct rproc *rproc; -+ int ret; -+ char *subdev_name; -+ const char **firmware; -+ -+ desc = of_device_get_match_data(&pdev->dev); -+ if (!desc) -+ return -EINVAL; -+ -+ firmware = devm_kcalloc(&pdev->dev, MAX_FIRMWARE, -+ sizeof(*firmware), GFP_KERNEL); -+ if (!firmware) -+ return -ENOMEM; -+ -+ ret = of_property_read_string_array(pdev->dev.of_node, "firmware-name", -+ firmware, MAX_FIRMWARE); -+ if (ret < 0) -+ return ret; -+ -+ rproc = rproc_alloc(&pdev->dev, pdev->name, desc->ops, -+ firmware[0], sizeof(*wcss)); -+ if (!rproc) { -+ dev_err(&pdev->dev, "failed to allocate rproc\n"); -+ return -ENOMEM; -+ } -+ wcss = rproc->priv; -+ wcss->dev = &pdev->dev; -+ wcss->desc = desc; -+ wcss->firmware = firmware; -+ -+ ret = q6_alloc_memory_region(wcss); -+ if (ret) -+ goto free_rproc; -+ -+ wcss->pd_asid = qcom_get_pd_asid(wcss->dev->of_node); -+ if (wcss->pd_asid < 0) -+ goto free_rproc; -+ -+ if (desc->init_irq) { -+ ret = desc->init_irq(&wcss->q6, pdev, rproc, -+ desc->crash_reason_smem, NULL, NULL); -+ if (ret) -+ goto free_rproc; -+ } -+ -+ if (desc->glink_subdev_required) -+ qcom_add_glink_subdev(rproc, &wcss->glink_subdev, desc->ssr_name); -+ -+ subdev_name = (char *)(desc->ssr_name ? desc->ssr_name : pdev->name); -+ qcom_add_ssr_subdev(rproc, &wcss->ssr_subdev, subdev_name); -+ -+ rproc->auto_boot = false; -+ ret = rproc_add(rproc); -+ if (ret) -+ goto free_rproc; -+ -+ platform_set_drvdata(pdev, rproc); -+ -+ ret = of_platform_populate(wcss->dev->of_node, NULL, -+ NULL, wcss->dev); -+ if (ret) { -+ dev_err(&pdev->dev, "failed to populate wcss pd nodes\n"); -+ goto free_rproc; -+ } -+ return 0; -+ -+free_rproc: -+ rproc_free(rproc); -+ -+ return ret; -+} -+ -+static int q6_wcss_remove(struct platform_device *pdev) -+{ -+ struct rproc *rproc = platform_get_drvdata(pdev); -+ struct q6_wcss *wcss = rproc->priv; -+ -+ qcom_q6v5_deinit(&wcss->q6); -+ -+ rproc_del(rproc); -+ rproc_free(rproc); -+ -+ return 0; -+} -+ -+static const struct wcss_data q6_ipq5018_res_init = { -+ .init_irq = qcom_q6v5_init, -+ .crash_reason_smem = WCSS_CRASH_REASON, -+ .ssr_name = "q6wcss", -+ .ops = &q6_wcss_ipq5018_ops, -+ .version = Q6_IPQ, -+ .glink_subdev_required = true, -+ .pasid = MPD_WCNSS_PAS_ID, -+}; -+ -+static const struct wcss_data q6_ipq9574_res_init = { -+ .init_irq = qcom_q6v5_init, -+ .crash_reason_smem = WCSS_CRASH_REASON, -+ .ssr_name = "q6wcss", -+ .ops = &q6_wcss_ipq5018_ops, -+ .version = Q6_IPQ, -+ .glink_subdev_required = true, -+ .pasid = WCNSS_PAS_ID, -+}; -+ -+static const struct wcss_data wcss_ahb_ipq5018_res_init = { -+ .init_irq = init_irq, -+ .crash_reason_smem = WCSS_CRASH_REASON, -+ .ops = &wcss_ahb_pcie_ipq5018_ops, -+ .version = WCSS_AHB_IPQ, -+ .pasid = MPD_WCNSS_PAS_ID, -+ .reset_seq = true, -+ .mdt_load_sec = qcom_mdt_load_pd_seg, -+ .powerup_scm = qti_scm_int_radio_powerup, -+ .powerdown_scm = qti_scm_int_radio_powerdown, -+}; -+ -+static const struct wcss_data wcss_ahb_ipq9574_res_init = { -+ .crash_reason_smem = WCSS_CRASH_REASON, -+ .ops = &wcss_ahb_pcie_ipq5018_ops, -+ .version = WCSS_AHB_IPQ, -+ .pasid = WCNSS_PAS_ID, -+ .mdt_load_sec = qcom_mdt_load, -+}; -+ -+static const struct wcss_data wcss_pcie_ipq5018_res_init = { -+ .init_irq = init_irq, -+ .crash_reason_smem = WCSS_CRASH_REASON, -+ .ops = &wcss_ahb_pcie_ipq5018_ops, -+ .version = WCSS_PCIE_IPQ, -+ .reset_seq = true, -+ .mdt_load_sec = qcom_mdt_load_pd_seg, -+ .pasid = MPD_WCNSS_PAS_ID, -+}; -+ -+static const struct of_device_id q6_wcss_of_match[] = { -+ { .compatible = "qcom,ipq5018-q6-mpd", .data = &q6_ipq5018_res_init }, -+ { .compatible = "qcom,ipq9574-q6-mpd", .data = &q6_ipq9574_res_init }, -+ { .compatible = "qcom,ipq5018-wcss-ahb-mpd", -+ .data = &wcss_ahb_ipq5018_res_init }, -+ { .compatible = "qcom,ipq9574-wcss-ahb-mpd", -+ .data = &wcss_ahb_ipq9574_res_init }, -+ { .compatible = "qcom,ipq5018-wcss-pcie-mpd", -+ .data = &wcss_pcie_ipq5018_res_init }, -+ { }, -+}; -+MODULE_DEVICE_TABLE(of, q6_wcss_of_match); -+ -+static struct platform_driver q6_wcss_driver = { -+ .probe = q6_wcss_probe, -+ .remove = q6_wcss_remove, -+ .driver = { -+ .name = "qcom-q6-mpd", -+ .of_match_table = q6_wcss_of_match, -+ }, -+}; -+module_platform_driver(q6_wcss_driver); -+ -+MODULE_DESCRIPTION("Hexagon WCSS Multipd Peripheral Image Loader"); -+MODULE_LICENSE("GPL v2"); ---- a/drivers/soc/qcom/mdt_loader.c -+++ b/drivers/soc/qcom/mdt_loader.c -@@ -16,6 +16,56 @@ - #include - #include - #include -+#include -+ -+#include "../../remoteproc/qcom_common.h" -+#define PDSEG_PAS_ID 0xD -+ -+/** -+ * struct region - structure passed to TrustZone -+ * @addr: address of dma region, where dma blocks/chunks address resides -+ * @blk_size: size of each block -+ */ -+struct region { -+ u64 addr; -+ unsigned int blk_size; -+}; -+ -+/** -+ * struct pdseg_dma_mem_info -+ * @tz_addr: reference to structure passed to trustzone -+ * @blocks: no of blocks -+ * @tz_dma: dma handle of tz_addr -+ * @dma_blk_arr_addr_phys: dma handle of dma_blk_arr_addr -+ * @dma_blk_arr_addr: VA of dma array, where each index points to -+ * dma block PA -+ * @pt: stores VA of each block -+ * -+ * -+ ---- ---- ---- -+ DMA | | | | | | -+ blocks ---- ---- ---- -+ | | | -+ |-----| | |------- -+ | | | -+ Array of -------------- -+ pointers | | | | dma_blk_arr_addr_phys -+ -------------- -+ | -+ | -+ Address referred tz_addr->addr -+ by trustzone -+ to get dma blocks -+ */ -+ -+struct pdseg_dma_mem_info { -+ struct region *tz_addr; -+ int blocks; -+ dma_addr_t tz_dma; -+ dma_addr_t dma_blk_arr_addr_phys; -+ u64 *dma_blk_arr_addr; -+ void **pt; -+}; - - static bool mdt_phdr_valid(const struct elf32_phdr *phdr) - { -@@ -393,6 +443,261 @@ static int __qcom_mdt_load(struct device - return ret; - } - -+static int allocate_dma_mem(struct device *dev, -+ struct pdseg_dma_mem_info *pd_dma, -+ int max_size) -+{ -+ dma_addr_t dma_tmp = 0; -+ int i; -+ -+ pd_dma->blocks = DIV_ROUND_UP(max_size, PAGE_SIZE); -+ -+ /* Allocate dma memory for structure passed to trust zone */ -+ pd_dma->tz_addr = dma_alloc_coherent(dev, sizeof(struct region), -+ &pd_dma->tz_dma, GFP_DMA); -+ if (!pd_dma->tz_addr) { -+ pr_err("Error in dma alloc\n"); -+ return -ENOMEM; -+ } -+ -+ /* Allocate dma memory to store array of blocks PA */ -+ pd_dma->dma_blk_arr_addr = -+ dma_alloc_coherent(dev, (pd_dma->blocks * sizeof(u64)), -+ &pd_dma->dma_blk_arr_addr_phys, GFP_DMA); -+ if (!pd_dma->dma_blk_arr_addr) { -+ pr_err("Error in dma alloc\n"); -+ goto free_tz_dma_alloc; -+ } -+ -+ /* Assign dma block array PA to trustzone structure addr variable */ -+ memcpy(&pd_dma->tz_addr->addr, &pd_dma->dma_blk_arr_addr_phys, -+ sizeof(dma_addr_t)); -+ -+ /* Allocate memory to store array of blocks VA */ -+ pd_dma->pt = kzalloc(pd_dma->blocks * sizeof(void *), GFP_KERNEL); -+ if (!pd_dma->pt) { -+ pr_err("Error in memory alloc\n"); -+ goto free_dma_blk_arr_alloc; -+ } -+ -+ for (i = 0; i < pd_dma->blocks; i++) { -+ /* Allocate dma memory for blocks with PAGE_SIZE each */ -+ pd_dma->pt[i] = dma_alloc_coherent(dev, PAGE_SIZE, -+ &dma_tmp, GFP_DMA); -+ if (!pd_dma->pt[i]) { -+ pr_err("Error in dma alloc i:%d - blocks:%d\n", i, -+ pd_dma->blocks); -+ goto free_mem_alloc; -+ } -+ -+ /* Assign dma block PA to dma_blk_arr_addr */ -+ memcpy(&pd_dma->dma_blk_arr_addr[i], &dma_tmp, -+ sizeof(dma_addr_t)); -+ } -+ pd_dma->tz_addr->blk_size = PAGE_SIZE; -+ return 0; -+ -+free_mem_alloc: -+ i = 0; -+ while (i < pd_dma->blocks && pd_dma->pt[i]) { -+ memcpy(&dma_tmp, &pd_dma->dma_blk_arr_addr[i], -+ sizeof(dma_addr_t)); -+ dma_free_coherent(dev, PAGE_SIZE, pd_dma->pt[i], dma_tmp); -+ i++; -+ } -+ kfree(pd_dma->pt); -+free_dma_blk_arr_alloc: -+ dma_free_coherent(dev, (pd_dma->blocks * sizeof(u64)), -+ pd_dma->dma_blk_arr_addr, -+ pd_dma->dma_blk_arr_addr_phys); -+free_tz_dma_alloc: -+ dma_free_coherent(dev, sizeof(struct region), pd_dma->tz_addr, -+ pd_dma->tz_dma); -+ -+ return -ENOMEM; -+} -+ -+static void free_dma_mem(struct device *dev, struct pdseg_dma_mem_info *pd_dma) -+{ -+ int i; -+ dma_addr_t dma_tmp = 0; -+ -+ for (i = 0; i < pd_dma->blocks; i++) { -+ memcpy(&dma_tmp, &pd_dma->dma_blk_arr_addr[i], -+ sizeof(dma_addr_t)); -+ dma_free_coherent(dev, PAGE_SIZE, pd_dma->pt[i], -+ dma_tmp); -+ } -+ -+ dma_free_coherent(dev, (pd_dma->blocks * sizeof(u64)), -+ pd_dma->dma_blk_arr_addr, -+ pd_dma->dma_blk_arr_addr_phys); -+ -+ dma_free_coherent(dev, sizeof(struct region), pd_dma->tz_addr, -+ pd_dma->tz_dma); -+ kfree(pd_dma->pt); -+} -+ -+static int memcpy_pdseg_to_dma_blk(const char *fw_name, struct device *dev, -+ int ph_no, struct pdseg_dma_mem_info *pd_dma) -+{ -+ const struct firmware *seg_fw; -+ int ret, offset_tmp = 0, tmp = 0; -+ size_t size = 0; -+ -+ ret = request_firmware(&seg_fw, fw_name, dev); -+ if (ret) { -+ dev_err(dev, "failed to load %s\n", fw_name); -+ return ret; -+ } -+ size = seg_fw->size < PAGE_SIZE ? -+ seg_fw->size : PAGE_SIZE; -+ while (tmp < pd_dma->blocks && size) { -+ /* Clear last block and copy data */ -+ if ((tmp + 1) == pd_dma->blocks) -+ memset_io(pd_dma->pt[tmp], 0, PAGE_SIZE); -+ memcpy_toio(pd_dma->pt[tmp], seg_fw->data + offset_tmp, size); -+ tmp++; -+ offset_tmp += size; -+ if ((seg_fw->size - offset_tmp) < PAGE_SIZE) -+ size = seg_fw->size - offset_tmp; -+ } -+ release_firmware(seg_fw); -+ ret = qti_scm_pdseg_memcpy_v2(PDSEG_PAS_ID, ph_no, pd_dma->tz_dma, -+ tmp); -+ if (ret) { -+ dev_err(dev, "pd seg memcpy scm failed\n"); -+ return ret; -+ } -+ return ret; -+} -+ -+static int __qcom_mdt_load_pd_seg(struct device *dev, const struct firmware *fw, -+ const char *fw_name, int pas_id, void *mem_region, -+ phys_addr_t mem_phys, size_t mem_size, -+ phys_addr_t *reloc_base, bool pas_init) -+{ -+ const struct elf32_phdr *phdrs; -+ const struct elf32_phdr *phdr; -+ const struct elf32_hdr *ehdr; -+ phys_addr_t mem_reloc; -+ phys_addr_t min_addr = PHYS_ADDR_MAX; -+ ssize_t offset; -+ bool relocate = false; -+ int ret = 0; -+ int i; -+ u8 pd_asid; -+ int max_size = 0; -+ struct pdseg_dma_mem_info pd_dma = {0}; -+ char *firmware_name; -+ size_t fw_name_len = strlen(fw_name); -+ -+ if (!fw || !mem_region || !mem_phys || !mem_size) -+ return -EINVAL; -+ -+ firmware_name = kstrdup(fw_name, GFP_KERNEL); -+ if (!firmware_name) -+ return -ENOMEM; -+ -+ pd_asid = qcom_get_pd_asid(dev->of_node); -+ -+ ehdr = (struct elf32_hdr *)fw->data; -+ phdrs = (struct elf32_phdr *)(ehdr + 1); -+ -+ for (i = 0; i < ehdr->e_phnum; i++) { -+ phdr = &phdrs[i]; -+ -+ if (!mdt_phdr_valid(phdr)) -+ continue; -+ /* -+ * While doing PD specific reloading, load only that PD -+ * specific writeable entries. Skip others -+ */ -+ if ((QCOM_MDT_PF_ASID(phdr->p_flags) != pd_asid) || -+ ((phdr->p_flags & PF_W) == 0)) -+ continue; -+ -+ if (phdr->p_flags & QCOM_MDT_RELOCATABLE) -+ relocate = true; -+ -+ if (phdr->p_paddr < min_addr) -+ min_addr = phdr->p_paddr; -+ -+ if (max_size < phdr->p_memsz) -+ max_size = phdr->p_memsz; -+ } -+ -+ /** -+ * During userpd PIL segments reloading, Q6 is live. Due to -+ * this we can't access memory region of PIL segments. So -+ * create DMA chunks/blocks to store PIL segments data. -+ */ -+ ret = allocate_dma_mem(dev, &pd_dma, max_size); -+ if (ret) -+ goto out; -+ -+ if (relocate) { -+ /* -+ * The image is relocatable, so offset each segment based on -+ * the lowest segment address. -+ */ -+ mem_reloc = min_addr; -+ } else { -+ /* -+ * Image is not relocatable, so offset each segment based on -+ * the allocated physical chunk of memory. -+ */ -+ mem_reloc = mem_phys; -+ } -+ -+ for (i = 0; i < ehdr->e_phnum; i++) { -+ phdr = &phdrs[i]; -+ -+ if (!mdt_phdr_valid(phdr)) -+ continue; -+ -+ /* -+ * While doing PD specific reloading, load only that PD -+ * specific writeable entries. Skip others -+ */ -+ if ((QCOM_MDT_PF_ASID(phdr->p_flags) != pd_asid) || -+ ((phdr->p_flags & PF_W) == 0)) -+ continue; -+ -+ offset = phdr->p_paddr - mem_reloc; -+ if (offset < 0 || offset + phdr->p_memsz > mem_size) { -+ dev_err(dev, "segment outside memory range\n"); -+ ret = -EINVAL; -+ break; -+ } -+ -+ if (phdr->p_filesz > phdr->p_memsz) { -+ dev_err(dev, -+ "refusing to load segment %d with p_filesz > p_memsz\n", -+ i); -+ ret = -EINVAL; -+ break; -+ } -+ -+ if (phdr->p_filesz) { -+ snprintf(firmware_name + fw_name_len - 3, 4, "b%02d", i); -+ -+ /* copy PIL segments data to dma blocks */ -+ ret = memcpy_pdseg_to_dma_blk(firmware_name, dev, i, &pd_dma); -+ if (ret) -+ goto free_dma; -+ } -+ } -+free_dma: -+ free_dma_mem(dev, &pd_dma); -+ -+out: -+ if (reloc_base) -+ *reloc_base = mem_reloc; -+ -+ return ret; -+} -+ - /** - * qcom_mdt_load() - load the firmware which header is loaded as fw - * @dev: device handle to associate resources with -@@ -445,5 +750,32 @@ int qcom_mdt_load_no_init(struct device - } - EXPORT_SYMBOL_GPL(qcom_mdt_load_no_init); - -+/** -+ * qcom_mdt_load_pd_seg() - load userpd specific PIL segements -+ * @dev: device handle to associate resources with -+ * @fw: firmware object for the mdt file -+ * @firmware: name of the firmware, for construction of segment file names -+ * @pas_id: PAS identifier -+ * @mem_region: allocated memory region to load firmware into -+ * @mem_phys: physical address of allocated memory region -+ * @mem_size: size of the allocated memory region -+ * @reloc_base: adjusted physical address after relocation -+ * -+ * Here userpd PIL segements are stitched with rootpd firmware. -+ * This function reloads userpd specific PIL segments during SSR -+ * of userpd. -+ * -+ * Returns 0 on success, negative errno otherwise. -+ */ -+int qcom_mdt_load_pd_seg(struct device *dev, const struct firmware *fw, -+ const char *firmware, int pas_id, void *mem_region, -+ phys_addr_t mem_phys, size_t mem_size, -+ phys_addr_t *reloc_base) -+{ -+ return __qcom_mdt_load_pd_seg(dev, fw, firmware, pas_id, mem_region, mem_phys, -+ mem_size, reloc_base, true); -+} -+EXPORT_SYMBOL_GPL(qcom_mdt_load_pd_seg); -+ - MODULE_DESCRIPTION("Firmware parser for Qualcomm MDT format"); - MODULE_LICENSE("GPL v2"); ---- a/include/linux/soc/qcom/mdt_loader.h -+++ b/include/linux/soc/qcom/mdt_loader.h -@@ -7,6 +7,11 @@ - #define QCOM_MDT_TYPE_MASK (7 << 24) - #define QCOM_MDT_TYPE_HASH (2 << 24) - #define QCOM_MDT_RELOCATABLE BIT(27) -+#define QCOM_MDT_ASID_MASK 0xfu -+#define QCOM_MDT_PF_ASID_SHIFT 16 -+#define QCOM_MDT_PF_ASID_MASK (QCOM_MDT_ASID_MASK << QCOM_MDT_PF_ASID_SHIFT) -+#define QCOM_MDT_PF_ASID(x) \ -+ (((x) >> QCOM_MDT_PF_ASID_SHIFT) & QCOM_MDT_ASID_MASK) - - struct device; - struct firmware; -@@ -27,6 +32,10 @@ int qcom_mdt_load_no_init(struct device - const char *fw_name, int pas_id, void *mem_region, - phys_addr_t mem_phys, size_t mem_size, - phys_addr_t *reloc_base); -+int qcom_mdt_load_pd_seg(struct device *dev, const struct firmware *fw, -+ const char *firmware, int pas_id, void *mem_region, -+ phys_addr_t mem_phys, size_t mem_size, -+ phys_addr_t *reloc_base); - void *qcom_mdt_read_metadata(const struct firmware *fw, size_t *data_len, - const char *fw_name, struct device *dev); - -@@ -61,6 +70,16 @@ static inline int qcom_mdt_load_no_init( - { - return -ENODEV; - } -+ -+static inline int qcom_mdt_load_pd_seg(struct device *dev, -+ const struct firmware *fw, -+ const char *fw_name, int pas_id, -+ void *mem_region, phys_addr_t mem_phys, -+ size_t mem_size, -+ phys_addr_t *reloc_base) -+{ -+ return -ENODEV; -+} - - static inline void *qcom_mdt_read_metadata(const struct firmware *fw, - size_t *data_len, const char *fw_name, diff --git a/target/linux/qualcommax/patches-6.6/9999-01-add-serveal-support-for-ipq6018.patch b/target/linux/qualcommax/patches-6.6/9999-01-add-serveal-support-for-ipq6018.patch deleted file mode 100644 index 2e9b38377eb..00000000000 --- a/target/linux/qualcommax/patches-6.6/9999-01-add-serveal-support-for-ipq6018.patch +++ /dev/null @@ -1,154 +0,0 @@ ---- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi -@@ -28,6 +28,12 @@ - clock-frequency = <24000000>; - #clock-cells = <0>; - }; -+ -+ usb3phy_0_cc_pipe_clk: usb3phy-0-cc-pipe-clk { -+ compatible = "fixed-clock"; -+ clock-frequency = <125000000>; -+ #clock-cells = <0>; -+ }; - }; - - cpus: cpus { -@@ -198,6 +204,11 @@ - reg = <0x0 0x00060000 0x0 0x6000>; - no-map; - }; -+ -+ nss_region: nss@40000000 { -+ no-map; -+ reg = <0x0 0x40000000 0x0 0x01000000>; -+ }; - - bootloader@4a100000 { - reg = <0x0 0x4a100000 0x0 0x400000>; -@@ -223,6 +234,16 @@ - reg = <0x0 0x4ab00000 0x0 0x5500000>; - no-map; - }; -+ -+ q6_etr_region: q6_etr_dump@50000000 { -+ no-map; -+ reg = <0x0 0x50000000 0x0 0x00100000>; -+ }; -+ -+ m3_dump_region: m3_dump@50100000 { -+ no-map; -+ reg = <0x0 0x50100000 0x0 0x00100000>; -+ }; - - ramoops_region: ramoops@50000000 { - compatible = "ramoops"; -@@ -424,8 +445,12 @@ - gcc: gcc@1800000 { - compatible = "qcom,gcc-ipq6018"; - reg = <0x0 0x01800000 0x0 0x80000>; -- clocks = <&xo>, <&sleep_clk>; -- clock-names = "xo", "sleep_clk"; -+ clocks = <&xo>, -+ <&sleep_clk>, -+ <&usb3phy_0_cc_pipe_clk>; -+ clock-names = "xo", -+ "sleep_clk", -+ "usb3phy_0_cc_pipe_clk"; - #clock-cells = <1>; - #reset-cells = <1>; - }; -@@ -437,8 +462,21 @@ - }; - - tcsr: syscon@1937000 { -- compatible = "qcom,tcsr-ipq6018", "syscon"; -+ compatible = "qcom,tcsr-ipq6018", "syscon", "simple-mfd"; - reg = <0x0 0x01937000 0x0 0x21000>; -+ ranges = <0x0 0x0 0x01937000 0x21000>; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ -+ pwm: pwm@a010 { -+ compatible = "qcom,ipq6018-pwm"; -+ reg = <0xa010 0x20>; -+ clocks = <&gcc GCC_ADSS_PWM_CLK>; -+ assigned-clocks = <&gcc GCC_ADSS_PWM_CLK>; -+ assigned-clock-rates = <100000000>; -+ #pwm-cells = <2>; -+ status = "disabled"; -+ }; - }; - - usb2: usb@70f8800 { -@@ -603,6 +641,20 @@ - status = "disabled"; - }; - -+ blsp1_spi5: spi@78b9000 { -+ compatible = "qcom,spi-qup-v2.2.1"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <0x0 0x078b9000 0x0 0x600>; -+ interrupts = ; -+ clocks = <&gcc GCC_BLSP1_QUP5_SPI_APPS_CLK>, -+ <&gcc GCC_BLSP1_AHB_CLK>; -+ clock-names = "core", "iface"; -+ dmas = <&blsp_dma 20>, <&blsp_dma 21>; -+ dma-names = "tx", "rx"; -+ status = "disabled"; -+ }; -+ - blsp1_i2c2: i2c@78b6000 { - compatible = "qcom,i2c-qup-v2.2.1"; - #address-cells = <1>; -@@ -633,6 +685,21 @@ - status = "disabled"; - }; - -+ blsp1_i2c6: i2c@78ba000 { -+ compatible = "qcom,i2c-qup-v2.2.1"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <0x0 0x078ba000 0x0 0x600>; -+ interrupts = ; -+ clocks = <&gcc GCC_BLSP1_QUP6_I2C_APPS_CLK>, -+ <&gcc GCC_BLSP1_AHB_CLK>; -+ clock-names = "core", "iface"; -+ clock-frequency = <400000>; -+ dmas = <&blsp_dma 22>, <&blsp_dma 23>; -+ dma-names = "tx", "rx"; -+ status = "disabled"; -+ }; -+ - qpic_bam: dma-controller@7984000 { - compatible = "qcom,bam-v1.7.0"; - reg = <0x0 0x07984000 0x0 0x1a000>; -@@ -937,8 +1004,26 @@ - "wcss_reset", - "wcss_q6_reset"; - -- clocks = <&gcc GCC_PRNG_AHB_CLK>, <&gcc GCC_QDSS_AT_CLK>; -- clock-names = "prng", "qdss" ; -+ clocks = <&gcc GCC_PRNG_AHB_CLK>, -+ <&gcc GCC_QDSS_AT_CLK>, -+ <&gcc GCC_SYS_NOC_WCSS_AHB_CLK>, -+ <&gcc GCC_Q6SS_ATBM_CLK>, -+ <&gcc GCC_Q6SS_PCLKDBG_CLK>, -+ <&gcc GCC_Q6_TSCTR_1TO2_CLK>; -+ clock-names = "prng", -+ "qdss", -+ "gcc_sys_noc_wcss_ahb_clk", -+ "gcc_q6ss_atbm_clk", -+ "gcc_q6ss_pclkdbg_clk", -+ "gcc_q6_tsctr_1to2_clk"; -+ assigned-clocks = <&gcc GCC_SYS_NOC_WCSS_AHB_CLK>, -+ <&gcc GCC_Q6SS_PCLKDBG_CLK>, -+ <&gcc GCC_Q6_TSCTR_1TO2_CLK>, -+ <&gcc GCC_Q6SS_ATBM_CLK>; -+ assigned-clock-rates = <133333333>, -+ <600000000>, -+ <600000000>, -+ <240000000>; - - qcom,halt-regs = <&tcsr 0x18000 0x1b000 0xe000>; - diff --git a/target/linux/qualcommax/patches-6.6/9999-add-nss-macsec.patch b/target/linux/qualcommax/patches-6.6/9999-add-nss-macsec.patch deleted file mode 100644 index a2fa689688a..00000000000 --- a/target/linux/qualcommax/patches-6.6/9999-add-nss-macsec.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/arch/arm64/boot/dts/qcom/ipq8074-nss.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq8074-nss.dtsi -@@ -9,6 +9,12 @@ - regulator-always-on; - regulator-boot-on; - }; -+ nss-macsec1 { -+ compatible = "qcom,nss-macsec"; -+ phy_addr = <0x1c>; -+ phy_access_mode = <0x00>; -+ mdiobus = <&mdio>; -+ }; - }; - - &soc {