From patchwork Tue Apr 9 22:31:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2418101 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id EBC393FC71 for ; Tue, 9 Apr 2013 22:32:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763205Ab3DIWcv (ORCPT ); Tue, 9 Apr 2013 18:32:51 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]:35217 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753305Ab3DIWcu (ORCPT ); Tue, 9 Apr 2013 18:32:50 -0400 Received: by mail-lb0-f179.google.com with SMTP id t1so7372772lbd.10 for ; Tue, 09 Apr 2013 15:32:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:to:subject:cc:from:organization:date:mime-version :content-type:content-transfer-encoding:message-id :x-gm-message-state; bh=l1Wo9OX1jnfu978YhO3rXGM+OPHB4FJJkoNa+JAOzDQ=; b=Z8B2YG+wA+Ayvw5Ah+Weit0/b0QAJKM7Q+0X0wENmOzCbHEhQeJm4ZlLcH15qDKK4D dKbQkPoSKSdM35uCUNqzEdsiD4XMM5gHiUG8H+e2C5Z2stBt9WX5tetOAGRsfFr8rAdq HwdBlMiL3II2z50am6Pgee7ABTdYBxP+F1CqhaKO6PgM0Y0DlqLCqrqonSfeuKvWuhON KUegiGm+HEYzn18zY+wDC1QUZTTSvZybIw/C9Ohvo/1+XHEMvxJBrvdFIA0uFKOf44En TCQlkhIePapcU+MqdOCSTXzf/CJaAtPVpTGDukZQRB9rsBxbk+ulYNZWKoaYpoSrEqiu PFqA== X-Received: by 10.112.180.193 with SMTP id dq1mr14404496lbc.60.1365546769317; Tue, 09 Apr 2013 15:32:49 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-79-87-206.pppoe.mtu-net.ru. [91.79.87.206]) by mx.google.com with ESMTPS id t20sm13094252lbi.5.2013.04.09.15.32.47 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 09 Apr 2013 15:32:48 -0700 (PDT) To: horms@verge.net.au, magnus.damm@gmail.com, linux@arm.linux.org.uk, linux-sh@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 3/9] ARM: shmobile: R8A7779: setup EHCI internal buffer Cc: linux-usb@vger.kernel.org From: Sergei Shtylyov Organization: Cogent Embedded Date: Wed, 10 Apr 2013 02:31:48 +0400 MIME-Version: 1.0 Message-Id: <201304100231.48628.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQnJQeEb7utjdZxi1+K+NB2MZEgd7oXMfj43JcDzgXAa7jNipK9WK8cTR6w3J5bbbexqaw/q Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Setup the EHCI internal buffer (before EHCI driver has a chance to touch the registers) using the pre_setup() method in 'struct usb_ehci_pdata'. The patch has been tested on the Marzen board. Signed-off-by: Sergei Shtylyov Acked-by: Kuninori Morimoto Acked-by: Simon Horman --- Changes since version 2: - added #include ; - added a note about testing to the changelog; - added ACKs from Simon Horman and Kuninori Morimoto. Changes since the original posting: - changed from init() platform device method to pre_setup() as per the previous patch. arch/arm/mach-shmobile/setup-r8a7779.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: renesas/arch/arm/mach-shmobile/setup-r8a7779.c =================================================================== --- renesas.orig/arch/arm/mach-shmobile/setup-r8a7779.c +++ renesas/arch/arm/mach-shmobile/setup-r8a7779.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -446,10 +447,25 @@ static void usb_power_off(struct platfor pm_runtime_disable(&pdev->dev); } +static int ehci_init_internal_buffer(struct usb_hcd *hcd) +{ + /* + * Below are recommended values from the datasheet; + * see [USB :: Setting of EHCI Internal Buffer]. + */ + /* EHCI IP internal buffer setting */ + iowrite32(0x00ff0040, hcd->regs + 0x0094); + /* EHCI IP internal buffer enable */ + iowrite32(0x00000001, hcd->regs + 0x009C); + + return 0; +} + static struct usb_ehci_pdata ehcix_pdata = { .power_on = usb_power_on, .power_off = usb_power_off, .power_suspend = usb_power_off, + .pre_setup = ehci_init_internal_buffer, }; static struct resource ehci0_resources[] = {