immortalwrt/package/kernel/qca-nss-dp/patches/0006-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch
Kristian Skramstad a76651a24a kernel: qca-nss-dp: update to 12.5.5
There is some new changes since 12.5.r2 to 12.5.5, so refresh
and update patches.

Changes:
modified:   package/kernel/qca-nss-dp/Makefile
modified:   package/kernel/qca-nss-dp/patches/0006-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch
modified:   package/kernel/qca-nss-dp/patches/0008-nss-dp-allow-setting-netdev-name-from-DTS.patch
deleted:    package/kernel/qca-nss-dp/patches/0011-01-edma_v1-rework-hw_reset-logic-to-permit-rmmod-and-in.patch
deleted:    package/kernel/qca-nss-dp/patches/0011-02-nss_dp_switchdev-correctly-unregister-notifier-on-dp.patch
deleted:    package/kernel/qca-nss-dp/patches/0011-03-nss_dp_main-swap-dp_exit-function-call.patch
deleted:    package/kernel/qca-nss-dp/patches/0011-04-nss_dp_main-call-unregister_netdev-first-in-dp_remov.patch
deleted:    package/kernel/qca-nss-dp/patches/0011-05-nss_dp_main-use-phy_detach-instead-of-disconnect-in-.patch
deleted:    package/kernel/qca-nss-dp/patches/0011-06-edma_v1-skip-edma_disable_port-in-edma_cleanup-subse.patch

Log:
2024-10-16 |4c9f671| [qca-nss-dp] removed the calling of fal_port_autoneg_status_get
2024-10-16 |fb33119| Merge "[qca-nss-dp] Change Debug Level of TX Complete Errors"
2024-10-15 |e197b9d| [qca-nss-dp] Change Debug Level of TX Complete Errors
2024-10-03 |1b7aeb1| Merge remote-tracking branch origin/AU_LINUX_QSDK_GINGER_OPEN_TARGET_ALL.12.5.5.230.918 into HEAD
2024-10-01 |830ac73| Merge "[qca-nss-dp] Enable rmmod support for qca-nss-dp module."
2024-06-05 |aef242d| [qca-nss-dp] Enable rmmod support for qca-nss-dp module.
2024-09-18 |b1bfeb6| Merge "[qca-nss-dp] Move pr_info to pr_debug"
2024-09-12 |54aee26| Merge "[qca-nss-dp] Fix Loopback ring teardown path"
2024-09-10 |21f6567| Merge "[qca-nss-dp] Extend Tx Complete errors to track individual error type"
2024-09-10 |7fee76f| Merge "[qca-nss-dp] Destination VP xmit support"
2024-09-09 |0d4ecfd| [qca-nss-dp] Fix Loopback ring teardown path
2024-08-29 |438ab8e| [qca-nss-dp] Move pr_info to pr_debug
2024-08-29 |3f45e3d| Merge "[qca-nss-dp] Fix EDMA Recovery API to Prevent Multiple RX NAPI Add Calls"
2024-08-23 |7a792b1| [qca-nss-dp] Fix EDMA Recovery API to Prevent Multiple RX NAPI Add Calls
2024-07-08 |1227746| [qca-nss-dp] Add support for DDR extended buffer
2024-08-20 |d45bceb| [qca-nss-dp] Extend Tx Complete errors to track individual error type
2024-06-17 |a8f7155| [qca-nss-dp] Destination VP xmit support
2024-08-21 |a5d189b| Merge "[qca-nss-dp] Support for the PPE-VP Qdisc feature"
2024-08-16 |da97bc7| Merge "[qca-nss-dp] Restrict compilation of a file in DP module"
2024-06-22 |bf90fe9| [qca-nss-dp] Support for the PPE-VP Qdisc feature
2024-02-07 |6ceeb8f| [qca-nss-dp] Enable EDMA driver to allocate from beyond 4GB space.
2024-03-19 |4a7ff28| [qca-nss-dp] Restrict compilation of a file in DP module
2024-07-09 |73bad34| [qca-nss-dp] Check for DS node state before getting ppe queue
2024-05-03 |22cdbd6| [qca-nss-dp] Add PPE-DS Enqueue vp to queue mapping
2024-07-04 |5d6ef18| Merge "[qca-nss-dp] NAPI Budget change for KPI improvement"
2024-07-02 |cd0b543| Merge "[qca-nss-dp] Read fake_mac header indication from rx_desc"
2024-07-01 |160b988| [qca-nss-dp] NAPI Budget change for KPI improvement
2024-05-22 |54c2fd1| [qca-nss-dp]: Fixing SA warnings as part of qca-nss-dp module.
2024-06-22 |602534b| [qca-nss-dp] Read fake_mac header indication from rx_desc
2023-11-24 |10210e2| [qca-nss-dp] EDMA register changes for ipq54xx
2024-05-22 |1af0d03| Merge "[qca-nss-dp]: Change to support PPE-VP path for MLO Assist"
2024-05-15 |2acd9f3| [qca-nss-dp]: Change to support PPE-VP path for MLO Assist
2023-09-27 |1ca59f2| [qca-nss-dp] DP changes for ipq54xx
2024-04-18 |bc60c5a| Merge "[qca-nss-dp] Add support for the XGMAC latency computation"
2024-04-18 |6a67d6d| Merge "[qca-nss-dp] Fix the packets processing in the Rx NAPI"

