From patchwork Wed Aug 21 10:12:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 19368 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1606723981 for ; Wed, 21 Aug 2013 10:14:20 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id f64sf204993yha.6 for ; Wed, 21 Aug 2013 03:14:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state: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=GHXYsbLFz7vr1hhcZQH55BzO99DRe/XvX7w5cDIi/IU=; b=UnEdxqOXQCoSzz14Ku3IlXEXugtEOh0+rWMnPiZdPAnUG4rw8pVOSxMBCa2uqmrCT6 SfgotirbxXxpVwQK4PVNqy6t9Wg+BRMsW+R+YRgFdUeVocC9gX7/T1F5tIOADjkb8w8C PrpewAKAiuksZTC9JqJEhgkOgXYh+I3MO/h3SaX269PU2ALUtBwCQI07RNWOe4iumQ4k cdkGg4hLFoahZmhyVG7N7U7iCdtKsi6btQgFFx9v7zPKYYUuV1H7Fmj0V4k1AslwFgDg V5Fo1KpgpVQJpkWFHK+lXDVvx7rhW04gKC6hKezc9pemNGey64qoMxIhLmdDUscWoX5y Dc4A== X-Received: by 10.236.186.36 with SMTP id v24mr2362302yhm.40.1377080059804; Wed, 21 Aug 2013 03:14:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.13.66 with SMTP id f2ls522806qec.81.gmail; Wed, 21 Aug 2013 03:14:19 -0700 (PDT) X-Received: by 10.52.120.114 with SMTP id lb18mr4936965vdb.23.1377080059704; Wed, 21 Aug 2013 03:14:19 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id se5si1892547vdc.62.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Aug 2013 03:14:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id hf12so140208vcb.13 for ; Wed, 21 Aug 2013 03:14:19 -0700 (PDT) X-Gm-Message-State: ALoCoQlkx0PVqNkbbn53C78jTLtjv8vRpF417mrHnIMI9Ku7uoE9WselHIFjrpeufV+t0p2QvdlS X-Received: by 10.58.146.71 with SMTP id ta7mr5842445veb.23.1377080059613; Wed, 21 Aug 2013 03:14:19 -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 u4csp210633vcz; Wed, 21 Aug 2013 03:14:19 -0700 (PDT) X-Received: by 10.68.12.134 with SMTP id y6mr6992430pbb.29.1377080057027; Wed, 21 Aug 2013 03:14:17 -0700 (PDT) Received: from mailout2.samsung.com (mailout2.samsung.com. [203.254.224.25]) by mx.google.com with ESMTP id yk3si5962209pac.157.1969.12.31.16.00.00; Wed, 21 Aug 2013 03:14:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of gautam.vivek@samsung.com designates 203.254.224.25 as permitted sender) client-ip=203.254.224.25; Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MRV00LC0LROM370@mailout2.samsung.com> for patches@linaro.org; Wed, 21 Aug 2013 19:14:15 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.124]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 8F.FD.08825.7F294125; Wed, 21 Aug 2013 19:14:15 +0900 (KST) X-AuditID: cbfee68e-b7f276d000002279-ab-521492f7e1b8 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 19.DD.31505.7F294125; Wed, 21 Aug 2013 19:14:15 +0900 (KST) Received: from vivekkumarg-linuxpc.sisodomain.com ([107.108.214.169]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MRV0073WLRGZW20@mmp1.samsung.com>; Wed, 21 Aug 2013 19:14:15 +0900 (KST) From: Vivek Gautam To: u-boot@lists.denx.de Cc: u-boot-review@google.com, patches@linaro.org, marex@denx.de, dmurphy@ti.com, jwerner@chromium.org, sjg@chromium.org, mk7.kang@samsung.com, vikas.sajjan@samsung.com, gautam.vivek@samsung.com Subject: [PATCH v2 3/7] arm: exynos: Add methods to control power to USB 3.0 PHY Date: Wed, 21 Aug 2013 15:42:44 +0530 Message-id: <1377079968-1077-4-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.6.5 In-reply-to: <1377079968-1077-1-git-send-email-gautam.vivek@samsung.com> References: <1377079968-1077-1-git-send-email-gautam.vivek@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeLIzCtJLcpLzFFi42JZI2JSo/t9kkiQwa4Zuhbdp7ewWrRdOchu 0XHoMZPFm7ZGRouOIy2MFlMOf2Gx+LZlG6PF8tcb2S3e7u1kt7j5bDuTA5fH7IaLLB7zZp1g 8ViwqdTjzrU9bB5n7+xg9OjbsorR4/iN7UwB7FFcNimpOZllqUX6dglcGdc3nGUr2C5QMWvT L8YGxh+8XYycHBICJhIPtp5ngrDFJC7cW8/WxcjFIS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YU8JDYe2ERK0iJEFDJmUNZExh5 FzAyrGIUTS1ILihOSs810itOzC0uzUvXS87P3cQIjrtn0jsYVzVYHGIU4GBU4uG9oCwSJMSa WFZcmXuIUYKDWUmEd1E1UIg3JbGyKrUoP76oNCe1+BBjMtBNE5mlRJPzgSkhryTe0NjE3NTY 1NLEwsTMkjRhJXHeg63WgUIC6YklqdmpqQWpRTBbmDg4pRoYjT582digNFNL6vqDaZLGWw/e vBQzj0tda7aNafs7l587eW/vX6p/a2FQyKQZXLuVV9vzKir/t2N4PslnxnXmDey2ide6fQ80 zz2c4uckN7/BoWPV1iI5uTj5VZ5rNpn6SX4OPjYxbmnz/PlT7+76qm0TrmZ+1PL/i/J5fCvq kiQOvy2PV5/4X4mlOCPRUIu5qDgRAHY2rEL/AgAA 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.220.182 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 --- 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)