common.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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 = OMAP2420_SDRC_BASE,
  40. .sms = OMAP2420_SMS_BASE,
  41. .ctrl = OMAP242X_CTRL_BASE,
  42. .prm = OMAP2420_PRM_BASE,
  43. .cm = OMAP2420_CM_BASE,
  44. };
  45. void __init omap2_set_globals_242x(void)
  46. {
  47. __omap2_set_globals(&omap242x_globals);
  48. }
  49. #endif
  50. #if defined(CONFIG_SOC_OMAP2430)
  51. static struct omap_globals omap243x_globals = {
  52. .class = OMAP243X_CLASS,
  53. .tap = OMAP2_L4_IO_ADDRESS(0x4900a000),
  54. .sdrc = OMAP243X_SDRC_BASE,
  55. .sms = OMAP243X_SMS_BASE,
  56. .ctrl = OMAP243X_CTRL_BASE,
  57. .prm = OMAP2430_PRM_BASE,
  58. .cm = OMAP2430_CM_BASE,
  59. };
  60. void __init omap2_set_globals_243x(void)
  61. {
  62. __omap2_set_globals(&omap243x_globals);
  63. }
  64. #endif
  65. #if defined(CONFIG_ARCH_OMAP3)
  66. static struct omap_globals omap3_globals = {
  67. .class = OMAP343X_CLASS,
  68. .tap = OMAP2_L4_IO_ADDRESS(0x4830A000),
  69. .sdrc = OMAP343X_SDRC_BASE,
  70. .sms = OMAP343X_SMS_BASE,
  71. .ctrl = OMAP343X_CTRL_BASE,
  72. .prm = OMAP3430_PRM_BASE,
  73. .cm = OMAP3430_CM_BASE,
  74. };
  75. void __init omap2_set_globals_3xxx(void)
  76. {
  77. __omap2_set_globals(&omap3_globals);
  78. }
  79. void __init omap3_map_io(void)
  80. {
  81. omap2_set_globals_3xxx();
  82. omap34xx_map_common_io();
  83. }
  84. /*
  85. * Adjust TAP register base such that omap3_check_revision accesses the correct
  86. * TI816X register for checking device ID (it adds 0x204 to tap base while
  87. * TI816X DEVICE ID register is at offset 0x600 from control base).
  88. */
  89. #define TI816X_TAP_BASE (TI816X_CTRL_BASE + \
  90. TI816X_CONTROL_DEVICE_ID - 0x204)
  91. static struct omap_globals ti816x_globals = {
  92. .class = OMAP343X_CLASS,
  93. .tap = OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
  94. .ctrl = TI816X_CTRL_BASE,
  95. .prm = TI816X_PRCM_BASE,
  96. .cm = TI816X_PRCM_BASE,
  97. };
  98. void __init omap2_set_globals_ti816x(void)
  99. {
  100. __omap2_set_globals(&ti816x_globals);
  101. }
  102. #endif
  103. #if defined(CONFIG_ARCH_OMAP4)
  104. static struct omap_globals omap4_globals = {
  105. .class = OMAP443X_CLASS,
  106. .tap = OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE),
  107. .ctrl = OMAP443X_SCM_BASE,
  108. .ctrl_pad = OMAP443X_CTRL_BASE,
  109. .prm = OMAP4430_PRM_BASE,
  110. .cm = OMAP4430_CM_BASE,
  111. .cm2 = OMAP4430_CM2_BASE,
  112. };
  113. void __init omap2_set_globals_443x(void)
  114. {
  115. omap2_set_globals_tap(&omap4_globals);
  116. omap2_set_globals_control(&omap4_globals);
  117. omap2_set_globals_prcm(&omap4_globals);
  118. }
  119. #endif