From patchwork Mon Jun 23 21:25:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 32389 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C7260203AC for ; Mon, 23 Jun 2014 21:26:09 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id kq14sf28938154pab.4 for ; Mon, 23 Jun 2014 14:26:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=TCtnkC5Hcy8sO5bIJJSYU+Xe+3Y47jZB+CW+XZ+Wh0w=; b=EMGXCpeHw+968JnvEAWz71S+R93dl6jRrqBvV65lEX2poBXO9dWu3+yQ3uZTgm6oO1 fObqaKHCi0261PVl3QbS2RoMIVBNf1sXOdc6kVVb+TkIng+y8L2uhoy8JAelxB1Ebpnr meCKw9prPsZEELXVC+O/LmCatf88tNi+BxdzYjp5XYRDbeHFW1en8lFK8mTMoXHZZw3p elZ1cmOdXjmN3e2xXvh+I5BekvWUNAbIsTWSkYRsp7txFUp134YusZfCIZHBg+0vRnzf 9f4rkcn4tmfdp7GKd/0plDrhlRqzGOuzLpOzRT+z+Gt6zO/0EMIhsep+pPtdi7W3JYaR KReg== X-Gm-Message-State: ALoCoQlPD7A6zL8Va3HpfKpBrIwen7o8RVDghi5rP8QmBZF6ThP9+RgUJJ3LpICnlg/pm6bj+ODY X-Received: by 10.66.66.109 with SMTP id e13mr10743834pat.1.1403558769094; Mon, 23 Jun 2014 14:26:09 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.35.199 with SMTP id n65ls2002996qgn.59.gmail; Mon, 23 Jun 2014 14:26:09 -0700 (PDT) X-Received: by 10.221.20.199 with SMTP id qp7mr21352103vcb.24.1403558768989; Mon, 23 Jun 2014 14:26:08 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id sv2si9678992veb.87.2014.06.23.14.26.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Jun 2014 14:26:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.172 as permitted sender) client-ip=209.85.128.172; Received: by mail-ve0-f172.google.com with SMTP id jz11so6635272veb.17 for ; Mon, 23 Jun 2014 14:26:08 -0700 (PDT) X-Received: by 10.52.159.226 with SMTP id xf2mr18133495vdb.14.1403558768917; Mon, 23 Jun 2014 14:26:08 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp159710vcb; Mon, 23 Jun 2014 14:26:08 -0700 (PDT) X-Received: by 10.180.37.230 with SMTP id b6mr29145545wik.47.1403558768063; Mon, 23 Jun 2014 14:26:08 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id a5si18695455wiy.31.2014.06.23.14.26.07 for ; Mon, 23 Jun 2014 14:26:08 -0700 (PDT) Received-SPF: none (google.com: u-boot-bounces@lists.denx.de does not designate permitted sender hosts) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D143BA74B2; Mon, 23 Jun 2014 23:26:05 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X2xHsv0Sq6oO; Mon, 23 Jun 2014 23:26:05 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D2F52A74B3; Mon, 23 Jun 2014 23:25:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E2B20A74A9 for ; Mon, 23 Jun 2014 23:25:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6oewsiooUjpH for ; Mon, 23 Jun 2014 23:25:48 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by theia.denx.de (Postfix) with ESMTPS id 7E070A74AB for ; Mon, 23 Jun 2014 23:25:43 +0200 (CEST) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s5NLPgUd005403 for ; Mon, 23 Jun 2014 16:25:42 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5NLPgZT008217 for ; Mon, 23 Jun 2014 16:25:42 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Mon, 23 Jun 2014 16:25:42 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5NLPfV9022951; Mon, 23 Jun 2014 16:25:41 -0500 From: Felipe Balbi To: Tom Rini Date: Mon, 23 Jun 2014 16:25:39 -0500 Message-ID: <1403558739-24461-2-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.0.0.390.gcb682f8 In-Reply-To: <1403558739-24461-1-git-send-email-balbi@ti.com> References: <1403558739-24461-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Cc: Steven Kipisz , u-boot@lists.denx.de, "Franklin Cooper Jr." Subject: [U-Boot] [PATCH 2/2] usb: phy: omap_usb_phy: implement usb_phy_power() for AM437x X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Newer AM437x silicon requires us to explicitly power up the USB2 PHY. By implementing usb_phy_power() we can achieve that. Signed-off-by: Felipe Balbi --- drivers/usb/phy/omap_usb_phy.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/usb/phy/omap_usb_phy.c b/drivers/usb/phy/omap_usb_phy.c index af46db2..0ed3e70 100644 --- a/drivers/usb/phy/omap_usb_phy.c +++ b/drivers/usb/phy/omap_usb_phy.c @@ -222,7 +222,22 @@ static void am437x_enable_usb2_phy2(struct omap_xhci *omap) void usb_phy_power(int on) { - return; + u32 val; + + /* USB1_CTRL */ + val = readl(0x44e10628); + if (on) { + /* + * these bits are re-used on AM437x to power up/down the USB + * CM and OTG PHYs, if we don't toggle them, USB will not be + * functional on newer silicon revisions + */ + val &= ~0x3; + } else { + val |= 0x3; + } + + writel(val, 0x44e10628); } #endif /* CONFIG_AM437X_USB2PHY2_HOST */