io.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. /*
  2. * linux/arch/arm/mach-omap2/io.c
  3. *
  4. * OMAP2 I/O mapping code
  5. *
  6. * Copyright (C) 2005 Nokia Corporation
  7. * Copyright (C) 2007-2009 Texas Instruments
  8. *
  9. * Author:
  10. * Juha Yrjola <juha.yrjola@nokia.com>
  11. * Syed Khasim <x0khasim@ti.com>
  12. *
  13. * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
  14. *
  15. * This program is free software; you can redistribute it and/or modify
  16. * it under the terms of the GNU General Public License version 2 as
  17. * published by the Free Software Foundation.
  18. */
  19. #include <linux/module.h>
  20. #include <linux/kernel.h>
  21. #include <linux/init.h>
  22. #include <linux/io.h>
  23. #include <linux/clk.h>
  24. #include <asm/tlb.h>
  25. #include <asm/mach/map.h>
  26. #include <plat-omap/dma-omap.h>
  27. #include "../plat-omap/sram.h"
  28. #include <plat/prcm.h>
  29. #include "omap_hwmod.h"
  30. #include "soc.h"
  31. #include "iomap.h"
  32. #include "voltage.h"
  33. #include "powerdomain.h"
  34. #include "clockdomain.h"
  35. #include "common.h"
  36. #include "clock.h"
  37. #include "clock2xxx.h"
  38. #include "clock3xxx.h"
  39. #include "clock44xx.h"
  40. #include "omap-pm.h"
  41. #include "sdrc.h"
  42. #include "control.h"
  43. #include "serial.h"
  44. #include "cm2xxx.h"
  45. #include "cm3xxx.h"
  46. #include "prm.h"
  47. #include "cm.h"
  48. #include "prcm_mpu44xx.h"
  49. #include "prminst44xx.h"
  50. #include "cminst44xx.h"
  51. /*
  52. * The machine specific code may provide the extra mapping besides the
  53. * default mapping provided here.
  54. */
  55. #if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430)
  56. static struct map_desc omap24xx_io_desc[] __initdata = {
  57. {
  58. .virtual = L3_24XX_VIRT,
  59. .pfn = __phys_to_pfn(L3_24XX_PHYS),
  60. .length = L3_24XX_SIZE,
  61. .type = MT_DEVICE
  62. },
  63. {
  64. .virtual = L4_24XX_VIRT,
  65. .pfn = __phys_to_pfn(L4_24XX_PHYS),
  66. .length = L4_24XX_SIZE,
  67. .type = MT_DEVICE
  68. },
  69. };
  70. #ifdef CONFIG_SOC_OMAP2420
  71. static struct map_desc omap242x_io_desc[] __initdata = {
  72. {
  73. .virtual = DSP_MEM_2420_VIRT,
  74. .pfn = __phys_to_pfn(DSP_MEM_2420_PHYS),
  75. .length = DSP_MEM_2420_SIZE,
  76. .type = MT_DEVICE
  77. },
  78. {
  79. .virtual = DSP_IPI_2420_VIRT,
  80. .pfn = __phys_to_pfn(DSP_IPI_2420_PHYS),
  81. .length = DSP_IPI_2420_SIZE,
  82. .type = MT_DEVICE
  83. },
  84. {
  85. .virtual = DSP_MMU_2420_VIRT,
  86. .pfn = __phys_to_pfn(DSP_MMU_2420_PHYS),
  87. .length = DSP_MMU_2420_SIZE,
  88. .type = MT_DEVICE
  89. },
  90. };
  91. #endif
  92. #ifdef CONFIG_SOC_OMAP2430
  93. static struct map_desc omap243x_io_desc[] __initdata = {
  94. {
  95. .virtual = L4_WK_243X_VIRT,
  96. .pfn = __phys_to_pfn(L4_WK_243X_PHYS),
  97. .length = L4_WK_243X_SIZE,
  98. .type = MT_DEVICE
  99. },
  100. {
  101. .virtual = OMAP243X_GPMC_VIRT,
  102. .pfn = __phys_to_pfn(OMAP243X_GPMC_PHYS),
  103. .length = OMAP243X_GPMC_SIZE,
  104. .type = MT_DEVICE
  105. },
  106. {
  107. .virtual = OMAP243X_SDRC_VIRT,
  108. .pfn = __phys_to_pfn(OMAP243X_SDRC_PHYS),
  109. .length = OMAP243X_SDRC_SIZE,
  110. .type = MT_DEVICE
  111. },
  112. {
  113. .virtual = OMAP243X_SMS_VIRT,
  114. .pfn = __phys_to_pfn(OMAP243X_SMS_PHYS),
  115. .length = OMAP243X_SMS_SIZE,
  116. .type = MT_DEVICE
  117. },
  118. };
  119. #endif
  120. #endif
  121. #ifdef CONFIG_ARCH_OMAP3
  122. static struct map_desc omap34xx_io_desc[] __initdata = {
  123. {
  124. .virtual = L3_34XX_VIRT,
  125. .pfn = __phys_to_pfn(L3_34XX_PHYS),
  126. .length = L3_34XX_SIZE,
  127. .type = MT_DEVICE
  128. },
  129. {
  130. .virtual = L4_34XX_VIRT,
  131. .pfn = __phys_to_pfn(L4_34XX_PHYS),
  132. .length = L4_34XX_SIZE,
  133. .type = MT_DEVICE
  134. },
  135. {
  136. .virtual = OMAP34XX_GPMC_VIRT,
  137. .pfn = __phys_to_pfn(OMAP34XX_GPMC_PHYS),
  138. .length = OMAP34XX_GPMC_SIZE,
  139. .type = MT_DEVICE
  140. },
  141. {
  142. .virtual = OMAP343X_SMS_VIRT,
  143. .pfn = __phys_to_pfn(OMAP343X_SMS_PHYS),
  144. .length = OMAP343X_SMS_SIZE,
  145. .type = MT_DEVICE
  146. },
  147. {
  148. .virtual = OMAP343X_SDRC_VIRT,
  149. .pfn = __phys_to_pfn(OMAP343X_SDRC_PHYS),
  150. .length = OMAP343X_SDRC_SIZE,
  151. .type = MT_DEVICE
  152. },
  153. {
  154. .virtual = L4_PER_34XX_VIRT,
  155. .pfn = __phys_to_pfn(L4_PER_34XX_PHYS),
  156. .length = L4_PER_34XX_SIZE,
  157. .type = MT_DEVICE
  158. },
  159. {
  160. .virtual = L4_EMU_34XX_VIRT,
  161. .pfn = __phys_to_pfn(L4_EMU_34XX_PHYS),
  162. .length = L4_EMU_34XX_SIZE,
  163. .type = MT_DEVICE
  164. },
  165. #if defined(CONFIG_DEBUG_LL) && \
  166. (defined(CONFIG_MACH_OMAP_ZOOM2) || defined(CONFIG_MACH_OMAP_ZOOM3))
  167. {
  168. .virtual = ZOOM_UART_VIRT,
  169. .pfn = __phys_to_pfn(ZOOM_UART_BASE),
  170. .length = SZ_1M,
  171. .type = MT_DEVICE
  172. },
  173. #endif
  174. };
  175. #endif
  176. #ifdef CONFIG_SOC_TI81XX
  177. static struct map_desc omapti81xx_io_desc[] __initdata = {
  178. {
  179. .virtual = L4_34XX_VIRT,
  180. .pfn = __phys_to_pfn(L4_34XX_PHYS),
  181. .length = L4_34XX_SIZE,
  182. .type = MT_DEVICE
  183. }
  184. };
  185. #endif
  186. #ifdef CONFIG_SOC_AM33XX
  187. static struct map_desc omapam33xx_io_desc[] __initdata = {
  188. {
  189. .virtual = L4_34XX_VIRT,
  190. .pfn = __phys_to_pfn(L4_34XX_PHYS),
  191. .length = L4_34XX_SIZE,
  192. .type = MT_DEVICE
  193. },
  194. {
  195. .virtual = L4_WK_AM33XX_VIRT,
  196. .pfn = __phys_to_pfn(L4_WK_AM33XX_PHYS),
  197. .length = L4_WK_AM33XX_SIZE,
  198. .type = MT_DEVICE
  199. }
  200. };
  201. #endif
  202. #ifdef CONFIG_ARCH_OMAP4
  203. static struct map_desc omap44xx_io_desc[] __initdata = {
  204. {
  205. .virtual = L3_44XX_VIRT,
  206. .pfn = __phys_to_pfn(L3_44XX_PHYS),
  207. .length = L3_44XX_SIZE,
  208. .type = MT_DEVICE,
  209. },
  210. {
  211. .virtual = L4_44XX_VIRT,
  212. .pfn = __phys_to_pfn(L4_44XX_PHYS),
  213. .length = L4_44XX_SIZE,
  214. .type = MT_DEVICE,
  215. },
  216. {
  217. .virtual = L4_PER_44XX_VIRT,
  218. .pfn = __phys_to_pfn(L4_PER_44XX_PHYS),
  219. .length = L4_PER_44XX_SIZE,
  220. .type = MT_DEVICE,
  221. },
  222. #ifdef CONFIG_OMAP4_ERRATA_I688
  223. {
  224. .virtual = OMAP4_SRAM_VA,
  225. .pfn = __phys_to_pfn(OMAP4_SRAM_PA),
  226. .length = PAGE_SIZE,
  227. .type = MT_MEMORY_SO,
  228. },
  229. #endif
  230. };
  231. #endif
  232. #ifdef CONFIG_SOC_OMAP5
  233. static struct map_desc omap54xx_io_desc[] __initdata = {
  234. {
  235. .virtual = L3_54XX_VIRT,
  236. .pfn = __phys_to_pfn(L3_54XX_PHYS),
  237. .length = L3_54XX_SIZE,
  238. .type = MT_DEVICE,
  239. },
  240. {
  241. .virtual = L4_54XX_VIRT,
  242. .pfn = __phys_to_pfn(L4_54XX_PHYS),
  243. .length = L4_54XX_SIZE,
  244. .type = MT_DEVICE,
  245. },
  246. {
  247. .virtual = L4_WK_54XX_VIRT,
  248. .pfn = __phys_to_pfn(L4_WK_54XX_PHYS),
  249. .length = L4_WK_54XX_SIZE,
  250. .type = MT_DEVICE,
  251. },
  252. {
  253. .virtual = L4_PER_54XX_VIRT,
  254. .pfn = __phys_to_pfn(L4_PER_54XX_PHYS),
  255. .length = L4_PER_54XX_SIZE,
  256. .type = MT_DEVICE,
  257. },
  258. };
  259. #endif
  260. #ifdef CONFIG_SOC_OMAP2420
  261. void __init omap242x_map_io(void)
  262. {
  263. iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
  264. iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc));
  265. }
  266. #endif
  267. #ifdef CONFIG_SOC_OMAP2430
  268. void __init omap243x_map_io(void)
  269. {
  270. iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
  271. iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc));
  272. }
  273. #endif
  274. #ifdef CONFIG_ARCH_OMAP3
  275. void __init omap3_map_io(void)
  276. {
  277. iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc));
  278. }
  279. #endif
  280. #ifdef CONFIG_SOC_TI81XX
  281. void __init ti81xx_map_io(void)
  282. {
  283. iotable_init(omapti81xx_io_desc, ARRAY_SIZE(omapti81xx_io_desc));
  284. }
  285. #endif
  286. #ifdef CONFIG_SOC_AM33XX
  287. void __init am33xx_map_io(void)
  288. {
  289. iotable_init(omapam33xx_io_desc, ARRAY_SIZE(omapam33xx_io_desc));
  290. }
  291. #endif
  292. #ifdef CONFIG_ARCH_OMAP4
  293. void __init omap4_map_io(void)
  294. {
  295. iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc));
  296. omap_barriers_init();
  297. }
  298. #endif
  299. #ifdef CONFIG_SOC_OMAP5
  300. void __init omap5_map_io(void)
  301. {
  302. iotable_init(omap54xx_io_desc, ARRAY_SIZE(omap54xx_io_desc));
  303. }
  304. #endif
  305. /*
  306. * omap2_init_reprogram_sdrc - reprogram SDRC timing parameters
  307. *
  308. * Sets the CORE DPLL3 M2 divider to the same value that it's at
  309. * currently. This has the effect of setting the SDRC SDRAM AC timing
  310. * registers to the values currently defined by the kernel. Currently
  311. * only defined for OMAP3; will return 0 if called on OMAP2. Returns
  312. * -EINVAL if the dpll3_m2_ck cannot be found, 0 if called on OMAP2,
  313. * or passes along the return value of clk_set_rate().
  314. */
  315. static int __init _omap2_init_reprogram_sdrc(void)
  316. {
  317. struct clk *dpll3_m2_ck;
  318. int v = -EINVAL;
  319. long rate;
  320. if (!cpu_is_omap34xx())
  321. return 0;
  322. dpll3_m2_ck = clk_get(NULL, "dpll3_m2_ck");
  323. if (IS_ERR(dpll3_m2_ck))
  324. return -EINVAL;
  325. rate = clk_get_rate(dpll3_m2_ck);
  326. pr_info("Reprogramming SDRC clock to %ld Hz\n", rate);
  327. v = clk_set_rate(dpll3_m2_ck, rate);
  328. if (v)
  329. pr_err("dpll3_m2_clk rate change failed: %d\n", v);
  330. clk_put(dpll3_m2_ck);
  331. return v;
  332. }
  333. static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
  334. {
  335. return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
  336. }
  337. static void __init omap_common_init_early(void)
  338. {
  339. omap_init_consistent_dma_size();
  340. }
  341. static void __init omap_hwmod_init_postsetup(void)
  342. {
  343. u8 postsetup_state;
  344. /* Set the default postsetup state for all hwmods */
  345. #ifdef CONFIG_PM_RUNTIME
  346. postsetup_state = _HWMOD_STATE_IDLE;
  347. #else
  348. postsetup_state = _HWMOD_STATE_ENABLED;
  349. #endif
  350. omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state);
  351. omap_pm_if_early_init();
  352. }
  353. #ifdef CONFIG_SOC_OMAP2420
  354. void __init omap2420_init_early(void)
  355. {
  356. omap2_set_globals_tap(OMAP242X_CLASS, OMAP2_L4_IO_ADDRESS(0x48014000));
  357. omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE),
  358. OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE));
  359. omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE),
  360. NULL);
  361. omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE));
  362. omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE), NULL);
  363. omap2xxx_check_revision();
  364. omap2xxx_cm_init();
  365. omap_common_init_early();
  366. omap2xxx_voltagedomains_init();
  367. omap242x_powerdomains_init();
  368. omap242x_clockdomains_init();
  369. omap2420_hwmod_init();
  370. omap_hwmod_init_postsetup();
  371. omap2420_clk_init();
  372. }
  373. void __init omap2420_init_late(void)
  374. {
  375. omap_mux_late_init();
  376. omap2_common_pm_late_init();
  377. omap2_pm_init();
  378. }
  379. #endif
  380. #ifdef CONFIG_SOC_OMAP2430
  381. void __init omap2430_init_early(void)
  382. {
  383. omap2_set_globals_tap(OMAP243X_CLASS, OMAP2_L4_IO_ADDRESS(0x4900a000));
  384. omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE),
  385. OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE));
  386. omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE),
  387. NULL);
  388. omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE));
  389. omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE), NULL);
  390. omap2xxx_check_revision();
  391. omap2xxx_cm_init();
  392. omap_common_init_early();
  393. omap2xxx_voltagedomains_init();
  394. omap243x_powerdomains_init();
  395. omap243x_clockdomains_init();
  396. omap2430_hwmod_init();
  397. omap_hwmod_init_postsetup();
  398. omap2430_clk_init();
  399. }
  400. void __init omap2430_init_late(void)
  401. {
  402. omap_mux_late_init();
  403. omap2_common_pm_late_init();
  404. omap2_pm_init();
  405. }
  406. #endif
  407. /*
  408. * Currently only board-omap3beagle.c should call this because of the
  409. * same machine_id for 34xx and 36xx beagle.. Will get fixed with DT.
  410. */
  411. #ifdef CONFIG_ARCH_OMAP3
  412. void __init omap3_init_early(void)
  413. {
  414. omap2_set_globals_tap(OMAP343X_CLASS, OMAP2_L4_IO_ADDRESS(0x4830A000));
  415. omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE),
  416. OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE));
  417. omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
  418. NULL);
  419. omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE));
  420. omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE), NULL);
  421. omap3xxx_check_revision();
  422. omap3xxx_check_features();
  423. omap3xxx_cm_init();
  424. omap_common_init_early();
  425. omap3xxx_voltagedomains_init();
  426. omap3xxx_powerdomains_init();
  427. omap3xxx_clockdomains_init();
  428. omap3xxx_hwmod_init();
  429. omap_hwmod_init_postsetup();
  430. omap3xxx_clk_init();
  431. }
  432. void __init omap3430_init_early(void)
  433. {
  434. omap3_init_early();
  435. }
  436. void __init omap35xx_init_early(void)
  437. {
  438. omap3_init_early();
  439. }
  440. void __init omap3630_init_early(void)
  441. {
  442. omap3_init_early();
  443. }
  444. void __init am35xx_init_early(void)
  445. {
  446. omap3_init_early();
  447. }
  448. void __init ti81xx_init_early(void)
  449. {
  450. omap2_set_globals_tap(OMAP343X_CLASS,
  451. OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE));
  452. omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
  453. NULL);
  454. omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE));
  455. omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE), NULL);
  456. omap3xxx_check_revision();
  457. ti81xx_check_features();
  458. omap_common_init_early();
  459. omap3xxx_voltagedomains_init();
  460. omap3xxx_powerdomains_init();
  461. omap3xxx_clockdomains_init();
  462. omap3xxx_hwmod_init();
  463. omap_hwmod_init_postsetup();
  464. omap3xxx_clk_init();
  465. }
  466. void __init omap3_init_late(void)
  467. {
  468. omap_mux_late_init();
  469. omap2_common_pm_late_init();
  470. omap3_pm_init();
  471. }
  472. void __init omap3430_init_late(void)
  473. {
  474. omap_mux_late_init();
  475. omap2_common_pm_late_init();
  476. omap3_pm_init();
  477. }
  478. void __init omap35xx_init_late(void)
  479. {
  480. omap_mux_late_init();
  481. omap2_common_pm_late_init();
  482. omap3_pm_init();
  483. }
  484. void __init omap3630_init_late(void)
  485. {
  486. omap_mux_late_init();
  487. omap2_common_pm_late_init();
  488. omap3_pm_init();
  489. }
  490. void __init am35xx_init_late(void)
  491. {
  492. omap_mux_late_init();
  493. omap2_common_pm_late_init();
  494. omap3_pm_init();
  495. }
  496. void __init ti81xx_init_late(void)
  497. {
  498. omap_mux_late_init();
  499. omap2_common_pm_late_init();
  500. omap3_pm_init();
  501. }
  502. #endif
  503. #ifdef CONFIG_SOC_AM33XX
  504. void __init am33xx_init_early(void)
  505. {
  506. omap2_set_globals_tap(AM335X_CLASS,
  507. AM33XX_L4_WK_IO_ADDRESS(AM33XX_TAP_BASE));
  508. omap2_set_globals_control(AM33XX_L4_WK_IO_ADDRESS(AM33XX_CTRL_BASE),
  509. NULL);
  510. omap2_set_globals_prm(AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE));
  511. omap2_set_globals_cm(AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE), NULL);
  512. omap3xxx_check_revision();
  513. ti81xx_check_features();
  514. omap_common_init_early();
  515. am33xx_voltagedomains_init();
  516. am33xx_powerdomains_init();
  517. am33xx_clockdomains_init();
  518. am33xx_hwmod_init();
  519. omap_hwmod_init_postsetup();
  520. am33xx_clk_init();
  521. }
  522. #endif
  523. #ifdef CONFIG_ARCH_OMAP4
  524. void __init omap4430_init_early(void)
  525. {
  526. omap2_set_globals_tap(OMAP443X_CLASS,
  527. OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE));
  528. omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE),
  529. OMAP2_L4_IO_ADDRESS(OMAP443X_CTRL_BASE));
  530. omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE));
  531. omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE),
  532. OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE));
  533. omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE));
  534. omap_prm_base_init();
  535. omap_cm_base_init();
  536. omap4xxx_check_revision();
  537. omap4xxx_check_features();
  538. omap_common_init_early();
  539. omap44xx_voltagedomains_init();
  540. omap44xx_powerdomains_init();
  541. omap44xx_clockdomains_init();
  542. omap44xx_hwmod_init();
  543. omap_hwmod_init_postsetup();
  544. omap4xxx_clk_init();
  545. }
  546. void __init omap4430_init_late(void)
  547. {
  548. omap_mux_late_init();
  549. omap2_common_pm_late_init();
  550. omap4_pm_init();
  551. }
  552. #endif
  553. #ifdef CONFIG_SOC_OMAP5
  554. void __init omap5_init_early(void)
  555. {
  556. omap2_set_globals_tap(OMAP54XX_CLASS,
  557. OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE));
  558. omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE),
  559. OMAP2_L4_IO_ADDRESS(OMAP54XX_CTRL_BASE));
  560. omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRM_BASE));
  561. omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_AON_BASE),
  562. OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_BASE));
  563. omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE));
  564. omap_prm_base_init();
  565. omap_cm_base_init();
  566. omap5xxx_check_revision();
  567. omap_common_init_early();
  568. }
  569. #endif
  570. void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
  571. struct omap_sdrc_params *sdrc_cs1)
  572. {
  573. omap_sram_init();
  574. if (cpu_is_omap24xx() || omap3_has_sdrc()) {
  575. omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
  576. _omap2_init_reprogram_sdrc();
  577. }
  578. }