prm3xxx.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /*
  2. * OMAP3xxx Power/Reset Management (PRM) register definitions
  3. *
  4. * Copyright (C) 2007-2009, 2011-2012 Texas Instruments, Inc.
  5. * Copyright (C) 2008-2010 Nokia Corporation
  6. * Paul Walmsley
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. * The PRM hardware modules on the OMAP2/3 are quite similar to each
  13. * other. The PRM on OMAP4 has a new register layout, and is handled
  14. * in a separate file.
  15. */
  16. #ifndef __ARCH_ARM_MACH_OMAP2_PRM3XXX_H
  17. #define __ARCH_ARM_MACH_OMAP2_PRM3XXX_H
  18. #include "prcm-common.h"
  19. #include "prm.h"
  20. #include "prm2xxx_3xxx.h"
  21. #define OMAP34XX_PRM_REGADDR(module, reg) \
  22. OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg))
  23. /*
  24. * OMAP3-specific global PRM registers
  25. * Use {read,write}l_relaxed() with these registers.
  26. *
  27. * With a few exceptions, these are the register names beginning with
  28. * PRM_* on 34xx. (The exceptions are the IRQSTATUS and IRQENABLE
  29. * bits.)
  30. */
  31. #define OMAP3_PRM_REVISION_OFFSET 0x0004
  32. #define OMAP3430_PRM_REVISION OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0004)
  33. #define OMAP3_PRM_SYSCONFIG_OFFSET 0x0014
  34. #define OMAP3430_PRM_SYSCONFIG OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0014)
  35. #define OMAP3_PRM_IRQSTATUS_MPU_OFFSET 0x0018
  36. #define OMAP3430_PRM_IRQSTATUS_MPU OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0018)
  37. #define OMAP3_PRM_IRQENABLE_MPU_OFFSET 0x001c
  38. #define OMAP3430_PRM_IRQENABLE_MPU OMAP34XX_PRM_REGADDR(OCP_MOD, 0x001c)
  39. #define OMAP3_PRM_VC_SMPS_SA_OFFSET 0x0020
  40. #define OMAP3430_PRM_VC_SMPS_SA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0020)
  41. #define OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET 0x0024
  42. #define OMAP3430_PRM_VC_SMPS_VOL_RA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0024)
  43. #define OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET 0x0028
  44. #define OMAP3430_PRM_VC_SMPS_CMD_RA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0028)
  45. #define OMAP3_PRM_VC_CMD_VAL_0_OFFSET 0x002c
  46. #define OMAP3430_PRM_VC_CMD_VAL_0 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x002c)
  47. #define OMAP3_PRM_VC_CMD_VAL_1_OFFSET 0x0030
  48. #define OMAP3430_PRM_VC_CMD_VAL_1 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0030)
  49. #define OMAP3_PRM_VC_CH_CONF_OFFSET 0x0034
  50. #define OMAP3430_PRM_VC_CH_CONF OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0034)
  51. #define OMAP3_PRM_VC_I2C_CFG_OFFSET 0x0038
  52. #define OMAP3430_PRM_VC_I2C_CFG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0038)
  53. #define OMAP3_PRM_VC_BYPASS_VAL_OFFSET 0x003c
  54. #define OMAP3430_PRM_VC_BYPASS_VAL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x003c)
  55. #define OMAP3_PRM_RSTCTRL_OFFSET 0x0050
  56. #define OMAP3430_PRM_RSTCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0050)
  57. #define OMAP3_PRM_RSTTIME_OFFSET 0x0054
  58. #define OMAP3430_PRM_RSTTIME OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0054)
  59. #define OMAP3_PRM_RSTST_OFFSET 0x0058
  60. #define OMAP3430_PRM_RSTST OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0058)
  61. #define OMAP3_PRM_VOLTCTRL_OFFSET 0x0060
  62. #define OMAP3430_PRM_VOLTCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0060)
  63. #define OMAP3_PRM_SRAM_PCHARGE_OFFSET 0x0064
  64. #define OMAP3430_PRM_SRAM_PCHARGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0064)
  65. #define OMAP3_PRM_CLKSRC_CTRL_OFFSET 0x0070
  66. #define OMAP3430_PRM_CLKSRC_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0070)
  67. #define OMAP3_PRM_VOLTSETUP1_OFFSET 0x0090
  68. #define OMAP3430_PRM_VOLTSETUP1 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0090)
  69. #define OMAP3_PRM_VOLTOFFSET_OFFSET 0x0094
  70. #define OMAP3430_PRM_VOLTOFFSET OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0094)
  71. #define OMAP3_PRM_CLKSETUP_OFFSET 0x0098
  72. #define OMAP3430_PRM_CLKSETUP OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0098)
  73. #define OMAP3_PRM_POLCTRL_OFFSET 0x009c
  74. #define OMAP3430_PRM_POLCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x009c)
  75. #define OMAP3_PRM_VOLTSETUP2_OFFSET 0x00a0
  76. #define OMAP3430_PRM_VOLTSETUP2 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00a0)
  77. #define OMAP3_PRM_VP1_CONFIG_OFFSET 0x00b0
  78. #define OMAP3430_PRM_VP1_CONFIG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b0)
  79. #define OMAP3_PRM_VP1_VSTEPMIN_OFFSET 0x00b4
  80. #define OMAP3430_PRM_VP1_VSTEPMIN OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b4)
  81. #define OMAP3_PRM_VP1_VSTEPMAX_OFFSET 0x00b8
  82. #define OMAP3430_PRM_VP1_VSTEPMAX OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b8)
  83. #define OMAP3_PRM_VP1_VLIMITTO_OFFSET 0x00bc
  84. #define OMAP3430_PRM_VP1_VLIMITTO OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00bc)
  85. #define OMAP3_PRM_VP1_VOLTAGE_OFFSET 0x00c0
  86. #define OMAP3430_PRM_VP1_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c0)
  87. #define OMAP3_PRM_VP1_STATUS_OFFSET 0x00c4
  88. #define OMAP3430_PRM_VP1_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c4)
  89. #define OMAP3_PRM_VP2_CONFIG_OFFSET 0x00d0
  90. #define OMAP3430_PRM_VP2_CONFIG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d0)
  91. #define OMAP3_PRM_VP2_VSTEPMIN_OFFSET 0x00d4
  92. #define OMAP3430_PRM_VP2_VSTEPMIN OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d4)
  93. #define OMAP3_PRM_VP2_VSTEPMAX_OFFSET 0x00d8
  94. #define OMAP3430_PRM_VP2_VSTEPMAX OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d8)
  95. #define OMAP3_PRM_VP2_VLIMITTO_OFFSET 0x00dc
  96. #define OMAP3430_PRM_VP2_VLIMITTO OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00dc)
  97. #define OMAP3_PRM_VP2_VOLTAGE_OFFSET 0x00e0
  98. #define OMAP3430_PRM_VP2_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e0)
  99. #define OMAP3_PRM_VP2_STATUS_OFFSET 0x00e4
  100. #define OMAP3430_PRM_VP2_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e4)
  101. #define OMAP3_PRM_CLKSEL_OFFSET 0x0040
  102. #define OMAP3430_PRM_CLKSEL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0040)
  103. #define OMAP3_PRM_CLKOUT_CTRL_OFFSET 0x0070
  104. #define OMAP3430_PRM_CLKOUT_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
  105. /* OMAP3 specific register offsets */
  106. #define OMAP3430ES2_PM_WKEN3 0x00f0
  107. #define OMAP3430ES2_PM_WKST3 0x00b8
  108. #define OMAP3430_PM_MPUGRPSEL 0x00a4
  109. #define OMAP3430_PM_MPUGRPSEL1 OMAP3430_PM_MPUGRPSEL
  110. #define OMAP3430ES2_PM_MPUGRPSEL3 0x00f8
  111. #define OMAP3430_PM_IVAGRPSEL 0x00a8
  112. #define OMAP3430_PM_IVAGRPSEL1 OMAP3430_PM_IVAGRPSEL
  113. #define OMAP3430ES2_PM_IVAGRPSEL3 0x00f4
  114. #define OMAP3430_PM_PREPWSTST 0x00e8
  115. #define OMAP3430_PRM_IRQSTATUS_IVA2 0x00f8
  116. #define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc
  117. #ifndef __ASSEMBLER__
  118. /*
  119. * OMAP3 access functions for voltage controller (VC) and
  120. * voltage proccessor (VP) in the PRM.
  121. */
  122. extern u32 omap3_prm_vcvp_read(u8 offset);
  123. extern void omap3_prm_vcvp_write(u32 val, u8 offset);
  124. extern u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset);
  125. int __init omap3xxx_prm_init(const struct omap_prcm_init_data *data);
  126. void omap3xxx_prm_iva_idle(void);
  127. void omap3_prm_reset_modem(void);
  128. int omap3xxx_prm_clear_global_cold_reset(void);
  129. void omap3_prm_save_scratchpad_contents(u32 *ptr);
  130. void omap3_prm_init_pm(bool has_uart4, bool has_iva);
  131. #endif /* __ASSEMBLER */
  132. #endif