board-mop500.c 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. /*
  2. * Copyright (C) 2008-2012 ST-Ericsson
  3. *
  4. * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2, as
  8. * published by the Free Software Foundation.
  9. *
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/init.h>
  13. #include <linux/interrupt.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/clk.h>
  16. #include <linux/io.h>
  17. #include <linux/platform_data/db8500_thermal.h>
  18. #include <linux/amba/bus.h>
  19. #include <linux/amba/pl022.h>
  20. #include <linux/amba/serial.h>
  21. #include <linux/mfd/abx500/ab8500.h>
  22. #include <linux/regulator/ab8500.h>
  23. #include <linux/regulator/fixed.h>
  24. #include <linux/regulator/driver.h>
  25. #include <linux/mfd/tps6105x.h>
  26. #include <linux/platform_data/leds-lp55xx.h>
  27. #include <linux/input.h>
  28. #include <linux/delay.h>
  29. #include <linux/leds.h>
  30. #include <linux/pinctrl/consumer.h>
  31. #include <linux/platform_data/pinctrl-nomadik.h>
  32. #include <linux/platform_data/dma-ste-dma40.h>
  33. #include <asm/mach-types.h>
  34. #include "setup.h"
  35. #include "devices.h"
  36. #include "irqs.h"
  37. #include "ste-dma40-db8500.h"
  38. #include "db8500-regs.h"
  39. #include "devices-db8500.h"
  40. #include "board-mop500.h"
  41. #include "board-mop500-regulators.h"
  42. struct ab8500_platform_data ab8500_platdata = {
  43. .irq_base = MOP500_AB8500_IRQ_BASE,
  44. .regulator = &ab8500_regulator_plat_data,
  45. };
  46. #ifdef CONFIG_STE_DMA40
  47. static struct stedma40_chan_cfg ssp0_dma_cfg_rx = {
  48. .mode = STEDMA40_MODE_LOGICAL,
  49. .dir = DMA_DEV_TO_MEM,
  50. .dev_type = DB8500_DMA_DEV8_SSP0,
  51. };
  52. static struct stedma40_chan_cfg ssp0_dma_cfg_tx = {
  53. .mode = STEDMA40_MODE_LOGICAL,
  54. .dir = DMA_MEM_TO_DEV,
  55. .dev_type = DB8500_DMA_DEV8_SSP0,
  56. };
  57. #endif
  58. struct pl022_ssp_controller ssp0_plat = {
  59. .bus_id = 0,
  60. #ifdef CONFIG_STE_DMA40
  61. .enable_dma = 1,
  62. .dma_filter = stedma40_filter,
  63. .dma_rx_param = &ssp0_dma_cfg_rx,
  64. .dma_tx_param = &ssp0_dma_cfg_tx,
  65. #else
  66. .enable_dma = 0,
  67. #endif
  68. /* on this platform, gpio 31,142,144,214 &
  69. * 224 are connected as chip selects
  70. */
  71. .num_chipselect = 5,
  72. };
  73. #ifdef CONFIG_STE_DMA40
  74. static struct stedma40_chan_cfg uart0_dma_cfg_rx = {
  75. .mode = STEDMA40_MODE_LOGICAL,
  76. .dir = DMA_DEV_TO_MEM,
  77. .dev_type = DB8500_DMA_DEV13_UART0,
  78. };
  79. static struct stedma40_chan_cfg uart0_dma_cfg_tx = {
  80. .mode = STEDMA40_MODE_LOGICAL,
  81. .dir = DMA_MEM_TO_DEV,
  82. .dev_type = DB8500_DMA_DEV13_UART0,
  83. };
  84. static struct stedma40_chan_cfg uart1_dma_cfg_rx = {
  85. .mode = STEDMA40_MODE_LOGICAL,
  86. .dir = DMA_DEV_TO_MEM,
  87. .dev_type = DB8500_DMA_DEV12_UART1,
  88. };
  89. static struct stedma40_chan_cfg uart1_dma_cfg_tx = {
  90. .mode = STEDMA40_MODE_LOGICAL,
  91. .dir = DMA_MEM_TO_DEV,
  92. .dev_type = DB8500_DMA_DEV12_UART1,
  93. };
  94. static struct stedma40_chan_cfg uart2_dma_cfg_rx = {
  95. .mode = STEDMA40_MODE_LOGICAL,
  96. .dir = DMA_DEV_TO_MEM,
  97. .dev_type = DB8500_DMA_DEV11_UART2,
  98. };
  99. static struct stedma40_chan_cfg uart2_dma_cfg_tx = {
  100. .mode = STEDMA40_MODE_LOGICAL,
  101. .dir = DMA_MEM_TO_DEV,
  102. .dev_type = DB8500_DMA_DEV11_UART2,
  103. };
  104. #endif
  105. struct amba_pl011_data uart0_plat = {
  106. #ifdef CONFIG_STE_DMA40
  107. .dma_filter = stedma40_filter,
  108. .dma_rx_param = &uart0_dma_cfg_rx,
  109. .dma_tx_param = &uart0_dma_cfg_tx,
  110. #endif
  111. };
  112. struct amba_pl011_data uart1_plat = {
  113. #ifdef CONFIG_STE_DMA40
  114. .dma_filter = stedma40_filter,
  115. .dma_rx_param = &uart1_dma_cfg_rx,
  116. .dma_tx_param = &uart1_dma_cfg_tx,
  117. #endif
  118. };
  119. struct amba_pl011_data uart2_plat = {
  120. #ifdef CONFIG_STE_DMA40
  121. .dma_filter = stedma40_filter,
  122. .dma_rx_param = &uart2_dma_cfg_rx,
  123. .dma_tx_param = &uart2_dma_cfg_tx,
  124. #endif
  125. };
  126. static void __init mop500_uart_init(struct device *parent)
  127. {
  128. db8500_add_uart0(parent, &uart0_plat);
  129. db8500_add_uart1(parent, &uart1_plat);
  130. db8500_add_uart2(parent, &uart2_plat);
  131. }
  132. static void __init mop500_init_machine(void)
  133. {
  134. struct device *parent = NULL;
  135. platform_device_register(&db8500_prcmu_device);
  136. mop500_pinmaps_init();
  137. parent = u8500_init_devices();
  138. mop500_uart_init(parent);
  139. /* This board has full regulator constraints */
  140. regulator_has_full_constraints();
  141. }
  142. static void __init snowball_init_machine(void)
  143. {
  144. struct device *parent = NULL;
  145. platform_device_register(&db8500_prcmu_device);
  146. snowball_pinmaps_init();
  147. parent = u8500_init_devices();
  148. mop500_uart_init(parent);
  149. /* This board has full regulator constraints */
  150. regulator_has_full_constraints();
  151. }
  152. static void __init hrefv60_init_machine(void)
  153. {
  154. struct device *parent = NULL;
  155. platform_device_register(&db8500_prcmu_device);
  156. hrefv60_pinmaps_init();
  157. parent = u8500_init_devices();
  158. mop500_uart_init(parent);
  159. /* This board has full regulator constraints */
  160. regulator_has_full_constraints();
  161. }
  162. MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
  163. /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */
  164. .atag_offset = 0x100,
  165. .smp = smp_ops(ux500_smp_ops),
  166. .map_io = u8500_map_io,
  167. .init_irq = ux500_init_irq,
  168. /* we re-use nomadik timer here */
  169. .init_time = ux500_timer_init,
  170. .init_machine = mop500_init_machine,
  171. .init_late = ux500_init_late,
  172. .restart = ux500_restart,
  173. MACHINE_END
  174. MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520")
  175. .atag_offset = 0x100,
  176. .map_io = u8500_map_io,
  177. .init_irq = ux500_init_irq,
  178. .init_time = ux500_timer_init,
  179. .init_machine = mop500_init_machine,
  180. .init_late = ux500_init_late,
  181. .restart = ux500_restart,
  182. MACHINE_END
  183. MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
  184. .atag_offset = 0x100,
  185. .smp = smp_ops(ux500_smp_ops),
  186. .map_io = u8500_map_io,
  187. .init_irq = ux500_init_irq,
  188. .init_time = ux500_timer_init,
  189. .init_machine = hrefv60_init_machine,
  190. .init_late = ux500_init_late,
  191. .restart = ux500_restart,
  192. MACHINE_END
  193. MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
  194. .atag_offset = 0x100,
  195. .smp = smp_ops(ux500_smp_ops),
  196. .map_io = u8500_map_io,
  197. .init_irq = ux500_init_irq,
  198. /* we re-use nomadik timer here */
  199. .init_time = ux500_timer_init,
  200. .init_machine = snowball_init_machine,
  201. .init_late = NULL,
  202. .restart = ux500_restart,
  203. MACHINE_END