board-mop500.c 6.1 KB

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