]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
usb: host: ehci: samsung: Move hcor initialization after usb phy setup
authorLukasz Majewski <l.majewski@samsung.com>
Thu, 10 Dec 2015 15:32:25 +0000 (16:32 +0100)
committerMarek Vasut <marex@denx.de>
Thu, 17 Dec 2015 20:54:41 +0000 (21:54 +0100)
With the old order of initialization the hcor pointer has been setup to
the same address as Exynos EHCI base address (0x12110000 instead of
0x12110010).
Such behaviour was caused by reading value of 0 instead of 0x10 from EHCI
HCCPBASE register without doing proper clock initialization before.

To fix this problem hcor initialization has been moved after USB PHY setup.
Now ehci_readl(&ctx->hcd->cr_capbase) returns correct value.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
drivers/usb/host/ehci-exynos.c

index 18e9251b64f5c1cadd5e4121fb99a753c70a75a6..bede04b748ab86b216e60cdcd8a3435a436a310e 100644 (file)
@@ -219,14 +219,14 @@ static int ehci_usb_probe(struct udevice *dev)
 
        ctx->hcd = (struct ehci_hccr *)plat->hcd_base;
        ctx->usb = (struct exynos_usb_phy *)plat->phy_base;
-       hcor = (struct ehci_hcor *)((uint32_t)ctx->hcd +
-                       HC_LENGTH(ehci_readl(&ctx->hcd->cr_capbase)));
 
        /* setup the Vbus gpio here */
        if (dm_gpio_is_valid(&plat->vbus_gpio))
                dm_gpio_set_value(&plat->vbus_gpio, 1);
 
        setup_usb_phy(ctx->usb);
+       hcor = (struct ehci_hcor *)((uint32_t)ctx->hcd +
+                       HC_LENGTH(ehci_readl(&ctx->hcd->cr_capbase)));
 
        return ehci_register(dev, ctx->hcd, hcor, NULL, 0, USB_INIT_HOST);
 }