Amit Kucheria | a329b48 | 2010-02-04 12:21:53 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2009 Amit Kucheria <amit.kucheria@canonical.com> |
Dinh Nguyen | e24798e | 2010-04-22 16:28:42 +0300 | [diff] [blame] | 3 | * Copyright (C) 2010 Freescale Semiconductor, Inc. |
Amit Kucheria | a329b48 | 2010-02-04 12:21:53 -0800 | [diff] [blame] | 4 | * |
| 5 | * The code contained herein is licensed under the GNU General Public |
| 6 | * License. You may obtain a copy of the GNU General Public License |
| 7 | * Version 2 or later at the following locations: |
| 8 | * |
| 9 | * http://www.opensource.org/licenses/gpl-license.html |
| 10 | * http://www.gnu.org/copyleft/gpl.html |
| 11 | */ |
| 12 | |
| 13 | #include <linux/platform_device.h> |
Dinh Nguyen | c53bdf1 | 2010-04-30 15:48:24 -0500 | [diff] [blame] | 14 | #include <linux/dma-mapping.h> |
Amit Kucheria | a329b48 | 2010-02-04 12:21:53 -0800 | [diff] [blame] | 15 | #include <mach/hardware.h> |
| 16 | #include <mach/imx-uart.h> |
Dinh Nguyen | e24798e | 2010-04-22 16:28:42 +0300 | [diff] [blame] | 17 | #include <mach/irqs.h> |
Amit Kucheria | a329b48 | 2010-02-04 12:21:53 -0800 | [diff] [blame] | 18 | |
Dinh Nguyen | 71c2e51 | 2010-05-27 10:45:04 -0500 | [diff] [blame] | 19 | static struct resource mxc_hsi2c_resources[] = { |
| 20 | { |
| 21 | .start = MX51_HSI2C_DMA_BASE_ADDR, |
| 22 | .end = MX51_HSI2C_DMA_BASE_ADDR + SZ_16K - 1, |
| 23 | .flags = IORESOURCE_MEM, |
| 24 | }, |
| 25 | { |
| 26 | .start = MX51_MXC_INT_HS_I2C, |
| 27 | .end = MX51_MXC_INT_HS_I2C, |
| 28 | .flags = IORESOURCE_IRQ, |
| 29 | }, |
| 30 | }; |
| 31 | |
| 32 | struct platform_device mxc_hsi2c_device = { |
| 33 | .name = "imx-i2c", |
| 34 | .id = 2, |
| 35 | .num_resources = ARRAY_SIZE(mxc_hsi2c_resources), |
| 36 | .resource = mxc_hsi2c_resources |
| 37 | }; |
| 38 | |
Dinh Nguyen | c53bdf1 | 2010-04-30 15:48:24 -0500 | [diff] [blame] | 39 | static u64 usb_dma_mask = DMA_BIT_MASK(32); |
| 40 | |
| 41 | static struct resource usbotg_resources[] = { |
| 42 | { |
| 43 | .start = MX51_OTG_BASE_ADDR, |
| 44 | .end = MX51_OTG_BASE_ADDR + 0x1ff, |
| 45 | .flags = IORESOURCE_MEM, |
| 46 | }, |
| 47 | { |
| 48 | .start = MX51_MXC_INT_USB_OTG, |
| 49 | .flags = IORESOURCE_IRQ, |
| 50 | }, |
| 51 | }; |
| 52 | |
Dinh Nguyen | 2ba5a2c | 2010-05-10 13:45:59 -0500 | [diff] [blame] | 53 | /* OTG gadget device */ |
| 54 | struct platform_device mxc_usbdr_udc_device = { |
| 55 | .name = "fsl-usb2-udc", |
| 56 | .id = -1, |
| 57 | .num_resources = ARRAY_SIZE(usbotg_resources), |
| 58 | .resource = usbotg_resources, |
| 59 | .dev = { |
| 60 | .dma_mask = &usb_dma_mask, |
| 61 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 62 | }, |
| 63 | }; |
| 64 | |
Dinh Nguyen | c53bdf1 | 2010-04-30 15:48:24 -0500 | [diff] [blame] | 65 | struct platform_device mxc_usbdr_host_device = { |
| 66 | .name = "mxc-ehci", |
| 67 | .id = 0, |
| 68 | .num_resources = ARRAY_SIZE(usbotg_resources), |
| 69 | .resource = usbotg_resources, |
| 70 | .dev = { |
| 71 | .dma_mask = &usb_dma_mask, |
| 72 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 73 | }, |
| 74 | }; |
| 75 | |
| 76 | static struct resource usbh1_resources[] = { |
| 77 | { |
| 78 | .start = MX51_OTG_BASE_ADDR + 0x200, |
| 79 | .end = MX51_OTG_BASE_ADDR + 0x200 + 0x1ff, |
| 80 | .flags = IORESOURCE_MEM, |
| 81 | }, |
| 82 | { |
| 83 | .start = MX51_MXC_INT_USB_H1, |
| 84 | .flags = IORESOURCE_IRQ, |
| 85 | }, |
| 86 | }; |
| 87 | |
| 88 | struct platform_device mxc_usbh1_device = { |
| 89 | .name = "mxc-ehci", |
| 90 | .id = 1, |
| 91 | .num_resources = ARRAY_SIZE(usbh1_resources), |
| 92 | .resource = usbh1_resources, |
| 93 | .dev = { |
| 94 | .dma_mask = &usb_dma_mask, |
| 95 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 96 | }, |
| 97 | }; |
| 98 | |
Arnaud Patard (Rtp) | 8305ed7 | 2010-12-20 16:48:57 +0100 | [diff] [blame] | 99 | static struct resource usbh2_resources[] = { |
| 100 | { |
| 101 | .start = MX51_OTG_BASE_ADDR + 0x400, |
| 102 | .end = MX51_OTG_BASE_ADDR + 0x400 + 0x1ff, |
| 103 | .flags = IORESOURCE_MEM, |
| 104 | }, |
| 105 | { |
| 106 | .start = MX51_MXC_INT_USB_H2, |
| 107 | .flags = IORESOURCE_IRQ, |
| 108 | }, |
| 109 | }; |
| 110 | |
| 111 | struct platform_device mxc_usbh2_device = { |
| 112 | .name = "mxc-ehci", |
| 113 | .id = 2, |
| 114 | .num_resources = ARRAY_SIZE(usbh2_resources), |
| 115 | .resource = usbh2_resources, |
| 116 | .dev = { |
| 117 | .dma_mask = &usb_dma_mask, |
| 118 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 119 | }, |
| 120 | }; |