Signed-off-by: Kristian Skramstad <kristian+github@83.no>
Link: https://github.com/openwrt/openwrt/pull/17731
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-02-25 10:46:33 +01:00

184 lines
5.6 KiB
Diff

From 5b05b1d7a2d2001d9711856608f61abaf7b9a9a5 Mon Sep 17 00:00:00 2001
From: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Date: Fri, 23 Jun 2023 13:34:56 +0200
Subject: [PATCH 6/8] nss_dp_main: Use a 'phy-handle' property to connect to
the PHY
The original method of connecting a PHY to the ethernet controller
requires the "qcom,link-poll", and "qcom,phy-mdio-addr" devicetree
properties. This is redundant. The PHY node already contains the MDIO
address, and attaching a PHY implies "link-poll".
Allow using a "phy-handle" property. Remove the following properties,
as they are no longer used:
* "qcom,link-poll"
* "qcom,phy-mdio-addr"
* "mdio-bus"
* "qcom,forced-speed"
* "qcom,forced-duplex"
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
include/nss_dp_dev.h | 5 +--
nss_dp_main.c | 91 +++++++-------------------------------------
2 files changed, 14 insertions(+), 82 deletions(-)
--- a/include/nss_dp_dev.h
+++ b/include/nss_dp_dev.h
@@ -225,13 +225,10 @@ struct nss_dp_dev {
unsigned long drv_flags; /* Driver specific feature flags */
/* Phy related stuff */
+ struct device_node *phy_node; /* Phy device OF node */
struct phy_device *phydev; /* Phy device */
struct mii_bus *miibus; /* MII bus */
uint32_t phy_mii_type; /* RGMII/SGMII/QSGMII */
- uint32_t phy_mdio_addr; /* Mdio address */
- bool link_poll; /* Link polling enable? */
- uint32_t forced_speed; /* Forced speed? */
- uint32_t forced_duplex; /* Forced duplex? */
uint32_t link_state; /* Current link state */
uint32_t pause; /* Current flow control settings */
--- a/nss_dp_main.c
+++ b/nss_dp_main.c
@@ -464,7 +464,7 @@ static int nss_dp_open(struct net_device
netif_start_queue(netdev);
- if (!dp_priv->link_poll) {
+ if (!dp_priv->phydev) {
/* Notify data plane link is up */
if (dp_priv->data_plane_ops->link_state(dp_priv->dpc, 1)) {
netdev_dbg(netdev, "Data plane set link failed\n");
@@ -661,6 +661,12 @@ static int32_t nss_dp_of_get_pdata(struc
return -EFAULT;
}
+ dp_priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
+ if (!dp_priv->phy_node) {
+ pr_err("%s: error parsing phy-handle\n", np->name);
+ return -EFAULT;
+ }
+
if (of_property_read_u32(np, "qcom,mactype", &hal_pdata->mactype)) {
pr_err("%s: error reading mactype\n", np->name);
return -EFAULT;
@@ -681,18 +687,6 @@ static int32_t nss_dp_of_get_pdata(struc
return -EFAULT;
#endif
- dp_priv->link_poll = of_property_read_bool(np, "qcom,link-poll");
- if (of_property_read_u32(np, "qcom,phy-mdio-addr",
- &dp_priv->phy_mdio_addr) && dp_priv->link_poll) {
- pr_err("%s: mdio addr required if link polling is enabled\n",
- np->name);
- return -EFAULT;
- }
-
- of_property_read_u32(np, "qcom,forced-speed", &dp_priv->forced_speed);
- of_property_read_u32(np, "qcom,forced-duplex", &dp_priv->forced_duplex);
-
-
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0))
maddr = (uint8_t *)of_get_mac_address(np);
#if (LINUX_VERSION_CODE > KERNEL_VERSION(5, 4, 0))
@@ -781,56 +775,6 @@ static int32_t nss_dp_of_get_pdata(struc
return 0;
}
-/*
- * nss_dp_mdio_attach()
- */
-static struct mii_bus *nss_dp_mdio_attach(struct platform_device *pdev)
-{
- struct device_node *mdio_node;
- struct platform_device *mdio_plat;
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0))
- struct ipq40xx_mdio_data *mdio_data;
-#endif
-
- /*
- * Find mii_bus using "mdio-bus" handle.
- */
- mdio_node = of_parse_phandle(pdev->dev.of_node, "mdio-bus", 0);
- if (mdio_node) {
- return of_mdio_find_bus(mdio_node);
- }
-
- mdio_node = of_find_compatible_node(NULL, NULL, "qcom,qca-mdio");
- if (!mdio_node) {
- mdio_node = of_find_compatible_node(NULL, NULL,
- "qcom,ipq40xx-mdio");
- if (!mdio_node) {
- dev_err(&pdev->dev, "cannot find mdio node by phandle\n");
- return NULL;
- }
- }
-
- mdio_plat = of_find_device_by_node(mdio_node);
- if (!mdio_plat) {
- dev_err(&pdev->dev, "cannot find platform device from mdio node\n");
- of_node_put(mdio_node);
- return NULL;
- }
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0))
- return dev_get_drvdata(&mdio_plat->dev);
-#else
- mdio_data = dev_get_drvdata(&mdio_plat->dev);
- if (!mdio_data) {
- dev_err(&pdev->dev, "cannot get mii bus reference from device data\n");
- of_node_put(mdio_node);
- return NULL;
- }
-
- return mdio_data->mii_bus;
-#endif
-}
-
#ifdef CONFIG_NET_SWITCHDEV
/*
* nss_dp_is_phy_dev()
@@ -889,7 +833,6 @@ static int32_t nss_dp_probe(struct platf
struct device_node *np = pdev->dev.of_node;
struct nss_gmac_hal_platform_data gmac_hal_pdata;
int32_t ret = 0;
- uint8_t phy_id[MII_BUS_ID_SIZE + 3];
#if defined(NSS_DP_PPE_SUPPORT)
uint32_t vsi_id;
fal_port_t port_id;
@@ -968,22 +911,16 @@ static int32_t nss_dp_probe(struct platf
dp_priv->drv_flags |= NSS_DP_PRIV_FLAG(INIT_DONE);
- if (dp_priv->link_poll) {
- dp_priv->miibus = nss_dp_mdio_attach(pdev);
- if (!dp_priv->miibus) {
- netdev_dbg(netdev, "failed to find miibus\n");
- goto phy_setup_fail;
- }
- snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT,
- dp_priv->miibus->id, dp_priv->phy_mdio_addr);
+ if (dp_priv->phy_node) {
- dp_priv->phydev = phy_connect(netdev, phy_id,
- &nss_dp_adjust_link,
- dp_priv->phy_mii_type);
- if (IS_ERR(dp_priv->phydev)) {
- netdev_dbg(netdev, "failed to connect to phy device\n");
- goto phy_setup_fail;
- }
+ dp_priv->phydev = of_phy_connect(netdev, dp_priv->phy_node,
+ &nss_dp_adjust_link, 0,
+ dp_priv->phy_mii_type);
+ if (!(dp_priv->phydev)) {
+ netdev_err(netdev, "failed to connect to phy device\n");
+ goto phy_setup_fail;
+ }
+ phy_attached_info(dp_priv->phydev);
}
#if defined(NSS_DP_PPE_SUPPORT)