]> rtime.felk.cvut.cz Git - mcf548x/linux.git/blob - arch/m68k/coldfire/usb/otg_host.c
Current (FEC from 2.6.31 port, no CAN, no I2C, no PCI)
[mcf548x/linux.git] / arch / m68k / coldfire / usb / otg_host.c
1 /*
2  * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3  */
4
5 /*
6  * The code contained herein is licensed under the GNU General Public
7  * License. You may obtain a copy of the GNU General Public License
8  * Version 2 or later at the following locations:
9  *
10  * http://www.opensource.org/licenses/gpl-license.html
11  * http://www.gnu.org/copyleft/gpl.html
12  */
13
14 #include <linux/module.h>
15 #include <linux/kernel.h>
16 #include <linux/types.h>
17 #include <linux/errno.h>
18 #include <linux/init.h>
19 #include <linux/io.h>
20 #include <linux/irq.h>
21 #include <linux/err.h>
22 #include <linux/platform_device.h>
23 #include <linux/delay.h>
24 #include <linux/fsl_devices.h>
25 #include <linux/usb/fsl_xcvr.h>
26
27 #include <asm/system.h>
28 #include <asm/mcfsim.h>
29
30 #define USB_OTGREGS_BASE MCF_REG32(0xFC0B0000)
31 #define INT_USB         (64 + 64 + 47)  /* INTC1:47 16.2.9.1 */
32 #define INT_UOCSR       (64 + 64 + 53)  /* INTC1:53 16.2.9.1 */
33
34 struct platform_device *otg_host_device;
35
36 extern struct platform_device *host_pdev_register(struct resource *res,
37                                                   int n_res,
38                                                   struct fsl_usb2_platform_data
39                                                   *config);
40
41 extern int usbotg_init(struct platform_device *pdev);
42 extern void usbotg_uninit(struct fsl_usb2_platform_data *pdata);
43 extern struct fsl_usb2_platform_data mxc_otg_config;
44
45 /*!
46  * OTG host config
47  */
48 static struct resource otg_host_resources[] = {
49         [0] = {
50                 .start = (u32) (&USB_OTGREGS_BASE),
51                 .end   = (u32) (&USB_OTGREGS_BASE + 0x1ff),
52                 .flags = IORESOURCE_MEM,
53         },
54         [1] = {
55                 .start = INT_USB,
56                 .flags = IORESOURCE_IRQ,
57         },
58 };
59
60 static int __init otg_host_init(void)
61 {
62         otg_host_device = host_pdev_register(otg_host_resources,
63                                              ARRAY_SIZE(otg_host_resources),
64                                              &mxc_otg_config);
65         return 0;
66 }
67
68 subsys_initcall(otg_host_init);