board-generic.c 9.1 KB

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