From patchwork Sun Sep 25 17:25:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jana Rapava X-Patchwork-Id: 116309 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 52AA7B6F75 for ; Mon, 26 Sep 2011 03:22:35 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E2C63282AB; Sun, 25 Sep 2011 19:22:24 +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 pjvDVU6KKn5Y; Sun, 25 Sep 2011 19:22:24 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 59B5B28284; Sun, 25 Sep 2011 19:22:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4046B28214 for ; Sun, 25 Sep 2011 19:22:12 +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 a3tCdIm+Ndvj for ; Sun, 25 Sep 2011 19:22:11 +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 mail-bw0-f44.google.com (mail-bw0-f44.google.com [209.85.214.44]) by theia.denx.de (Postfix) with ESMTPS id 27C602827D for ; Sun, 25 Sep 2011 19:22:09 +0200 (CEST) Received: by mail-bw0-f44.google.com with SMTP id q10so4634715bka.3 for ; Sun, 25 Sep 2011 10:22:09 -0700 (PDT) Received: by 10.204.137.19 with SMTP id u19mr2723869bkt.107.1316971328919; Sun, 25 Sep 2011 10:22:08 -0700 (PDT) Received: from hex.kolej.mff.cuni.cz (janalaptop.kolej.mff.cuni.cz. [78.128.199.214]) by mx.google.com with ESMTPS id z7sm17987065bkt.5.2011.09.25.10.22.08 (version=SSLv3 cipher=OTHER); Sun, 25 Sep 2011 10:22:08 -0700 (PDT) From: Jana Rapava To: u-boot@lists.denx.de Date: Sun, 25 Sep 2011 19:25:08 +0200 Message-Id: <1316971511-5667-2-git-send-email-fermata7@gmail.com> X-Mailer: git-send-email 1.7.6.3 In-Reply-To: <1316971511-5667-1-git-send-email-fermata7@gmail.com> References: <1316312368-13006-1-git-send-email-fermata7@gmail.com> <1316971511-5667-1-git-send-email-fermata7@gmail.com> Cc: Jana Rapava Subject: [U-Boot] [PATCH v4 2/4] EHCI: add callback ehci_fixup X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Add callback to ehci_fixup to prepare for solving the problem with VBUS reset on Efika. Signed-off-by: Jana Rapava Cc: Marek Vasut Cc: Remy Bohmer Cc: Stefano Babic --- Changes for v2: - changed to proper patch Changes for v3: - merged other USB patches from u-boot-pxa/efikasb - offset-based access changed to struct-based access - use {clrset,clr,set}bits_le32() calls - CodingStyle and naming cleanup Changes for v4: - split into patchset - add callback ehci_fixup drivers/usb/host/ehci-hcd.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index bdadd46..8d31921 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -536,6 +537,14 @@ static inline int min3(int a, int b, int c) return a; } +inline void __ehci_fixup(uint32_t *status_reg, uint32_t *reg_ref) +{ + wait_ms(50); +} + +void ehci_fixup(uint32_t *status_reg, uint32_t *reg_ref) + __attribute__((weak, alias("__ehci_fixup"))); + int ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer, int length, struct devrequest *req) @@ -709,8 +718,7 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer, * usb 2.0 specification say 50 ms resets on * root */ - wait_ms(50); - /* terminate the reset */ + ehci_fixup(status_reg, ®); ehci_writel(status_reg, reg & ~EHCI_PS_PR); /* * A host controller must terminate the reset