pmbus.rst 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. Kernel driver pmbus
  2. ===================
  3. Supported chips:
  4. * Flex BMR310, BMR453, BMR454, BMR456, BMR457, BMR458, BMR480,
  5. BMR490, BMR491, BMR492
  6. Prefixes: 'bmr310', 'bmr453', 'bmr454', 'bmr456', 'bmr457', 'bmr458', 'bmr480',
  7. 'bmr490', 'bmr491', 'bmr492'
  8. Addresses scanned: -
  9. Datasheets:
  10. https://flexpowermodules.com/products
  11. * ON Semiconductor ADP4000, NCP4200, NCP4208
  12. Prefixes: 'adp4000', 'ncp4200', 'ncp4208'
  13. Addresses scanned: -
  14. Datasheets:
  15. https://www.onsemi.com/pub_link/Collateral/ADP4000-D.PDF
  16. https://www.onsemi.com/pub_link/Collateral/NCP4200-D.PDF
  17. https://www.onsemi.com/pub_link/Collateral/JUNE%202009-%20REV.%200.PDF
  18. * Lineage Power
  19. Prefixes: 'mdt040', 'pdt003', 'pdt006', 'pdt012', 'udt020'
  20. Addresses scanned: -
  21. Datasheets:
  22. http://www.lineagepower.com/oem/pdf/PDT003A0X.pdf
  23. http://www.lineagepower.com/oem/pdf/PDT006A0X.pdf
  24. http://www.lineagepower.com/oem/pdf/PDT012A0X.pdf
  25. http://www.lineagepower.com/oem/pdf/UDT020A0X.pdf
  26. http://www.lineagepower.com/oem/pdf/MDT040A0X.pdf
  27. * Texas Instruments TPS40400, TPS544B20, TPS544B25, TPS544C20, TPS544C25
  28. Prefixes: 'tps40400', 'tps544b20', 'tps544b25', 'tps544c20', 'tps544c25'
  29. Addresses scanned: -
  30. Datasheets:
  31. https://www.ti.com/lit/gpn/tps40400
  32. https://www.ti.com/lit/gpn/tps544b20
  33. https://www.ti.com/lit/gpn/tps544b25
  34. https://www.ti.com/lit/gpn/tps544c20
  35. https://www.ti.com/lit/gpn/tps544c25
  36. * Maxim MAX20796
  37. Prefix: 'max20796'
  38. Addresses scanned: -
  39. Datasheet:
  40. Not published
  41. * Generic PMBus devices
  42. Prefix: 'pmbus'
  43. Addresses scanned: -
  44. Datasheet: n.a.
  45. Author: Guenter Roeck <[email protected]>
  46. Description
  47. -----------
  48. This driver supports hardware monitoring for various PMBus compliant devices.
  49. It supports voltage, current, power, and temperature sensors as supported
  50. by the device.
  51. Each monitored channel has its own high and low limits, plus a critical
  52. limit.
  53. Fan support will be added in a later version of this driver.
  54. Usage Notes
  55. -----------
  56. This driver does not probe for PMBus devices, since there is no register
  57. which can be safely used to identify the chip (The MFG_ID register is not
  58. supported by all chips), and since there is no well defined address range for
  59. PMBus devices. You will have to instantiate the devices explicitly.
  60. Example: the following will load the driver for an LTC2978 at address 0x60
  61. on I2C bus #1::
  62. $ modprobe pmbus
  63. $ echo ltc2978 0x60 > /sys/bus/i2c/devices/i2c-1/new_device
  64. Platform data support
  65. ---------------------
  66. Support for additional PMBus chips can be added by defining chip parameters in
  67. a new chip specific driver file. For example, (untested) code to add support for
  68. Emerson DS1200 power modules might look as follows::
  69. static struct pmbus_driver_info ds1200_info = {
  70. .pages = 1,
  71. /* Note: All other sensors are in linear mode */
  72. .direct[PSC_VOLTAGE_OUT] = true,
  73. .direct[PSC_TEMPERATURE] = true,
  74. .direct[PSC_CURRENT_OUT] = true,
  75. .m[PSC_VOLTAGE_IN] = 1,
  76. .b[PSC_VOLTAGE_IN] = 0,
  77. .R[PSC_VOLTAGE_IN] = 3,
  78. .m[PSC_VOLTAGE_OUT] = 1,
  79. .b[PSC_VOLTAGE_OUT] = 0,
  80. .R[PSC_VOLTAGE_OUT] = 3,
  81. .m[PSC_TEMPERATURE] = 1,
  82. .b[PSC_TEMPERATURE] = 0,
  83. .R[PSC_TEMPERATURE] = 3,
  84. .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN | PMBUS_HAVE_STATUS_INPUT
  85. | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
  86. | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
  87. | PMBUS_HAVE_PIN | PMBUS_HAVE_POUT
  88. | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP
  89. | PMBUS_HAVE_FAN12 | PMBUS_HAVE_STATUS_FAN12,
  90. };
  91. static int ds1200_probe(struct i2c_client *client)
  92. {
  93. return pmbus_do_probe(client, &ds1200_info);
  94. }
  95. static const struct i2c_device_id ds1200_id[] = {
  96. {"ds1200", 0},
  97. {}
  98. };
  99. MODULE_DEVICE_TABLE(i2c, ds1200_id);
  100. /* This is the driver that will be inserted */
  101. static struct i2c_driver ds1200_driver = {
  102. .driver = {
  103. .name = "ds1200",
  104. },
  105. .probe_new = ds1200_probe,
  106. .id_table = ds1200_id,
  107. };
  108. static int __init ds1200_init(void)
  109. {
  110. return i2c_add_driver(&ds1200_driver);
  111. }
  112. static void __exit ds1200_exit(void)
  113. {
  114. i2c_del_driver(&ds1200_driver);
  115. }
  116. Sysfs entries
  117. -------------
  118. When probing the chip, the driver identifies which PMBus registers are
  119. supported, and determines available sensors from this information.
  120. Attribute files only exist if respective sensors are supported by the chip.
  121. Labels are provided to inform the user about the sensor associated with
  122. a given sysfs entry.
  123. The following attributes are supported. Limits are read-write; all other
  124. attributes are read-only.
  125. ======================= ========================================================
  126. inX_input Measured voltage. From READ_VIN or READ_VOUT register.
  127. inX_min Minimum Voltage.
  128. From VIN_UV_WARN_LIMIT or VOUT_UV_WARN_LIMIT register.
  129. inX_max Maximum voltage.
  130. From VIN_OV_WARN_LIMIT or VOUT_OV_WARN_LIMIT register.
  131. inX_lcrit Critical minimum Voltage.
  132. From VIN_UV_FAULT_LIMIT or VOUT_UV_FAULT_LIMIT register.
  133. inX_crit Critical maximum voltage.
  134. From VIN_OV_FAULT_LIMIT or VOUT_OV_FAULT_LIMIT register.
  135. inX_min_alarm Voltage low alarm. From VOLTAGE_UV_WARNING status.
  136. inX_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status.
  137. inX_lcrit_alarm Voltage critical low alarm.
  138. From VOLTAGE_UV_FAULT status.
  139. inX_crit_alarm Voltage critical high alarm.
  140. From VOLTAGE_OV_FAULT status.
  141. inX_label "vin", "vcap", or "voutY"
  142. inX_rated_min Minimum rated voltage.
  143. From MFR_VIN_MIN or MFR_VOUT_MIN register.
  144. inX_rated_max Maximum rated voltage.
  145. From MFR_VIN_MAX or MFR_VOUT_MAX register.
  146. currX_input Measured current. From READ_IIN or READ_IOUT register.
  147. currX_max Maximum current.
  148. From IIN_OC_WARN_LIMIT or IOUT_OC_WARN_LIMIT register.
  149. currX_lcrit Critical minimum output current.
  150. From IOUT_UC_FAULT_LIMIT register.
  151. currX_crit Critical maximum current.
  152. From IIN_OC_FAULT_LIMIT or IOUT_OC_FAULT_LIMIT register.
  153. currX_alarm Current high alarm.
  154. From IIN_OC_WARNING or IOUT_OC_WARNING status.
  155. currX_max_alarm Current high alarm.
  156. From IIN_OC_WARN_LIMIT or IOUT_OC_WARN_LIMIT status.
  157. currX_lcrit_alarm Output current critical low alarm.
  158. From IOUT_UC_FAULT status.
  159. currX_crit_alarm Current critical high alarm.
  160. From IIN_OC_FAULT or IOUT_OC_FAULT status.
  161. currX_label "iin", "iinY", "iinY.Z", "ioutY", or "ioutY.Z",
  162. where Y reflects the page number and Z reflects the
  163. phase.
  164. currX_rated_max Maximum rated current.
  165. From MFR_IIN_MAX or MFR_IOUT_MAX register.
  166. powerX_input Measured power. From READ_PIN or READ_POUT register.
  167. powerX_cap Output power cap. From POUT_MAX register.
  168. powerX_max Power limit. From PIN_OP_WARN_LIMIT or
  169. POUT_OP_WARN_LIMIT register.
  170. powerX_crit Critical output power limit.
  171. From POUT_OP_FAULT_LIMIT register.
  172. powerX_alarm Power high alarm.
  173. From PIN_OP_WARNING or POUT_OP_WARNING status.
  174. powerX_crit_alarm Output power critical high alarm.
  175. From POUT_OP_FAULT status.
  176. powerX_label "pin", "pinY", "pinY.Z", "poutY", or "poutY.Z",
  177. where Y reflects the page number and Z reflects the
  178. phase.
  179. powerX_rated_max Maximum rated power.
  180. From MFR_PIN_MAX or MFR_POUT_MAX register.
  181. tempX_input Measured temperature.
  182. From READ_TEMPERATURE_X register.
  183. tempX_min Minimum temperature. From UT_WARN_LIMIT register.
  184. tempX_max Maximum temperature. From OT_WARN_LIMIT register.
  185. tempX_lcrit Critical low temperature.
  186. From UT_FAULT_LIMIT register.
  187. tempX_crit Critical high temperature.
  188. From OT_FAULT_LIMIT register.
  189. tempX_min_alarm Chip temperature low alarm. Set by comparing
  190. READ_TEMPERATURE_X with UT_WARN_LIMIT if
  191. TEMP_UT_WARNING status is set.
  192. tempX_max_alarm Chip temperature high alarm. Set by comparing
  193. READ_TEMPERATURE_X with OT_WARN_LIMIT if
  194. TEMP_OT_WARNING status is set.
  195. tempX_lcrit_alarm Chip temperature critical low alarm. Set by comparing
  196. READ_TEMPERATURE_X with UT_FAULT_LIMIT if
  197. TEMP_UT_FAULT status is set.
  198. tempX_crit_alarm Chip temperature critical high alarm. Set by comparing
  199. READ_TEMPERATURE_X with OT_FAULT_LIMIT if
  200. TEMP_OT_FAULT status is set.
  201. tempX_rated_min Minimum rated temperature.
  202. From MFR_TAMBIENT_MIN register.
  203. tempX_rated_max Maximum rated temperature.
  204. From MFR_TAMBIENT_MAX, MFR_MAX_TEMP_1, MFR_MAX_TEMP_2 or
  205. MFR_MAX_TEMP_3 register.
  206. ======================= ========================================================