spear300.c 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. /*
  2. * arch/arm/mach-spear3xx/spear300.c
  3. *
  4. * SPEAr300 machine source file
  5. *
  6. * Copyright (C) 2009-2012 ST Microelectronics
  7. * Viresh Kumar <vireshk@kernel.org>
  8. *
  9. * This file is licensed under the terms of the GNU General Public
  10. * License version 2. This program is licensed "as is" without any
  11. * warranty of any kind, whether express or implied.
  12. */
  13. #define pr_fmt(fmt) "SPEAr300: " fmt
  14. #include <linux/amba/pl08x.h>
  15. #include <linux/of_platform.h>
  16. #include <asm/mach/arch.h>
  17. #include "generic.h"
  18. #include <mach/spear.h>
  19. /* DMAC platform data's slave info */
  20. struct pl08x_channel_data spear300_dma_info[] = {
  21. {
  22. .bus_id = "uart0_rx",
  23. .min_signal = 2,
  24. .max_signal = 2,
  25. .muxval = 0,
  26. .periph_buses = PL08X_AHB1,
  27. }, {
  28. .bus_id = "uart0_tx",
  29. .min_signal = 3,
  30. .max_signal = 3,
  31. .muxval = 0,
  32. .periph_buses = PL08X_AHB1,
  33. }, {
  34. .bus_id = "ssp0_rx",
  35. .min_signal = 8,
  36. .max_signal = 8,
  37. .muxval = 0,
  38. .periph_buses = PL08X_AHB1,
  39. }, {
  40. .bus_id = "ssp0_tx",
  41. .min_signal = 9,
  42. .max_signal = 9,
  43. .muxval = 0,
  44. .periph_buses = PL08X_AHB1,
  45. }, {
  46. .bus_id = "i2c_rx",
  47. .min_signal = 10,
  48. .max_signal = 10,
  49. .muxval = 0,
  50. .periph_buses = PL08X_AHB1,
  51. }, {
  52. .bus_id = "i2c_tx",
  53. .min_signal = 11,
  54. .max_signal = 11,
  55. .muxval = 0,
  56. .periph_buses = PL08X_AHB1,
  57. }, {
  58. .bus_id = "irda",
  59. .min_signal = 12,
  60. .max_signal = 12,
  61. .muxval = 0,
  62. .periph_buses = PL08X_AHB1,
  63. }, {
  64. .bus_id = "adc",
  65. .min_signal = 13,
  66. .max_signal = 13,
  67. .muxval = 0,
  68. .periph_buses = PL08X_AHB1,
  69. }, {
  70. .bus_id = "to_jpeg",
  71. .min_signal = 14,
  72. .max_signal = 14,
  73. .muxval = 0,
  74. .periph_buses = PL08X_AHB1,
  75. }, {
  76. .bus_id = "from_jpeg",
  77. .min_signal = 15,
  78. .max_signal = 15,
  79. .muxval = 0,
  80. .periph_buses = PL08X_AHB1,
  81. }, {
  82. .bus_id = "ras0_rx",
  83. .min_signal = 0,
  84. .max_signal = 0,
  85. .muxval = 1,
  86. .periph_buses = PL08X_AHB1,
  87. }, {
  88. .bus_id = "ras0_tx",
  89. .min_signal = 1,
  90. .max_signal = 1,
  91. .muxval = 1,
  92. .periph_buses = PL08X_AHB1,
  93. }, {
  94. .bus_id = "ras1_rx",
  95. .min_signal = 2,
  96. .max_signal = 2,
  97. .muxval = 1,
  98. .periph_buses = PL08X_AHB1,
  99. }, {
  100. .bus_id = "ras1_tx",
  101. .min_signal = 3,
  102. .max_signal = 3,
  103. .muxval = 1,
  104. .periph_buses = PL08X_AHB1,
  105. }, {
  106. .bus_id = "ras2_rx",
  107. .min_signal = 4,
  108. .max_signal = 4,
  109. .muxval = 1,
  110. .periph_buses = PL08X_AHB1,
  111. }, {
  112. .bus_id = "ras2_tx",
  113. .min_signal = 5,
  114. .max_signal = 5,
  115. .muxval = 1,
  116. .periph_buses = PL08X_AHB1,
  117. }, {
  118. .bus_id = "ras3_rx",
  119. .min_signal = 6,
  120. .max_signal = 6,
  121. .muxval = 1,
  122. .periph_buses = PL08X_AHB1,
  123. }, {
  124. .bus_id = "ras3_tx",
  125. .min_signal = 7,
  126. .max_signal = 7,
  127. .muxval = 1,
  128. .periph_buses = PL08X_AHB1,
  129. }, {
  130. .bus_id = "ras4_rx",
  131. .min_signal = 8,
  132. .max_signal = 8,
  133. .muxval = 1,
  134. .periph_buses = PL08X_AHB1,
  135. }, {
  136. .bus_id = "ras4_tx",
  137. .min_signal = 9,
  138. .max_signal = 9,
  139. .muxval = 1,
  140. .periph_buses = PL08X_AHB1,
  141. }, {
  142. .bus_id = "ras5_rx",
  143. .min_signal = 10,
  144. .max_signal = 10,
  145. .muxval = 1,
  146. .periph_buses = PL08X_AHB1,
  147. }, {
  148. .bus_id = "ras5_tx",
  149. .min_signal = 11,
  150. .max_signal = 11,
  151. .muxval = 1,
  152. .periph_buses = PL08X_AHB1,
  153. }, {
  154. .bus_id = "ras6_rx",
  155. .min_signal = 12,
  156. .max_signal = 12,
  157. .muxval = 1,
  158. .periph_buses = PL08X_AHB1,
  159. }, {
  160. .bus_id = "ras6_tx",
  161. .min_signal = 13,
  162. .max_signal = 13,
  163. .muxval = 1,
  164. .periph_buses = PL08X_AHB1,
  165. }, {
  166. .bus_id = "ras7_rx",
  167. .min_signal = 14,
  168. .max_signal = 14,
  169. .muxval = 1,
  170. .periph_buses = PL08X_AHB1,
  171. }, {
  172. .bus_id = "ras7_tx",
  173. .min_signal = 15,
  174. .max_signal = 15,
  175. .muxval = 1,
  176. .periph_buses = PL08X_AHB1,
  177. },
  178. };
  179. /* Add SPEAr300 auxdata to pass platform data */
  180. static struct of_dev_auxdata spear300_auxdata_lookup[] __initdata = {
  181. OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL,
  182. &pl022_plat_data),
  183. OF_DEV_AUXDATA("arm,pl080", SPEAR_ICM3_DMA_BASE, NULL,
  184. &pl080_plat_data),
  185. {}
  186. };
  187. static void __init spear300_dt_init(void)
  188. {
  189. pl080_plat_data.slave_channels = spear300_dma_info;
  190. pl080_plat_data.num_slave_channels = ARRAY_SIZE(spear300_dma_info);
  191. of_platform_default_populate(NULL, spear300_auxdata_lookup, NULL);
  192. }
  193. static const char * const spear300_dt_board_compat[] = {
  194. "st,spear300",
  195. "st,spear300-evb",
  196. NULL,
  197. };
  198. static void __init spear300_map_io(void)
  199. {
  200. spear3xx_map_io();
  201. }
  202. DT_MACHINE_START(SPEAR300_DT, "ST SPEAr300 SoC with Flattened Device Tree")
  203. .map_io = spear300_map_io,
  204. .init_time = spear3xx_timer_init,
  205. .init_machine = spear300_dt_init,
  206. .restart = spear_restart,
  207. .dt_compat = spear300_dt_board_compat,
  208. MACHINE_END