From cf4ce59b3b70238352c7f1729f0f7223214828ad Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Fri, 20 Sep 2024 01:46:19 +0000
Subject: [PATCH] rtl88x2CE_WiFi_linux add concurrent mode
---
u-boot/drivers/phy/phy-rockchip-usbdp.c | 26 ++++++++++++++------------
1 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/u-boot/drivers/phy/phy-rockchip-usbdp.c b/u-boot/drivers/phy/phy-rockchip-usbdp.c
index 7b624f8..cefceff 100644
--- a/u-boot/drivers/phy/phy-rockchip-usbdp.c
+++ b/u-boot/drivers/phy/phy-rockchip-usbdp.c
@@ -549,14 +549,15 @@
return 0;
}
-static int udphy_parse_lane_mux_data(struct rockchip_udphy *udphy, const struct device_node *np)
+static int udphy_parse_lane_mux_data(struct rockchip_udphy *udphy, struct udevice *dev)
{
+ const struct device_node *np = ofnode_to_np(dev->node);
struct property *prop;
int ret, i, len, num_lanes;
prop = of_find_property(np, "rockchip,dp-lane-mux", &len);
if (!prop) {
- dev_dbg(udphy->dev, "failed to find dp lane mux, following dp alt mode\n");
+ dev_dbg(dev, "failed to find dp lane mux, following dp alt mode\n");
udphy->mode = UDPHY_MODE_USB;
return 0;
}
@@ -564,13 +565,13 @@
num_lanes = len / sizeof(u32);
if (num_lanes != 2 && num_lanes != 4) {
- dev_err(udphy->dev, "invalid number of lane mux\n");
+ dev_err(dev, "invalid number of lane mux\n");
return -EINVAL;
}
ret = of_read_u32_array(np, "rockchip,dp-lane-mux", udphy->dp_lane_sel, num_lanes);
if (ret) {
- dev_err(udphy->dev, "get dp lane mux failed\n");
+ dev_err(dev, "get dp lane mux failed\n");
return -EINVAL;
}
@@ -578,7 +579,7 @@
int j;
if (udphy->dp_lane_sel[i] > 3) {
- dev_err(udphy->dev, "lane mux between 0 and 3, exceeding the range\n");
+ dev_err(dev, "lane mux between 0 and 3, exceeding the range\n");
return -EINVAL;
}
@@ -586,22 +587,23 @@
for (j = i + 1; j < num_lanes; j++) {
if (udphy->dp_lane_sel[i] == udphy->dp_lane_sel[j]) {
- dev_err(udphy->dev, "set repeat lane mux value\n");
+ dev_err(dev, "set repeat lane mux value\n");
return -EINVAL;
}
}
}
udphy->mode = UDPHY_MODE_DP;
- if (num_lanes == 2)
+ if (num_lanes == 2) {
udphy->mode |= UDPHY_MODE_USB;
+ udphy->flip = udphy->lane_mux_sel[0] == PHY_LANE_MUX_DP ? true : false;
+ }
return 0;
}
static int udphy_parse_dt(struct rockchip_udphy *udphy, struct udevice *dev)
{
- const struct device_node *np = ofnode_to_np(dev->node);
enum usb_device_speed maximum_speed;
int ret;
@@ -645,7 +647,7 @@
}
}
- ret = udphy_parse_lane_mux_data(udphy, np);
+ ret = udphy_parse_lane_mux_data(udphy, dev);
if (ret)
return ret;
@@ -947,7 +949,7 @@
dev_for_each_subnode(subnode, parent) {
if (!ofnode_valid(subnode)) {
- printf("%s: no subnode for %s", __func__, parent->name);
+ printf("%s: no subnode for %s\n", __func__, parent->name);
return -ENXIO;
}
@@ -1014,14 +1016,14 @@
val & TRSV_LN0_MON_RX_CDR_LOCK_DONE,
200, 100);
if (ret)
- dev_err(udphy->dev, "trsv ln0 mon rx cdr lock timeout\n");
+ dev_notice(udphy->dev, "trsv ln0 mon rx cdr lock timeout\n");
} else {
ret = regmap_read_poll_timeout(udphy->pma_regmap,
TRSV_LN2_MON_RX_CDR_DONE_OFFSET, val,
val & TRSV_LN2_MON_RX_CDR_LOCK_DONE,
200, 100);
if (ret)
- dev_err(udphy->dev, "trsv ln2 mon rx cdr lock timeout\n");
+ dev_notice(udphy->dev, "trsv ln2 mon rx cdr lock timeout\n");
}
}
--
Gitblit v1.6.2