aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini2024-01-20 11:39:13 -0500
committerTom Rini2024-01-20 11:39:13 -0500
commit3c04fcf3137d5f694d52b8f355373e4baabe5f78 (patch)
tree1dcce68d488046855985cab3fc653a966e64fb93
parentfea3efb757f7a9c6831c023cb456f9fa5fd0278e (diff)
parent172c846f39f19738630a3a1854689f7df1a08312 (diff)
Merge patch series "k3-j721e: beagleboneai: Fix USB"
Roger Quadros <rogerq@kernel.org> says: Hi, This series fixes USB operation on k3-j721e based boards.
-rw-r--r--arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi2
-rw-r--r--arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi8
-rw-r--r--arch/arm/dts/k3-j721e-sk-u-boot.dtsi8
-rw-r--r--board/ti/j721e/evm.c77
-rw-r--r--configs/j721e_beagleboneai64_a72_defconfig2
-rw-r--r--drivers/usb/cdns3/core.c28
6 files changed, 38 insertions, 87 deletions
diff --git a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
index f83caf79988..017a5a722e0 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 {
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 b77f8d92de3..7ae7cf3d4c9 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 370fe5190b2..479b7bcd6f8 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;
};
diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index c541880107e..b77cffc5ef5 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
diff --git a/configs/j721e_beagleboneai64_a72_defconfig b/configs/j721e_beagleboneai64_a72_defconfig
index 959f86844d3..f66206f6e37 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
diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index 644a9791b9c..12a741c6ea7 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)