All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] k3-j721e: beagleboneai: Fix USB
@ 2024-01-12 12:49 Roger Quadros
  2024-01-12 12:49 ` [PATCH 1/5] board: ti: j721e: Drop SERDES PHY init from board file Roger Quadros
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Roger Quadros @ 2024-01-12 12:49 UTC (permalink / raw)
  To: nm, robertcnelson, trini, marex
  Cc: n-francis, praneeth, s-vadapalli, r-gunasekaran, srk, vigneshr,
	u-boot, Roger Quadros

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
-- 
2.34.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/5] board: ti: j721e: Drop SERDES PHY init from board file
  2024-01-12 12:49 [PATCH 0/5] k3-j721e: beagleboneai: Fix USB Roger Quadros
@ 2024-01-12 12:49 ` Roger Quadros
  2024-01-12 12:49 ` [PATCH 2/5] usb: cdns3: avoid error messages if phys don't exist Roger Quadros
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Roger Quadros @ 2024-01-12 12:49 UTC (permalink / raw)
  To: nm, robertcnelson, trini, marex
  Cc: n-francis, praneeth, s-vadapalli, r-gunasekaran, srk, vigneshr,
	u-boot, Roger Quadros

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.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
 board/ti/j721e/evm.c | 77 --------------------------------------------
 1 file changed, 77 deletions(-)

diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index c541880107..b77cffc5ef 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/5] usb: cdns3: avoid error messages if phys don't exist
  2024-01-12 12:49 [PATCH 0/5] k3-j721e: beagleboneai: Fix USB Roger Quadros
  2024-01-12 12:49 ` [PATCH 1/5] board: ti: j721e: Drop SERDES PHY init from board file Roger Quadros
@ 2024-01-12 12:49 ` Roger Quadros
  2024-01-12 12:49 ` [PATCH 3/5] arm: dts: k3-j721e: Fix USB0 operation Roger Quadros
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Roger Quadros @ 2024-01-12 12:49 UTC (permalink / raw)
  To: nm, robertcnelson, trini, marex
  Cc: n-francis, praneeth, s-vadapalli, r-gunasekaran, srk, vigneshr,
	u-boot, Roger Quadros

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

Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
 drivers/usb/cdns3/core.c | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index 644a9791b9..12a741c6ea 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -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)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/5] arm: dts: k3-j721e: Fix USB0 operation
  2024-01-12 12:49 [PATCH 0/5] k3-j721e: beagleboneai: Fix USB Roger Quadros
  2024-01-12 12:49 ` [PATCH 1/5] board: ti: j721e: Drop SERDES PHY init from board file Roger Quadros
  2024-01-12 12:49 ` [PATCH 2/5] usb: cdns3: avoid error messages if phys don't exist Roger Quadros
@ 2024-01-12 12:49 ` Roger Quadros
  2024-01-12 12:49 ` [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation Roger Quadros
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Roger Quadros @ 2024-01-12 12:49 UTC (permalink / raw)
  To: nm, robertcnelson, trini, marex
  Cc: n-francis, praneeth, s-vadapalli, r-gunasekaran, srk, vigneshr,
	u-boot, 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")
Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
 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(+)

diff --git a/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi
index b77f8d92de..7ae7cf3d4c 100644
--- a/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi
+++ b/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi
@@ -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;
 };
diff --git a/arch/arm/dts/k3-j721e-sk-u-boot.dtsi b/arch/arm/dts/k3-j721e-sk-u-boot.dtsi
index 370fe5190b..479b7bcd6f 100644
--- a/arch/arm/dts/k3-j721e-sk-u-boot.dtsi
+++ b/arch/arm/dts/k3-j721e-sk-u-boot.dtsi
@@ -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;
 };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation
  2024-01-12 12:49 [PATCH 0/5] k3-j721e: beagleboneai: Fix USB Roger Quadros
                   ` (2 preceding siblings ...)
  2024-01-12 12:49 ` [PATCH 3/5] arm: dts: k3-j721e: Fix USB0 operation Roger Quadros
