From patchwork Fri Aug 21 18:22:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 43178 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7LINWHD016679 for ; Fri, 21 Aug 2009 18:23:33 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id n7LILXNe001235; Fri, 21 Aug 2009 13:21:39 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id n7LILXiw005833; Fri, 21 Aug 2009 13:21:33 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 1AC0280627; Fri, 21 Aug 2009 13:21:33 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 4595680626 for ; Fri, 21 Aug 2009 13:21:30 -0500 (CDT) Received: from white.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id n7LILTMt015204 for ; Fri, 21 Aug 2009 13:21:30 -0500 (CDT) Received: from mail30-tx2-R.bigfish.com (mail-tx2.bigfish.com [65.55.88.111]) by white.ext.ti.com (8.13.7/8.13.7) with ESMTP id n7LILOif025773 for ; Fri, 21 Aug 2009 13:21:29 -0500 Received: from mail30-tx2 (localhost.localdomain [127.0.0.1]) by mail30-tx2-R.bigfish.com (Postfix) with ESMTP id 7674732857E for ; Fri, 21 Aug 2009 18:21:24 +0000 (UTC) X-SpamScore: 6 X-BigFish: vps6(zcb8kz19c2kzz1202hzzz2dh6bh61h) X-Spam-TCS-SCL: 0:0 X-MS-Exchange-Organization-Antispam-Report: OrigIP: 63.81.120.155; Service: EHS Received: by mail30-tx2 (MessageSwitch) id 1250878882274281_22187; Fri, 21 Aug 2009 18:21:22 +0000 (UCT) Received: from imap.sh.mvista.com (unknown [63.81.120.155]) by mail30-tx2.bigfish.com (Postfix) with ESMTP id E73151468055 for ; Fri, 21 Aug 2009 18:21:21 +0000 (UTC) Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9]) by imap.sh.mvista.com (Postfix) with ESMTP id 7A7993EC9; Fri, 21 Aug 2009 11:21:19 -0700 (PDT) From: Sergei Shtylyov Organization: MontaVista Software Inc. To: davinci-linux-open-source@linux.davincidsp.com, linux-usb@vger.kernel.org Date: Fri, 21 Aug 2009 22:22:39 +0400 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200908212222.40870.sshtylyov@ru.mvista.com> Cc: Subject: [PATCH RFC 2/3] DA8xx: OHCI platform device X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com Add the function to register the OHCI platform device, given the root hub related platform data passed from the board specific code. While at it, modify USB 2.0 clock entry in order to match the clock by name instead of by device since it is also needed by the OHCI glue layer... Signed-off-by: Sergei Shtylyov --- The patch is against the recent DaVinci tree... arch/arm/mach-davinci/da830.c | 2 - arch/arm/mach-davinci/devices-da8xx.c | 33 +++++++++++++++++++++++++++++ arch/arm/mach-davinci/include/mach/da8xx.h | 2 + 3 files changed, 36 insertions(+), 1 deletion(-) Index: linux-davinci/arch/arm/mach-davinci/da830.c =================================================================== --- linux-davinci.orig/arch/arm/mach-davinci/da830.c +++ linux-davinci/arch/arm/mach-davinci/da830.c @@ -415,7 +415,7 @@ static struct davinci_clk da830_clks[] = CLK("davinci-mcasp.0", NULL, &mcasp0_clk), CLK("davinci-mcasp.1", NULL, &mcasp1_clk), CLK("davinci-mcasp.2", NULL, &mcasp2_clk), - CLK("musb_hdrc", NULL, &usb20_clk), + CLK(NULL, "usb20", &usb20_clk), CLK(NULL, "aemif", &aemif_clk), CLK(NULL, "aintc", &aintc_clk), CLK(NULL, "secu_mgr", &secu_mgr_clk), Index: linux-davinci/arch/arm/mach-davinci/devices-da8xx.c =================================================================== --- linux-davinci.orig/arch/arm/mach-davinci/devices-da8xx.c +++ linux-davinci/arch/arm/mach-davinci/devices-da8xx.c @@ -33,6 +33,7 @@ #define DA8XX_EMAC_CPGMACSS_BASE 0x01e22000 #define DA8XX_EMAC_CPGMAC_BASE 0x01e23000 #define DA8XX_EMAC_MDIO_BASE 0x01e24000 +#define DA8XX_USB1_BASE 0x01e25000 #define DA8XX_GPIO_BASE 0x01e26000 #define DA8XX_I2C1_BASE 0x01e28000 @@ -234,6 +235,38 @@ int __init da8xx_register_watchdog(void) return platform_device_register(&davinci_wdt_device); } +static struct resource da8xx_usb11_resources[] = { + [0] = { + .start = DA8XX_USB1_BASE, + .end = DA8XX_USB1_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_DA8XX_IRQN, + .end = IRQ_DA8XX_IRQN, + .flags = IORESOURCE_IRQ, + }, +}; + +static u64 da8xx_usb11_dma_mask = DMA_BIT_MASK(32); + +static struct platform_device da8xx_usb11_device = { + .name = "ohci", + .id = 0, + .dev = { + .dma_mask = &da8xx_usb11_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), + }, + .num_resources = ARRAY_SIZE(da8xx_usb11_resources), + .resource = da8xx_usb11_resources, +}; + +int __init da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata) +{ + da8xx_usb11_device.dev.platform_data = pdata; + return platform_device_register(&da8xx_usb11_device); +} + static struct resource da8xx_emac_resources[] = { { .start = DA8XX_EMAC_CPPI_PORT_BASE, Index: linux-davinci/arch/arm/mach-davinci/include/mach/da8xx.h =================================================================== --- linux-davinci.orig/arch/arm/mach-davinci/include/mach/da8xx.h +++ linux-davinci/arch/arm/mach-davinci/include/mach/da8xx.h @@ -16,6 +16,7 @@ #include #include #include +#include /* * The cp_intc interrupt controller for the da8xx isn't in the same @@ -71,6 +72,7 @@ void __init da850_init(void); int da8xx_register_edma(void); int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata); int da8xx_register_watchdog(void); +int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata); int da8xx_register_emac(void); void __init da8xx_init_mcasp(int id, struct snd_platform_data *pdata);