public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <morimoto.kuninori@renesas.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH 3/6] Add USB support for SH7724
Date: Wed, 15 Apr 2009 02:42:55 +0000	[thread overview]
Message-ID: <ud4be3ads.wl%morimoto.kuninori@renesas.com> (raw)
In-Reply-To: <uzlej1ubl.wl%morimoto.kuninori@renesas.com>


Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
---
 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.
-- 
1.5.6.3


  reply	other threads:[~2009-04-15  2:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14  8:25 [PATCH 3/6] Add USB support for SH7724 Kuninori Morimoto
2009-04-15  2:42 ` Kuninori Morimoto [this message]
2009-04-15 11:49 ` Magnus Damm
2009-04-15 12:12 ` Paul Mundt
2009-04-15 12:16 ` Magnus Damm
2009-04-16  0:41 ` Kuninori Morimoto
2009-04-16  1:05 ` Paul Mundt
2009-04-16  1:12 ` Yoshihiro Shimoda
2009-04-16  2:46 ` Kuninori Morimoto
2009-04-16  2:46 ` Kuninori Morimoto
2009-04-16  4:26 ` Kuninori Morimoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ud4be3ads.wl%morimoto.kuninori@renesas.com \
    --to=morimoto.kuninori@renesas.com \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox