board-m6ref-power.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. #ifndef __LINUX_AXP_CFG_H_
  2. #define __LINUX_AXP_CFG_H_
  3. #include <mach/irqs.h>
  4. #define AXP18_ADDR 0x2C >> 1
  5. #define AXP19_ADDR 0x68 >> 1
  6. #define AXP20_ADDR 0x68 >> 1
  7. #define AXP18_I2CBUS 1
  8. #define AXP19_I2CBUS 0
  9. #define AXP20_I2CBUS 2
  10. #define BATRDC 150 //initial rdc
  11. #define AXP20_IRQNO INT_WATCHDOG //0 smp irq number base change to 32
  12. #define LDO1SET 0 //0: LDO1SET connect AGND, 1: LDO1SET connect AIPS, for axp189 LDOSET bonding to AGND
  13. #define DC2SET 1 //0: DC2SET connect GND, 1: DC2SET connect IPSOUT, for axp189 DC2SET bonding to IPSOUT
  14. #define DC3SET 1 //0:DC3SET connect GND, 1:DC3SET connect IPSOUT ,for axp189 DC3SET to pin
  15. #define AXP19LDO1 1250
  16. #define AXP20LDO1 1300
  17. #if !LDO1SET
  18. #define LDO1MIN 1250
  19. #define LDO1MAX 1250
  20. #else
  21. #define LDO1MIN 3300
  22. #define LDO1MAX 3300
  23. #endif
  24. #if DC2SET
  25. #define DCDC2MIN 800
  26. #define DCDC2MAX 1400
  27. #else
  28. #define DCDC2MIN 1400
  29. #define DCDC2MAX 2000
  30. #endif
  31. #if DC3SET
  32. #define DCDC3MIN 2000
  33. #define DCDC3MAX 2700
  34. #define LDO3MIN 1600
  35. #define LDO3MAX 1900
  36. #else
  37. #define DCDC3MIN 1300
  38. #define DCDC3MAX 1900
  39. #define LDO3MIN 2300
  40. #define LDO3MAX 2600
  41. #endif
  42. #define AXP18_VOL_MAX 50//1200
  43. #define AXP18_TIME_MAX 20//100
  44. #define AXP18_RDC_COUNT 10
  45. #define CHG_RDC_RATE 20//100
  46. #define DISCHARGE_CUR_RATE 10
  47. #define MAX_BAT_CUR 15
  48. #define DISCHARGE_RDC_CAL 53
  49. #define AXP19_VOL_MAX 50
  50. #define AXP19_TIME_MAX 20
  51. #define AXP19_AVER_MAX 10
  52. #define AXP19_RDC_COUNT 10
  53. #define AXP20_VOL_MAX 12 // capability buffer length
  54. #define AXP20_TIME_MAX 20
  55. #define AXP20_AVER_MAX 10
  56. #define AXP20_RDC_COUNT 10
  57. #define ABS(x) ((x) >0 ? (x) : -(x) )
  58. #define END_VOLTAGE_APS 3350
  59. #define BAT_AVER_VOL 3820 //Aver Vol:3.82V
  60. #define FUELGUAGE_LOW_VOL 3400 //<3.4v,2%
  61. #define FUELGUAGE_VOL1 3500 //<3.5v,3%
  62. #define FUELGUAGE_VOL2 3600
  63. #define FUELGUAGE_VOL3 3700
  64. #define FUELGUAGE_VOL4 3800
  65. #define FUELGUAGE_VOL5 3900
  66. #define FUELGUAGE_VOL6 4000
  67. #define FUELGUAGE_VOL7 4100
  68. #define FUELGUAGE_TOP_VOL 4160 //>4.16v,100%
  69. #define FUELGUAGE_LOW_LEVEL 2 //<3.4v,2%
  70. #define FUELGUAGE_LEVEL1 3 //<3.5v,3%
  71. #define FUELGUAGE_LEVEL2 5
  72. #define FUELGUAGE_LEVEL3 16
  73. #define FUELGUAGE_LEVEL4 46
  74. #define FUELGUAGE_LEVEL5 66
  75. #define FUELGUAGE_LEVEL6 83
  76. #define FUELGUAGE_LEVEL7 93
  77. #define FUELGUAGE_TOP_LEVEL 100 //>4.16v,100%
  78. #define INTLDO4 2800000 //initial ldo4 voltage
  79. #define INIT_RDC 150 //initial rdc
  80. #define TIMER 20 //axp19 renew capability time
  81. #define BATTERYCAP 3400 //battery capability
  82. #define RENEW_TIME 10 //axp20 renew capability time
  83. #define INTCHGCUR 500000 //set initial charging current limite
  84. #define SUSCHGCUR 1000000 //set suspend charging current limite
  85. #define RESCHGCUR INTCHGCUR //set resume charging current limite
  86. #define CLSCHGCUR SUSCHGCUR //set shutdown charging current limite
  87. #define INTCHGVOL 4200000 //set initial charing target voltage
  88. #define INTCHGENDRATE 10 //set initial charing end current rate
  89. #define INTCHGENABLED 1 //set initial charing enabled
  90. #define INTADCFREQ 25 //set initial adc frequency
  91. #define INTADCFREQC 100 //set initial coulomb adc coufrequency
  92. #define INTCHGPRETIME 50 //set initial pre-charging time
  93. #define INTCHGCSTTIME 480 //set initial pre-charging time
  94. #define BATMAXVOL 4200000 //set battery max design volatge
  95. #define BATMINVOL 3500000 //set battery min design volatge
  96. #define OCVREG0 0 //3.1328
  97. #define OCVREG1 0 //3.2736
  98. #define OCVREG2 0 //3.4144
  99. #define OCVREG3 0 //3.5552
  100. #define OCVREG4 0 //3.6256
  101. #define OCVREG5 1 //3.6608
  102. #define OCVREG6 8 //3.6960
  103. #define OCVREG7 13 //3.7312
  104. #define OCVREG8 22 //3.7664
  105. #define OCVREG9 41 //3.8016
  106. #define OCVREGA 52 //3.8368
  107. #define OCVREGB 57 //3.8720
  108. #define OCVREGC 71 //3.9424
  109. #define OCVREGD 82 //4.0128
  110. #define OCVREGE 90 //4.0832
  111. #define OCVREGF 99 //4.1536
  112. extern struct axp_cfg_info *axp_cfg_board;
  113. #endif