@ 2024-01-12 12:49 ` Roger Quadros
  2024-01-12 13:02   ` Nishanth Menon
  2024-01-12 12:49 ` [PATCH 5/5] configs/j721e_beagleboneai64_a72_defconfig: Enable Sierra PHY Roger Quadros
  2024-01-20 21:04 ` [PATCH 0/5] k3-j721e: beagleboneai: Fix USB Tom Rini
  5 siblings, 1 reply; 15+ messages in thread
From: Roger Quadros @ 2024-01-12 12:49 UTC (permalink / raw)
  To: nm, robertcnelson, trini, marex
  Cc: n-francis, praneeth, s-vadapalli, r-gunasekaran, srk, vigneshr,
	u-boot, 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.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
 arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
index f83caf7998..017a5a722e 100644
--- a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
+++ b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
@@ -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 {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 5/5] configs/j721e_beagleboneai64_a72_defconfig: Enable Sierra PHY
  2024-01-12 12:49 [PATCH 0/5] k3-j721e: beagleboneai: Fix USB Roger Quadros
                   ` (3 preceding siblings ...)
  2024-01-12 12:49 ` [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation Roger Quadros
@ 2024-01-12 12:49 ` Roger Quadros
  2024-01-20 21:04 ` [PATCH 0/5] k3-j721e: beagleboneai: Fix USB Tom Rini
  5 siblings, 0 replies; 15+ messages in thread
From: Roger Quadros @ 2024-01-12 12:49 UTC (permalink / raw)
  To: nm, robertcnelson, trini, marex
  Cc: n-francis, praneeth, s-vadapalli, r-gunasekaran, srk, vigneshr,
	u-boot, Roger Quadros

This is required for USB Super-Speed operation.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
 configs/j721e_beagleboneai64_a72_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/j721e_beagleboneai64_a72_defconfig b/configs/j721e_beagleboneai64_a72_defconfig
index 959f86844d..f66206f6e3 100644
--- a/configs/j721e_beagleboneai64_a72_defconfig
+++ b/configs/j721e_beagleboneai64_a72_defconfig
@@ -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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation
  2024-01-12 12:49 ` [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation Roger Quadros
@ 2024-01-12 13:02   ` Nishanth Menon
  2024-01-12 13:06     ` Roger Quadros
  0 siblings, 1 reply; 15+ messages in thread
From: Nishanth Menon @ 2024-01-12 13:02 UTC (permalink / raw)
  To: Roger Quadros
  Cc: robertcnelson, trini, marex, n-francis, praneeth, s-vadapalli,
	r-gunasekaran, srk, vigneshr, u-boot

On 14:49-20240112, Roger Quadros wrote:
> 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.
> 
> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> ---
>  arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> index f83caf7998..017a5a722e 100644
> --- a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> +++ b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> @@ -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 {
> -- 
> 2.34.1
> 

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

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation
  2024-01-12 13:02   ` Nishanth Menon
@ 2024-01-12 13:06     ` Roger Quadros
  2024-01-12 13:14       ` Nishanth Menon
  0 siblings, 1 reply; 15+ messages in thread
From: Roger Quadros @ 2024-01-12 13:06 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: robertcnelson, trini, marex, n-francis, praneeth, s-vadapalli,
	r-gunasekaran, srk, vigneshr, u-boot



On 12/01/2024 15:02, Nishanth Menon wrote:
> On 14:49-20240112, Roger Quadros wrote:
>> 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.
>>
>> Signed-off-by: Roger Quadros <rogerq@kernel.org>
>> ---
>>  arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
>> index f83caf7998..017a5a722e 100644
>> --- a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
>> +++ b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
>> @@ -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 {
>> -- 
>> 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;
}


-- 
cheers,
-roger

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation
  2024-01-12 13:06     ` Roger Quadros
@ 2024-01-12 13:14       ` Nishanth Menon
  2024-01-12 13:21         ` Tom Rini
  0 siblings, 1 reply; 15+ messages in thread
From: Nishanth Menon @ 2024-01-12 13:14 UTC (permalink / raw)
  To: Roger Quadros
  Cc: robertcnelson, trini, marex, n-francis, praneeth, s-vadapalli,
	r-gunasekaran, srk, vigneshr, u-boot

On 15:06-20240112, Roger Quadros wrote:
> 
> 
> On 12/01/2024 15:02, Nishanth Menon wrote:
> > On 14:49-20240112, Roger Quadros wrote:
> >> 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.
> >>
> >> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> >> ---
> >>  arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
> >>  1 file changed, 2 insertions(+)
> >>
> >> diff --git a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> >> index f83caf7998..017a5a722e 100644
> >> --- a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> >> +++ b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> >> @@ -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 {
> >> -- 
> >> 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;
> }
> 
> 

Uggh.. We need to see eventually how to get rid of this.
This makes
https://lore.kernel.org/u-boot/20240110103547.719757-1-sumit.garg@linaro.org/#t
harder now?

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation
  2024-01-12 13:14       ` Nishanth Menon
@ 2024-01-12 13:21         ` Tom Rini
  2024-01-15 11:40           ` Roger Quadros
  0 siblings, 1 reply; 15+ messages in thread
From: Tom Rini @ 2024-01-12 13:21 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Roger Quadros, robertcnelson, marex, n-francis, praneeth,
	s-vadapalli, r-gunasekaran, srk, vigneshr, u-boot

[-- Attachment #1: Type: text/plain, Size: 2583 bytes --]

On Fri, Jan 12, 2024 at 07:14:50AM -0600, Nishanth Menon wrote:
> On 15:06-20240112, Roger Quadros wrote:
> > 
> > 
> > On 12/01/2024 15:02, Nishanth Menon wrote:
> > > On 14:49-20240112, Roger Quadros wrote:
> > >> 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.
> > >>
> > >> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> > >> ---
> > >>  arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
> > >>  1 file changed, 2 insertions(+)
> > >>
> > >> diff --git a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> > >> index f83caf7998..017a5a722e 100644
> > >> --- a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> > >> +++ b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> > >> @@ -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 {

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

> > >> -- 
> > >> 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;
> > }
> > 
> > 
> 
> Uggh.. We need to see eventually how to get rid of this.
> This makes
> https://lore.kernel.org/u-boot/20240110103547.719757-1-sumit.garg@linaro.org/#t
> harder now?

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

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation
  2024-01-12 13:21         ` Tom Rini
@ 2024-01-15 11:40           ` Roger Quadros
  2024-01-20 16:50             ` Tom Rini
  0 siblings, 1 reply; 15+ messages in thread
From: Roger Quadros @ 2024-01-15 11:40 UTC (permalink / raw)
  To: Tom Rini, Nishanth Menon
  Cc: robertcnelson, marex, n-francis, praneeth, s-vadapalli,
	r-gunasekaran, srk, vigneshr, u-boot



On 12/01/2024 15:21, Tom Rini wrote:
> On Fri, Jan 12, 2024 at 07:14:50AM -0600, Nishanth Menon wrote:
>> On 15:06-20240112, Roger Quadros wrote:
>>>
>>>
>>> On 12/01/2024 15:02, Nishanth Menon wrote:
>>>> On 14:49-20240112, Roger Quadros wrote:
>>>>> 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.
>>>>>
>>>>> Signed-off-by: Roger Quadros <rogerq@kernel.org>
>>>>> ---
>>>>>  arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
>>>>>  1 file changed, 2 insertions(+)
>>>>>
>>>>> diff --git a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
>>>>> index f83caf7998..017a5a722e 100644
>>>>> --- a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
>>>>> +++ b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
>>>>> @@ -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 {
> 
> 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.

>>>>> -- 
>>>>> 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;
>>> }
>>>
>>>
>>
>> Uggh.. We need to see eventually how to get rid of this.
>> This makes
>> https://lore.kernel.org/u-boot/20240110103547.719757-1-sumit.garg@linaro.org/#t
>> harder now?
> 
> No, it should be fine, Sumit's series handles -u-boot.dtsi files.
> 

-- 
cheers,
-roger

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation
  2024-01-15 11:40           ` Roger Quadros
@ 2024-01-20 16:50             ` Tom Rini
  2024-01-22 11:39               ` Roger Quadros
  0 siblings, 1 reply; 15+ messages in thread
From: Tom Rini @ 2024-01-20 16:50 UTC (permalink / raw)
  To: Roger Quadros
  Cc: Nishanth Menon, robertcnelson, marex, n-francis, praneeth,
	s-vadapalli, r-gunasekaran, srk, vigneshr, u-boot

[-- Attachment #1: Type: text/plain, Size: 2053 bytes --]

On Mon, Jan 15, 2024 at 01:40:00PM +0200, Roger Quadros wrote:
> 
> 
> On 12/01/2024 15:21, Tom Rini wrote:
> > On Fri, Jan 12, 2024 at 07:14:50AM -0600, Nishanth Menon wrote:
> >> On 15:06-20240112, Roger Quadros wrote:
> >>>
> >>>
> >>> On 12/01/2024 15:02, Nishanth Menon wrote:
> >>>> On 14:49-20240112, Roger Quadros wrote:
> >>>>> 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.
> >>>>>
> >>>>> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> >>>>> ---
> >>>>>  arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
> >>>>>  1 file changed, 2 insertions(+)
> >>>>>
> >>>>> diff --git a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> >>>>> index f83caf7998..017a5a722e 100644
> >>>>> --- a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> >>>>> +++ b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> >>>>> @@ -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 {
> > 
> > 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.

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.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 0/5] k3-j721e: beagleboneai: Fix USB
  2024-01-12 12:49 [PATCH 0/5] k3-j721e: beagleboneai: Fix USB Roger Quadros
                   ` (4 preceding siblings ...)
  2024-01-12 12:49 ` [PATCH 5/5] configs/j721e_beagleboneai64_a72_defconfig: Enable Sierra PHY Roger Quadros
@ 2024-01-20 21:04 ` Tom Rini
  5 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2024-01-20 21:04 UTC (permalink / raw)
  To: nm, robertcnelson, marex, Roger Quadros
  Cc: n-francis, praneeth, s-vadapalli, r-gunasekaran, srk, vigneshr, u-boot

On Fri, 12 Jan 2024 14:49:46 +0200, Roger Quadros wrote:

> This series fixes USB operation on k3-j721e based boards.
> 
> CI testing: https://github.com/u-boot/u-boot/pull/468
> 
> cheers,
> -roger
> 
> [...]

Applied to u-boot/master, thanks!

-- 
Tom



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation
  2024-01-20 16:50             ` Tom Rini
@ 2024-01-22 11:39               ` Roger Quadros
  2024-01-22 16:00                 ` Tom Rini
  0 siblings, 1 reply; 15+ messages in thread
From: Roger Quadros @ 2024-01-22 11:39 UTC (permalink / raw)
  To: Tom Rini
  Cc: Nishanth Menon, robertcnelson, marex, n-francis, praneeth,
	s-vadapalli, r-gunasekaran, srk, vigneshr, u-boot



On 20/01/2024 18:50, Tom Rini wrote:
> On Mon, Jan 15, 2024 at 01:40:00PM +0200, Roger Quadros wrote:
>>
>>
>> On 12/01/2024 15:21, Tom Rini wrote:
>>> On Fri, Jan 12, 2024 at 07:14:50AM -0600, Nishanth Menon wrote:
>>>> On 15:06-20240112, Roger Quadros wrote:
>>>>>
>>>>>
>>>>> On 12/01/2024 15:02, Nishanth Menon wrote:
>>>>>> On 14:49-20240112, Roger Quadros wrote:
>>>>>>> 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.
>>>>>>>
>>>>>>> Signed-off-by: Roger Quadros <rogerq@kernel.org>
>>>>>>> ---
>>>>>>>  arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
>>>>>>>  1 file changed, 2 insertions(+)
>>>>>>>
>>>>>>> diff --git a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
>>>>>>> index f83caf7998..017a5a722e 100644
>>>>>>> --- a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
>>>>>>> +++ b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
>>>>>>> @@ -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 {
>>>
>>> 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.
> 
> 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?

diff --git a/drivers/mux/mux-uclass.c b/drivers/mux/mux-uclass.c
index c98576ceb8..8833888ded 100644
--- a/drivers/mux/mux-uclass.c
+++ b/drivers/mux/mux-uclass.c
@@ -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",

-- 
cheers,
-roger

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation
  2024-01-22 11:39               ` Roger Quadros
@ 2024-01-22 16:00                 ` Tom Rini
  0 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2024-01-22 16:00 UTC (permalink / raw)
  To: Roger Quadros
  Cc: Nishanth Menon, robertcnelson, marex, n-francis, praneeth,
	s-vadapalli, r-gunasekaran, srk, vigneshr, u-boot

[-- Attachment #1: Type: text/plain, Size: 3209 bytes --]

On Mon, Jan 22, 2024 at 01:39:06PM +0200, Roger Quadros wrote:
> 
> 
> On 20/01/2024 18:50, Tom Rini wrote:
> > On Mon, Jan 15, 2024 at 01:40:00PM +0200, Roger Quadros wrote:
> >>
> >>
> >> On 12/01/2024 15:21, Tom Rini wrote:
> >>> On Fri, Jan 12, 2024 at 07:14:50AM -0600, Nishanth Menon wrote:
> >>>> On 15:06-20240112, Roger Quadros wrote:
> >>>>>
> >>>>>
> >>>>> On 12/01/2024 15:02, Nishanth Menon wrote:
> >>>>>> On 14:49-20240112, Roger Quadros wrote:
> >>>>>>> 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.
> >>>>>>>
> >>>>>>> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> >>>>>>> ---
> >>>>>>>  arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 2 ++
> >>>>>>>  1 file changed, 2 insertions(+)
> >>>>>>>
> >>>>>>> diff --git a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> >>>>>>> index f83caf7998..017a5a722e 100644
> >>>>>>> --- a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> >>>>>>> +++ b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> >>>>>>> @@ -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 {
> >>>
> >>> 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.
> > 
> > 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?
> 
> diff --git a/drivers/mux/mux-uclass.c b/drivers/mux/mux-uclass.c
> index c98576ceb8..8833888ded 100644
> --- a/drivers/mux/mux-uclass.c
> +++ b/drivers/mux/mux-uclass.c
> @@ -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.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-01-22 16:00 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-12 12:49 [PATCH 0/5] k3-j721e: beagleboneai: Fix USB Roger Quadros
2024-01-12 12:49 ` [PATCH 1/5] board: ti: j721e: Drop SERDES PHY init from board file Roger Quadros
2024-01-12 12:49 ` [PATCH 2/5] usb: cdns3: avoid error messages if phys don't exist Roger Quadros
2024-01-12 12:49 ` [PATCH 3/5] arm: dts: k3-j721e: Fix USB0 operation Roger Quadros
2024-01-12 12:49 ` [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation Roger Quadros
2024-01-12 13:02   ` Nishanth Menon
2024-01-12 13:06     ` Roger Quadros
2024-01-12 13:14       ` Nishanth Menon
2024-01-12 13:21         ` Tom Rini
2024-01-15 11:40           ` Roger Quadros
2024-01-20 16:50             ` Tom Rini
2024-01-22 11:39               ` Roger Quadros
2024-01-22 16:00                 ` Tom Rini
2024-01-12 12:49 ` [PATCH 5/5] configs/j721e_beagleboneai64_a72_defconfig: Enable Sierra PHY Roger Quadros
2024-01-20 21:04 ` [PATCH 0/5] k3-j721e: beagleboneai: Fix USB Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.