Skip to contentSkip to conversation

k3-j721e: beagleboneai: Fix USB

PATCH In review Roger Quadros 3 participants 15 messages Jan 12, 2024 – Jan 22, 2024

Subsystems (5)
lore
Share & tools
lore

Roger Quadros

author reviewer
#0 lore raw

cover k3-j721e: beagleboneai: Fix USB

Hi,

This series fixes USB operation on k3-j721e based boards.

CI testing: https://github.com/u-boot/u-boot/pull/468

cheers,
-roger

Roger Quadros (5):
board: ti: j721e: Drop SERDES PHY init from board file
usb: cdns3: avoid error messages if phys don't exist
arm: dts: k3-j721e: Fix USB0 operation
arm: dts: k3-j721e-beagleboneai64: Fix USB operation configs/j721e_beagleboneai64_a72_defconfig: Enable Sierra PHY

 .../dts/k3-j721e-beagleboneai64-u-boot.dtsi   |  2 +
 .../k3-j721e-common-proc-board-u-boot.dtsi    |  8 ++
 arch/arm/dts/k3-j721e-sk-u-boot.dtsi          |  8 ++
 board/ti/j721e/evm.c                          | 77 -------------------
 configs/j721e_beagleboneai64_a72_defconfig    |  2 +
 drivers/usb/cdns3/core.c                      | 28 ++++---
 6 files changed, 38 insertions(+), 87 deletions(-)

base-commit: f28a77589e7505535a4eebdc7269df98f67dbe68

Signature · 1 line
2.34.1
author reviewer
#1 lore raw

PATCH 1/5 board: ti: j721e: Drop SERDES PHY init from board file

Since commit 69b19ca67bcb ("arm: dts: k3-j721e: Sync with v6.6-rc1"), the following error message is seen at u-boot
"Sierra init failed:-19"

Probing and initializing the SERDES PHY from
board file is not a clean solution so drop it.

Proper use case should be via PHY_UCLASS APIs.

---
 board/ti/j721e/evm.c | 77 --------------------------------------------
 1 file changed, 77 deletions(-)
board/ti/j721e/evm.c +0 -77
index c541880107..b77cffc5ef 100644
@@ -352,77 +352,6 @@ static int probe_daughtercards(void)
 }
 #endif
 
-void configure_serdes_torrent(void)
-{
-	struct udevice *dev;
-	struct phy serdes;
-	int ret;
-
-	if (!IS_ENABLED(CONFIG_PHY_CADENCE_TORRENT))
-		return;
-
-	ret = uclass_get_device_by_driver(UCLASS_PHY,
-					  DM_DRIVER_GET(torrent_phy_provider),
-					  &dev);
-	if (ret) {
-		printf("Torrent init failed:%d\n", ret);
-		return;
-	}
-
-	serdes.dev = dev;
-	serdes.id = 0;
-
-	ret = generic_phy_init(&serdes);
-	if (ret) {
-		printf("phy_init failed!!: %d\n", ret);
-		return;
-	}
-
-	ret = generic_phy_power_on(&serdes);
-	if (ret) {
-		printf("phy_power_on failed!!: %d\n", ret);
-		return;
-	}
-}
-
-void configure_serdes_sierra(void)
-{
-	struct udevice *dev, *link_dev;
-	struct phy link;
-	int ret, count, i;
-	int link_count = 0;
-
-	if (!IS_ENABLED(CONFIG_PHY_CADENCE_SIERRA))
-		return;
-
-	ret = uclass_get_device_by_driver(UCLASS_MISC,
-					  DM_DRIVER_GET(sierra_phy_provider),
-					  &dev);
-	if (ret) {
-		printf("Sierra init failed:%d\n", ret);
-		return;
-	}
-
-	count = device_get_child_count(dev);
-	for (i = 0; i < count; i++) {
-		ret = device_get_child(dev, i, &link_dev);
-		if (ret) {
-			printf("probe of sierra child node %d failed: %d\n", i, ret);
-			return;
-		}
-		if (link_dev->driver->id == UCLASS_PHY) {
-			link.dev = link_dev;
-			link.id = link_count++;
-
-			ret = generic_phy_power_on(&link);
-			if (ret) {
-				printf("phy_power_on failed!!: %d\n", ret);
-				return;
-			}
-		}
-	}
-}
-
 #ifdef CONFIG_BOARD_LATE_INIT
 static void setup_board_eeprom_env(void)
 {
@@ -476,12 +405,6 @@ int board_late_init(void)
 			probe_daughtercards();
 	}
 
