obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o \
board-2430sdp-flash.o \
board-sdp-hsmmc.o \
- board-2430sdp-usb.o
+ usb-musb.o \
+ usb-ehci.o
obj-$(CONFIG_MACH_OMAP_2430OSK) += board-2430osk.o
obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \
board-sdp-hsmmc.o \
- board-3430sdp-usb.o \
+ usb-musb.o \
+ usb-ehci.o \
board-3430sdp-flash.o
obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o
obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o \
#include <asm/arch/gpio.h>
#include <asm/arch/mux.h>
#include <asm/arch/board.h>
+#include <asm/arch/usb-musb.h>
+#include <asm/arch/usb-ehci.h>
#include <asm/arch/common.h>
#include <asm/arch/keypad.h>
#include <asm/arch/gpmc.h>
omap_serial_init();
sdp2430_flash_init();
- sdp2430_usb_init();
+ usb_musb_init();
+ usb_ehci_init();
spi_register_board_info(sdp2430_spi_board_info,
ARRAY_SIZE(sdp2430_spi_board_info));
#include <asm/arch/gpio.h>
#include <asm/arch/mux.h>
#include <asm/arch/board.h>
+#include <asm/arch/usb-musb.h>
+#include <asm/arch/usb-ehci.h>
#include <asm/arch/common.h>
#include <asm/arch/keypad.h>
#include <asm/arch/dma.h>
ads7846_dev_init();
sdp3430_flash_init();
omap_serial_init();
- sdp3430_usb_init();
+ usb_musb_init();
+ usb_ehci_init();
sdp_mmc_init();
}
/*
- * linux/arch/arm/mach-omap2/board-3430sdp-usb.c
+ * linux/arch/arm/mach-omap2/usb-ehci.c
*
* This file will contain the board specific details for the
- * MENTOR USB OTG and Synopsys EHCI host controllers on OMAP3430
+ * Synopsys EHCI host controller on OMAP3430
*
- * Copyright (C) 2007 Texas Instruments
- * Author: Vikram Pandita
+ * Copyright (C) 2008 Nokia Corporation
+ * Author: Felipe Balbi <felipe.balbi@nokia.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
#include <asm/arch/pm.h>
#include <asm/arch/usb.h>
-#ifdef CONFIG_USB_MUSB_SOC
-static struct resource musb_resources[] = {
- [0] = {
- .start = OMAP34XX_HSUSB_OTG_BASE,
- .end = OMAP34XX_HSUSB_OTG_BASE + SZ_8K - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = { /* general IRQ */
- .start = INT_243X_HS_USB_MC,
- .flags = IORESOURCE_IRQ,
- },
- [2] = { /* DMA IRQ */
- .start = INT_243X_HS_USB_DMA,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static int hsotgusb_ick_on;
-
-static int musb_set_clock(struct clk *clk, int state)
-{
- if (state) {
- if (hsotgusb_ick_on > 0)
- return -ENODEV;
-
- omap2_block_sleep();
- clk_enable(clk);
- hsotgusb_ick_on = 1;
- } else {
- if (hsotgusb_ick_on == 0)
- return -ENODEV;
-
- clk_disable(clk);
- hsotgusb_ick_on = 0;
- omap2_allow_sleep();
- }
-
- return 0;
-}
-
-static struct musb_hdrc_platform_data musb_plat = {
-#ifdef CONFIG_USB_MUSB_OTG
- .mode = MUSB_OTG,
-#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
- .mode = MUSB_HOST,
-#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
- .mode = MUSB_PERIPHERAL,
-#endif
- .multipoint = 1,
- .clock = "hsotgusb_ick",
- .set_clock = musb_set_clock,
-};
-
-static u64 musb_dmamask = ~(u32)0;
-
-static struct platform_device musb_device = {
- .name = "musb_hdrc",
- .id = 0,
- .dev = {
- .dma_mask = &musb_dmamask,
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &musb_plat,
- },
- .num_resources = ARRAY_SIZE(musb_resources),
- .resource = musb_resources,
-};
-#endif
-
-
-/* EHCI platform specific data */
-
#if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE)
static struct resource ehci_resources[] = {
[0] = {
#endif /* EHCI specific data */
-void __init sdp3430_usb_init(void)
+void __init usb_ehci_init(void)
{
-#ifdef CONFIG_USB_MUSB_SOC
- if (platform_device_register(&musb_device) < 0) {
- printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
- return;
- }
-#endif
-
#if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE)
-
/* Setup Pin IO MUX for EHCI */
- setup_ehci_io_mux();
+ if (cpu_is_omap34xx())
+ setup_ehci_io_mux();
if (platform_device_register(&ehci_device) < 0) {
printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
return;
}
#endif
-
}
/*
- * linux/arch/arm/mach-omap2/board-2430sdp-usb.c
+ * linux/arch/arm/mach-omap2/usb-musb.c
*
- * Copyright (C) 2007 MontaVista Software, Inc. <source@mvista.com>
- * Author: Kevin Hilman
+ * This file will contain the board specific details for the
+ * MENTOR USB OTG controller on OMAP3430
+ *
+ * Copyright (C) 2007-2008 Texas Instruments
+ * Copyright (C) 2008 Nokia Corporation
+ * Author: Vikram Pandita
+ *
+ * Generalization by:
+ * Felipe Balbi <felipe.balbi@nokia.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
+#include <asm/io.h>
+#include <asm/arch/mux.h>
#include <linux/usb/musb.h>
#include <asm/arch/hardware.h>
#include <asm/arch/pm.h>
#include <asm/arch/usb.h>
+#ifdef CONFIG_USB_MUSB_SOC
static struct resource musb_resources[] = {
[0] = {
- .start = OMAP243X_HS_BASE,
- .end = OMAP243X_HS_BASE + SZ_8K - 1,
+ .start = cpu_is_omap34xx()
+ ? OMAP34XX_HSUSB_OTG_BASE
+ : OMAP243X_HS_BASE,
+ .end = cpu_is_omap34xx()
+ ? OMAP34XX_HSUSB_OTG_BASE + SZ_8K - 1
+ : OMAP243X_HS_BASE + SZ_8K -1,
.flags = IORESOURCE_MEM,
},
[1] = { /* general IRQ */
},
};
-static int usbhs_ick_on;
+static int clk_on;
static int musb_set_clock(struct clk *clk, int state)
{
- if (state) {
- if (usbhs_ick_on > 0)
- return -ENODEV;
+ if (state) {
+ if (clk_on > 0)
+ return -ENODEV;
- omap2_block_sleep();
- clk_enable(clk);
- usbhs_ick_on = 1;
- } else {
- if (usbhs_ick_on == 0)
- return -ENODEV;
+ omap2_block_sleep();
+ clk_enable(clk);
+ clk_on = 1;
+ } else {
+ if (clk_on == 0)
+ return -ENODEV;
- clk_disable(clk);
- usbhs_ick_on = 0;
- omap2_allow_sleep();
- }
+ clk_disable(clk);
+ clk_on = 0;
+ omap2_allow_sleep();
+ }
- return 0;
+ return 0;
}
static struct musb_hdrc_platform_data musb_plat = {
.mode = MUSB_PERIPHERAL,
#endif
.multipoint = 1,
- .clock = "usbhs_ick",
+ .clock = cpu_is_omap34xx()
+ ? "hsotgusb_ick"
+ : "usbhs_ick",
.set_clock = musb_set_clock,
};
.num_resources = ARRAY_SIZE(musb_resources),
.resource = musb_resources,
};
+#endif
+
-void __init sdp2430_usb_init(void)
+void __init usb_musb_init(void)
{
+#ifdef CONFIG_USB_MUSB_SOC
if (platform_device_register(&musb_device) < 0) {
printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
return;
}
+#endif
}
--- /dev/null
+/*
+ * linux/include/asm-arm/arch-omap/usb-ehci.h
+ *
+ * Hardware definitions for Synopsys EHCI host controller.
+ *
+ * Initial creation by Felipe Balbi.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __ASM_ARCH_OMAP_USB_EHCI_H
+#define __ASM_ARCH_OMAP_USB_EHCI_H
+
+extern void usb_ehci_init(void);
+
+#endif /* __ASM_ARCH_OMAP_USB_EHCI_H */
+
--- /dev/null
+/*
+ * linux/include/asm-arm/arch-omap/usb-musb.h
+ *
+ * Hardware definitions for Mentor Graphics MUSBMHDRC.
+ *
+ * Initial creation by Felipe Balbi.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __ASM_ARCH_OMAP_USB_MUSB_H
+#define __ASM_ARCH_OMAP_USB_MUSB_H
+
+extern void usb_musb_init(void);
+
+#endif /* __ASM_ARCH_OMAP_USB_MUSB_H */
+