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