From patchwork Thu Jul 10 04:02:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 33369 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3F873203F4 for ; Thu, 10 Jul 2014 04:03:14 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id v10sf52382822pde.7 for ; Wed, 09 Jul 2014 21:03:13 -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=OP+4c+/poYEtyvbno8X8GmFALo0CFYPU4Ai45TjSCiM=; b=WENjSBBUtyaYFRZvcWSfJMhR8e1nmmKViV5dC06v6QM6rCncqOOPr6F4F/HU383iiu 8OE9MaLp6PmEU6Rc7rEf7szK1GupBcEPF+32SFeamz2s/pcUvsMCEPwlYFacnQPPyFXf nQlJZhLaZOXFF64DvvX7b7OCie35bayjoyTPHRe+xV1xvXtc1MrCjT7w/zj2LxtCLOvl LdoMZL5qBrs9FSTDMRADXfbhml3cuSpG8+NN1/4/vB9WwhonGbstSzS+5ljvaBCF78qU DManX0egzaUXwhByo+b1P+iS8qByHDHiNf0928SRXDhoH6rzXNQBLGo01nby2PdnPjSa d16g== X-Gm-Message-State: ALoCoQlwY4FpMBwdtak5lwgA9Q/sRpkbTDr9PAH3hj/iJrVsDlnomSPuoJH9o4ZoYp9HunEpznAu X-Received: by 10.66.161.234 with SMTP id xv10mr23308381pab.20.1404964993151; Wed, 09 Jul 2014 21:03:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.168 with SMTP id h37ls2805657qgd.62.gmail; Wed, 09 Jul 2014 21:03:13 -0700 (PDT) X-Received: by 10.58.12.73 with SMTP id w9mr44203023veb.13.1404964993040; Wed, 09 Jul 2014 21:03:13 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id br17si6462551veb.63.2014.07.09.21.03.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Jul 2014 21:03:13 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id id10so9355374vcb.38 for ; Wed, 09 Jul 2014 21:03:12 -0700 (PDT) X-Received: by 10.52.17.129 with SMTP id o1mr36285188vdd.0.1404964992924; Wed, 09 Jul 2014 21:03:12 -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 tc5csp100418vcb; Wed, 9 Jul 2014 21:03:12 -0700 (PDT) X-Received: by 10.194.62.140 with SMTP id y12mr53677561wjr.27.1404964991594; Wed, 09 Jul 2014 21:03:11 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id r4si10797822wif.99.2014.07.09.21.03.10 for ; Wed, 09 Jul 2014 21:03:11 -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 8061CA786D; Thu, 10 Jul 2014 06:03:10 +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 9nK3d5JXaJpM; Thu, 10 Jul 2014 06:03:10 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3782CA7894; Thu, 10 Jul 2014 06:03:07 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 92269A7895 for ; Thu, 10 Jul 2014 06:03:04 +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 Ymwvo2ESU1eq for ; Thu, 10 Jul 2014 06:03:01 +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 arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by theia.denx.de (Postfix) with ESMTPS id 5DDE0A786D for ; Thu, 10 Jul 2014 06:02:57 +0200 (CEST) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s6A42q3K028840; Wed, 9 Jul 2014 23:02:52 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s6A42q5u005951; Wed, 9 Jul 2014 23:02:52 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Wed, 9 Jul 2014 23:02:51 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s6A42pvL012183; Wed, 9 Jul 2014 23:02:51 -0500 From: Felipe Balbi To: Date: Wed, 9 Jul 2014 23:02:43 -0500 Message-ID: <1404964963-6614-2-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.0.0.390.gcb682f8 In-Reply-To: <1404964963-6614-1-git-send-email-balbi@ti.com> References: <1404964963-6614-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de, Steven Kipisz , Tom Rini , "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.220.179 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 --- arch/arm/include/asm/arch-am33xx/hardware_am43xx.h | 5 +++++ drivers/usb/phy/omap_usb_phy.c | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/arch-am33xx/hardware_am43xx.h b/arch/arm/include/asm/arch-am33xx/hardware_am43xx.h index b470319..efdecf4 100644 --- a/arch/arm/include/asm/arch-am33xx/hardware_am43xx.h +++ b/arch/arm/include/asm/arch-am33xx/hardware_am43xx.h @@ -43,6 +43,11 @@ #define VTP0_CTRL_ADDR 0x44E10E0C #define VTP1_CTRL_ADDR 0x48140E10 +/* USB CTRL Base Address */ +#define USB1_CTRL 0x44e10628 +#define USB1_CTRL_CM_PWRDN BIT(0) +#define USB1_CTRL_OTG_PWRDN BIT(1) + /* DDR Base address */ #define DDR_PHY_CMD_ADDR 0x44E12000 #define DDR_PHY_DATA_ADDR 0x44E120C8 diff --git a/drivers/usb/phy/omap_usb_phy.c b/drivers/usb/phy/omap_usb_phy.c index af46db2..53778b3 100644 --- a/drivers/usb/phy/omap_usb_phy.c +++ b/drivers/usb/phy/omap_usb_phy.c @@ -222,7 +222,16 @@ static void am437x_enable_usb2_phy2(struct omap_xhci *omap) void usb_phy_power(int on) { - return; + /* + * In order to get USB working on newer AM43xx silicon, we must + * explicitly power the USB PHYs. + */ + if (on) + clrbits_le32(USB1_CTRL, USB1_CTRL_CM_PWRDN | + USB1_CTRL_OTG_PWRDN); + else + setbits_le32(USB1_CTRL, USB1_CTRL_CM_PWRDN | + USB1_CTRL_OTG_PWRDN); } #endif /* CONFIG_AM437X_USB2PHY2_HOST */