devices.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. #include <linux/dma-mapping.h>
  20. #include <linux/module.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/serial.h>
  23. #include <linux/gpio.h>
  24. #include <mach/hardware.h>
  25. #include <mach/irqs.h>
  26. #include <mach/common.h>
  27. #include <mach/mx3_camera.h>
  28. #include "devices.h"
  29. /* i.MX31 Image Processing Unit */
  30. /* The resource order is important! */
  31. static struct resource mx3_ipu_rsrc[] = {
  32. {
  33. .start = MX3x_IPU_CTRL_BASE_ADDR,
  34. .end = MX3x_IPU_CTRL_BASE_ADDR + 0x5F,
  35. .flags = IORESOURCE_MEM,
  36. }, {
  37. .start = MX3x_IPU_CTRL_BASE_ADDR + 0x88,
  38. .end = MX3x_IPU_CTRL_BASE_ADDR + 0xB3,
  39. .flags = IORESOURCE_MEM,
  40. }, {
  41. .start = MX3x_INT_IPU_SYN,
  42. .end = MX3x_INT_IPU_SYN,
  43. .flags = IORESOURCE_IRQ,
  44. }, {
  45. .start = MX3x_INT_IPU_ERR,
  46. .end = MX3x_INT_IPU_ERR,
  47. .flags = IORESOURCE_IRQ,
  48. },
  49. };
  50. struct platform_device mx3_ipu = {
  51. .name = "ipu-core",
  52. .id = -1,
  53. .num_resources = ARRAY_SIZE(mx3_ipu_rsrc),
  54. .resource = mx3_ipu_rsrc,
  55. };
  56. static struct resource fb_resources[] = {
  57. {
  58. .start = MX3x_IPU_CTRL_BASE_ADDR + 0xB4,
  59. .end = MX3x_IPU_CTRL_BASE_ADDR + 0x1BF,
  60. .flags = IORESOURCE_MEM,
  61. },
  62. };
  63. struct platform_device mx3_fb = {
  64. .name = "mx3_sdc_fb",
  65. .id = -1,
  66. .num_resources = ARRAY_SIZE(fb_resources),
  67. .resource = fb_resources,
  68. .dev = {
  69. .coherent_dma_mask = DMA_BIT_MASK(32),
  70. },
  71. };
  72. static struct resource camera_resources[] = {
  73. {
  74. .start = MX3x_IPU_CTRL_BASE_ADDR + 0x60,
  75. .end = MX3x_IPU_CTRL_BASE_ADDR + 0x87,
  76. .flags = IORESOURCE_MEM,
  77. },
  78. };
  79. struct platform_device mx3_camera = {
  80. .name = "mx3-camera",
  81. .id = 0,
  82. .num_resources = ARRAY_SIZE(camera_resources),
  83. .resource = camera_resources,
  84. .dev = {
  85. .coherent_dma_mask = DMA_BIT_MASK(32),
  86. },
  87. };
  88. static struct resource imx_rtc_resources[] = {
  89. {
  90. .start = MX31_RTC_BASE_ADDR,
  91. .end = MX31_RTC_BASE_ADDR + 0x3fff,
  92. .flags = IORESOURCE_MEM,
  93. },
  94. {
  95. .start = MX31_INT_RTC,
  96. .flags = IORESOURCE_IRQ,
  97. },
  98. };
  99. struct platform_device imx_rtc_device0 = {
  100. .name = "mxc_rtc",
  101. .id = -1,
  102. .num_resources = ARRAY_SIZE(imx_rtc_resources),
  103. .resource = imx_rtc_resources,
  104. };