From patchwork Fri Aug 21 18:27:42 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 43179 Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7LIRsrx017122 for ; Fri, 21 Aug 2009 18:27:55 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id n7LIQPQ0008783; Fri, 21 Aug 2009 13:26:30 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id n7LIQOPL003576; Fri, 21 Aug 2009 13:26:24 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 316C680627; Fri, 21 Aug 2009 13:26:24 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id C38D480626 for ; Fri, 21 Aug 2009 13:26:22 -0500 (CDT) Received: from medina.ext.ti.com (localhost [127.0.0.1]) by dflp51.itg.ti.com (8.13.7/8.13.7) with ESMTP id n7LIQM7o022662 for ; Fri, 21 Aug 2009 13:26:22 -0500 (CDT) Received: from mail84-tx2-R.bigfish.com (mail-tx2.bigfish.com [65.55.88.112]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id n7LIQH6f032282 for ; Fri, 21 Aug 2009 13:26:22 -0500 Received: from mail84-tx2 (localhost.localdomain [127.0.0.1]) by mail84-tx2-R.bigfish.com (Postfix) with ESMTP id 3032616D054F for ; Fri, 21 Aug 2009 18:26:17 +0000 (UTC) X-SpamScore: 6 X-BigFish: vps6(zcb8kz19c2kzz1202hzzz2dh6bh61h) X-Spam-TCS-SCL: 0:0 X-FB-SS: 5, X-MS-Exchange-Organization-Antispam-Report: OrigIP: 63.81.120.155; Service: EHS Received: by mail84-tx2 (MessageSwitch) id 1250879175310284_11718; Fri, 21 Aug 2009 18:26:15 +0000 (UCT) Received: from imap.sh.mvista.com (unknown [63.81.120.155]) by mail84-tx2.bigfish.com (Postfix) with ESMTP id 0FE5537004E for ; Fri, 21 Aug 2009 18:26:15 +0000 (UTC) Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9]) by imap.sh.mvista.com (Postfix) with ESMTP id ED1A73EC9; Fri, 21 Aug 2009 11:26:11 -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:27:42 +0400 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200908212227.42330.sshtylyov@ru.mvista.com> Cc: Subject: [PATCH RFC 2/3] DA8xx: OHCI platform device (take 2) 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 --- Oops, I did hit send too early -- my copy of the DaVinci tree appeared to be not up-to-date! :-) 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 @@ -34,6 +34,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 @@ -235,6 +236,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 @@ -17,6 +17,7 @@ #include #include #include +#include /* * The cp_intc interrupt controller for the da8xx isn't in the same @@ -72,6 +73,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); int da8xx_register_lcdc(void); int da8xx_register_mmcsd0(struct davinci_mmc_config *config);