io.c 14 KB

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