board-generic.c 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. /*
  2. * Copyright (C) 2005 Nokia Corporation
  3. * Author: Paul Mundt <paul.mundt@nokia.com>
  4. *
  5. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
  6. *
  7. * Modified from the original mach-omap/omap2/board-generic.c did by Paul
  8. * to support the OMAP2+ device tree boards with an unique board file.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. */
  14. #include <linux/io.h>
  15. #include <linux/of_irq.h>
  16. #include <linux/of_platform.h>
  17. #include <linux/irqdomain.h>
  18. #include <asm/mach/arch.h>
  19. #include "common.h"
  20. #if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3))
  21. #define intc_of_init NULL
  22. #endif
  23. #ifndef CONFIG_ARCH_OMAP4
  24. #define gic_of_init NULL
  25. #endif
  26. static const struct of_device_id omap_dt_match_table[] __initconst = {
  27. { .compatible = "simple-bus", },
  28. { .compatible = "ti,omap-infra", },
  29. { }
  30. };
  31. static void __init omap_generic_init(void)
  32. {
  33. omapdss_early_init_of();
  34. pdata_quirks_init(omap_dt_match_table);
  35. omapdss_init_of();
  36. }
  37. #ifdef CONFIG_SOC_OMAP2420
  38. static const char *const omap242x_boards_compat[] __initconst = {
  39. "ti,omap2420",
  40. NULL,
  41. };
  42. DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
  43. .reserve = omap_reserve,
  44. .map_io = omap242x_map_io,
  45. .init_early = omap2420_init_early,
  46. .init_machine = omap_generic_init,
  47. .init_time = omap2_sync32k_timer_init,
  48. .dt_compat = omap242x_boards_compat,
  49. .restart = omap2xxx_restart,
  50. MACHINE_END
  51. #endif
  52. #ifdef CONFIG_SOC_OMAP2430
  53. static const char *const omap243x_boards_compat[] __initconst = {
  54. "ti,omap2430",
  55. NULL,
  56. };
  57. DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
  58. .reserve = omap_reserve,
  59. .map_io = omap243x_map_io,
  60. .init_early = omap2430_init_early,
  61. .init_machine = omap_generic_init,
  62. .init_time = omap2_sync32k_timer_init,
  63. .dt_compat = omap243x_boards_compat,
  64. .restart = omap2xxx_restart,
  65. MACHINE_END
  66. #endif
  67. #ifdef CONFIG_ARCH_OMAP3
  68. /* Some boards need board name for legacy userspace in /proc/cpuinfo */
  69. static const char *const n900_boards_compat[] __initconst = {
  70. "nokia,omap3-n900",
  71. NULL,
  72. };
  73. DT_MACHINE_START(OMAP3_N900_DT, "Nokia RX-51 board")
  74. .reserve = omap_reserve,
  75. .map_io = omap3_map_io,
  76. .init_early = omap3430_init_early,
  77. .init_machine = omap_generic_init,
  78. .init_late = omap3_init_late,
  79. .init_time = omap3_sync32k_timer_init,
  80. .dt_compat = n900_boards_compat,
  81. .restart = omap3xxx_restart,
  82. MACHINE_END
  83. /* Generic omap3 boards, most boards can use these */
  84. static const char *const omap3_boards_compat[] __initconst = {
  85. "ti,omap3430",
  86. "ti,omap3",
  87. NULL,
  88. };
  89. DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
  90. .reserve = omap_reserve,
  91. .map_io = omap3_map_io,
  92. .init_early = omap3430_init_early,
  93. .init_machine = omap_generic_init,
  94. .init_late = omap3_init_late,
  95. .init_time = omap3_sync32k_timer_init,
  96. .dt_compat = omap3_boards_compat,
  97. .restart = omap3xxx_restart,
  98. MACHINE_END
  99. static const char *const omap36xx_boards_compat[] __initconst = {
  100. "ti,omap36xx",
  101. NULL,
  102. };
  103. DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened Device Tree)")
  104. .reserve = omap_reserve,
  105. .map_io = omap3_map_io,
  106. .init_early = omap3630_init_early,
  107. .init_machine = omap_generic_init,
  108. .init_late = omap3_init_late,
  109. .init_time = omap3_sync32k_timer_init,
  110. .dt_compat = omap36xx_boards_compat,
  111. .restart = omap3xxx_restart,
  112. MACHINE_END
  113. static const char *const omap3_gp_boards_compat[] __initconst = {
  114. "ti,omap3-beagle",
  115. "timll,omap3-devkit8000",
  116. NULL,
  117. };
  118. DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)")
  119. .reserve = omap_reserve,
  120. .map_io = omap3_map_io,
  121. .init_early = omap3430_init_early,
  122. .init_machine = omap_generic_init,
  123. .init_late = omap3_init_late,
  124. .init_time = omap3_secure_sync32k_timer_init,
  125. .dt_compat = omap3_gp_boards_compat,
  126. .restart = omap3xxx_restart,
  127. MACHINE_END
  128. static const char *const am3517_boards_compat[] __initconst = {
  129. "ti,am3517",
  130. NULL,
  131. };
  132. DT_MACHINE_START(AM3517_DT, "Generic AM3517 (Flattened Device Tree)")
  133. .reserve = omap_reserve,
  134. .map_io = omap3_map_io,
  135. .init_early = am35xx_init_early,
  136. .init_machine = omap_generic_init,
  137. .init_late = omap3_init_late,
  138. .init_time = omap3_gptimer_timer_init,
  139. .dt_compat = am3517_boards_compat,
  140. .restart = omap3xxx_restart,
  141. MACHINE_END
  142. #endif
  143. #ifdef CONFIG_SOC_AM33XX
  144. static const char *const am33xx_boards_compat[] __initconst = {
  145. "ti,am33xx",
  146. NULL,
  147. };
  148. DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
  149. .reserve = omap_reserve,
  150. .map_io = am33xx_map_io,
  151. .init_early = am33xx_init_early,
  152. .init_machine = omap_generic_init,
  153. .init_late = am33xx_init_late,
  154. .init_time = omap3_gptimer_timer_init,
  155. .dt_compat = am33xx_boards_compat,
  156. .restart = am33xx_restart,
  157. MACHINE_END
  158. #endif
  159. #ifdef CONFIG_ARCH_OMAP4
  160. static const char *const omap4_boards_compat[] __initconst = {
  161. "ti,omap4460",
  162. "ti,omap4430",
  163. "ti,omap4",
  164. NULL,
  165. };
  166. DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
  167. .reserve = omap_reserve,
  168. .smp = smp_ops(omap4_smp_ops),
  169. .map_io = omap4_map_io,
  170. .init_early = omap4430_init_early,
  171. .init_irq = omap_gic_of_init,
  172. .init_machine = omap_generic_init,
  173. .init_late = omap4430_init_late,
  174. .init_time = omap4_local_timer_init,
  175. .dt_compat = omap4_boards_compat,
  176. .restart = omap44xx_restart,
  177. MACHINE_END
  178. #endif
  179. #ifdef CONFIG_SOC_OMAP5
  180. static const char *const omap5_boards_compat[] __initconst = {
  181. "ti,omap5432",
  182. "ti,omap5430",
  183. "ti,omap5",
  184. NULL,
  185. };
  186. DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
  187. .reserve = omap_reserve,
  188. .smp = smp_ops(omap4_smp_ops),
  189. .map_io = omap5_map_io,
  190. .init_early = omap5_init_early,
  191. .init_irq = omap_gic_of_init,
  192. .init_machine = omap_generic_init,
  193. .init_late = omap5_init_late,
  194. .init_time = omap5_realtime_timer_init,
  195. .dt_compat = omap5_boards_compat,
  196. .restart = omap44xx_restart,
  197. MACHINE_END
  198. #endif
  199. #ifdef CONFIG_SOC_AM43XX
  200. static const char *const am43_boards_compat[] __initconst = {
  201. "ti,am4372",
  202. "ti,am43",
  203. NULL,
  204. };
  205. DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
  206. .map_io = am33xx_map_io,
  207. .init_early = am43xx_init_early,
  208. .init_late = am43xx_init_late,
  209. .init_irq = omap_gic_of_init,
  210. .init_machine = omap_generic_init,
  211. .init_time = omap3_gptimer_timer_init,
  212. .dt_compat = am43_boards_compat,
  213. .restart = omap44xx_restart,
  214. MACHINE_END
  215. #endif
  216. #ifdef CONFIG_SOC_DRA7XX
  217. static const char *const dra74x_boards_compat[] __initconst = {
  218. "ti,am5728",
  219. "ti,am5726",
  220. "ti,dra742",
  221. "ti,dra7",
  222. NULL,
  223. };
  224. DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)")
  225. .reserve = omap_reserve,
  226. .smp = smp_ops(omap4_smp_ops),
  227. .map_io = omap5_map_io,
  228. .init_early = dra7xx_init_early,
  229. .init_late = dra7xx_init_late,
  230. .init_irq = omap_gic_of_init,
  231. .init_machine = omap_generic_init,
  232. .init_time = omap5_realtime_timer_init,
  233. .dt_compat = dra74x_boards_compat,
  234. .restart = omap44xx_restart,
  235. MACHINE_END
  236. static const char *const dra72x_boards_compat[] __initconst = {
  237. "ti,am5718",
  238. "ti,am5716",
  239. "ti,dra722",
  240. NULL,
  241. };
  242. DT_MACHINE_START(DRA72X_DT, "Generic DRA72X (Flattened Device Tree)")
  243. .reserve = omap_reserve,
  244. .map_io = omap5_map_io,
  245. .init_early = dra7xx_init_early,
  246. .init_late = dra7xx_init_late,
  247. .init_irq = omap_gic_of_init,
  248. .init_machine = omap_generic_init,
  249. .init_time = omap5_realtime_timer_init,
  250. .dt_compat = dra72x_boards_compat,
  251. .restart = omap44xx_restart,
  252. MACHINE_END
  253. #endif