From patchwork Mon Jul 16 08:12:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Yanok X-Patchwork-Id: 171144 X-Patchwork-Delegate: marek.vasut@gmail.com 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 609462C00B9 for ; Mon, 16 Jul 2012 18:12:25 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0AF6628185; Mon, 16 Jul 2012 10:12:23 +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 b3pfjfDr1qwI; Mon, 16 Jul 2012 10:12:22 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 29DD128173; Mon, 16 Jul 2012 10:12:20 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D335D28173 for ; Mon, 16 Jul 2012 10:12:17 +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 421lnlVID82X for ; Mon, 16 Jul 2012 10:12:17 +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-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) by theia.denx.de (Postfix) with ESMTPS id 1381A2816D for ; Mon, 16 Jul 2012 10:12:15 +0200 (CEST) Received: by lbbgo11 with SMTP id go11so7009638lbb.3 for ; Mon, 16 Jul 2012 01:12:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=naVH/6Ok7uVsYruv1FOKGOqX6IW99n9YLHtFamxQBP4=; b=NzhByORVbdh3vZqfzIH2XEnNfNyB3WHQouJwahNAGnL+wP3H2VonuDh3S+DfV/vLfw PTHtMbhBx4zwuyBiGqMU+DMeYWRt1SNLpEAvDAKOkWINi2TVlxzMLX40Z2AnZFHBkHGl v9zJLE5ezW88fV3xHvzGwQFLCe8B2Qy7FKi2a/FpJRZujO3WFahEH7mcXeF8XXJHZSJ7 eLPwv5NbgOcYkMDsiFpK+svUzv/QRyn/n+E6fmuVqTQCrndOOzIyAWc5J5sj8R40HPnE aOBBT43lccxd1p63riXr8e852ib/8DWyOjv1/rSc98rtD6UJWrekN+PH3M8044bmncCL 4Xjg== Received: by 10.152.146.163 with SMTP id td3mr10730603lab.26.1342426334878; Mon, 16 Jul 2012 01:12:14 -0700 (PDT) Received: from localhost.localdomain ([188.134.70.194]) by mx.google.com with ESMTPS id pi5sm15413842lab.7.2012.07.16.01.12.13 (version=SSLv3 cipher=OTHER); Mon, 16 Jul 2012 01:12:14 -0700 (PDT) From: Ilya Yanok To: u-boot@lists.denx.de, Marek Vasut Date: Mon, 16 Jul 2012 12:12:08 +0400 Message-Id: <1342426328-31357-1-git-send-email-ilya.yanok@cogentembedded.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: X-Gm-Message-State: ALoCoQkvJSt1ihJofr7ay1nkF4NLQTKBFO4xj5HI5aw5UN5QWVMgKAfVCrl0fwV92lTn7kmkAVNM Cc: Tom Rini , Ilya Yanok Subject: [U-Boot] [PATCH] ehci-hcd: program asynclistaddr before every transfer X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 Move or_asynclistaddr programming to ehci_submit_async() function to make sure queue head is properly programmed before every transfer. This solves the problem with changing qh address. Also remove unneeded qh_list->qh_link reprogramming at the end of transfer. Signed-off-by: Ilya Yanok --- drivers/usb/host/ehci-hcd.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 04300be..3be2a77 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -348,6 +348,9 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer, flush_dcache_range((uint32_t)&qh, (uint32_t)&qh + sizeof(struct QH)); flush_dcache_range((uint32_t)qtd, (uint32_t)qtd + sizeof(qtd)); + /* Set async. queue head pointer. */ + ehci_writel(&hcor->or_asynclistaddr, (uint32_t)&qh_list); + usbsts = ehci_readl(&hcor->or_usbsts); ehci_writel(&hcor->or_usbsts, (usbsts & 0x3f)); @@ -403,8 +406,6 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer, goto fail; } - qh_list.qh_link = cpu_to_hc32((uint32_t)&qh_list | QH_LINK_TYPE_QH); - token = hc32_to_cpu(qh.qh_overlay.qt_token); if (!(token & 0x80)) { debug("TOKEN=%#x\n", token); @@ -741,9 +742,6 @@ int usb_lowlevel_init(void) qh_list.qh_overlay.qt_altnext = cpu_to_hc32(QT_NEXT_TERMINATE); qh_list.qh_overlay.qt_token = cpu_to_hc32(0x40); - /* Set async. queue head pointer. */ - ehci_writel(&hcor->or_asynclistaddr, (uint32_t)&qh_list); - reg = ehci_readl(&hccr->cr_hcsparams); descriptor.hub.bNbrPorts = HCS_N_PORTS(reg); printf("Register %x NbrPorts %d\n", reg, descriptor.hub.bNbrPorts);