lede/package/qca/qca-nss-dp/patches/0013-nss_dp_main-support-fixed-link.patch

42 lines
1.2 KiB
Diff

From 309a1a330ccaa103a7648e944d97a0032116b338 Mon Sep 17 00:00:00 2001
From: hzy <hzyitc@outlook.com>
Date: Mon, 22 Apr 2024 21:50:39 +0800
Subject: [PATCH] nss_dp_main: support fixed-link
Signed-off-by: hzy <hzyitc@outlook.com>
---
nss_dp_main.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/nss_dp_main.c b/nss_dp_main.c
index 9a09edd5..204063bf 100644
--- a/nss_dp_main.c
+++ b/nss_dp_main.c
@@ -619,11 +619,20 @@ static int32_t nss_dp_of_get_pdata(struct device_node *np,
}
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(!dp_priv->phy_node) {
+ if(of_phy_is_fixed_link(np)) {
+ int ret = of_phy_register_fixed_link(np);
+ if(ret < 0) {
+ pr_err("%s: fail to register fixed-link: %d\n", np->name, ret);
+ return -EFAULT;
+ }
+ }
+ dp_priv->phy_node = of_node_get(np);
}
+ if(!dp_priv->phy_node)
+ pr_err("%s: no phy-handle or fixed-link found\n", np->name);
+
if (of_property_read_u32(np, "qcom,mactype", &hal_pdata->mactype)) {
pr_err("%s: error reading mactype\n", np->name);
return -EFAULT;
--
2.40.1