0001 .. SPDX-License-Identifier: GPL-2.0-only
0002
0003 Kernel driver bt1-pvt
0004 =====================
0005
0006 Supported chips:
0007
0008 * Baikal-T1 PVT sensor (in SoC)
0009
0010 Prefix: 'bt1-pvt'
0011
0012 Addresses scanned: -
0013
0014 Datasheet: Provided by BAIKAL ELECTRONICS upon request and under NDA
0015
0016 Authors:
0017 Maxim Kaurkin <maxim.kaurkin@baikalelectronics.ru>
0018 Serge Semin <Sergey.Semin@baikalelectronics.ru>
0019
0020 Description
0021 -----------
0022
0023 This driver implements support for the hardware monitoring capabilities of the
0024 embedded into Baikal-T1 process, voltage and temperature sensors. PVT IP-core
0025 consists of one temperature and four voltage sensors, which can be used to
0026 monitor the chip internal environment like heating, supply voltage and
0027 transistors performance. The driver can optionally provide the hwmon alarms
0028 for each sensor the PVT controller supports. The alarms functionality is made
0029 compile-time configurable due to the hardware interface implementation
0030 peculiarity, which is connected with an ability to convert data from only one
0031 sensor at a time. Additional limitation is that the controller performs the
0032 thresholds checking synchronously with the data conversion procedure. Due to
0033 these in order to have the hwmon alarms automatically detected the driver code
0034 must switch from one sensor to another, read converted data and manually check
0035 the threshold status bits. Depending on the measurements timeout settings
0036 (update_interval sysfs node value) this design may cause additional burden on
0037 the system performance. So in case if alarms are unnecessary in your system
0038 design it's recommended to have them disabled to prevent the PVT IRQs being
0039 periodically raised to get the data cache/alarms status up to date. By default
0040 in alarm-less configuration the data conversion is performed by the driver
0041 on demand when read operation is requested via corresponding _input-file.
0042
0043 Temperature Monitoring
0044 ----------------------
0045
0046 Temperature is measured with 10-bit resolution and reported in millidegree
0047 Celsius. The driver performs all the scaling by itself therefore reports true
0048 temperatures that don't need any user-space adjustments. While the data
0049 translation formulae isn't linear, which gives us non-linear discreteness,
0050 it's close to one, but giving a bit better accuracy for higher temperatures.
0051 The temperature input is mapped as follows (the last column indicates the input
0052 ranges)::
0053
0054 temp1: CPU embedded diode -48.38C - +147.438C
0055
0056 In case if the alarms kernel config is enabled in the driver the temperature input
0057 has associated min and max limits which trigger an alarm when crossed.
0058
0059 Voltage Monitoring
0060 ------------------
0061
0062 The voltage inputs are also sampled with 10-bit resolution and reported in
0063 millivolts. But in this case the data translation formulae is linear, which
0064 provides a constant measurements discreteness. The data scaling is also
0065 performed by the driver, so returning true millivolts. The voltage inputs are
0066 mapped as follows (the last column indicates the input ranges)::
0067
0068 in0: VDD (processor core) 0.62V - 1.168V
0069 in1: Low-Vt (low voltage threshold) 0.62V - 1.168V
0070 in2: High-Vt (high voltage threshold) 0.62V - 1.168V
0071 in3: Standard-Vt (standard voltage threshold) 0.62V - 1.168V
0072
0073 In case if the alarms config is enabled in the driver the voltage inputs
0074 have associated min and max limits which trigger an alarm when crossed.
0075
0076 Sysfs Attributes
0077 ----------------
0078
0079 Following is a list of all sysfs attributes that the driver provides, their
0080 permissions and a short description:
0081
0082 =============================== ======= =======================================
0083 Name Perm Description
0084 =============================== ======= =======================================
0085 update_interval RW Measurements update interval per
0086 sensor.
0087 temp1_type RO Sensor type (always 1 as CPU embedded
0088 diode).
0089 temp1_label RO CPU Core Temperature sensor.
0090 temp1_input RO Measured temperature in millidegree
0091 Celsius.
0092 temp1_min RW Low limit for temp input.
0093 temp1_max RW High limit for temp input.
0094 temp1_min_alarm RO Temperature input alarm. Returns 1 if
0095 temperature input went below min limit,
0096 0 otherwise.
0097 temp1_max_alarm RO Temperature input alarm. Returns 1 if
0098 temperature input went above max limit,
0099 0 otherwise.
0100 temp1_offset RW Temperature offset in millidegree
0101 Celsius which is added to the
0102 temperature reading by the chip. It can
0103 be used to manually adjust the
0104 temperature measurements within 7.130
0105 degrees Celsius.
0106 in[0-3]_label RO CPU Voltage sensor (either core or
0107 low/high/standard thresholds).
0108 in[0-3]_input RO Measured voltage in millivolts.
0109 in[0-3]_min RW Low limit for voltage input.
0110 in[0-3]_max RW High limit for voltage input.
0111 in[0-3]_min_alarm RO Voltage input alarm. Returns 1 if
0112 voltage input went below min limit,
0113 0 otherwise.
0114 in[0-3]_max_alarm RO Voltage input alarm. Returns 1 if
0115 voltage input went above max limit,
0116 0 otherwise.
0117 =============================== ======= =======================================