From patchwork Tue Apr 14 08:25:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 18060 X-Patchwork-Delegate: lethal@linux-sh.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3E93Vcf009978 for ; Tue, 14 Apr 2009 09:03:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752547AbZDNJDA (ORCPT ); Tue, 14 Apr 2009 05:03:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753445AbZDNJDA (ORCPT ); Tue, 14 Apr 2009 05:03:00 -0400 Received: from mail.renesas.com ([202.234.163.13]:60778 "EHLO mail03.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752547AbZDNJC7 (ORCPT ); Tue, 14 Apr 2009 05:02:59 -0400 X-AuditID: ac140386-0000000400001aa8-6b-49e4514059ec Received: from guardian01.idc.renesas.com ([172.20.8.200]) by mail03.idc.renesas.com (sendmail) with ESMTP id n3E92uoa008450; Tue, 14 Apr 2009 18:02:56 +0900 (JST) Received: (from root@localhost) by guardian01.idc.renesas.com with id n3E92vuN026929; Tue, 14 Apr 2009 18:02:57 +0900 (JST) Received: from mta03.idc.renesas.com (localhost [127.0.0.1]) by mta03.idc.renesas.com with ESMTP id n3E92ugw001172; Tue, 14 Apr 2009 18:02:56 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0KI300DIO2GW5O@ims05.idc.renesas.com>; Tue, 14 Apr 2009 18:02:57 +0900 (JST) Date: Tue, 14 Apr 2009 17:25:02 +0900 From: Kuninori Morimoto Subject: [PATCH 3/6] Add USB support for SH7724 To: Paul Mundt Cc: SH-Linux Message-id: MIME-version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-type: text/plain; charset=US-ASCII User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.1 (i386-mingw-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/3.00-dev (KIKU) X-Brightmail-Tracker: AAAAAA== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Signed-off-by: Kuninori Morimoto --- arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 45 ++++++++++++++++++++++++++++++++ drivers/usb/host/Kconfig | 2 +- 2 files changed, 46 insertions(+), 1 deletions(-) diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c index 71ccb25..4257713 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c @@ -99,15 +99,60 @@ static struct platform_device rtc_device = { .resource = rtc_resources, }; +/* USB0 */ +static struct resource usb0_host_resources[] = { + [0] = { + .name = "r8a66597_hcd", + .start = 0xa4d80000, + .end = 0xa4d800ff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = 65, + .end = 65, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device usb0_device = { + .name = "r8a66597_hcd", + .id = 0, + .dev = { + .dma_mask = NULL, /* not use dma */ + .coherent_dma_mask = 0xffffffff, + }, + .num_resources = ARRAY_SIZE(usb0_host_resources), + .resource = usb0_host_resources, +}; + static struct platform_device *sh7724_devices[] __initdata = { &sci_device, &rtc_device, + &usb0_device, }; +#define UPONCR0 0xa40501d4 +#define UPONCR1 0xa4050192 +#define USBPOWERON 0x0600 +static void __init sh7724_usb_setup(void) +{ + /* + * USB initial settings + * + * The following settings are necessary + * for using the USB modules. + * + * see "USB Inital Settings" for detail + */ + __raw_writew(USBPOWERON , UPONCR0); + __raw_writew(USBPOWERON , UPONCR1); +} + static int __init sh7724_devices_setup(void) { clk_always_enable("rtc0"); /* RTC */ + sh7724_usb_setup(); return platform_add_devices(sh7724_devices, ARRAY_SIZE(sh7724_devices)); } diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 845479f..e2b7393 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -317,7 +317,7 @@ config USB_R8A66597_HCD config SUPERH_ON_CHIP_R8A66597 boolean "Enable SuperH on-chip R8A66597 USB" - depends on USB_R8A66597_HCD && (CPU_SUBTYPE_SH7366 || CPU_SUBTYPE_SH7723) + depends on USB_R8A66597_HCD && (CPU_SUBTYPE_SH7366 || CPU_SUBTYPE_SH7723 || CPU_SUBTYPE_SH7724) help This driver enables support for the on-chip R8A66597 in the SH7366 and SH7723 processors.