vc3xxx_data.c 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * OMAP3 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 "prm-regbits-34xx.h"
  22. #include "voltage.h"
  23. #include "vc.h"
  24. /*
  25. * VC data common to 34xx/36xx chips
  26. * XXX This stuff presumably belongs in the vc3xxx.c or vc.c file.
  27. */
  28. static struct omap_vc_common omap3_vc_common = {
  29. .bypass_val_reg = OMAP3_PRM_VC_BYPASS_VAL_OFFSET,
  30. .data_shift = OMAP3430_DATA_SHIFT,
  31. .slaveaddr_shift = OMAP3430_SLAVEADDR_SHIFT,
  32. .regaddr_shift = OMAP3430_REGADDR_SHIFT,
  33. .valid = OMAP3430_VALID_MASK,
  34. .cmd_on_shift = OMAP3430_VC_CMD_ON_SHIFT,
  35. .cmd_on_mask = OMAP3430_VC_CMD_ON_MASK,
  36. .cmd_onlp_shift = OMAP3430_VC_CMD_ONLP_SHIFT,
  37. .cmd_ret_shift = OMAP3430_VC_CMD_RET_SHIFT,
  38. .cmd_off_shift = OMAP3430_VC_CMD_OFF_SHIFT,
  39. .i2c_cfg_clear_mask = OMAP3430_SREN_MASK | OMAP3430_HSEN_MASK,
  40. .i2c_cfg_hsen_mask = OMAP3430_HSEN_MASK,
  41. .i2c_cfg_reg = OMAP3_PRM_VC_I2C_CFG_OFFSET,
  42. .i2c_mcode_mask = OMAP3430_MCODE_MASK,
  43. };
  44. struct omap_vc_channel omap3_vc_mpu = {
  45. .flags = OMAP_VC_CHANNEL_DEFAULT,
  46. .common = &omap3_vc_common,
  47. .smps_sa_reg = OMAP3_PRM_VC_SMPS_SA_OFFSET,
  48. .smps_volra_reg = OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET,
  49. .smps_cmdra_reg = OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET,
  50. .cfg_channel_reg = OMAP3_PRM_VC_CH_CONF_OFFSET,
  51. .cmdval_reg = OMAP3_PRM_VC_CMD_VAL_0_OFFSET,
  52. .smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA0_MASK,
  53. .smps_volra_mask = OMAP3430_VOLRA0_MASK,
  54. .smps_cmdra_mask = OMAP3430_CMDRA0_MASK,
  55. .cfg_channel_sa_shift = OMAP3430_PRM_VC_SMPS_SA_SA0_SHIFT,
  56. };
  57. struct omap_vc_channel omap3_vc_core = {
  58. .common = &omap3_vc_common,
  59. .smps_sa_reg = OMAP3_PRM_VC_SMPS_SA_OFFSET,
  60. .smps_volra_reg = OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET,
  61. .smps_cmdra_reg = OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET,
  62. .cfg_channel_reg = OMAP3_PRM_VC_CH_CONF_OFFSET,
  63. .cmdval_reg = OMAP3_PRM_VC_CMD_VAL_1_OFFSET,
  64. .smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA1_MASK,
  65. .smps_volra_mask = OMAP3430_VOLRA1_MASK,
  66. .smps_cmdra_mask = OMAP3430_CMDRA1_MASK,
  67. .cfg_channel_sa_shift = OMAP3430_PRM_VC_SMPS_SA_SA1_SHIFT,
  68. };
  69. /*
  70. * Voltage levels for different operating modes: on, sleep, retention and off
  71. */
  72. #define OMAP3_ON_VOLTAGE_UV 1200000
  73. #define OMAP3_ONLP_VOLTAGE_UV 1000000
  74. #define OMAP3_RET_VOLTAGE_UV 975000
  75. #define OMAP3_OFF_VOLTAGE_UV 600000
  76. struct omap_vc_param omap3_mpu_vc_data = {
  77. .on = OMAP3_ON_VOLTAGE_UV,
  78. .onlp = OMAP3_ONLP_VOLTAGE_UV,
  79. .ret = OMAP3_RET_VOLTAGE_UV,
  80. .off = OMAP3_OFF_VOLTAGE_UV,
  81. };
  82. struct omap_vc_param omap3_core_vc_data = {
  83. .on = OMAP3_ON_VOLTAGE_UV,
  84. .onlp = OMAP3_ONLP_VOLTAGE_UV,
  85. .ret = OMAP3_RET_VOLTAGE_UV,
  86. .off = OMAP3_OFF_VOLTAGE_UV,
  87. };