aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2022-03-09 10:05:45 +0100
committerMarek Vasut <marex@denx.de>2022-04-22 10:35:14 +0200
commit142d50fbce7c364a74f5e8204dba491b9f066e6c (patch)
treec65a5484eae44f4917dffd0bd24c7e17c405e0d1 /drivers
parente81782ab883552dd48f5109ba41327b879a92498 (diff)
downloadu-boot-142d50fbce7c364a74f5e8204dba491b9f066e6c.zip
u-boot-142d50fbce7c364a74f5e8204dba491b9f066e6c.tar.gz
u-boot-142d50fbce7c364a74f5e8204dba491b9f066e6c.tar.bz2
usb: dwc3: Add support for usb3-phy PHY configuration
When usb3-phy label is found, PHY driver is called and serdes line is initialized. This is preparation for serdes/psgtr driver to configure GT lines based on description in DT. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/dwc3/dwc3-generic.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 01bd0ca..2c5205d 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -14,6 +14,7 @@
#include <dm/device-internal.h>
#include <dm/lists.h>
#include <dwc3-uboot.h>
+#include <generic-phy.h>
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/usb/ch9.h>
@@ -409,6 +410,17 @@ static int dwc3_glue_probe(struct udevice *dev)
struct udevice *child = NULL;
int index = 0;
int ret;
+ struct phy phy;
+
+ ret = generic_phy_get_by_name(dev, "usb3-phy", &phy);
+ if (!ret) {
+ ret = generic_phy_init(&phy);
+ if (ret)
+ return ret;
+ } else if (ret != -ENOENT) {
+ debug("could not get phy (err %d)\n", ret);
+ return ret;
+ }
glue->regs = dev_read_addr(dev);
@@ -420,6 +432,12 @@ static int dwc3_glue_probe(struct udevice *dev)
if (ret)
return ret;
+ if (phy.dev) {
+ ret = generic_phy_power_on(&phy);
+ if (ret)
+ return ret;
+ }
+
ret = device_find_first_child(dev, &child);
if (ret)
return ret;