vc44xx_data.c 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * OMAP4 Voltage Controller (VC) data
  3. *
  4. * Copyright (C) 2007, 2010 Texas Instruments, Inc.
  5. * Rajendra Nayak <rnayak@ti.com>
  6. * Lesly A M <x0080970@ti.com>
  7. * Thara Gopinath <thara@ti.com>
  8. *
  9. * Copyright (C) 2008, 2011 Nokia Corporation
  10. * Kalle Jokiniemi
  11. * Paul Walmsley
  12. *
  13. * This program is free software; you can redistribute it and/or modify
  14. * it under the terms of the GNU General Public License version 2 as
  15. * published by the Free Software Foundation.
  16. */
  17. #include <linux/io.h>
  18. #include <linux/err.h>
  19. #include <linux/init.h>
  20. #include "common.h"
  21. #include "prm44xx.h"
  22. #include "prm-regbits-44xx.h"
  23. #include "voltage.h"
  24. #include "vc.h"
  25. /*
  26. * VC data common to 44xx chips
  27. * XXX This stuff presumably belongs in the vc3xxx.c or vc.c file.
  28. */
  29. static const struct omap_vc_common omap4_vc_common = {
  30. .bypass_val_reg = OMAP4_PRM_VC_VAL_BYPASS_OFFSET,
  31. .data_shift = OMAP4430_DATA_SHIFT,
  32. .slaveaddr_shift = OMAP4430_SLAVEADDR_SHIFT,
  33. .regaddr_shift = OMAP4430_REGADDR_SHIFT,
  34. .valid = OMAP4430_VALID_MASK,
  35. .cmd_on_shift = OMAP4430_ON_SHIFT,
  36. .cmd_on_mask = OMAP4430_ON_MASK,
  37. .cmd_onlp_shift = OMAP4430_ONLP_SHIFT,
  38. .cmd_ret_shift = OMAP4430_RET_SHIFT,
  39. .cmd_off_shift = OMAP4430_OFF_SHIFT,
  40. .i2c_cfg_reg = OMAP4_PRM_VC_CFG_I2C_MODE_OFFSET,
  41. .i2c_cfg_clear_mask = OMAP4430_SRMODEEN_MASK | OMAP4430_HSMODEEN_MASK,
  42. .i2c_cfg_hsen_mask = OMAP4430_HSMODEEN_MASK,
  43. .i2c_mcode_mask = OMAP4430_HSMCODE_MASK,
  44. };
  45. /* VC instance data for each controllable voltage line */
  46. struct omap_vc_channel omap4_vc_mpu = {
  47. .flags = OMAP_VC_CHANNEL_DEFAULT | OMAP_VC_CHANNEL_CFG_MUTANT,
  48. .common = &omap4_vc_common,
  49. .smps_sa_reg = OMAP4_PRM_VC_SMPS_SA_OFFSET,
  50. .smps_volra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET,
  51. .smps_cmdra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_CMD_OFFSET,
  52. .cfg_channel_reg = OMAP4_PRM_VC_CFG_CHANNEL_OFFSET,
  53. .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_MPU_L_OFFSET,
  54. .smps_sa_mask = OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_MASK,
  55. .smps_volra_mask = OMAP4430_VOLRA_VDD_MPU_L_MASK,
  56. .smps_cmdra_mask = OMAP4430_CMDRA_VDD_MPU_L_MASK,
  57. .cfg_channel_sa_shift = OMAP4430_SA_VDD_MPU_L_SHIFT,
  58. };
  59. struct omap_vc_channel omap4_vc_iva = {
  60. .common = &omap4_vc_common,
  61. .smps_sa_reg = OMAP4_PRM_VC_SMPS_SA_OFFSET,
  62. .smps_volra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET,
  63. .smps_cmdra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_CMD_OFFSET,
  64. .cfg_channel_reg = OMAP4_PRM_VC_CFG_CHANNEL_OFFSET,
  65. .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_IVA_L_OFFSET,
  66. .smps_sa_mask = OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_MASK,
  67. .smps_volra_mask = OMAP4430_VOLRA_VDD_IVA_L_MASK,
  68. .smps_cmdra_mask = OMAP4430_CMDRA_VDD_IVA_L_MASK,
  69. .cfg_channel_sa_shift = OMAP4430_SA_VDD_IVA_L_SHIFT,
  70. };
  71. struct omap_vc_channel omap4_vc_core = {
  72. .common = &omap4_vc_common,
  73. .smps_sa_reg = OMAP4_PRM_VC_SMPS_SA_OFFSET,
  74. .smps_volra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET,
  75. .smps_cmdra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_CMD_OFFSET,
  76. .cfg_channel_reg = OMAP4_PRM_VC_CFG_CHANNEL_OFFSET,
  77. .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_CORE_L_OFFSET,
  78. .smps_sa_mask = OMAP4430_SA_VDD_CORE_L_0_6_MASK,
  79. .smps_volra_mask = OMAP4430_VOLRA_VDD_CORE_L_MASK,
  80. .smps_cmdra_mask = OMAP4430_CMDRA_VDD_CORE_L_MASK,
  81. .cfg_channel_sa_shift = OMAP4430_SA_VDD_CORE_L_SHIFT,
  82. };
  83. /*
  84. * Voltage levels for different operating modes: on, sleep, retention and off
  85. */
  86. #define OMAP4_ON_VOLTAGE_UV 1375000
  87. #define OMAP4_ONLP_VOLTAGE_UV 1375000
  88. #define OMAP4_RET_VOLTAGE_UV 837500
  89. #define OMAP4_OFF_VOLTAGE_UV 0
  90. struct omap_vc_param omap4_mpu_vc_data = {
  91. .on = OMAP4_ON_VOLTAGE_UV,
  92. .onlp = OMAP4_ONLP_VOLTAGE_UV,
  93. .ret = OMAP4_RET_VOLTAGE_UV,
  94. .off = OMAP4_OFF_VOLTAGE_UV,
  95. };
  96. struct omap_vc_param omap4_iva_vc_data = {
  97. .on = OMAP4_ON_VOLTAGE_UV,
  98. .onlp = OMAP4_ONLP_VOLTAGE_UV,
  99. .ret = OMAP4_RET_VOLTAGE_UV,
  100. .off = OMAP4_OFF_VOLTAGE_UV,
  101. };
  102. struct omap_vc_param omap4_core_vc_data = {
  103. .on = OMAP4_ON_VOLTAGE_UV,
  104. .onlp = OMAP4_ONLP_VOLTAGE_UV,
  105. .ret = OMAP4_RET_VOLTAGE_UV,
  106. .off = OMAP4_OFF_VOLTAGE_UV,
  107. };