io.c 15 KB

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