xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/hwmon/baikal,bt1-pvt.yaml (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*4882a593Smuzhiyun# Copyright (C) 2020 BAIKAL ELECTRONICS, JSC
3*4882a593Smuzhiyun%YAML 1.2
4*4882a593Smuzhiyun---
5*4882a593Smuzhiyun$id: http://devicetree.org/schemas/hwmon/baikal,bt1-pvt.yaml#
6*4882a593Smuzhiyun$schema: http://devicetree.org/meta-schemas/core.yaml#
7*4882a593Smuzhiyun
8*4882a593Smuzhiyuntitle: Baikal-T1 PVT Sensor
9*4882a593Smuzhiyun
10*4882a593Smuzhiyunmaintainers:
11*4882a593Smuzhiyun  - Serge Semin <fancer.lancer@gmail.com>
12*4882a593Smuzhiyun
13*4882a593Smuzhiyundescription: |
14*4882a593Smuzhiyun  Baikal-T1 SoC provides an embedded process, voltage and temperature
15*4882a593Smuzhiyun  sensor to monitor an internal SoC environment (chip temperature, supply
16*4882a593Smuzhiyun  voltage and process monitor) and on time detect critical situations,
17*4882a593Smuzhiyun  which may cause the system instability and even damages. The IP-block
18*4882a593Smuzhiyun  is based on the Analog Bits PVT sensor, but is equipped with a dedicated
19*4882a593Smuzhiyun  control wrapper, which provides a MMIO registers-based access to the
20*4882a593Smuzhiyun  sensor core functionality (APB3-bus based) and exposes an additional
21*4882a593Smuzhiyun  functions like thresholds/data ready interrupts, its status and masks,
22*4882a593Smuzhiyun  measurements timeout. Its internal structure is depicted on the next
23*4882a593Smuzhiyun  diagram:
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun     Analog Bits core                     Bakal-T1 PVT control block
26*4882a593Smuzhiyun  +--------------------+                  +------------------------+
27*4882a593Smuzhiyun  | Temperature sensor |-+         +------| Sensors control        |
28*4882a593Smuzhiyun  |--------------------| |<---En---|      |------------------------|
29*4882a593Smuzhiyun  | Voltage sensor     |-|<--Mode--| +--->| Sampled data           |
30*4882a593Smuzhiyun  |--------------------| |<--Trim--+ |    |------------------------|
31*4882a593Smuzhiyun  | Low-Vt sensor      |-|           | +--| Thresholds comparator  |
32*4882a593Smuzhiyun  |--------------------| |---Data----| |  |------------------------|
33*4882a593Smuzhiyun  | High-Vt sensor     |-|           | +->| Interrupts status      |
34*4882a593Smuzhiyun  |--------------------| |--Valid--+-+ |  |------------------------|
35*4882a593Smuzhiyun  | Standard-Vt sensor |-+         +---+--| Interrupts mask        |
36*4882a593Smuzhiyun  +--------------------+                  |------------------------|
37*4882a593Smuzhiyun           ^                              | Interrupts timeout     |
38*4882a593Smuzhiyun           |                              +------------------------+
39*4882a593Smuzhiyun           |                                        ^  ^
40*4882a593Smuzhiyun  Rclk-----+----------------------------------------+  |
41*4882a593Smuzhiyun  APB3-------------------------------------------------+
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun  This bindings describes the external Baikal-T1 PVT control interfaces
44*4882a593Smuzhiyun  like MMIO registers space, interrupt request number and clocks source.
45*4882a593Smuzhiyun  These are then used by the corresponding hwmon device driver to
46*4882a593Smuzhiyun  implement the sysfs files-based access to the sensors functionality.
47*4882a593Smuzhiyun
48*4882a593Smuzhiyunproperties:
49*4882a593Smuzhiyun  compatible:
50*4882a593Smuzhiyun    const: baikal,bt1-pvt
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun  reg:
53*4882a593Smuzhiyun    maxItems: 1
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun  interrupts:
56*4882a593Smuzhiyun    maxItems: 1
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun  clocks:
59*4882a593Smuzhiyun    items:
60*4882a593Smuzhiyun      - description: PVT reference clock
61*4882a593Smuzhiyun      - description: APB3 interface clock
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun  clock-names:
64*4882a593Smuzhiyun    items:
65*4882a593Smuzhiyun      - const: ref
66*4882a593Smuzhiyun      - const: pclk
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun  "#thermal-sensor-cells":
69*4882a593Smuzhiyun    description: Baikal-T1 can be referenced as the CPU thermal-sensor
70*4882a593Smuzhiyun    const: 0
71*4882a593Smuzhiyun
72*4882a593Smuzhiyun  baikal,pvt-temp-offset-millicelsius:
73*4882a593Smuzhiyun    description: |
74*4882a593Smuzhiyun      Temperature sensor trimming factor. It can be used to manually adjust the
75*4882a593Smuzhiyun      temperature measurements within 7.130 degrees Celsius.
76*4882a593Smuzhiyun    maxItems: 1
77*4882a593Smuzhiyun    items:
78*4882a593Smuzhiyun      default: 0
79*4882a593Smuzhiyun      minimum: 0
80*4882a593Smuzhiyun      maximum: 7130
81*4882a593Smuzhiyun
82*4882a593SmuzhiyunadditionalProperties: false
83*4882a593Smuzhiyun
84*4882a593Smuzhiyunrequired:
85*4882a593Smuzhiyun  - compatible
86*4882a593Smuzhiyun  - reg
87*4882a593Smuzhiyun  - interrupts
88*4882a593Smuzhiyun  - clocks
89*4882a593Smuzhiyun  - clock-names
90*4882a593Smuzhiyun
91*4882a593Smuzhiyunexamples:
92*4882a593Smuzhiyun  - |
93*4882a593Smuzhiyun    #include <dt-bindings/interrupt-controller/mips-gic.h>
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun    pvt@1f200000 {
96*4882a593Smuzhiyun      compatible = "baikal,bt1-pvt";
97*4882a593Smuzhiyun      reg = <0x1f200000 0x1000>;
98*4882a593Smuzhiyun      #thermal-sensor-cells = <0>;
99*4882a593Smuzhiyun
100*4882a593Smuzhiyun      interrupts = <GIC_SHARED 31 IRQ_TYPE_LEVEL_HIGH>;
101*4882a593Smuzhiyun
102*4882a593Smuzhiyun      baikal,pvt-temp-offset-millicelsius = <1000>;
103*4882a593Smuzhiyun
104*4882a593Smuzhiyun      clocks = <&ccu_sys>, <&ccu_sys>;
105*4882a593Smuzhiyun      clock-names = "ref", "pclk";
106*4882a593Smuzhiyun    };
107*4882a593Smuzhiyun...
108