Sascha Hauer | e3d13ff | 2008-07-05 10:02:48 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved. |
| 3 | * Copyright 2008 Sascha Hauer, kernel@pengutronix.de |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU General Public License |
| 7 | * as published by the Free Software Foundation; either version 2 |
| 8 | * of the License, or (at your option) any later version. |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 | * Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
Guennadi Liakhovetski | eb05bbe | 2009-05-04 13:13:52 +0200 | [diff] [blame] | 20 | #include <linux/dma-mapping.h> |
Sascha Hauer | e3d13ff | 2008-07-05 10:02:48 +0200 | [diff] [blame] | 21 | #include <linux/module.h> |
| 22 | #include <linux/platform_device.h> |
| 23 | #include <linux/serial.h> |
Juergen Beisert | 07bd1a6 | 2008-07-05 10:02:49 +0200 | [diff] [blame] | 24 | #include <linux/gpio.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 25 | #include <mach/hardware.h> |
Russell King | 80b02c1 | 2009-01-08 10:01:47 +0000 | [diff] [blame] | 26 | #include <mach/irqs.h> |
Alan Carvalho de Assis | 45001e9 | 2009-04-02 12:38:41 -0300 | [diff] [blame] | 27 | #include <mach/common.h> |
Valentin Longchamp | 9c70e22 | 2009-05-07 11:51:42 +0200 | [diff] [blame] | 28 | #include <mach/mx3_camera.h> |
Sascha Hauer | e3d13ff | 2008-07-05 10:02:48 +0200 | [diff] [blame] | 29 | |
Sascha Hauer | 87bbb19 | 2009-01-29 16:00:23 +0100 | [diff] [blame] | 30 | #include "devices.h" |
| 31 | |
Valentin Longchamp | ca489f8 | 2009-02-16 12:47:52 +0100 | [diff] [blame] | 32 | /* i.MX31 Image Processing Unit */ |
| 33 | |
| 34 | /* The resource order is important! */ |
| 35 | static struct resource mx3_ipu_rsrc[] = { |
| 36 | { |
Uwe Kleine-König | 9651b7d | 2010-10-22 14:49:45 +0200 | [diff] [blame] | 37 | .start = MX3x_IPU_CTRL_BASE_ADDR, |
| 38 | .end = MX3x_IPU_CTRL_BASE_ADDR + 0x5F, |
Valentin Longchamp | ca489f8 | 2009-02-16 12:47:52 +0100 | [diff] [blame] | 39 | .flags = IORESOURCE_MEM, |
| 40 | }, { |
Uwe Kleine-König | 9651b7d | 2010-10-22 14:49:45 +0200 | [diff] [blame] | 41 | .start = MX3x_IPU_CTRL_BASE_ADDR + 0x88, |
| 42 | .end = MX3x_IPU_CTRL_BASE_ADDR + 0xB3, |
Valentin Longchamp | ca489f8 | 2009-02-16 12:47:52 +0100 | [diff] [blame] | 43 | .flags = IORESOURCE_MEM, |
| 44 | }, { |
Uwe Kleine-König | 9651b7d | 2010-10-22 14:49:45 +0200 | [diff] [blame] | 45 | .start = MX3x_INT_IPU_SYN, |
| 46 | .end = MX3x_INT_IPU_SYN, |
Valentin Longchamp | ca489f8 | 2009-02-16 12:47:52 +0100 | [diff] [blame] | 47 | .flags = IORESOURCE_IRQ, |
| 48 | }, { |
Uwe Kleine-König | 9651b7d | 2010-10-22 14:49:45 +0200 | [diff] [blame] | 49 | .start = MX3x_INT_IPU_ERR, |
| 50 | .end = MX3x_INT_IPU_ERR, |
Valentin Longchamp | ca489f8 | 2009-02-16 12:47:52 +0100 | [diff] [blame] | 51 | .flags = IORESOURCE_IRQ, |
| 52 | }, |
| 53 | }; |
| 54 | |
| 55 | struct platform_device mx3_ipu = { |
| 56 | .name = "ipu-core", |
| 57 | .id = -1, |
| 58 | .num_resources = ARRAY_SIZE(mx3_ipu_rsrc), |
| 59 | .resource = mx3_ipu_rsrc, |
| 60 | }; |
| 61 | |
| 62 | static struct resource fb_resources[] = { |
| 63 | { |
Uwe Kleine-König | 9651b7d | 2010-10-22 14:49:45 +0200 | [diff] [blame] | 64 | .start = MX3x_IPU_CTRL_BASE_ADDR + 0xB4, |
| 65 | .end = MX3x_IPU_CTRL_BASE_ADDR + 0x1BF, |
Valentin Longchamp | ca489f8 | 2009-02-16 12:47:52 +0100 | [diff] [blame] | 66 | .flags = IORESOURCE_MEM, |
| 67 | }, |
| 68 | }; |
| 69 | |
| 70 | struct platform_device mx3_fb = { |
| 71 | .name = "mx3_sdc_fb", |
| 72 | .id = -1, |
| 73 | .num_resources = ARRAY_SIZE(fb_resources), |
| 74 | .resource = fb_resources, |
| 75 | .dev = { |
Valentin Longchamp | 9c70e22 | 2009-05-07 11:51:42 +0200 | [diff] [blame] | 76 | .coherent_dma_mask = DMA_BIT_MASK(32), |
Valentin Longchamp | ca489f8 | 2009-02-16 12:47:52 +0100 | [diff] [blame] | 77 | }, |
| 78 | }; |
Sascha Hauer | 9536ff3 | 2009-02-06 15:38:51 +0100 | [diff] [blame] | 79 | |
Valentin Longchamp | 9c70e22 | 2009-05-07 11:51:42 +0200 | [diff] [blame] | 80 | static struct resource camera_resources[] = { |
| 81 | { |
Uwe Kleine-König | 9651b7d | 2010-10-22 14:49:45 +0200 | [diff] [blame] | 82 | .start = MX3x_IPU_CTRL_BASE_ADDR + 0x60, |
| 83 | .end = MX3x_IPU_CTRL_BASE_ADDR + 0x87, |
Valentin Longchamp | 9c70e22 | 2009-05-07 11:51:42 +0200 | [diff] [blame] | 84 | .flags = IORESOURCE_MEM, |
| 85 | }, |
| 86 | }; |
| 87 | |
| 88 | struct platform_device mx3_camera = { |
| 89 | .name = "mx3-camera", |
| 90 | .id = 0, |
| 91 | .num_resources = ARRAY_SIZE(camera_resources), |
| 92 | .resource = camera_resources, |
| 93 | .dev = { |
| 94 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 95 | }, |
| 96 | }; |
| 97 | |
Vladimir Zapolskiy | ded518c | 2010-03-24 14:32:17 +0300 | [diff] [blame] | 98 | static struct resource imx_rtc_resources[] = { |
| 99 | { |
| 100 | .start = MX31_RTC_BASE_ADDR, |
| 101 | .end = MX31_RTC_BASE_ADDR + 0x3fff, |
| 102 | .flags = IORESOURCE_MEM, |
| 103 | }, |
| 104 | { |
| 105 | .start = MX31_INT_RTC, |
| 106 | .flags = IORESOURCE_IRQ, |
| 107 | }, |
| 108 | }; |
| 109 | |
| 110 | struct platform_device imx_rtc_device0 = { |
| 111 | .name = "mxc_rtc", |
| 112 | .id = -1, |
| 113 | .num_resources = ARRAY_SIZE(imx_rtc_resources), |
| 114 | .resource = imx_rtc_resources, |
| 115 | }; |