common.c 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. * linux/arch/arm/mach-omap2/common.c
  3. *
  4. * Code common to all OMAP2+ machines.
  5. *
  6. * Copyright (C) 2009 Texas Instruments
  7. * Copyright (C) 2010 Nokia Corporation
  8. * Tony Lindgren <tony@atomide.com>
  9. * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. */
  15. #include <linux/kernel.h>
  16. #include <linux/init.h>
  17. #include <linux/clk.h>
  18. #include <linux/io.h>
  19. #include <plat/common.h>
  20. #include <plat/board.h>
  21. #include <plat/mux.h>
  22. #include <plat/clock.h>
  23. #include "sdrc.h"
  24. #include "control.h"
  25. /* Global address base setup code */
  26. #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
  27. static void __init __omap2_set_globals(struct omap_globals *omap2_globals)
  28. {
  29. omap2_set_globals_tap(omap2_globals);
  30. omap2_set_globals_sdrc(omap2_globals);
  31. omap2_set_globals_control(omap2_globals);
  32. omap2_set_globals_prcm(omap2_globals);
  33. }
  34. #endif
  35. #if defined(CONFIG_SOC_OMAP2420)
  36. static struct omap_globals omap242x_globals = {
  37. .class = OMAP242X_CLASS,
  38. .tap = OMAP2_L4_IO_ADDRESS(0x48014000),
  39. .sdrc = OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE),
  40. .sms = OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE),
  41. .ctrl = OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE),
  42. .prm = OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE),
  43. .cm = OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE),
  44. };
  45. void __init omap2_set_globals_242x(void)
  46. {
  47. __omap2_set_globals(&omap242x_globals);
  48. }
  49. void __init omap242x_map_io(void)
  50. {
  51. omap242x_map_common_io();
  52. }
  53. #endif
  54. #if defined(CONFIG_SOC_OMAP2430)
  55. static struct omap_globals omap243x_globals = {
  56. .class = OMAP243X_CLASS,
  57. .tap = OMAP2_L4_IO_ADDRESS(0x4900a000),
  58. .sdrc = OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE),
  59. .sms = OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE),
  60. .ctrl = OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE),
  61. .prm = OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE),
  62. .cm = OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE),
  63. };
  64. void __init omap2_set_globals_243x(void)
  65. {
  66. __omap2_set_globals(&omap243x_globals);
  67. }
  68. void __init omap243x_map_io(void)
  69. {
  70. omap243x_map_common_io();
  71. }
  72. #endif
  73. #if defined(CONFIG_ARCH_OMAP3)
  74. static struct omap_globals omap3_globals = {
  75. .class = OMAP343X_CLASS,
  76. .tap = OMAP2_L4_IO_ADDRESS(0x4830A000),
  77. .sdrc = OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE),
  78. .sms = OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE),
  79. .ctrl = OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
  80. .prm = OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE),
  81. .cm = OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE),
  82. };
  83. void __init omap2_set_globals_3xxx(void)
  84. {
  85. __omap2_set_globals(&omap3_globals);
  86. }
  87. void __init omap3_map_io(void)
  88. {
  89. omap34xx_map_common_io();
  90. }
  91. /*
  92. * Adjust TAP register base such that omap3_check_revision accesses the correct
  93. * TI816X register for checking device ID (it adds 0x204 to tap base while
  94. * TI816X DEVICE ID register is at offset 0x600 from control base).
  95. */
  96. #define TI816X_TAP_BASE (TI816X_CTRL_BASE + \
  97. TI816X_CONTROL_DEVICE_ID - 0x204)
  98. static struct omap_globals ti816x_globals = {
  99. .class = OMAP343X_CLASS,
  100. .tap = OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
  101. .ctrl = OMAP2_L4_IO_ADDRESS(TI816X_CTRL_BASE),
  102. .prm = OMAP2_L4_IO_ADDRESS(TI816X_PRCM_BASE),
  103. .cm = OMAP2_L4_IO_ADDRESS(TI816X_PRCM_BASE),
  104. };
  105. void __init omap2_set_globals_ti816x(void)
  106. {
  107. __omap2_set_globals(&ti816x_globals);
  108. }
  109. #endif
  110. #if defined(CONFIG_ARCH_OMAP4)
  111. static struct omap_globals omap4_globals = {
  112. .class = OMAP443X_CLASS,
  113. .tap = OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE),
  114. .ctrl = OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE),
  115. .ctrl_pad = OMAP2_L4_IO_ADDRESS(OMAP443X_CTRL_BASE),
  116. .prm = OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE),
  117. .cm = OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE),
  118. .cm2 = OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE),
  119. };
  120. void __init omap2_set_globals_443x(void)
  121. {
  122. omap2_set_globals_tap(&omap4_globals);
  123. omap2_set_globals_control(&omap4_globals);
  124. omap2_set_globals_prcm(&omap4_globals);
  125. }
  126. void __init omap4_map_io(void)
  127. {
  128. omap44xx_map_common_io();
  129. }
  130. #endif