io.c 15 KB

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