From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 10 Dec 2015 17:20:50 +0100 Subject: [U-Boot] [PATCH] usb: host: ehci: samsung: Move hcor initialization after usb phy setup In-Reply-To: <1449761545-4824-1-git-send-email-l.majewski@samsung.com> References: <1449761545-4824-1-git-send-email-l.majewski@samsung.com> Message-ID: <201512101720.50937.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thursday, December 10, 2015 at 04:32:25 PM, Lukasz Majewski wrote: > 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 > --- > drivers/usb/host/ehci-exynos.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/host/ehci-exynos.c > b/drivers/usb/host/ehci-exynos.c index 18e9251..bede04b 100644 > --- a/drivers/usb/host/ehci-exynos.c > +++ b/drivers/usb/host/ehci-exynos.c > @@ -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))); Acked-by: Marek Vasut Best regards, Marek Vasut