board-generic.c 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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. static const struct of_device_id omap_dt_match_table[] __initconst = {
  21. { .compatible = "simple-bus", },
  22. { .compatible = "ti,omap-infra", },
  23. { }
  24. };
  25. static void __init omap_generic_init(void)
  26. {
  27. omapdss_early_init_of();
  28. pdata_quirks_init(omap_dt_match_table);
  29. omapdss_init_of();
  30. }
  31. #ifdef CONFIG_SOC_OMAP2420
  32. static const char *const omap242x_boards_compat[] __initconst = {
  33. "ti,omap2420",
  34. NULL,
  35. };
  36. DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
  37. .reserve = omap_reserve,
  38. .map_io = omap242x_map_io,
  39. .init_early = omap2420_init_early,
  40. .init_machine = omap_generic_init,
  41. .init_time = omap2_sync32k_timer_init,
  42. .dt_compat = omap242x_boards_compat,
  43. .restart = omap2xxx_restart,
  44. MACHINE_END
  45. #endif
  46. #ifdef CONFIG_SOC_OMAP2430
  47. static const char *const omap243x_boards_compat[] __initconst = {
  48. "ti,omap2430",
  49. NULL,
  50. };
  51. DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
  52. .reserve = omap_reserve,
  53. .map_io = omap243x_map_io,
  54. .init_early = omap2430_init_early,
  55. .init_machine = omap_generic_init,
  56. .init_time = omap2_sync32k_timer_init,
  57. .dt_compat = omap243x_boards_compat,
  58. .restart = omap2xxx_restart,
  59. MACHINE_END
  60. #endif
  61. #ifdef CONFIG_ARCH_OMAP3
  62. /* Some boards need board name for legacy userspace in /proc/cpuinfo */
  63. static const char *const n900_boards_compat[] __initconst = {
  64. "nokia,omap3-n900",
  65. NULL,
  66. };
  67. DT_MACHINE_START(OMAP3_N900_DT, "Nokia RX-51 board")
  68. .reserve = omap_reserve,
  69. .map_io = omap3_map_io,
  70. .init_early = omap3430_init_early,
  71. .init_machine = omap_generic_init,
  72. .init_late = omap3_init_late,
  73. .init_time = omap3_sync32k_timer_init,
  74. .dt_compat = n900_boards_compat,
  75. .restart = omap3xxx_restart,
  76. MACHINE_END
  77. /* Generic omap3 boards, most boards can use these */
  78. static const char *const omap3_boards_compat[] __initconst = {
  79. "ti,omap3430",
  80. "ti,omap3",
  81. NULL,
  82. };
  83. DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
  84. .reserve = omap_reserve,
  85. .map_io = omap3_map_io,
  86. .init_early = omap3430_init_early,
  87. .init_machine = omap_generic_init,
  88. .init_late = omap3_init_late,
  89. .init_time = omap3_sync32k_timer_init,
  90. .dt_compat = omap3_boards_compat,
  91. .restart = omap3xxx_restart,
  92. MACHINE_END
  93. static const char *const omap36xx_boards_compat[] __initconst = {
  94. "ti,omap36xx",
  95. NULL,
  96. };
  97. DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened Device Tree)")
  98. .reserve = omap_reserve,
  99. .map_io = omap3_map_io,
  100. .init_early = omap3630_init_early,
  101. .init_machine = omap_generic_init,
  102. .init_late = omap3_init_late,
  103. .init_time = omap3_sync32k_timer_init,
  104. .dt_compat = omap36xx_boards_compat,
  105. .restart = omap3xxx_restart,
  106. MACHINE_END
  107. static const char *const omap3_gp_boards_compat[] __initconst = {
  108. "ti,omap3-beagle",
  109. "timll,omap3-devkit8000",
  110. NULL,
  111. };
  112. DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)")
  113. .reserve = omap_reserve,
  114. .map_io = omap3_map_io,
  115. .init_early = omap3430_init_early,
  116. .init_machine = omap_generic_init,
  117. .init_late = omap3_init_late,
  118. .init_time = omap3_secure_sync32k_timer_init,
  119. .dt_compat = omap3_gp_boards_compat,
  120. .restart = omap3xxx_restart,
  121. MACHINE_END
  122. static const char *const am3517_boards_compat[] __initconst = {
  123. "ti,am3517",
  124. NULL,
  125. };
  126. DT_MACHINE_START(AM3517_DT, "Generic AM3517 (Flattened Device Tree)")
  127. .reserve = omap_reserve,
  128. .map_io = omap3_map_io,
  129. .init_early = am35xx_init_early,
  130. .init_machine = omap_generic_init,
  131. .init_late = omap3_init_late,
  132. .init_time = omap3_gptimer_timer_init,
  133. .dt_compat = am3517_boards_compat,
  134. .restart = omap3xxx_restart,
  135. MACHINE_END
  136. #endif
  137. #ifdef CONFIG_SOC_TI81XX
  138. static const char *const ti814x_boards_compat[] __initconst = {
  139. "ti,dm8148",
  140. "ti,dm814",
  141. NULL,
  142. };
  143. DT_MACHINE_START(TI814X_DT, "Generic ti814x (Flattened Device Tree)")
  144. .reserve = omap_reserve,
  145. .map_io = ti81xx_map_io,
  146. .init_early = ti814x_init_early,
  147. .init_machine = omap_generic_init,
  148. .init_late = ti81xx_init_late,
  149. .init_time = omap3_gptimer_timer_init,
  150. .dt_compat = ti814x_boards_compat,
  151. .restart = ti81xx_restart,
  152. MACHINE_END
  153. static const char *const ti816x_boards_compat[] __initconst = {
  154. "ti,dm8168",
  155. "ti,dm816",
  156. NULL,
  157. };
  158. DT_MACHINE_START(TI816X_DT, "Generic ti816x (Flattened Device Tree)")
  159. .reserve = omap_reserve,
  160. .map_io = ti81xx_map_io,
  161. .init_early = ti816x_init_early,
  162. .init_machine = omap_generic_init,
  163. .init_late = ti81xx_init_late,
  164. .init_time = omap3_gptimer_timer_init,
  165. .dt_compat = ti816x_boards_compat,
  166. .restart = ti81xx_restart,
  167. MACHINE_END
  168. #endif
  169. #ifdef CONFIG_SOC_AM33XX
  170. static const char *const am33xx_boards_compat[] __initconst = {
  171. "ti,am33xx",
  172. NULL,
  173. };
  174. DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
  175. .reserve = omap_reserve,
  176. .map_io = am33xx_map_io,
  177. .init_early = am33xx_init_early,
  178. .init_machine = omap_generic_init,
  179. .init_late = am33xx_init_late,
  180. .init_time = omap3_gptimer_timer_init,
  181. .dt_compat = am33xx_boards_compat,
  182. .restart = am33xx_restart,
  183. MACHINE_END
  184. #endif
  185. #ifdef CONFIG_ARCH_OMAP4
  186. static const char *const omap4_boards_compat[] __initconst = {
  187. "ti,omap4460",
  188. "ti,omap4430",
  189. "ti,omap4",
  190. NULL,
  191. };
  192. DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
  193. .l2c_aux_val = OMAP_L2C_AUX_CTRL,
  194. .l2c_aux_mask = 0xcf9fffff,
  195. .l2c_write_sec = omap4_l2c310_write_sec,
  196. .reserve = omap_reserve,
  197. .smp = smp_ops(omap4_smp_ops),
  198. .map_io = omap4_map_io,
  199. .init_early = omap4430_init_early,
  200. .init_irq = omap_gic_of_init,
  201. .init_machine = omap_generic_init,
  202. .init_late = omap4430_init_late,
  203. .init_time = omap4_local_timer_init,
  204. .dt_compat = omap4_boards_compat,
  205. .restart = omap44xx_restart,
  206. MACHINE_END
  207. #endif
  208. #ifdef CONFIG_SOC_OMAP5
  209. static const char *const omap5_boards_compat[] __initconst = {
  210. "ti,omap5432",
  211. "ti,omap5430",
  212. "ti,omap5",
  213. NULL,
  214. };
  215. DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
  216. .reserve = omap_reserve,
  217. .smp = smp_ops(omap4_smp_ops),
  218. .map_io = omap5_map_io,
  219. .init_early = omap5_init_early,
  220. .init_irq = omap_gic_of_init,
  221. .init_machine = omap_generic_init,
  222. .init_late = omap5_init_late,
  223. .init_time = omap5_realtime_timer_init,
  224. .dt_compat = omap5_boards_compat,
  225. .restart = omap44xx_restart,
  226. MACHINE_END
  227. #endif
  228. #ifdef CONFIG_SOC_AM43XX
  229. static const char *const am43_boards_compat[] __initconst = {
  230. "ti,am4372",
  231. "ti,am43",
  232. NULL,
  233. };
  234. DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
  235. .l2c_aux_val = OMAP_L2C_AUX_CTRL,
  236. .l2c_aux_mask = 0xcf9fffff,
  237. .l2c_write_sec = omap4_l2c310_write_sec,
  238. .map_io = am33xx_map_io,
  239. .init_early = am43xx_init_early,
  240. .init_late = am43xx_init_late,
  241. .init_irq = omap_gic_of_init,
  242. .init_machine = omap_generic_init,
  243. .init_time = omap3_gptimer_timer_init,
  244. .dt_compat = am43_boards_compat,
  245. .restart = omap44xx_restart,
  246. MACHINE_END
  247. #endif
  248. #ifdef CONFIG_SOC_DRA7XX
  249. static const char *const dra74x_boards_compat[] __initconst = {
  250. "ti,am5728",
  251. "ti,am5726",
  252. "ti,dra742",
  253. "ti,dra7",
  254. NULL,
  255. };
  256. DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)")
  257. .reserve = omap_reserve,
  258. .smp = smp_ops(omap4_smp_ops),
  259. .map_io = dra7xx_map_io,
  260. .init_early = dra7xx_init_early,
  261. .init_late = dra7xx_init_late,
  262. .init_irq = omap_gic_of_init,
  263. .init_machine = omap_generic_init,
  264. .init_time = omap5_realtime_timer_init,
  265. .dt_compat = dra74x_boards_compat,
  266. .restart = omap44xx_restart,
  267. MACHINE_END
  268. static const char *const dra72x_boards_compat[] __initconst = {
  269. "ti,am5718",
  270. "ti,am5716",
  271. "ti,dra722",
  272. NULL,
  273. };
  274. DT_MACHINE_START(DRA72X_DT, "Generic DRA72X (Flattened Device Tree)")
  275. .reserve = omap_reserve,
  276. .map_io = dra7xx_map_io,
  277. .init_early = dra7xx_init_early,
  278. .init_late = dra7xx_init_late,
  279. .init_irq = omap_gic_of_init,
  280. .init_machine = omap_generic_init,
  281. .init_time = omap5_realtime_timer_init,
  282. .dt_compat = dra72x_boards_compat,
  283. .restart = omap44xx_restart,
  284. MACHINE_END
  285. #endif