[U-Boot] [PATCH v5 10/14] usb: extend generic EHCI with PHY

patrice.chotard at st.com patrice.chotard at st.com
Wed May 10 16:09:55 UTC 2017


From: Patrice Chotard <patrice.chotard at st.com>

Signed-off-by: Patrice Chotard <patrice.chotard at st.com>
---

v5:   _ add support of new generic PHY UCLASS

 drivers/usb/host/ehci-generic.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
index 2190adb..3c2f5a7 100644
--- a/drivers/usb/host/ehci-generic.c
+++ b/drivers/usb/host/ehci-generic.c
@@ -6,6 +6,8 @@
 
 #include <common.h>
 #include <clk.h>
+#include <fdtdec.h>
+#include <generic-phy.h>
 #include <reset.h>
 #include <asm/io.h>
 #include <dm.h>
@@ -50,6 +52,17 @@ static int ehci_usb_probe(struct udevice *dev)
 		reset_free(&reset);
 	}
 
+	for (i = 0; ; i++) {
+		struct phy usb_phy;
+		int ret;
+
+		ret = generic_phy_get_by_index(dev, i, &usb_phy);
+		if (ret < 0)
+			break;
+		if (generic_phy_init(&usb_phy))
+			printf("failed to init usb phy %d\n", i);
+	}
+
 	hccr = map_physmem(dev_get_addr(dev), 0x100, MAP_NOCACHE);
 	hcor = (struct ehci_hcor *)((uintptr_t)hccr +
 				    HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
-- 
1.9.1



More information about the U-Boot mailing list