From patchwork Sat Sep 14 08:32:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 20304 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f199.google.com (mail-ye0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2866D2617D for ; Sat, 14 Sep 2013 08:34:15 +0000 (UTC) Received: by mail-ye0-f199.google.com with SMTP id l4sf2183625yen.2 for ; Sat, 14 Sep 2013 01:34:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:dlp-filter:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=KS4Kn97dIQEd1hwjInXXQXXGBrNY8PEDnxUEJJqI5EA=; b=EiLFeXh3+39Brd1qZtnrXUE0dgXwUtuP8j5WdEIY/rix0MpEUyd8XKuMXnQV8lqWvy v4upx/TISOIuQYs/pT7GOnCjOpv/uLzRlddvIKRSgJGJEgdq4lP3+DQ1BKrUXt9phldL wltuG8BG+dJ7Fcn8hW1HZ2IbCf/4KMl1/AxaQRM/lggb1NCtmVfmt7n0SE+pdCZsxiNv nf+bru5iCXcwGMohIszUF+yNR40LMMH8tDbQr54XlKuRDyNm0WoVe1gS7OO819tuQZpB 30AW+yb/ce7p98pRKpZxAVCOzcsm1qq6KSqr7jiegblGqOvhnE2AKepr2M39pRepcZ/0 WUWg== X-Gm-Message-State: ALoCoQmWPy95hfN84h4bk5Y5Mt9VP2jIv2YJdCPohO4C3//KsRiU9AftgRcQk4TzTHQG2DAJlivg X-Received: by 10.236.85.6 with SMTP id t6mr6363994yhe.37.1379147654787; Sat, 14 Sep 2013 01:34:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.71.83 with SMTP id s19ls1466706qeu.7.gmail; Sat, 14 Sep 2013 01:34:14 -0700 (PDT) X-Received: by 10.59.8.232 with SMTP id dn8mr16071555ved.8.1379147654689; Sat, 14 Sep 2013 01:34:14 -0700 (PDT) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id o5si4415859vdw.24.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 14 Sep 2013 01:34:14 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.50; Received: by mail-vb0-f50.google.com with SMTP id x14so1620832vbb.37 for ; Sat, 14 Sep 2013 01:34:14 -0700 (PDT) X-Received: by 10.59.8.232 with SMTP id dn8mr16071549ved.8.1379147654584; Sat, 14 Sep 2013 01:34:14 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp3319vcz; Sat, 14 Sep 2013 01:34:14 -0700 (PDT) X-Received: by 10.66.142.132 with SMTP id rw4mr17398516pab.6.1379147650938; Sat, 14 Sep 2013 01:34:10 -0700 (PDT) Received: from mailout1.samsung.com (mailout1.samsung.com. [203.254.224.24]) by mx.google.com with ESMTP id z4si3746132paz.2.1969.12.31.16.00.00; Sat, 14 Sep 2013 01:34:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of gautam.vivek@samsung.com designates 203.254.224.24 as permitted sender) client-ip=203.254.224.24; Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MT300FEPX4RUD40@mailout1.samsung.com> for patches@linaro.org; Sat, 14 Sep 2013 17:34:09 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.123]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 95.CB.20109.18F14325; Sat, 14 Sep 2013 17:34:09 +0900 (KST) X-AuditID: cbfee68f-b7f1e6d000004e8d-97-52341f817d79 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id A4.64.05832.18F14325; Sat, 14 Sep 2013 17:34:09 +0900 (KST) Received: from vivekkumarg-linuxpc.sisodomain.com ([107.108.214.169]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MT3000S4X4MT840@mmp2.samsung.com>; Sat, 14 Sep 2013 17:34:09 +0900 (KST) From: Vivek Gautam To: u-boot@lists.denx.de, patches@linaro.org Cc: u-boot-review@google.com, Julius Werner , Simon Glass , Minkyu Kang , Dan Murphy , Marek Vasut Subject: [PATCH v3 04/10] arm: exynos: Add methods to control power to USB 3.0 PHY Date: Sat, 14 Sep 2013 14:02:47 +0530 Message-id: <1379147573-21897-5-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.6.5 In-reply-to: <1379147573-21897-1-git-send-email-gautam.vivek@samsung.com> References: <1379147573-21897-1-git-send-email-gautam.vivek@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphkeLIzCtJLcpLzFFi42JZI2JSrdsobxJkcOeSkUX36S2sFh2HHjNZ vGlrZLToONLCaDHl8BcWi29btjFaLH+9kd3i7d5OdgcOj9kNF1k85s06weKxYFOpx51re9g8 zt7ZwejRt2UVo8fxG9uZAtijuGxSUnMyy1KL9O0SuDI+nCoquC1Qcf7HfKYGxgl8XYycHBIC JhJXnhxnhrDFJC7cW8/WxcjFISSwlFFi6fonjDBFc1ctZIdITGeUmPeynRnCmcIk8W/mdbB2 NgFdiaa3u8A6RAR0JJ4vu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5II r5OYSZAQb0piZVVqUX58UWlOavEhxmSgmyYyS4km5wOjP68k3tDYxNzU2NTSxMLEzJI0YSVx 3oOt1oFCAumJJanZqakFqUUwW5g4OKUaGHtL50fI3LEXdnvwcv7Wo4wLHI/VT9PfoNEY71P9 8PjiV8z1vslnL3zs7Jux77GllgWTRt9be2/9hW8V19144nOJX23yZb4ZFk9+xq5tMG9OWuO4 zFY64MKP0n9Tvs4MfizGf11bt8XizLULysUXn8/bfPtfntHRVlVurktn+bRSTV2LF/M3TlFi Kc5INNRiLipOBAAkSiXS9AIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: gautam.vivek@samsung.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Adding methods to turn on/off power to USB3.0 type PHY as and when required by the controller. Signed-off-by: Vivek Gautam Cc: Julius Werner Cc: Simon Glass Cc: Minkyu Kang Cc: Dan Murphy Cc: Marek Vasut --- Changes since v2: - Nothing. arch/arm/cpu/armv7/exynos/power.c | 22 ++++++++++++++++++++++ arch/arm/include/asm/arch-exynos/power.h | 5 +++++ 2 files changed, 27 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/armv7/exynos/power.c b/arch/arm/cpu/armv7/exynos/power.c index 517e804..563abd7 100644 --- a/arch/arm/cpu/armv7/exynos/power.c +++ b/arch/arm/cpu/armv7/exynos/power.c @@ -59,6 +59,28 @@ void set_usbhost_phy_ctrl(unsigned int enable) exynos5_set_usbhost_phy_ctrl(enable); } +static void exynos5_set_usbdrd_phy_ctrl(unsigned int enable) +{ + struct exynos5_power *power = + (struct exynos5_power *)samsung_get_base_power(); + + if (enable) { + /* Enabling USBDRD_PHY */ + setbits_le32(&power->usbdrd_phy_control, + POWER_USB_DRD_PHY_CTRL_EN); + } else { + /* Disabling USBDRD_PHY */ + clrbits_le32(&power->usbdrd_phy_control, + POWER_USB_DRD_PHY_CTRL_EN); + } +} + +void set_usbdrd_phy_ctrl(unsigned int enable) +{ + if (cpu_is_exynos5()) + exynos5_set_usbdrd_phy_ctrl(enable); +} + static void exynos5_dp_phy_control(unsigned int enable) { unsigned int cfg; diff --git a/arch/arm/include/asm/arch-exynos/power.h b/arch/arm/include/asm/arch-exynos/power.h index 3241327..8db18c5 100644 --- a/arch/arm/include/asm/arch-exynos/power.h +++ b/arch/arm/include/asm/arch-exynos/power.h @@ -847,6 +847,11 @@ void set_hw_thermal_trip(void); #define POWER_USB_HOST_PHY_CTRL_EN (1 << 0) #define POWER_USB_HOST_PHY_CTRL_DISABLE (0 << 0) +void set_usbdrd_phy_ctrl(unsigned int enable); + +#define POWER_USB_DRD_PHY_CTRL_EN (1 << 0) +#define POWER_USB_DRD_PHY_CTRL_DISABLE (0 << 0) + void set_dp_phy_ctrl(unsigned int enable); #define EXYNOS_DP_PHY_ENABLE (1 << 0)