Kernel driver bt1-pvt

Supported chips:

  • Baikal-T1 PVT sensor (in SoC)

    Prefix: ‘bt1-pvt’

    Addresses scanned: -

    Datasheet: Provided by BAIKAL ELECTRONICS upon request and under NDA

Authors:
Maxim Kaurkin <maxim.kaurkin@baikalelectronics.ru>Serge Semin <Sergey.Semin@baikalelectronics.ru>

Description

This driver implements support for the hardware monitoring capabilities of theembedded into Baikal-T1 process, voltage and temperature sensors. PVT IP-coreconsists of one temperature and four voltage sensors, which can be used tomonitor the chip internal environment like heating, supply voltage andtransistors performance. The driver can optionally provide the hwmon alarmsfor each sensor the PVT controller supports. The alarms functionality is madecompile-time configurable due to the hardware interface implementationpeculiarity, which is connected with an ability to convert data from only onesensor at a time. Additional limitation is that the controller performs thethresholds checking synchronously with the data conversion procedure. Due tothese in order to have the hwmon alarms automatically detected the driver codemust switch from one sensor to another, read converted data and manually checkthe threshold status bits. Depending on the measurements timeout settings(update_interval sysfs node value) this design may cause additional burden onthe system performance. So in case if alarms are unnecessary in your systemdesign it’s recommended to have them disabled to prevent the PVT IRQs beingperiodically raised to get the data cache/alarms status up to date. By defaultin alarm-less configuration the data conversion is performed by the driveron demand when read operation is requested via corresponding _input-file.

Temperature Monitoring

Temperature is measured with 10-bit resolution and reported in millidegreeCelsius. The driver performs all the scaling by itself therefore reports truetemperatures that don’t need any user-space adjustments. While the datatranslation formulae isn’t linear, which gives us non-linear discreteness,it’s close to one, but giving a bit better accuracy for higher temperatures.The temperature input is mapped as follows (the last column indicates the inputranges):

temp1: CPU embedded diode       -48.38C - +147.438C

In case if the alarms kernel config is enabled in the driver the temperature inputhas associated min and max limits which trigger an alarm when crossed.

Voltage Monitoring

The voltage inputs are also sampled with 10-bit resolution and reported inmillivolts. But in this case the data translation formulae is linear, whichprovides a constant measurements discreteness. The data scaling is alsoperformed by the driver, so returning true millivolts. The voltage inputs aremapped as follows (the last column indicates the input ranges):

in0: VDD                (processor core)                0.62V - 1.168Vin1: Low-Vt             (low voltage threshold)         0.62V - 1.168Vin2: High-Vt            (high voltage threshold)        0.62V - 1.168Vin3: Standard-Vt        (standard voltage threshold)    0.62V - 1.168V

In case if the alarms config is enabled in the driver the voltage inputshave associated min and max limits which trigger an alarm when crossed.

Sysfs Attributes

Following is a list of all sysfs attributes that the driver provides, theirpermissions and a short description:

NamePermDescription
update_intervalRWMeasurements update interval persensor.
temp1_typeROSensor type (always 1 as CPU embeddeddiode).
temp1_labelROCPU Core Temperature sensor.
temp1_inputROMeasured temperature in millidegreeCelsius.
temp1_minRWLow limit for temp input.
temp1_maxRWHigh limit for temp input.
temp1_min_alarmROTemperature input alarm. Returns 1 iftemperature input went below min limit,0 otherwise.
temp1_max_alarmROTemperature input alarm. Returns 1 iftemperature input went above max limit,0 otherwise.
temp1_offsetRWTemperature offset in millidegreeCelsius which is added to thetemperature reading by the chip. It canbe used to manually adjust thetemperature measurements within 7.130degrees Celsius.
in[0-3]_labelROCPU Voltage sensor (either core orlow/high/standard thresholds).
in[0-3]_inputROMeasured voltage in millivolts.
in[0-3]_minRWLow limit for voltage input.
in[0-3]_maxRWHigh limit for voltage input.
in[0-3]_min_alarmROVoltage input alarm. Returns 1 ifvoltage input went below min limit,0 otherwise.
in[0-3]_max_alarmROVoltage input alarm. Returns 1 ifvoltage input went above max limit,0 otherwise.