From patchwork Fri May 4 11:12:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajeshwari Shinde X-Patchwork-Id: 8389 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 E274623E49 for ; Fri, 4 May 2012 11:13:22 +0000 (UTC) Received: from mail-gy0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 9CD18A1859D for ; Fri, 4 May 2012 11:13:22 +0000 (UTC) Received: by ghbz12 with SMTP id z12so426201ghb.11 for ; Fri, 04 May 2012 04:13:22 -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=+y0Ey5s02tdWhHGOXnVa8a5vkxjB7U4pC0pI+fjdGVk=; b=cIjLROoBmPvK8VLI+A2eLFiCRNJ/Gx62A4OAzDeW9AMH6X9UlIVpiBe2FouyfNRWbJ tTfDiUIkBnHB/+MeRbd1hIbRtRKyrXXGODS+mF9zBqdZloqMoX71i2FzzqipfvS52Y9n pu+VKFpRLiSwxzXvtZe8ekCko+b97vkwqM602FpMkFllHb1J4rLivfRildexi9cw1A1H qjlmPoiyYLEbBnfHoeKDoCTJo9yDMc7/2hI36582BcIS3x6S2drVfLxzWV7uim1olJe3 xqDqVr7n4sMvp+JUpVWL+YTOr74E4AYiW6cdU2N3aq0a2PkpQ3hI+6zjvbG4Xx5jBvE0 ORwQ== Received: by 10.50.160.225 with SMTP id xn1mr2693575igb.3.1336130001952; Fri, 04 May 2012 04:13:21 -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.137.198 with SMTP id x6csp82936ibt; Fri, 4 May 2012 04:13:21 -0700 (PDT) Received: by 10.68.217.67 with SMTP id ow3mr9513993pbc.16.1336130001212; Fri, 04 May 2012 04:13:21 -0700 (PDT) Received: from mailout2.samsung.com (mailout2.samsung.com. [203.254.224.25]) by mx.google.com with ESMTP id o4si8585469pbi.115.2012.05.04.04.13.20; Fri, 04 May 2012 04:13:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of rajeshwari.s@samsung.com designates 203.254.224.25 as permitted sender) client-ip=203.254.224.25; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of rajeshwari.s@samsung.com designates 203.254.224.25 as permitted sender) smtp.mail=rajeshwari.s@samsung.com Received: from epcpsbgm1.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M3H00ED4WI4TMM0@mailout2.samsung.com> for patches@linaro.org; Fri, 04 May 2012 20:13:20 +0900 (KST) X-AuditID: cbfee61a-b7b97ae000004342-4a-4fa3b9cf196a Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id E3.8F.17218.FC9B3AF4; Fri, 04 May 2012 20:13:20 +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 <0M3H00BDMWCI0860@mmp1.samsung.com> for patches@linaro.org; Fri, 04 May 2012 20:13:19 +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 Subject: [PATCH 3/6 V2] EXYNOS5 : USB: Set USB 2.0 HOST Link mode Date: Fri, 04 May 2012 16:42:00 +0530 Message-id: <1336129923-2656-4-git-send-email-rajeshwari.s@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1336129923-2656-1-git-send-email-rajeshwari.s@samsung.com> References: <1336129923-2656-1-git-send-email-rajeshwari.s@samsung.com> X-Brightmail-Tracker: AAAAAA== X-TM-AS-MML: No X-Gm-Message-State: ALoCoQlLtYzSzb1yNAGHebWr2dAEoGPVSKWw/8xwmW2/HI2sOLsc0SJyFKxMI9S39cab9Bob+Bix This patch adds a function to set usb host mode to USB 2.0 HOST Link for EXYNOS5 Signed-off-by: Rajeshwari Shinde --- This patchset is based on: USB: EXYNOS: Add ehci support.patch 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..7ff4e09 100644 --- a/arch/arm/cpu/armv7/exynos/system.c +++ b/arch/arm/cpu/armv7/exynos/system.c @@ -46,3 +46,25 @@ void set_system_display_ctrl(void) if (cpu_is_exynos4()) exynos4_set_system_display(); } + +static void exynos5_enable_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 enable_usbhost_mode(unsigned int mode) +{ + if (cpu_is_exynos5()) + exynos5_enable_usbhost_mode(mode); +} diff --git a/arch/arm/include/asm/arch-exynos/system.h b/arch/arm/include/asm/arch-exynos/system.h index c1d880f..949661d 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_system_display_ctrl(void); +void enable_usbhost_mode(unsigned int mode); #endif /* _EXYNOS4_SYSTEM_H */ diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index 3830c43..d918a2a 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) { + enable_usbhost_mode(USB20_PHY_CFG_HOST_LINK_EN); + clrbits_le32(&usb->usbphyctrl0, HOST_CTRL0_FSEL_MASK | HOST_CTRL0_COMMONON_N |