diff --git a/qca/qca-nss-dp/Makefile b/qca/qca-nss-dp/Makefile index 1f3df5e..556bf71 100644 --- a/qca/qca-nss-dp/Makefile +++ b/qca/qca-nss-dp/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/nss-dp.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2022-04-30 -PKG_SOURCE_VERSION:=72e9ec4187414461cbcf6ccff100e8b5ebe5f40b -PKG_MIRROR_HASH:=805f16e59c75511132922f97740ebf6bf953845b0bbfd2089c4615456893bb37 +PKG_SOURCE_DATE:=2022-07-06 +PKG_SOURCE_VERSION:=2976b05cb8ddfaa695fc00372c8538a3dfb32277 +PKG_MIRROR_HASH:=c11d73e27385212fce6701b02146ee615d44c8e340c73917cbe4067502bdfc24 PKG_BUILD_PARALLEL:=1 diff --git a/qca/qca-nss-dp/patches/0011-treewide-fix-confusing-printing-of-registered-netdev.patch b/qca/qca-nss-dp/patches/0011-treewide-fix-confusing-printing-of-registered-netdev.patch index 63fea19..c33f849 100644 --- a/qca/qca-nss-dp/patches/0011-treewide-fix-confusing-printing-of-registered-netdev.patch +++ b/qca/qca-nss-dp/patches/0011-treewide-fix-confusing-printing-of-registered-netdev.patch @@ -10,39 +10,22 @@ give the user some info on correct nss-dp probe. Signed-off-by: Ansuel Smith --- - hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 4 ++-- nss_dp_main.c | 3 +++ - 2 files changed, 5 insertions(+), 2 deletions(-) + 1 files changed, 3 insertions(+), 0 deletions(-) -diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c -index 0af39c2..1d748db 100644 ---- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c -+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c -@@ -822,8 +822,8 @@ static int edma_register_netdevice(struct net_device *netdev, uint32_t macid) - return -EINVAL; - } - -- netdev_info(netdev, "nss_dp_edma: Registering netdev %s(qcom-id:%d) with EDMA\n", -- netdev->name, macid); -+ netdev_dbg(netdev, "nss_dp_edma: Registering netdev %s(qcom-id:%d) with EDMA\n", -+ netdev->name, macid); - - /* - * We expect 'macid' to correspond to ports numbers on diff --git a/nss_dp_main.c b/nss_dp_main.c index c0ae9d6..441c300 100644 --- a/nss_dp_main.c +++ b/nss_dp_main.c -@@ -875,6 +875,9 @@ static int32_t nss_dp_probe(struct platform_device *pdev) +@@ -860,6 +860,9 @@ static int32_t nss_dp_probe(struct platf goto phy_setup_fail; } - -+ netdev_info(netdev, "Registered netdev %s(qcom-id:%d)\n", -+ netdev->name, port_id); -+ - dp_global_ctx.nss_dp[dp_priv->macid - 1] = dp_priv; - dp_global_ctx.slowproto_acl_bm = 0; - --- -2.34.1 ++ netdev_info(netdev, "Registered netdev %s(qcom-id:%d)\n", ++ netdev->name, port_id); ++ + dp_global_ctx.nss_dp[nss_dp_get_idx_from_macid(dp_priv->macid)] = dp_priv; + dp_global_ctx.slowproto_acl_bm = 0; + +-- +2.34.1 diff --git a/qca/qca-nss-dp/patches/0012-gmac-syn-xgmac-silence-debug-log-on-probe.patch b/qca/qca-nss-dp/patches/0012-gmac-syn-xgmac-silence-debug-log-on-probe.patch deleted file mode 100644 index 2bc576c..0000000 --- a/qca/qca-nss-dp/patches/0012-gmac-syn-xgmac-silence-debug-log-on-probe.patch +++ /dev/null @@ -1,28 +0,0 @@ -From fee52ef165e9fab2fca15492677082fd8e9e891f Mon Sep 17 00:00:00 2001 -From: Ansuel Smith -Date: Thu, 19 May 2022 23:40:24 +0200 -Subject: [PATCH 12/12] gmac: syn: xgmac: silence debug log on probe - -Silence debug log set as info in xgmac port probe. - -Signed-off-by: Ansuel Smith ---- - hal/gmac_ops/syn/xgmac/syn_if.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hal/gmac_ops/syn/xgmac/syn_if.c b/hal/gmac_ops/syn/xgmac/syn_if.c -index 1152f5c..bc2880d 100644 ---- a/hal/gmac_ops/syn/xgmac/syn_if.c -+++ b/hal/gmac_ops/syn/xgmac/syn_if.c -@@ -445,7 +445,7 @@ static void *syn_init(struct nss_gmac_hal_platform_data *gmacpdata) - - spin_lock_init(&shd->nghd.slock); - -- netdev_info(ndev, "ioremap OK.Size 0x%x Ndev base 0x%lx macbase 0x%px\n", -+ netdev_dbg(ndev, "ioremap OK.Size 0x%x Ndev base 0x%lx macbase 0x%px\n", - gmacpdata->reg_len, - ndev->base_addr, - shd->nghd.mac_base); --- -2.34.1 - diff --git a/qca/qca-nss-dp/patches/0013-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch b/qca/qca-nss-dp/patches/0013-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch index ea6993d..bc8721b 100644 --- a/qca/qca-nss-dp/patches/0013-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch +++ b/qca/qca-nss-dp/patches/0013-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch @@ -29,7 +29,7 @@ index 19b3e78..63a857a 100644 +++ b/include/nss_dp_dev.h @@ -100,13 +100,10 @@ struct nss_dp_dev { unsigned long drv_flags; /* Driver specific feature flags */ - + /* Phy related stuff */ + struct device_node *phy_node; struct phy_device *phydev; /* Phy device */ @@ -41,15 +41,15 @@ index 19b3e78..63a857a 100644 - uint32_t forced_duplex; /* Forced duplex? */ uint32_t link_state; /* Current link state */ uint32_t pause; /* Current flow control settings */ - + diff --git a/nss_dp_main.c b/nss_dp_main.c index 441c300..a1e8627 100644 --- a/nss_dp_main.c +++ b/nss_dp_main.c @@ -399,7 +399,7 @@ static int nss_dp_open(struct net_device *netdev) - + netif_start_queue(netdev); - + - if (!dp_priv->link_poll) { + if (!dp_priv->phydev) { /* Notify data plane link is up */ @@ -58,7 +58,7 @@ index 441c300..a1e8627 100644 @@ -576,6 +576,8 @@ static int32_t nss_dp_of_get_pdata(struct device_node *np, return -EFAULT; } - + + dp_priv->phy_node = of_parse_phandle(np, "phy-handle", 0); + if (of_property_read_u32(np, "qcom,mactype", &hal_pdata->mactype)) { @@ -78,13 +78,13 @@ index 441c300..a1e8627 100644 - - of_property_read_u32(np, "qcom,forced-speed", &dp_priv->forced_speed); - of_property_read_u32(np, "qcom,forced-duplex", &dp_priv->forced_duplex); - + ret = of_get_mac_address(np, maddr); if (!ret && is_valid_ether_addr(maddr)) { @@ -636,50 +628,6 @@ static int32_t nss_dp_of_get_pdata(struct device_node *np, return 0; } - + -/* - * nss_dp_mdio_attach() - */ @@ -140,10 +140,10 @@ index 441c300..a1e8627 100644 #if defined(NSS_DP_PPE_SUPPORT) uint32_t vsi_id; fal_port_t port_id; -@@ -813,37 +760,17 @@ static int32_t nss_dp_probe(struct platform_device *pdev) - +@@ -758,24 +758,18 @@ 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) { @@ -153,37 +153,26 @@ index 441c300..a1e8627 100644 - 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) { ++ if (dp_priv->phy_node) { SET_NETDEV_DEV(netdev, &pdev->dev); -- + - dp_priv->phydev = phy_connect(netdev, phy_id, - &nss_dp_adjust_link, - dp_priv->phy_mii_type); -+ dp_priv->phydev = of_phy_connect(netdev, dp_priv->phy_node, -+ &nss_dp_adjust_link, 0, -+ dp_priv->phy_mii_type); - if (IS_ERR(dp_priv->phydev)) { +- 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 (IS_ERR(dp_priv->phydev)) { + dev_err(&pdev->dev, "Could not attach to PHY\n"); - goto phy_setup_fail; ++ goto phy_setup_fail; } - --#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) -- dp_priv->phydev->advertising |= -- (ADVERTISED_Pause | ADVERTISED_Asym_Pause); -- dp_priv->phydev->supported |= -- (SUPPORTED_Pause | SUPPORTED_Asym_Pause); --#else -- linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, dp_priv->phydev->advertising); -- linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, dp_priv->phydev->advertising); -- -- linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, dp_priv->phydev->supported); -- linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, dp_priv->phydev->supported); --#endif -+ phy_attached_info(dp_priv->phydev); ++ ++ phy_attached_info(dp_priv->phydev); } - - #if defined(NSS_DP_PPE_SUPPORT) --- -2.36.1 + #if defined(NSS_DP_PPE_SUPPORT) +-- +2.36.1 diff --git a/qca/qca-nss-dp/patches/0015-nss-dp-allow-setting-netdev-name-from-DTS.patch b/qca/qca-nss-dp/patches/0015-nss-dp-allow-setting-netdev-name-from-DTS.patch new file mode 100644 index 0000000..98ed63e --- /dev/null +++ b/qca/qca-nss-dp/patches/0015-nss-dp-allow-setting-netdev-name-from-DTS.patch @@ -0,0 +1,54 @@ +From 358b93e40d0c6b6d381fe0e9d2a63c45a10321b3 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Sun, 4 Dec 2022 18:41:36 +0100 +Subject: [PATCH] nss-dp: allow setting netdev name from DTS + +Allow reading the desired netdev name from DTS like DSA allows and then +set it as the netdev name during registration. + +If label is not defined, simply fallback to kernel ethN enumeration. + +Signed-off-by: Robert Marko +--- + nss_dp_main.c | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +diff --git a/nss_dp_main.c b/nss_dp_main.c +index 18e1088..19e14fb 100644 +--- a/nss_dp_main.c ++++ b/nss_dp_main.c +@@ -683,18 +683,29 @@ static int32_t nss_dp_probe(struct platform_device *pdev) + struct nss_dp_dev *dp_priv; + struct device_node *np = pdev->dev.of_node; + struct nss_gmac_hal_platform_data gmac_hal_pdata; ++ const char *name = of_get_property(np, "label", NULL); + int32_t ret = 0; ++ int assign_type; + #if defined(NSS_DP_PPE_SUPPORT) + uint32_t vsi_id; + fal_port_t port_id; + #endif + ++ if (name) { ++ assign_type = NET_NAME_PREDICTABLE; ++ } else { ++ name = "eth%d"; ++ assign_type = NET_NAME_ENUM; ++ } ++ + /* TODO: See if we need to do some SoC level common init */ + +- netdev = alloc_etherdev_mqs(sizeof(struct nss_dp_dev), +- NSS_DP_NETDEV_TX_QUEUE_NUM, NSS_DP_NETDEV_RX_QUEUE_NUM); ++ netdev = alloc_netdev_mqs(sizeof(struct nss_dp_dev), ++ name, assign_type, ++ ether_setup, ++ NSS_DP_NETDEV_TX_QUEUE_NUM, NSS_DP_NETDEV_RX_QUEUE_NUM); + if (!netdev) { +- pr_info("alloc_etherdev() failed\n"); ++ dev_err(&pdev->dev, "alloc_netdev_mqs() failed\n"); + return -ENOMEM; + } + +-- +2.38.1