From patchwork Mon Apr 8 21:21:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2411631 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 97C90DFB78 for ; Mon, 8 Apr 2013 21:22:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936133Ab3DHVW3 (ORCPT ); Mon, 8 Apr 2013 17:22:29 -0400 Received: from mail-lb0-f171.google.com ([209.85.217.171]:64975 "EHLO mail-lb0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936104Ab3DHVW2 (ORCPT ); Mon, 8 Apr 2013 17:22:28 -0400 Received: by mail-lb0-f171.google.com with SMTP id v10so6218061lbd.30 for ; Mon, 08 Apr 2013 14:22:27 -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=1/gWUrUKgjj7+NZqBV/+6VndlI31K6Jpub7EZXm0UHo=; b=P5O28f1KHpuXU/ehTisHssTkiqEIs0Xa2bbfcML9pCsaWQYCQfAcany998ZOKKjPpD UeELKbQfAjWpRhkONU5EYUGR3jFhg+NS7jdAcsDKm6PiZzAryzqV3mNV5/Uf7wiXZ3mI ba9vtK1sZ8zpRb9KklgnNEFbz/slrQJACkyF2gP3d1bnzmPfflGwZFqowZY0jzYQXbCE iSL1iCQJlyJqx+LuyJA2SQOiutRanN/+6c1Bcxa1PSlvj7itn6wak4vUCTbTXTzbAR/w UDfSUYNFIekGGbSj6HnJuJRRMrdqmcamS91e+AwJ0DP21TWYXR6QAF2owPY7hoRZxo0v rX1A== X-Received: by 10.112.180.193 with SMTP id dq1mr12170396lbc.60.1365456146871; Mon, 08 Apr 2013 14:22:26 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-79-99-249.pppoe.mtu-net.ru. [91.79.99.249]) by mx.google.com with ESMTPS id w6sm8974214lad.5.2013.04.08.14.22.24 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 08 Apr 2013 14:22:25 -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 v2 3/9] ARM: shmobile: R8A7779: setup EHCI internal buffer Cc: linux-usb@vger.kernel.org From: Sergei Shtylyov Organization: Cogent Embedded Date: Tue, 9 Apr 2013 01:21:22 +0400 MIME-Version: 1.0 Message-Id: <201304090121.23296.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQkCkH4HHkt4jUw8Je5FZ69t3dXPRFGKmm+jYxAbJLKPBn6Z4B/XHjjm3m7YtoTKaW7q6UT1 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'. Signed-off-by: Sergei Shtylyov --- 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 | 15 +++++++++++++++ 1 file changed, 15 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 @@ -446,10 +446,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[] = {