From patchwork Thu Dec 10 15:32:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Majewski?= X-Patchwork-Id: 555190 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 23AE0140213 for ; Fri, 11 Dec 2015 02:32:56 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D56764B6CB; Thu, 10 Dec 2015 16:32:53 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ee6MPQM4KqMA; Thu, 10 Dec 2015 16:32:53 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 234834B6BE; Thu, 10 Dec 2015 16:32:53 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8D2D64B6BE for ; Thu, 10 Dec 2015 16:32:48 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15CAGCGAWxba for ; Thu, 10 Dec 2015 16:32:48 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by theia.denx.de (Postfix) with ESMTPS id 0F6694B6BD for ; Thu, 10 Dec 2015 16:32:43 +0100 (CET) Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NZ5026N0F5XLKA0@mailout2.samsung.com> for u-boot@lists.denx.de; Fri, 11 Dec 2015 00:32:38 +0900 (KST) X-AuditID: cbfee61b-f793c6d00000236c-04-56699b16f380 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 13.DF.09068.61B99665; Fri, 11 Dec 2015 00:32:38 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NZ500GDEF651P60@mmp1.samsung.com>; Fri, 11 Dec 2015 00:32:38 +0900 (KST) From: Lukasz Majewski To: u-boot@lists.denx.de, Simon Glass Date: Thu, 10 Dec 2015 16:32:25 +0100 Message-id: <1449761545-4824-1-git-send-email-l.majewski@samsung.com> X-Mailer: git-send-email 1.7.10.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCLMWRmVeSWpSXmKPExsVy+t9jAV2x2ZlhBv+3GFq8ecRt8ebhZkaL dRtvsVu8aWtktNhx+QaLxb2Vr9gsvm3ZxmgxddJmdou3ezvZHTg9ZjdcZPGYN+sEi8fOWXfZ PV4dWMXucfbODkaPddPeMnv0bVnFGMAexWWTkpqTWZZapG+XwJWx9vcx5oIe7orTN+YzNzCu 4exi5OSQEDCRaPj3nxHCFpO4cG89WxcjF4eQwFJGicm39rJCOH8YJR5M+MACUsUmoCfx+e5T JhBbRMBC4vXxicwgRcwCM5kkDjeuBBslLBApsejNOTCbRUBVYsW9ZWANvAKuErv+dLNArFOU 6H42gW0CI/cCRoZVjBKpBckFxUnpuUZ5qeV6xYm5xaV56XrJ+bmbGMFh9Ux6B+PhXe6HGAU4 GJV4eBOtMsOEWBPLiitzDzFKcDArifBumQEU4k1JrKxKLcqPLyrNSS0+xCjNwaIkzrvvUmSY kEB6YklqdmpqQWoRTJaJg1OqgbGYaXr+pBmBe7L3unRqlSyZH5ty4IrS3ykPZ+Xtn8z7Yda0 si7uw90Rbnby03+WFmmcfjvBuyHJKz792em/rX8vZQtcmrnwW3VHjOnuG9ffzOe6G3X8gurL Q4KtD4+GdGiJTGbhkVufezDbSuBhnGWr/IMft5+x2Ms+WsWpx5zrzFl+fFGdgKgSS3FGoqEW c1FxIgBrok8MJwIAAA== Cc: Marek Vasut , Tom Rini , Anand Moon , Przemyslaw Marczak Subject: [U-Boot] [PATCH] usb: host: ehci: samsung: Move hcor initialization after usb phy setup X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Acked-by: Marek Vasut Reviewed-by: Simon Glass --- 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))); return ehci_register(dev, ctx->hcd, hcor, NULL, 0, USB_INIT_HOST); }