From patchwork Fri Apr 12 23:29:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2439191 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 083C03FD40 for ; Fri, 12 Apr 2013 23:30:54 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UQnQi-0006Ff-Ga; Fri, 12 Apr 2013 23:30:52 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UQnQf-0006NK-SH; Fri, 12 Apr 2013 23:30:49 +0000 Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UQnQc-0006Mt-P4 for linux-arm-kernel@lists.infradead.org; Fri, 12 Apr 2013 23:30:47 +0000 Received: by mail-la0-f45.google.com with SMTP id gw10so2974219lab.18 for ; Fri, 12 Apr 2013 16:30:44 -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=3/oLtOWC8TyaMrS3YeJIoHs2eA2b6BOGM14rsRnXhTE=; b=K5W7M2avETwNU0Mcwnp/Iyuj48uj8PQbCN6dGllu+dkLse62vpJycMwQxTDfMa2Ea7 ZgFzNq5t//5pMe+/vZsbdtcNGmRGE05ZMkzZphXYaRbIrQcLBXXpus4wqTlShWHT1rsB SDVI/pWguZNVlXK8RJdRm42VSxRzVqJ3Kd9frOJeld48ZxuXflUnWs39GnB8CUUQXGFi pKEBJd8lRJN5fSRIz9FK0HFKeAZfENfK9sjMs0qJDTXO1/M9CatxMioXtvfLFoX+zWRW 0D7hi4NZJjnvIYxKGBBaiKGkdlGv1tTL2uOxM6s9E6QiYg2pZLclyhKM2BZvRm1tJGg3 V8CQ== X-Received: by 10.112.155.131 with SMTP id vw3mr6272871lbb.64.1365809444382; Fri, 12 Apr 2013 16:30:44 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-79-80-224.pppoe.mtu-net.ru. [91.79.80.224]) by mx.google.com with ESMTPS id b2sm4044956lbv.4.2013.04.12.16.30.41 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 12 Apr 2013 16:30:42 -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 v4 3/9] ARM: shmobile: r8a7779: setup EHCI internal buffer From: Sergei Shtylyov Organization: Cogent Embedded Date: Sat, 13 Apr 2013 03:29:46 +0400 MIME-Version: 1.0 Message-Id: <201304130329.47389.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQl6K/8zILmn/Z4CluYn08kBhP6PTt6KvDqW3kULxh5TWCIM9EEKoB5PVY83xRitsdWxEC6t X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130412_193046_999965_DACB2289 X-CRM114-Status: GOOD ( 12.86 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-usb@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 3: - lowercased the SoC name in the subject. 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(+) 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[] = {