From patchwork Fri May 4 11:12:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajeshwari Shinde X-Patchwork-Id: 8390 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 3F46423E49 for ; Fri, 4 May 2012 11:14:09 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id ECC1EA1859D for ; Fri, 4 May 2012 11:14:08 +0000 (UTC) Received: by yhpp61 with SMTP id p61so3294673yhp.11 for ; Fri, 04 May 2012 04:14:08 -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=xO3XgJviAON3lhFn9Bwym6tyjQjLcsiUCYxFLJMznzM=; b=ZJ7242nG0QYTYIlyBlanrdReEIXN8f/RFHSKAL/oaRTlA5gDRtC77LpHIHHljO3c9Z DP3HoIsOQNozMwyO7HdmIN5DsbYuROEmyhZJcgWIYhVWnCG2LhcBc0XjENrJYLaDk2sx Xd/nYwm14x9u1vP3YtZbKTM3fPKlz0zWkxAdfHx/BAG5XkXUkP0FaAPDubSkEatjOWQP sqtOJsUAxAC82P0ZVDus9ZNX4aEVnw3dZfbWTetAuC9vvgFgr4h8T3CJoaw3fHntmfoV gtjyzTqUU73sSB2zP3DanlcI6sejSZceG7h0SGuDA9wI1xvb95IBULsI8haVPvS6uv2x 1rGw== Received: by 10.50.89.168 with SMTP id bp8mr2696369igb.3.1336130048132; Fri, 04 May 2012 04:14:08 -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 x6csp82965ibt; Fri, 4 May 2012 04:14:07 -0700 (PDT) Received: by 10.68.216.98 with SMTP id op2mr17421049pbc.93.1336130047343; Fri, 04 May 2012 04:14:07 -0700 (PDT) Received: from mailout2.samsung.com (mailout2.samsung.com. [203.254.224.25]) by mx.google.com with ESMTP id sp3si8581931pbc.155.2012.05.04.04.14.07; Fri, 04 May 2012 04:14:07 -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 epcpsbgm2.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 <0M3H00H33WJIY8L0@mailout2.samsung.com> for patches@linaro.org; Fri, 04 May 2012 20:14:06 +0900 (KST) X-AuditID: cbfee61b-b7c60ae000000c58-39-4fa3b9fe191d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (MMPCPMTA) with SMTP id 8E.2E.03160.EF9B3AF4; Fri, 04 May 2012 20:14:06 +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:14:06 +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 4/6 V2] Exynos5: Add power Enable/Disable for USB-EHCI Date: Fri, 04 May 2012 16:42:01 +0530 Message-id: <1336129923-2656-5-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: ALoCoQnA37dfkZQOWbmk3KREhjNlkcUtIFZGxaSN3iBbRYOPPpzmCaboRXA0nm25hLO+shCYpDj3 This patch adds functions to enable/disable the power of USB host controller for EXYNOS5. Signed-off-by: Vivek Gautam Signed-off-by: Che-Liang Chiou Signed-off-by: Rajeshwari Shinde --- This patchset is based on: USB: EXYNOS: Add ehci support.patch arch/arm/cpu/armv7/exynos/power.c | 37 ++++++++++++++++++++++++++++++ arch/arm/include/asm/arch-exynos/power.h | 4 +++ drivers/usb/host/ehci-exynos.c | 4 +++ 3 files changed, 45 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/armv7/exynos/power.c b/arch/arm/cpu/armv7/exynos/power.c index c765304..b2944b5 100644 --- a/arch/arm/cpu/armv7/exynos/power.c +++ b/arch/arm/cpu/armv7/exynos/power.c @@ -52,3 +52,40 @@ void set_mipi_phy_ctrl(unsigned int dev_index, unsigned int enable) if (cpu_is_exynos4()) exynos4_mipi_phy_control(dev_index, enable); } + +void exynos5_ps_hold_setup(void) +{ + struct exynos5_power *power = + (struct exynos5_power *)samsung_get_base_power(); + + /* Set PS-Hold high */ + setbits_le32(&power->ps_hold_control, POWER_PS_HOLD_CONTROL_DATA_HIGH); +} + +void exynos5_enable_usb_phy(unsigned int enable) +{ + struct exynos5_power *power = + (struct exynos5_power *)samsung_get_base_power(); + + if (enable) { + /* Enabling USBHOST_PHY */ + setbits_le32(&power->usbhost_phy_control, + POWER_USB_HOST_PHY_CTRL_EN); + } else { + /* Disabling USBHost_PHY */ + clrbits_le32(&power->usbhost_phy_control, + POWER_USB_HOST_PHY_CTRL_EN); + } +} + +void ps_hold_setup(void) +{ + if (cpu_is_exynos5()) + exynos5_ps_hold_setup(); +} + +void power_enable_usb_phy(unsigned int enable) +{ + if (cpu_is_exynos5()) + exynos5_enable_usb_phy(enable); +} diff --git a/arch/arm/include/asm/arch-exynos/power.h b/arch/arm/include/asm/arch-exynos/power.h index 4236beb..fc44d86 100644 --- a/arch/arm/include/asm/arch-exynos/power.h +++ b/arch/arm/include/asm/arch-exynos/power.h @@ -855,4 +855,8 @@ void set_mipi_phy_ctrl(unsigned int dev_index, unsigned int enable); #define EXYNOS_MIPI_PHY_SRESETN (1 << 1) #define EXYNOS_MIPI_PHY_MRESETN (1 << 2) +void power_enable_usb_phy(unsigned int enable); + +#define POWER_USB_HOST_PHY_CTRL_EN (1 << 0) +#define POWER_PS_HOLD_CONTROL_DATA_HIGH (1 << 8) #endif diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index d918a2a..7c7489c 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -33,6 +33,8 @@ static void setup_usb_phy(struct exynos_usb_phy *usb) { enable_usbhost_mode(USB20_PHY_CFG_HOST_LINK_EN); + power_enable_usb_phy(1); + clrbits_le32(&usb->usbphyctrl0, HOST_CTRL0_FSEL_MASK | HOST_CTRL0_COMMONON_N | @@ -73,6 +75,8 @@ static void reset_usb_phy(struct exynos_usb_phy *usb) HOST_CTRL0_SIDDQ | HOST_CTRL0_FORCESUSPEND | HOST_CTRL0_FORCESLEEP); + + power_enable_usb_phy(0); } /*