-	if (board_is_j7200_som())
-		configure_serdes_torrent();
-
-	if (board_is_j721e_som())
-		configure_serdes_sierra();
-
 	return 0;
 }
 #endif
Signature · 1 line
2.34.1
author reviewer
#2 lore raw

PATCH 2/5 usb: cdns3: avoid error messages if phys don't exist

In reply to Roger Quadros

The phys property is optional so don't complain
if it doesn't exist in device tree.

---
 drivers/usb/cdns3/core.c | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)
drivers/usb/cdns3/core.c +18 -10
index 644a9791b9..12a741c6ea 100644
@@ -333,20 +333,28 @@ static int cdns3_probe(struct cdns3 *cdns)
 	mutex_init(&cdns->mutex);
 
 	ret = generic_phy_get_by_name(dev, "cdns3,usb2-phy", &cdns->usb2_phy);
-	if (ret)
-		dev_warn(dev, "Unable to get USB2 phy (ret %d)\n", ret);
-
-	ret = generic_phy_init(&cdns->usb2_phy);
-	if (ret)
+	if (!ret) {
+		ret = generic_phy_init(&cdns->usb2_phy);
+		if (ret) {
+			dev_err(dev, "USB2 PHY init failed: %d\n", ret);
+			return ret;
+		}
+	} else if (ret != -ENOENT && ret != -ENODATA) {
+		dev_err(dev, "Couldn't get USB2 PHY:  %d\n", ret);
 		return ret;
+	}
 
 	ret = generic_phy_get_by_name(dev, "cdns3,usb3-phy", &cdns->usb3_phy);
-	if (ret)
-		dev_warn(dev, "Unable to get USB3 phy (ret %d)\n", ret);
-
-	ret = generic_phy_init(&cdns->usb3_phy);
-	if (ret)
+	if (!ret) {
+		ret = generic_phy_init(&cdns->usb3_phy);
+		if (ret) {
+			dev_err(dev, "USB3 PHY init failed: %d\n", ret);
+			return ret;
+		}
+	} else if (ret != -ENOENT && ret != -ENODATA) {
+		dev_err(dev, "Couldn't get USB3 PHY:  %d\n", ret);
 		return ret;
+	}
 
 	ret = generic_phy_power_on(&cdns->usb2_phy);
 	if (ret)
Signature · 1 line
2.34.1
author reviewer
#3 lore raw

PATCH 3/5 arm: dts: k3-j721e: Fix USB0 operation

In reply to Roger Quadros

Without correct SERDES MUX and Lane control settings USB0 will be broken. Set the MUX and Lane control devices to be auto probed so they are configured correctly.

Fixes 69b19ca67bcb ("arm: dts: k3-j721e: Sync with v6.6-rc1")
---
 arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi | 8 ++++++++
 arch/arm/dts/k3-j721e-sk-u-boot.dtsi                | 8 ++++++++
 2 files changed, 16 insertions(+)
arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi +8 -0
index b77f8d92de..7ae7cf3d4c 100644
@@ -93,6 +93,14 @@
 	bootph-all;
 };
 
+&serdes_ln_ctrl {
+	u-boot,mux-autoprobe;
+};
+
+&usb_serdes_mux {
+	u-boot,mux-autoprobe;
+};
+
 &main_usbss0_pins_default {
 	bootph-all;
 };
arch/arm/dts/k3-j721e-sk-u-boot.dtsi +8 -0
index 370fe5190b..479b7bcd6f 100644
@@ -89,6 +89,14 @@
 	bootph-all;
 };
 
