Commit 219fed7558346225bae3cfd8fdbf44876e5bf79f

Authored by Darius Augulis
Committed by Sascha Hauer
1 parent cfca8b539f

patch-mx1-add-devices

Adds common devices to ARCH_MX1.

Signed-off-by: Darius Augulis <augulis.darius@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Showing 2 changed files with 147 additions and 0 deletions Side-by-side Diff

arch/arm/mach-mx1/devices.c
... ... @@ -2,6 +2,7 @@
2 2 * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 3 * Copyright 2008 Sascha Hauer, kernel@pengutronix.de
4 4 * Copyright (c) 2008 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
  5 + * Copyright (c) 2008 Darius Augulis <darius.augulis@teltonika.lt>
5 6 *
6 7 * This program is free software; you can redistribute it and/or
7 8 * modify it under the terms of the GNU General Public License
... ... @@ -24,6 +25,52 @@
24 25 #include <linux/gpio.h>
25 26 #include <mach/hardware.h>
26 27  
  28 +static struct resource imx_csi_resources[] = {
  29 + [0] = {
  30 + .start = 0x00224000,
  31 + .end = 0x00224010,
  32 + .flags = IORESOURCE_MEM,
  33 + },
  34 + [1] = {
  35 + .start = CSI_INT,
  36 + .end = CSI_INT,
  37 + .flags = IORESOURCE_IRQ,
  38 + },
  39 +};
  40 +
  41 +static u64 imx_csi_dmamask = 0xffffffffUL;
  42 +
  43 +struct platform_device imx_csi_device = {
  44 + .name = "imx-csi",
  45 + .id = 0, /* This is used to put cameras on this interface */
  46 + .dev = {
  47 + .dma_mask = &imx_csi_dmamask,
  48 + .coherent_dma_mask = 0xffffffff,
  49 + },
  50 + .resource = imx_csi_resources,
  51 + .num_resources = ARRAY_SIZE(imx_csi_resources),
  52 +};
  53 +
  54 +static struct resource imx_i2c_resources[] = {
  55 + [0] = {
  56 + .start = 0x00217000,
  57 + .end = 0x00217010,
  58 + .flags = IORESOURCE_MEM,
  59 + },
  60 + [1] = {
  61 + .start = I2C_INT,
  62 + .end = I2C_INT,
  63 + .flags = IORESOURCE_IRQ,
  64 + },
  65 +};
  66 +
  67 +struct platform_device imx_i2c_device = {
  68 + .name = "imx-i2c",
  69 + .id = 0,
  70 + .resource = imx_i2c_resources,
  71 + .num_resources = ARRAY_SIZE(imx_i2c_resources),
  72 +};
  73 +
27 74 static struct resource imx_uart1_resources[] = {
28 75 [0] = {
29 76 .start = UART1_BASE_ADDR,
... ... @@ -82,6 +129,101 @@
82 129 .id = 1,
83 130 .num_resources = ARRAY_SIZE(imx_uart2_resources),
84 131 .resource = imx_uart2_resources,
  132 +};
  133 +
  134 +static struct resource imx_rtc_resources[] = {
  135 + [0] = {
  136 + .start = 0x00204000,
  137 + .end = 0x00204024,
  138 + .flags = IORESOURCE_MEM,
  139 + },
  140 + [1] = {
  141 + .start = RTC_INT,
  142 + .end = RTC_INT,
  143 + .flags = IORESOURCE_IRQ,
  144 + },
  145 + [2] = {
  146 + .start = RTC_SAMINT,
  147 + .end = RTC_SAMINT,
  148 + .flags = IORESOURCE_IRQ,
  149 + },
  150 +};
  151 +
  152 +struct platform_device imx_rtc_device = {
  153 + .name = "rtc-imx",
  154 + .id = 0,
  155 + .resource = imx_rtc_resources,
  156 + .num_resources = ARRAY_SIZE(imx_rtc_resources),
  157 +};
  158 +
  159 +static struct resource imx_wdt_resources[] = {
  160 + [0] = {
  161 + .start = 0x00201000,
  162 + .end = 0x00201008,
  163 + .flags = IORESOURCE_MEM,
  164 + },
  165 + [1] = {
  166 + .start = WDT_INT,
  167 + .end = WDT_INT,
  168 + .flags = IORESOURCE_IRQ,
  169 + },
  170 +};
  171 +
  172 +struct platform_device imx_wdt_device = {
  173 + .name = "imx-wdt",
  174 + .id = 0,
  175 + .resource = imx_wdt_resources,
  176 + .num_resources = ARRAY_SIZE(imx_wdt_resources),
  177 +};
  178 +
  179 +static struct resource imx_usb_resources[] = {
  180 + [0] = {
  181 + .start = 0x00212000,
  182 + .end = 0x00212148,
  183 + .flags = IORESOURCE_MEM,
  184 + },
  185 + [1] = {
  186 + .start = USBD_INT0,
  187 + .end = USBD_INT0,
  188 + .flags = IORESOURCE_IRQ,
  189 + },
  190 + [2] = {
  191 + .start = USBD_INT1,
  192 + .end = USBD_INT1,
  193 + .flags = IORESOURCE_IRQ,
  194 + },
  195 + [3] = {
  196 + .start = USBD_INT2,
  197 + .end = USBD_INT2,
  198 + .flags = IORESOURCE_IRQ,
  199 + },
  200 + [4] = {
  201 + .start = USBD_INT3,
  202 + .end = USBD_INT3,
  203 + .flags = IORESOURCE_IRQ,
  204 + },
  205 + [5] = {
  206 + .start = USBD_INT4,
  207 + .end = USBD_INT4,
  208 + .flags = IORESOURCE_IRQ,
  209 + },
  210 + [6] = {
  211 + .start = USBD_INT5,
  212 + .end = USBD_INT5,
  213 + .flags = IORESOURCE_IRQ,
  214 + },
  215 + [7] = {
  216 + .start = USBD_INT6,
  217 + .end = USBD_INT6,
  218 + .flags = IORESOURCE_IRQ,
  219 + },
  220 +};
  221 +
  222 +struct platform_device imx_usb_device = {
  223 + .name = "imx_udc",
  224 + .id = 0,
  225 + .num_resources = ARRAY_SIZE(imx_usb_resources),
  226 + .resource = imx_usb_resources,
85 227 };
86 228  
87 229 /* GPIO port description */
arch/arm/mach-mx1/devices.h
  1 +extern struct platform_device imx_csi_device;
  2 +extern struct platform_device imx_i2c_device;
1 3 extern struct platform_device imx_uart1_device;
2 4 extern struct platform_device imx_uart2_device;
  5 +extern struct platform_device imx_rtc_device;
  6 +extern struct platform_device imx_wdt_device;
  7 +extern struct platform_device imx_usb_device;