From patchwork Mon May 14 15:52:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajeshwari Shinde X-Patchwork-Id: 8598 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B502E23EAB for ; Mon, 14 May 2012 15:49:13 +0000 (UTC) Received: from mail-we0-f180.google.com (mail-we0-f180.google.com [74.125.82.180]) by fiordland.canonical.com (Postfix) with ESMTP id ADB61A18038 for ; Mon, 14 May 2012 15:49:13 +0000 (UTC) Received: by mail-we0-f180.google.com with SMTP id t11so2474063wey.11 for ; Mon, 14 May 2012 08:49:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:x-tm-as-mml:x-gm-message-state; bh=n9GpPFRw7K86gISidg30EiPVg4s4bArMsG0F+kMKjrw=; b=X6rkZ2fk4/E1/MTInuKSXyiiMbaNe77jw4eS57IFbWUoTGNDT5xRjCQhKum0zp2sfM 0fljfUsHyGd4Elq5EYujDgv8QGFcvg3fDqxF2qYswAnCOxk89I/3VMXx3K5GPLNHm5Nx 0P/5uecofSybWji7d8mvoALv9wczV3TaTuoQFA+88iHNOzZOQ9bZthEl2o3Pml3X+1Ik ZYMvRugDoJ+91Z/KSgeACaIxmGI+b126N/7YqHgjRmAVlzhRl8fLdFum1oATCnQp9+td 3bm+VF/tFVuj3kWnQSFWxnM/LNRFdMg6vCuvcfNPpjLDJIuk8i5H6Oc7I/JkwfTj1fOu agyA== Received: by 10.50.85.163 with SMTP id i3mr4480465igz.57.1337010552948; Mon, 14 May 2012 08:49:12 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.35.72 with SMTP id o8csp353076ibd; Mon, 14 May 2012 08:49:12 -0700 (PDT) Received: by 10.68.194.198 with SMTP id hy6mr24491630pbc.0.1337010551922; Mon, 14 May 2012 08:49:11 -0700 (PDT) Received: from mailout3.samsung.com (mailout3.samsung.com. [203.254.224.33]) by mx.google.com with ESMTP id gt5si23357404pbc.2.2012.05.14.08.49.11; Mon, 14 May 2012 08:49:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of rajeshwari.s@samsung.com designates 203.254.224.33 as permitted sender) client-ip=203.254.224.33; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of rajeshwari.s@samsung.com designates 203.254.224.33 as permitted sender) smtp.mail=rajeshwari.s@samsung.com Received: from epcpsbgm1.samsung.com (mailout3.samsung.com [203.254.224.33]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M40006M3RXU5910@mailout3.samsung.com> for patches@linaro.org; Tue, 15 May 2012 00:49:10 +0900 (KST) X-AuditID: cbfee61a-b7bbeae000003a71-5e-4fb1297651c3 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id 79.32.14961.67921BF4; Tue, 15 May 2012 00:49:10 +0900 (KST) Received: from rajeshwari-linux.sisodomain.com ([107.108.215.115]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M40002S8RXONL70@mmp1.samsung.com> for patches@linaro.org; Tue, 15 May 2012 00:49:10 +0900 (KST) From: Rajeshwari Shinde To: u-boot@lists.denx.de Cc: patches@linaro.org, marex@denx.de, l.majewski@samsung.com, sjg@chromium.org, clchiou@chromium.org, waihong@chromium.org, mk7.kang@samsung.com, k.chander@samsung.com, gautam.vivek@samsung.com Subject: [PATCH 3/6 V4] USB: EXYNOS: Set USB 2.0 HOST Link mode Date: Mon, 14 May 2012 21:22:02 +0530 Message-id: <1337010725-24807-3-git-send-email-rajeshwari.s@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1337010725-24807-1-git-send-email-rajeshwari.s@samsung.com> References: <1337010725-24807-1-git-send-email-rajeshwari.s@samsung.com> X-Brightmail-Tracker: AAAAAA== X-TM-AS-MML: No X-Gm-Message-State: ALoCoQlOgcYGC2zU80mbzygOxdA19aFEoDnk8caeyfEumKXrf09KLyD7hsuKCOASxS8J5+cePQB0 This patch adds a function to set usb host mode to USB 2.0 HOST Link for EXYNOS5 Signed-off-by: Rajeshwari Shinde --- arch/arm/cpu/armv7/exynos/system.c | 22 ++++++++++++++++++++++ arch/arm/include/asm/arch-exynos/system.h | 3 +++ drivers/usb/host/ehci-exynos.c | 3 +++ 3 files changed, 28 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/armv7/exynos/system.c b/arch/arm/cpu/armv7/exynos/system.c index 6c34730..cc6ee03 100644 --- a/arch/arm/cpu/armv7/exynos/system.c +++ b/arch/arm/cpu/armv7/exynos/system.c @@ -25,6 +25,28 @@ #include #include +static void exynos5_set_usbhost_mode(unsigned int mode) +{ + struct exynos5_sysreg *sysreg = + (struct exynos5_sysreg *)samsung_get_base_sysreg(); + unsigned int phy_cfg; + + /* Setting USB20PHY_CONFIG register to USB 2.0 HOST link */ + if (mode == USB20_PHY_CFG_HOST_LINK_EN) { + setbits_le32(&sysreg->usb20phy_cfg, + USB20_PHY_CFG_HOST_LINK_EN); + } else { + clrbits_le32(&sysreg->usb20phy_cfg, + USB20_PHY_CFG_HOST_LINK_EN); + } +} + +void set_usbhost_mode(unsigned int mode) +{ + if (cpu_is_exynos5()) + exynos5_set_usbhost_mode(mode); +} + static void exynos4_set_system_display(void) { struct exynos4_sysreg *sysreg = diff --git a/arch/arm/include/asm/arch-exynos/system.h b/arch/arm/include/asm/arch-exynos/system.h index c1d880f..42e1d21 100644 --- a/arch/arm/include/asm/arch-exynos/system.h +++ b/arch/arm/include/asm/arch-exynos/system.h @@ -49,6 +49,9 @@ struct exynos5_sysreg { }; #endif +#define USB20_PHY_CFG_HOST_LINK_EN (1 << 0) + +void set_usbhost_mode(unsigned int mode); void set_system_display_ctrl(void); #endif /* _EXYNOS4_SYSTEM_H */ diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index 3830c43..90d66d3 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -24,12 +24,15 @@ #include #include #include +#include #include "ehci.h" #include "ehci-core.h" /* Setup the EHCI host controller. */ static void setup_usb_phy(struct exynos_usb_phy *usb) { + set_usbhost_mode(USB20_PHY_CFG_HOST_LINK_EN); + clrbits_le32(&usb->usbphyctrl0, HOST_CTRL0_FSEL_MASK | HOST_CTRL0_COMMONON_N |