+&serdes_ln_ctrl {
+	u-boot,mux-autoprobe;
+};
+
+&usb_serdes_mux {
+	u-boot,mux-autoprobe;
+};
+
 &main_usbss0_pins_default {
 	bootph-all;
 };
Signature · 1 line
2.34.1
author reviewer
#4 lore raw

PATCH 4/5 arm: dts: k3-j721e-beagleboneai64: Fix USB operation

In reply to Roger Quadros

Without correct SERDES MUX and Lane control settings USB0 will be broken. Set the MUX and Lane control devices to be auto probed so they are configured correctly.

---
 arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +2 -0
index f83caf7998..017a5a722e 100644
@@ -165,6 +165,7 @@
 
 &serdes_ln_ctrl {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
 &serdes2_usb_link {
@@ -173,6 +174,7 @@
 
 &usb_serdes_mux {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
 &serdes_wiz2 {
Signature · 1 line
2.34.1
#5 lore raw

Re: [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation

Quoted 32 lines · Roger Quadros

Without correct SERDES MUX and Lane control settings USB0 will be broken. Set the MUX and Lane control devices to be auto probed so they are configured correctly.

---
 arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +2 -0
index f83caf7998..017a5a722e 100644
@@ -165,6 +165,7 @@
 
 &serdes_ln_ctrl {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
 &serdes2_usb_link {
@@ -173,6 +174,7 @@
 
 &usb_serdes_mux {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
 &serdes_wiz2 {
Signature · 1 line
2.34.1

Is this a u-boot thing? or a driver limitation?

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
author reviewer
#6 lore raw

Re: [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation

Quoted 29 lines · Nishanth Menon
Quoted 28 lines · Roger Quadros

Without correct SERDES MUX and Lane control settings USB0 will be broken. Set the MUX and Lane control devices to be auto probed so they are configured correctly.

---
 arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +2 -0
index f83caf7998..017a5a722e 100644
@@ -165,6 +165,7 @@
 
 &serdes_ln_ctrl {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
 &serdes2_usb_link {
@@ -173,6 +174,7 @@
 
 &usb_serdes_mux {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
Quoted 7 lines
Quoted 4 lines
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +0 -0
 &serdes_wiz2 {
Signature · 1 line
2.34.1

Is this a u-boot thing? or a driver limitation?

u-boot specific. We just want the mux driver to probe and apply the settings.

from drivers/mux/mux-uclass.c

int dm_mux_init(void)

{
        struct uclass *uc;
        struct udevice *dev;
        int ret;

        ret = uclass_get(UCLASS_MUX, &uc);
        if (ret < 0) {
                log_debug("unable to get MUX uclass\n");
                return ret;
        }
        uclass_foreach_dev(dev, uc) {
                if (dev_read_bool(dev, "u-boot,mux-autoprobe")) {
                        ret = device_probe(dev);
                        if (ret)
                                log_debug("unable to probe device %s\n",
                                          dev->name);
                }
        }

        return 0;
}
Signature · 2 lines
cheers,
-roger
#7 lore raw

Re: [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation

Quoted 59 lines · Roger Quadros
Quoted 29 lines · Nishanth Menon
Quoted 28 lines · Roger Quadros

Without correct SERDES MUX and Lane control settings USB0 will be broken. Set the MUX and Lane control devices to be auto probed so they are configured correctly.

---
 arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +2 -0
index f83caf7998..017a5a722e 100644
@@ -165,6 +165,7 @@
 
 &serdes_ln_ctrl {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
 &serdes2_usb_link {
@@ -173,6 +174,7 @@
 
 &usb_serdes_mux {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
Quoted 7 lines
Quoted 4 lines
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +0 -0
 &serdes_wiz2 {
Signature · 1 line
2.34.1

Is this a u-boot thing? or a driver limitation?

u-boot specific. We just want the mux driver to probe and apply the settings.

from drivers/mux/mux-uclass.c

int dm_mux_init(void)

{
        struct uclass *uc;
        struct udevice *dev;
        int ret;

        ret = uclass_get(UCLASS_MUX, &uc);
        if (ret < 0) {
                log_debug("unable to get MUX uclass\n");
                return ret;
        }
        uclass_foreach_dev(dev, uc) {
                if (dev_read_bool(dev, "u-boot,mux-autoprobe")) {
                        ret = device_probe(dev);
Quoted 10 lines
                        if (ret)
                                log_debug("unable to probe device %s\n",
                                          dev->name);
                }
        }

        return 0;
}

Uggh.. We need to see eventually how to get rid of this. This makes
https://lore.kernel.org/u-boot/[email protected]/#t
harder now?

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#8 lore raw

Re: [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation

Quoted 28 lines · Nishanth Menon
Quoted 27 lines · Roger Quadros
Quoted 24 lines · Nishanth Menon
Quoted 23 lines · Roger Quadros

Without correct SERDES MUX and Lane control settings USB0 will be broken. Set the MUX and Lane control devices to be auto probed so they are configured correctly.

---
 arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +1 -0
index f83caf7998..017a5a722e 100644
@@ -165,6 +165,7 @@
 
 &serdes_ln_ctrl {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
 &serdes2_usb_link {
@@ -173,6 +174,7 @@
 
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi line 180

Quoted 6 lines
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +1 -0
 &usb_serdes_mux {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
 &serdes_wiz2 {

OK, so both of these are compatible = "mmio-mux", is the problem they aren't probed in time or something else?

Quoted 37 lines
Quoted 26 lines
Quoted 6 lines
Quoted 3 lines
Signature · 1 line
2.34.1

Is this a u-boot thing? or a driver limitation?

u-boot specific. We just want the mux driver to probe and apply the settings.

from drivers/mux/mux-uclass.c

int dm_mux_init(void)

{
        struct uclass *uc;
        struct udevice *dev;
        int ret;

        ret = uclass_get(UCLASS_MUX, &uc);
        if (ret < 0) {
                log_debug("unable to get MUX uclass\n");
                return ret;
        }
        uclass_foreach_dev(dev, uc) {
                if (dev_read_bool(dev, "u-boot,mux-autoprobe")) {
                        ret = device_probe(dev);
Quoted 10 lines
                        if (ret)
                                log_debug("unable to probe device %s\n",
                                          dev->name);
                }
        }

        return 0;
}
Quoted 4 lines

Uggh.. We need to see eventually how to get rid of this. This makes
https://lore.kernel.org/u-boot/[email protected]/#t
harder now?

No, it should be fine, Sumit's series handles -u-boot.dtsi files.

Signature · 1 line
Tom
author reviewer
#9 lore raw

Re: [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation

Quoted 34 lines · Tom Rini
Quoted 33 lines · Nishanth Menon
Quoted 32 lines · Roger Quadros
Quoted 29 lines · Nishanth Menon
Quoted 28 lines · Roger Quadros

Without correct SERDES MUX and Lane control settings USB0 will be broken. Set the MUX and Lane control devices to be auto probed so they are configured correctly.

---
 arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +2 -0
index f83caf7998..017a5a722e 100644
@@ -165,6 +165,7 @@
 
 &serdes_ln_ctrl {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
 &serdes2_usb_link {
@@ -173,6 +174,7 @@
 
 &usb_serdes_mux {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi line 180

Quoted 1 line
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +0 -0
 &serdes_wiz2 {

OK, so both of these are compatible = "mmio-mux", is the problem they aren't probed in time or something else?

That's correct. They aren't probed ever. But that is because there are no explicit consumers for them. Since this is a platform wide configuration, we have been relying on the "idle-states" property and that they are auto-probed.

Quoted 44 lines
Quoted 37 lines
Quoted 26 lines
Quoted 6 lines
Quoted 3 lines
Signature · 1 line
2.34.1

Is this a u-boot thing? or a driver limitation?

u-boot specific. We just want the mux driver to probe and apply the settings.

from drivers/mux/mux-uclass.c

int dm_mux_init(void)

{
        struct uclass *uc;
        struct udevice *dev;
        int ret;

        ret = uclass_get(UCLASS_MUX, &uc);
        if (ret < 0) {
                log_debug("unable to get MUX uclass\n");
                return ret;
        }
        uclass_foreach_dev(dev, uc) {
                if (dev_read_bool(dev, "u-boot,mux-autoprobe")) {
                        ret = device_probe(dev);
Quoted 10 lines
                        if (ret)
                                log_debug("unable to probe device %s\n",
                                          dev->name);
                }
        }

        return 0;
}
Quoted 4 lines

Uggh.. We need to see eventually how to get rid of this. This makes
https://lore.kernel.org/u-boot/[email protected]/#t
harder now?

No, it should be fine, Sumit's series handles -u-boot.dtsi files.

Signature · 2 lines
cheers,
-roger
#10 lore raw

Re: [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation

Quoted 43 lines · Roger Quadros
Quoted 34 lines · Tom Rini
Quoted 33 lines · Nishanth Menon
Quoted 32 lines · Roger Quadros
Quoted 29 lines · Nishanth Menon
Quoted 28 lines · Roger Quadros

Without correct SERDES MUX and Lane control settings USB0 will be broken. Set the MUX and Lane control devices to be auto probed so they are configured correctly.

---
 arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +2 -0
index f83caf7998..017a5a722e 100644
@@ -165,6 +165,7 @@
 
 &serdes_ln_ctrl {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
 &serdes2_usb_link {
@@ -173,6 +174,7 @@
 
 &usb_serdes_mux {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi line 180

Quoted 1 line
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +0 -0
 &serdes_wiz2 {

OK, so both of these are compatible = "mmio-mux", is the problem they aren't probed in time or something else?

Quoted 3 lines

That's correct. They aren't probed ever. But that is because there are no explicit consumers for them. Since this is a platform wide configuration, we have been relying on the "idle-states" property and that they are auto-probed.

OK. Could we borrow the "wrap" logic that drivers/led/led_gpio.c for example does to get the probe to happen inside drivers/mux/mmio.c instead? I feel like there might have been assumptions about grander needs back when the framework for muxers was done that has not panned out since.

Signature · 1 line
Tom
author reviewer
#11 lore raw

Re: [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation

Quoted 48 lines · Tom Rini
Quoted 43 lines · Roger Quadros
Quoted 34 lines · Tom Rini
Quoted 33 lines · Nishanth Menon
Quoted 32 lines · Roger Quadros
Quoted 29 lines · Nishanth Menon
Quoted 28 lines · Roger Quadros

Without correct SERDES MUX and Lane control settings USB0 will be broken. Set the MUX and Lane control devices to be auto probed so they are configured correctly.

---
 arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +2 -0
index f83caf7998..017a5a722e 100644
@@ -165,6 +165,7 @@
 
 &serdes_ln_ctrl {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
 &serdes2_usb_link {
@@ -173,6 +174,7 @@
 
 &usb_serdes_mux {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi line 180

Quoted 1 line
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +0 -0
 &serdes_wiz2 {

OK, so both of these are compatible = "mmio-mux", is the problem they aren't probed in time or something else?

Quoted 3 lines

That's correct. They aren't probed ever. But that is because there are no explicit consumers for them. Since this is a platform wide configuration, we have been relying on the "idle-states" property and that they are auto-probed.

Quoted 6 lines

OK. Could we borrow the "wrap" logic that drivers/led/led_gpio.c for example does to get the probe to happen inside drivers/mux/mmio.c instead? I feel like there might have been assumptions about grander needs back when the framework for muxers was done that has not panned out since.

We only need the MUX driver to probe if the MUX node contains the "idle-states" property.

So maybe the MUX UCLASS code should be checking for that instead of/along with the custom u-boot,mux-autoprobe property?

How does this look?

drivers/mux/mux-uclass.c +2 -1
index c98576ceb8..8833888ded 100644
@@ -318,7 +318,8 @@ int dm_mux_init(void)
 		return ret;
 	}
 	uclass_foreach_dev(dev, uc) {
-		if (dev_read_bool(dev, "u-boot,mux-autoprobe")) {
+		if (dev_read_bool(dev, "u-boot,mux-autoprobe") ||
+		    dev_read_bool(dev, "idle-states")) {
 			ret = device_probe(dev);
 			if (ret)
 				log_debug("unable to probe device %s\n",
Signature · 2 lines
cheers,
-roger
#12 lore raw

Re: [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation

Quoted 71 lines · Roger Quadros
Quoted 48 lines · Tom Rini
Quoted 43 lines · Roger Quadros
Quoted 34 lines · Tom Rini
Quoted 33 lines · Nishanth Menon
Quoted 32 lines · Roger Quadros
Quoted 29 lines · Nishanth Menon
Quoted 28 lines · Roger Quadros

Without correct SERDES MUX and Lane control settings USB0 will be broken. Set the MUX and Lane control devices to be auto probed so they are configured correctly.

---
 arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +2 -0
index f83caf7998..017a5a722e 100644
@@ -165,6 +165,7 @@
 
 &serdes_ln_ctrl {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
 &serdes2_usb_link {
@@ -173,6 +174,7 @@
 
 &usb_serdes_mux {
 	bootph-all;
+	u-boot,mux-autoprobe;
 };
 
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi line 180

Quoted 1 line
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +0 -0
 &serdes_wiz2 {

OK, so both of these are compatible = "mmio-mux", is the problem they aren't probed in time or something else?

Quoted 3 lines

That's correct. They aren't probed ever. But that is because there are no explicit consumers for them. Since this is a platform wide configuration, we have been relying on the "idle-states" property and that they are auto-probed.

Quoted 6 lines

OK. Could we borrow the "wrap" logic that drivers/led/led_gpio.c for example does to get the probe to happen inside drivers/mux/mmio.c instead? I feel like there might have been assumptions about grander needs back when the framework for muxers was done that has not panned out since.

We only need the MUX driver to probe if the MUX node contains the "idle-states" property.

So maybe the MUX UCLASS code should be checking for that instead of/along with the custom u-boot,mux-autoprobe property?

How does this look?

drivers/mux/mux-uclass.c +0 -0
index c98576ceb8..8833888ded 100644

drivers/mux/mux-uclass.c int dm_mux_init(void) · line 325

Quoted 9 lines
drivers/mux/mux-uclass.c +2 -1
@@ -318,7 +318,8 @@ int dm_mux_init(void)
 		return ret;
 	}
 	uclass_foreach_dev(dev, uc) {
-		if (dev_read_bool(dev, "u-boot,mux-autoprobe")) {
+		if (dev_read_bool(dev, "u-boot,mux-autoprobe") ||
+		    dev_read_bool(dev, "idle-states")) {
 			ret = device_probe(dev);
 			if (ret)
 				log_debug("unable to probe device %s\n",

I would just drop "u-boot,mux-autoprobe" as TI platforms are the only users of this uclass and mmio driver, iirc.

Signature · 1 line
Tom
author reviewer
#13 lore raw

PATCH 5/5 configs/j721e_beagleboneai64_a72_defconfig: Enable Sierra PHY

In reply to Roger Quadros

This is required for USB Super-Speed operation.

---
 configs/j721e_beagleboneai64_a72_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/j721e_beagleboneai64_a72_defconfig +2 -0
index 959f86844d..f66206f6e3 100644
@@ -127,6 +127,8 @@ CONFIG_PHY_TI_DP83867=y
 CONFIG_PHY_FIXED=y
 CONFIG_TI_AM65_CPSW_NUSS=y
 CONFIG_PHY=y
+CONFIG_PHY_J721E_WIZ=y
+CONFIG_PHY_CADENCE_SIERRA=y
 CONFIG_SPL_PHY=y
 CONFIG_PINCTRL=y
 # CONFIG_PINCTRL_GENERIC is not set
Signature · 1 line
2.34.1