board-generic.c 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  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,omap3630",
  95. "ti,omap36xx",
  96. NULL,
  97. };
  98. DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened Device Tree)")
  99. .reserve = omap_reserve,
  100. .map_io = omap3_map_io,
  101. .init_early = omap3630_init_early,
  102. .init_machine = omap_generic_init,
  103. .init_late = omap3_init_late,
  104. .init_time = omap3_sync32k_timer_init,
  105. .dt_compat = omap36xx_boards_compat,
  106. .restart = omap3xxx_restart,
  107. MACHINE_END
  108. static const char *const omap3_gp_boards_compat[] __initconst = {
  109. "ti,omap3-beagle",
  110. "timll,omap3-devkit8000",
  111. NULL,
  112. };
  113. DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)")
  114. .reserve = omap_reserve,
  115. .map_io = omap3_map_io,
  116. .init_early = omap3430_init_early,
  117. .init_machine = omap_generic_init,
  118. .init_late = omap3_init_late,
  119. .init_time = omap3_secure_sync32k_timer_init,
  120. .dt_compat = omap3_gp_boards_compat,
  121. .restart = omap3xxx_restart,
  122. MACHINE_END
  123. static const char *const am3517_boards_compat[] __initconst = {
  124. "ti,am3517",
  125. NULL,
  126. };
  127. DT_MACHINE_START(AM3517_DT, "Generic AM3517 (Flattened Device Tree)")
  128. .reserve = omap_reserve,
  129. .map_io = omap3_map_io,
  130. .init_early = am35xx_init_early,
  131. .init_machine = omap_generic_init,
  132. .init_late = omap3_init_late,
  133. .init_time = omap3_gptimer_timer_init,
  134. .dt_compat = am3517_boards_compat,
  135. .restart = omap3xxx_restart,
  136. MACHINE_END
  137. #endif
  138. #ifdef CONFIG_SOC_TI81XX
  139. static const char *const ti814x_boards_compat[] __initconst = {
  140. "ti,dm8148",
  141. "ti,dm814",
  142. NULL,
  143. };
  144. DT_MACHINE_START(TI814X_DT, "Generic ti814x (Flattened Device Tree)")
  145. .reserve = omap_reserve,
  146. .map_io = ti81xx_map_io,
  147. .init_early = ti814x_init_early,
  148. .init_machine = omap_generic_init,
  149. .init_late = ti81xx_init_late,
  150. .init_time = omap3_gptimer_timer_init,
  151. .dt_compat = ti814x_boards_compat,
  152. .restart = ti81xx_restart,
  153. MACHINE_END
  154. static const char *const ti816x_boards_compat[] __initconst = {
  155. "ti,dm8168",
  156. "ti,dm816",
  157. NULL,
  158. };
  159. DT_MACHINE_START(TI816X_DT, "Generic ti816x (Flattened Device Tree)")
  160. .reserve = omap_reserve,
  161. .map_io = ti81xx_map_io,
  162. .init_early = ti816x_init_early,
  163. .init_machine = omap_generic_init,
  164. .init_late = ti81xx_init_late,
  165. .init_time = omap3_gptimer_timer_init,
  166. .dt_compat = ti816x_boards_compat,
  167. .restart = ti81xx_restart,
  168. MACHINE_END
  169. #endif
  170. #ifdef CONFIG_SOC_AM33XX
  171. static const char *const am33xx_boards_compat[] __initconst = {
  172. "ti,am33xx",
  173. NULL,
  174. };
  175. DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
  176. .reserve = omap_reserve,
  177. .map_io = am33xx_map_io,
  178. .init_early = am33xx_init_early,
  179. .init_machine = omap_generic_init,
  180. .init_late = am33xx_init_late,
  181. .init_time = omap3_gptimer_timer_init,
  182. .dt_compat = am33xx_boards_compat,
  183. .restart = am33xx_restart,
  184. MACHINE_END
  185. #endif
  186. #ifdef CONFIG_ARCH_OMAP4
  187. static const char *const omap4_boards_compat[] __initconst = {
  188. "ti,omap4460",
  189. "ti,omap4430",
  190. "ti,omap4",
  191. NULL,
  192. };
  193. DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
  194. .l2c_aux_val = OMAP_L2C_AUX_CTRL,
  195. .l2c_aux_mask = 0xcf9fffff,
  196. .l2c_write_sec = omap4_l2c310_write_sec,
  197. .reserve = omap_reserve,
  198. .smp = smp_ops(omap4_smp_ops),
  199. .map_io = omap4_map_io,
  200. .init_early = omap4430_init_early,
  201. .init_irq = omap_gic_of_init,
  202. .init_machine = omap_generic_init,
  203. .init_late = omap4430_init_late,
  204. .init_time = omap4_local_timer_init,
  205. .dt_compat = omap4_boards_compat,
  206. .restart = omap44xx_restart,
  207. MACHINE_END
  208. #endif
  209. #ifdef CONFIG_SOC_OMAP5
  210. static const char *const omap5_boards_compat[] __initconst = {
  211. "ti,omap5432",
  212. "ti,omap5430",
  213. "ti,omap5",
  214. NULL,
  215. };
  216. DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
  217. #if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE)
  218. .dma_zone_size = SZ_2G,
  219. #endif
  220. .reserve = omap_reserve,
  221. .smp = smp_ops(omap4_smp_ops),
  222. .map_io = omap5_map_io,
  223. .init_early = omap5_init_early,
  224. .init_irq = omap_gic_of_init,
  225. .init_machine = omap_generic_init,
  226. .init_late = omap5_init_late,
  227. .init_time = omap5_realtime_timer_init,
  228. .dt_compat = omap5_boards_compat,
  229. .restart = omap44xx_restart,
  230. MACHINE_END
  231. #endif
  232. #ifdef CONFIG_SOC_AM43XX
  233. static const char *const am43_boards_compat[] __initconst = {
  234. "ti,am4372",
  235. "ti,am43",
  236. NULL,
  237. };
  238. DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
  239. .l2c_aux_val = OMAP_L2C_AUX_CTRL,
  240. .l2c_aux_mask = 0xcf9fffff,
  241. .l2c_write_sec = omap4_l2c310_write_sec,
  242. .map_io = am33xx_map_io,
  243. .init_early = am43xx_init_early,
  244. .init_late = am43xx_init_late,
  245. .init_irq = omap_gic_of_init,
  246. .init_machine = omap_generic_init,
  247. .init_time = omap3_gptimer_timer_init,
  248. .dt_compat = am43_boards_compat,
  249. .restart = omap44xx_restart,
  250. MACHINE_END
  251. #endif
  252. #ifdef CONFIG_SOC_DRA7XX
  253. static const char *const dra74x_boards_compat[] __initconst = {
  254. "ti,am5728",
  255. "ti,am5726",
  256. "ti,dra742",
  257. "ti,dra7",
  258. NULL,
  259. };
  260. DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)")
  261. #if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE)
  262. .dma_zone_size = SZ_2G,
  263. #endif
  264. .reserve = omap_reserve,
  265. .smp = smp_ops(omap4_smp_ops),
  266. .map_io = dra7xx_map_io,
  267. .init_early = dra7xx_init_early,
  268. .init_late = dra7xx_init_late,
  269. .init_irq = omap_gic_of_init,
  270. .init_machine = omap_generic_init,
  271. .init_time = omap5_realtime_timer_init,
  272. .dt_compat = dra74x_boards_compat,
  273. .restart = omap44xx_restart,
  274. MACHINE_END
  275. static const char *const dra72x_boards_compat[] __initconst = {
  276. "ti,am5718",
  277. "ti,am5716",
  278. "ti,dra722",
  279. NULL,
  280. };
  281. DT_MACHINE_START(DRA72X_DT, "Generic DRA72X (Flattened Device Tree)")
  282. #if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE)
  283. .dma_zone_size = SZ_2G,
  284. #endif
  285. .reserve = omap_reserve,
  286. .map_io = dra7xx_map_io,
  287. .init_early = dra7xx_init_early,
  288. .init_late = dra7xx_init_late,
  289. .init_irq = omap_gic_of_init,
  290. .init_machine = omap_generic_init,
  291. .init_time = omap5_realtime_timer_init,
  292. .dt_compat = dra72x_boards_compat,
  293. .restart = omap44xx_restart,
  294. MACHINE_END
  295. #endif