Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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