From patchwork Wed Aug 19 09:52:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 42560 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 n7J9uWWE002446 for ; Wed, 19 Aug 2009 09:56:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751747AbZHSJ43 (ORCPT ); Wed, 19 Aug 2009 05:56:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751740AbZHSJ43 (ORCPT ); Wed, 19 Aug 2009 05:56:29 -0400 Received: from rv-out-0506.google.com ([209.85.198.236]:23183 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751560AbZHSJ42 (ORCPT ); Wed, 19 Aug 2009 05:56:28 -0400 Received: by rv-out-0506.google.com with SMTP id f6so1243029rvb.1 for ; Wed, 19 Aug 2009 02:56:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=HN1gUXo4T2o3IKi+YBxUbqsvj2O/17cGK8EqXeibYmY=; b=w5+8t48XdUBmeoAAbh2FGnNB2L8QmRYrj7/TBMD5UupXwoepsQQI9xK11G6LAU6V/k TpypAalLWYo6AuUEysvvTMmjRfxeN2LnmCPkan9qryyNvKarqqZ/jIP3u4fDW0+ipx5d 4TjZqZCJmm2T8n4DIi0pvZfMeTWc1ncz2YCS4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=XRV3bntFiWHQMnkYMaJ4f/efXfdmbNlKDnMhU+uJUJWKQX6eEYsPExCERuen9gSC1L aM4FrxgR6CAxlRIAcCYKB/jHToCW24vp1psweWuBPBeU6Pyu0OsNlxHPczeFWUkz6lgc Cc+7R+HZuXDsIzr3zHMZRJERHWKgivxoqLljM= Received: by 10.141.26.7 with SMTP id d7mr3309860rvj.209.1250675790567; Wed, 19 Aug 2009 02:56:30 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id g31sm24230106rvb.16.2009.08.19.02.56.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 19 Aug 2009 02:56:29 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org, shimoda.yoshihiro@renesas.com, linux-usb@vger.kernel.org, gregkh@suse.de Date: Wed, 19 Aug 2009 18:52:02 +0900 Message-Id: <20090819095202.11560.98304.sendpatchset@rx1.opensource.se> Subject: [PATCH] sh: add r8a66597 usb1 gadget to the se7724 board Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm Add USB gadget support for port CN26 on the Solution Engine 7724 board. The r8a66597-udc driver is hooked up as a platform device and some registers are configured to enable the USB in gadget mode. The hardware driving the USB port is the on-chip USB1 block in the sh7724 processor configured as USB gadget controller. Signed-off-by: Magnus Damm --- Needs the r8a66597-udc clock framework patch to run properly. arch/sh/boards/mach-se/7724/setup.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 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 --- 0001/arch/sh/boards/mach-se/7724/setup.c +++ work/arch/sh/boards/mach-se/7724/setup.c 2009-08-19 18:34:38.000000000 +0900 @@ -341,6 +341,35 @@ static struct platform_device sh7724_usb .resource = sh7724_usb0_host_resources, }; +static struct r8a66597_platdata sh7724_usb1_gadget_data = { + .on_chip = 1, +}; + +static struct resource sh7724_usb1_gadget_resources[] = { + [0] = { + .start = 0xa4d90000, + .end = 0xa4d90123, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = 66, + .end = 66, + .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, + }, +}; + +static struct platform_device sh7724_usb1_gadget_device = { + .name = "r8a66597_udc", + .id = 1, /* USB1 */ + .dev = { + .dma_mask = NULL, /* not use dma */ + .coherent_dma_mask = 0xffffffff, + .platform_data = &sh7724_usb1_gadget_data, + }, + .num_resources = ARRAY_SIZE(sh7724_usb1_gadget_resources), + .resource = sh7724_usb1_gadget_resources, +}; + static struct platform_device *ms7724se_devices[] __initdata = { &heartbeat_device, &smc91x_eth_device, @@ -351,6 +380,7 @@ static struct platform_device *ms7724se_ &keysc_device, &sh_eth_device, &sh7724_usb0_host_device, + &sh7724_usb1_gadget_device, }; #define EEPROM_OP 0xBA206000 @@ -459,6 +489,9 @@ static int __init devices_setup(void) /* enable USB0 port */ ctrl_outw(0x0600, 0xa40501d4); + /* enable USB1 port */ + ctrl_outw(0x0600, 0xa4050192); + /* enable IRQ 0,1,2 */ gpio_request(GPIO_FN_INTC_IRQ0, NULL); gpio_request(GPIO_FN_INTC_IRQ1, NULL);