bt1-pvt.rst 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. .. SPDX-License-Identifier: GPL-2.0-only
  2. Kernel driver bt1-pvt
  3. =====================
  4. Supported chips:
  5. * Baikal-T1 PVT sensor (in SoC)
  6. Prefix: 'bt1-pvt'
  7. Addresses scanned: -
  8. Datasheet: Provided by BAIKAL ELECTRONICS upon request and under NDA
  9. Authors:
  10. Maxim Kaurkin <maxim.kaurkin@baikalelectronics.ru>
  11. Serge Semin <Sergey.Semin@baikalelectronics.ru>
  12. Description
  13. -----------
  14. This driver implements support for the hardware monitoring capabilities of the
  15. embedded into Baikal-T1 process, voltage and temperature sensors. PVT IP-core
  16. consists of one temperature and four voltage sensors, which can be used to
  17. monitor the chip internal environment like heating, supply voltage and
  18. transistors performance. The driver can optionally provide the hwmon alarms
  19. for each sensor the PVT controller supports. The alarms functionality is made
  20. compile-time configurable due to the hardware interface implementation
  21. peculiarity, which is connected with an ability to convert data from only one
  22. sensor at a time. Additional limitation is that the controller performs the
  23. thresholds checking synchronously with the data conversion procedure. Due to
  24. these in order to have the hwmon alarms automatically detected the driver code
  25. must switch from one sensor to another, read converted data and manually check
  26. the threshold status bits. Depending on the measurements timeout settings
  27. (update_interval sysfs node value) this design may cause additional burden on
  28. the system performance. So in case if alarms are unnecessary in your system
  29. design it's recommended to have them disabled to prevent the PVT IRQs being
  30. periodically raised to get the data cache/alarms status up to date. By default
  31. in alarm-less configuration the data conversion is performed by the driver
  32. on demand when read operation is requested via corresponding _input-file.
  33. Temperature Monitoring
  34. ----------------------
  35. Temperature is measured with 10-bit resolution and reported in millidegree
  36. Celsius. The driver performs all the scaling by itself therefore reports true
  37. temperatures that don't need any user-space adjustments. While the data
  38. translation formulae isn't linear, which gives us non-linear discreteness,
  39. it's close to one, but giving a bit better accuracy for higher temperatures.
  40. The temperature input is mapped as follows (the last column indicates the input
  41. ranges)::
  42. temp1: CPU embedded diode -48.38C - +147.438C
  43. In case if the alarms kernel config is enabled in the driver the temperature input
  44. has associated min and max limits which trigger an alarm when crossed.
  45. Voltage Monitoring
  46. ------------------
  47. The voltage inputs are also sampled with 10-bit resolution and reported in
  48. millivolts. But in this case the data translation formulae is linear, which
  49. provides a constant measurements discreteness. The data scaling is also
  50. performed by the driver, so returning true millivolts. The voltage inputs are
  51. mapped as follows (the last column indicates the input ranges)::
  52. in0: VDD (processor core) 0.62V - 1.168V
  53. in1: Low-Vt (low voltage threshold) 0.62V - 1.168V
  54. in2: High-Vt (high voltage threshold) 0.62V - 1.168V
  55. in3: Standard-Vt (standard voltage threshold) 0.62V - 1.168V
  56. In case if the alarms config is enabled in the driver the voltage inputs
  57. have associated min and max limits which trigger an alarm when crossed.
  58. Sysfs Attributes
  59. ----------------
  60. Following is a list of all sysfs attributes that the driver provides, their
  61. permissions and a short description:
  62. =============================== ======= =======================================
  63. Name Perm Description
  64. =============================== ======= =======================================
  65. update_interval RW Measurements update interval per
  66. sensor.
  67. temp1_type RO Sensor type (always 1 as CPU embedded
  68. diode).
  69. temp1_label RO CPU Core Temperature sensor.
  70. temp1_input RO Measured temperature in millidegree
  71. Celsius.
  72. temp1_min RW Low limit for temp input.
  73. temp1_max RW High limit for temp input.
  74. temp1_min_alarm RO Temperature input alarm. Returns 1 if
  75. temperature input went below min limit,
  76. 0 otherwise.
  77. temp1_max_alarm RO Temperature input alarm. Returns 1 if
  78. temperature input went above max limit,
  79. 0 otherwise.
  80. temp1_offset RW Temperature offset in millidegree
  81. Celsius which is added to the
  82. temperature reading by the chip. It can
  83. be used to manually adjust the
  84. temperature measurements within 7.130
  85. degrees Celsius.
  86. in[0-3]_label RO CPU Voltage sensor (either core or
  87. low/high/standard thresholds).
  88. in[0-3]_input RO Measured voltage in millivolts.
  89. in[0-3]_min RW Low limit for voltage input.
  90. in[0-3]_max RW High limit for voltage input.
  91. in[0-3]_min_alarm RO Voltage input alarm. Returns 1 if
  92. voltage input went below min limit,
  93. 0 otherwise.
  94. in[0-3]_max_alarm RO Voltage input alarm. Returns 1 if
  95. voltage input went above max limit,
  96. 0 otherwise.
  97. =============================== ======= =======================================