From patchwork Sat Jun 1 21:37:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2648961 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 4AA713FDBC for ; Sat, 1 Jun 2013 21:36:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756083Ab3FAVgz (ORCPT ); Sat, 1 Jun 2013 17:36:55 -0400 Received: from mail-la0-f42.google.com ([209.85.215.42]:61889 "EHLO mail-la0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755540Ab3FAVgz (ORCPT ); Sat, 1 Jun 2013 17:36:55 -0400 Received: by mail-la0-f42.google.com with SMTP id fg20so2393596lab.29 for ; Sat, 01 Jun 2013 14:36:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:organization:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id:x-gm-message-state; bh=O2mhuvbctGlN9XnkOasEFRJitshBdvkum2fb7zkfUZg=; b=QW+h6i/sygHVN4embDnJRpM5BzeVa7/eHROM1B2rRYWt1StJm5SBrGKT4Ao2RAd8vg rfHsWza3bZDzIh9QIUeYsv7XJCmL+078AWJ4wu16Z4ohU+2qjOkF7WAA/W+Cq3NfifbN 8vuTmaKPe4+t5k3scOpcPYxeYxLRAi2vHyUyECuiWMToEkhf17Dffnbimui30gjtLJ7m fxnAyVYSNKEHe4Py5GlNAqvZrzy5uegFf1vYuoSTfQCl2Ot3j3OhtwLnS41sKqhVks2Q XLHlEpAzbVdb6vbftmx6El+XJKHkhsf72y0OLys3jO/7CWYlU1Ex5AWXbpeSWQ9XlADe PEcA== X-Received: by 10.112.210.135 with SMTP id mu7mr8097975lbc.70.1370122613712; Sat, 01 Jun 2013 14:36:53 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-76-145-9.pppoe.mtu-net.ru. [91.76.145.9]) by mx.google.com with ESMTPSA id e3sm20948094lbf.17.2013.06.01.14.36.51 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 01 Jun 2013 14:36:52 -0700 (PDT) From: Sergei Shtylyov Organization: Cogent Embedded To: horms@verge.net.au, linux-sh@vger.kernel.org Subject: [PATCH v8 3/9] ARM: shmobile: r8a7779: setup EHCI internal buffer Date: Sun, 2 Jun 2013 01:37:01 +0400 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.i686.PAE; KDE/4.4.5; i686; ; ) Cc: linux-usb@vger.kernel.org, magnus.damm@gmail.com, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org References: <201306020128.05914.sergei.shtylyov@cogentembedded.com> In-Reply-To: <201306020128.05914.sergei.shtylyov@cogentembedded.com> MIME-Version: 1.0 Message-Id: <201306020137.01998.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQmeVetffvXDbaNNdtpvyvcI/4OUMmXJSl+GeS3QgLWSt/fZYmsTmdOUNPS0V2u7FHHVdJkf 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 4: - refreshed the patch. 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(+) -- 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 @@ -435,10 +436,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[] = {