common.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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_ARCH_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. .uart1_phys = OMAP2_UART1_BASE,
  45. .uart2_phys = OMAP2_UART2_BASE,
  46. .uart3_phys = OMAP2_UART3_BASE,
  47. };
  48. void __init omap2_set_globals_242x(void)
  49. {
  50. __omap2_set_globals(&omap242x_globals);
  51. }
  52. #endif
  53. #if defined(CONFIG_ARCH_OMAP2430)
  54. static struct omap_globals omap243x_globals = {
  55. .class = OMAP243X_CLASS,
  56. .tap = OMAP2_L4_IO_ADDRESS(0x4900a000),
  57. .sdrc = OMAP243X_SDRC_BASE,
  58. .sms = OMAP243X_SMS_BASE,
  59. .ctrl = OMAP243X_CTRL_BASE,
  60. .prm = OMAP2430_PRM_BASE,
  61. .cm = OMAP2430_CM_BASE,
  62. .uart1_phys = OMAP2_UART1_BASE,
  63. .uart2_phys = OMAP2_UART2_BASE,
  64. .uart3_phys = OMAP2_UART3_BASE,
  65. };
  66. void __init omap2_set_globals_243x(void)
  67. {
  68. __omap2_set_globals(&omap243x_globals);
  69. }
  70. #endif
  71. #if defined(CONFIG_ARCH_OMAP3)
  72. static struct omap_globals omap3_globals = {
  73. .class = OMAP343X_CLASS,
  74. .tap = OMAP2_L4_IO_ADDRESS(0x4830A000),
  75. .sdrc = OMAP343X_SDRC_BASE,
  76. .sms = OMAP343X_SMS_BASE,
  77. .ctrl = OMAP343X_CTRL_BASE,
  78. .prm = OMAP3430_PRM_BASE,
  79. .cm = OMAP3430_CM_BASE,
  80. .uart1_phys = OMAP3_UART1_BASE,
  81. .uart2_phys = OMAP3_UART2_BASE,
  82. .uart3_phys = OMAP3_UART3_BASE,
  83. .uart4_phys = OMAP3_UART4_BASE, /* Only on 3630 */
  84. };
  85. void __init omap2_set_globals_3xxx(void)
  86. {
  87. __omap2_set_globals(&omap3_globals);
  88. }
  89. void __init omap3_map_io(void)
  90. {
  91. omap2_set_globals_3xxx();
  92. omap34xx_map_common_io();
  93. }
  94. #endif
  95. #if defined(CONFIG_ARCH_OMAP4)
  96. static struct omap_globals omap4_globals = {
  97. .class = OMAP443X_CLASS,
  98. .tap = OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE),
  99. .ctrl = OMAP443X_SCM_BASE,
  100. .ctrl_pad = OMAP443X_CTRL_BASE,
  101. .prm = OMAP4430_PRM_BASE,
  102. .cm = OMAP4430_CM_BASE,
  103. .cm2 = OMAP4430_CM2_BASE,
  104. .uart1_phys = OMAP4_UART1_BASE,
  105. .uart2_phys = OMAP4_UART2_BASE,
  106. .uart3_phys = OMAP4_UART3_BASE,
  107. .uart4_phys = OMAP4_UART4_BASE,
  108. };
  109. void __init omap2_set_globals_443x(void)
  110. {
  111. omap2_set_globals_tap(&omap4_globals);
  112. omap2_set_globals_control(&omap4_globals);
  113. omap2_set_globals_prcm(&omap4_globals);
  114. }
  115. #endif