]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/host/ehci-vf.c
ti_armv7_common: env: Add NFS loading support to default enviroment
[u-boot] / drivers / usb / host / ehci-vf.c
index 54548554df37fd75da0443aae3b8221987252077..335e303c2aa3fc08a82a8f47ac4bcf0c61cca1bf 100644 (file)
@@ -121,21 +121,30 @@ static void usb_oc_config(int index)
        setbits_le32(ctrl, UCTRL_OVER_CUR_DIS);
 }
 
+int __weak board_usb_phy_mode(int port)
+{
+       return 0;
+}
+
+int __weak board_ehci_hcd_init(int port)
+{
+       return 0;
+}
+
 int ehci_hcd_init(int index, enum usb_init_type init,
                struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        struct usb_ehci *ehci;
+       enum usb_init_type type;
 
        if (index >= ARRAY_SIZE(nc_reg_bases))
                return -EINVAL;
 
-       if (init == USB_INIT_DEVICE && index == 1)
-               return -ENODEV;
-       if (init == USB_INIT_HOST && index == 0)
-               return -ENODEV;
-
        ehci = (struct usb_ehci *)nc_reg_bases[index];
 
+       /* Do board specific initialisation */
+       board_ehci_hcd_init(index);
+
        usb_power_config(index);
        usb_oc_config(index);
        usb_internal_phy_clock_gate(index);
@@ -145,6 +154,10 @@ int ehci_hcd_init(int index, enum usb_init_type init,
        *hcor = (struct ehci_hcor *)((uint32_t)*hccr +
                        HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase)));
 
+       type = board_usb_phy_mode(index);
+       if (type != init)
+               return -ENODEV;
+
        if (init == USB_INIT_DEVICE) {
                setbits_le32(&ehci->usbmode, CM_DEVICE);
                writel((PORT_PTS_UTMI | PORT_PTS_PTW), &ehci->portsc);