* [PATCH 1/2] dt-bindings: hwmon: Add Baikal-T1 PVT sensor bindings
[not found] <20200306132604.14312-1-Sergey.Semin@baikalelectronics.ru>
@ 2020-03-06 13:26 ` Sergey.Semin
2020-03-12 22:13 ` Rob Herring
2020-03-10 0:25 ` [PATCH 0/2] hwmon: Add Baikal-T1 SoC Process, Voltage and Temp sensor support Sergey Semin
1 sibling, 1 reply; 4+ messages in thread
From: Sergey.Semin @ 2020-03-06 13:26 UTC (permalink / raw)
To: Jean Delvare, Guenter Roeck, Rob Herring, Mark Rutland
Cc: Serge Semin, Serge Semin, Maxim Kaurkin, Alexey Malahov,
Thomas Bogendoerfer, Paul Burton, Ralf Baechle, linux-hwmon,
devicetree, linux-kernel
From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Baikal-T1 SoC is equipped with an embedded process, voltage and
temperature sensor to monitor the chip internal environment like
temperature, supply voltage and transistors performance.
This bindings describes the external Baikal-T1 PVT control interfaces
like MMIO registers space, interrupt request number and clocks source.
These are then used by the corresponding hwmon device driver to
implement the sysfs files-based access to the sensors functionality.
Signed-off-by: Maxim Kaurkin <maxim.kaurkin@baikalelectronics.ru>
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
---
.../devicetree/bindings/hwmon/be,bt1-pvt.yaml | 100 ++++++++++++++++++
1 file changed, 100 insertions(+)
create mode 100644 Documentation/devicetree/bindings/hwmon/be,bt1-pvt.yaml
diff --git a/Documentation/devicetree/bindings/hwmon/be,bt1-pvt.yaml b/Documentation/devicetree/bindings/hwmon/be,bt1-pvt.yaml
new file mode 100644
index 000000000000..d575d124d538
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/be,bt1-pvt.yaml
@@ -0,0 +1,100 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Copyright (C) 2019 BAIKAL ELECTRONICS, JSC
+#
+# Baikal-T1 Process, Voltage, Temperature Sensor Device Tree Bindings.
+#
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/be,bt1-pvt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Baikal-T1 PVT Sensor Device Tree Bindings
+
+maintainers:
+ - Serge Semin <fancer.lancer@gmail.com>
+
+description: |
+ Baikal-T1 SoC provides an embedded process, voltage and temperature
+ sensor to monitor an internal SoC environment (chip temperature, supply
+ voltage and process monitor) and on time detect critical situations,
+ which may cause the system instability and even damages. The IP-block
+ is based on the Analog Bits PVT sensor, but is equipped with a dedicated
+ control wrapper, which provides a MMIO registers-based access to the
+ sensor core functionality (APB3-bus based) and exposes an additional
+ functions like thresholds/data ready interrupts, its status and masks,
+ measurements timeout. Its internal structure is depicted on the next
+ diagram:
+ Analog Bits core Bakal-T1 PVT control block
+ +--------------------+ +------------------------+
+ | Temperature sensor |-+ +------| Sensors control |
+ |--------------------| |<---En---| |------------------------|
+ | Voltage sensor |-|<--Mode--| +--->| Sampled data |
+ |--------------------| |<--Trim--+ | |------------------------|
+ | Low-Vt sensor |-| | +--| Thresholds comparator |
+ |--------------------| |---Data----| | |------------------------|
+ | High-Vt sensor |-| | +->| Interrupts status |
+ |--------------------| |--Valid--+-+ | |------------------------|
+ | Standard-Vt sensor |-+ +---+--| Interrupts mask |
+ +--------------------+ |------------------------|
+ ^ | Interrupts timeout |
+ | +------------------------+
+ | ^ ^
+ Rclk-----+----------------------------------------+ |
+ APB3-------------------------------------------------+
+
+ This bindings describes the external Baikal-T1 PVT control interfaces
+ like MMIO registers space, interrupt request number and clocks source.
+ These are then used by the corresponding hwmon device driver to
+ implement the sysfs files-based access to the sensors functionality.
+
+properties:
+ compatible:
+ const: be,bt1-pvt
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ items:
+ - description: PVT reference clock.
+ - description: APB3 interface clock.
+
+ clock-names:
+ items:
+ - const: ref
+ - const: pclk
+
+ "#thermal-sensor-cells":
+ description: Baikal-T1 can be referenced as the CPU thermal-sensor.
+ const: 0
+
+additionalProperties: false
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+ - clock-names
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/mips-gic.h>
+ #include <dt-bindings/clock/bt1-ccu.h>
+
+ pvt: pvt@1F200000 {
+ compatible = "be,bt1-pvt";
+ reg = <0x1F200000 0x1000>;
+ #thermal-sensor-cells = <0>;
+
+ interrupts = <GIC_SHARED 31 IRQ_TYPE_LEVEL_HIGH>;
+
+ clocks = <&ccu_sys CCU_SYS_PVT_CLK>,
+ <&ccu_sys CCU_SYS_APB_CLK>;
+ clock-names = "ref", "pclk";
+ };
+...
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] hwmon: Add Baikal-T1 SoC Process, Voltage and Temp sensor support
[not found] <20200306132604.14312-1-Sergey.Semin@baikalelectronics.ru>
2020-03-06 13:26 ` [PATCH 1/2] dt-bindings: hwmon: Add Baikal-T1 PVT sensor bindings Sergey.Semin
@ 2020-03-10 0:25 ` Sergey Semin
1 sibling, 0 replies; 4+ messages in thread
From: Sergey Semin @ 2020-03-10 0:25 UTC (permalink / raw)
To: Alexey Malahov, Maxim Kaurkin, Pavel Parkhomenko, Ramil Zaripov,
Ekaterina Skachko, Vadim Vlasov, Thomas Bogendoerfer, Paul Burton,
Ralf Baechle, Jean Delvare, Guenter Roeck, Rob Herring,
Mark Rutland, linux-hwmon, devicetree, linux-kernel
On Fri, Mar 06, 2020 at 04:26:02PM +0300, Sergey.Semin@baikalelectronics.ru wrote:
> From: Serge Semin <fancer.lancer@gmail.com>
>
> In order to keep track of Baikal-T1 SoC power consumption and make sure
> the chip heating is within the normal temperature limits, there is
> a dedicated hardware monitor sensor embedded into the SoC. It is based
> on the Analog Bits PVT sensor but equipped with a vendor-specific control
> wrapper, which ease an access to the sensors functionality. Fist of all it
> provides an accessed to the sampled Temperature, Voltage and
> Low/Standard/High Voltage thresholds. In addition the wrapper generates
> an interrupt in case if one enabled for alarm thresholds or data ready
> event. All of these functionality is implemented in the Baikal-T1 PVT
> driver submitted within this patchset. Naturally there is also a patch,
> which creates a corresponding yaml-based dt-binding file for the sensor.
>
> This patchset is rebased and tested on the mainline Linux kernel 5.6-rc4:
> commit 98d54f81e36b ("Linux 5.6-rc4").
>
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> Signed-off-by: Maxim Kaurkin <Maxim.Kaurkin@baikalelectronics.ru>
> Cc: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>
> Cc: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru>
> Cc: Ekaterina Skachko <Ekaterina.Skachko@baikalelectronics.ru>
> Cc: Vadim Vlasov <V.Vlasov@baikalelectronics.ru>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: Paul Burton <paulburton@kernel.org>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Jean Delvare <jdelvare@suse.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: linux-hwmon@vger.kernel.org
> Cc: devicetree@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
>
> Serge Semin (2):
> dt-bindings: hwmon: Add Baikal-T1 PVT sensor bindings
> hwmon: Add Baikal-T1 PVT sensor driver
>
> .../devicetree/bindings/hwmon/be,bt1-pvt.yaml | 100 ++
> Documentation/hwmon/bt1-pvt.rst | 113 ++
> drivers/hwmon/Kconfig | 29 +
> drivers/hwmon/Makefile | 1 +
> drivers/hwmon/bt1-pvt.c | 1147 +++++++++++++++++
> drivers/hwmon/bt1-pvt.h | 266 ++++
> 6 files changed, 1656 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/hwmon/be,bt1-pvt.yaml
> create mode 100644 Documentation/hwmon/bt1-pvt.rst
> create mode 100644 drivers/hwmon/bt1-pvt.c
> create mode 100644 drivers/hwmon/bt1-pvt.h
>
> --
> 2.25.1
>
Folks,
It appears our corporate email server changes the Message-Id field of
messages passing through it. Due to that the emails threading gets to be
broken. I'll resubmit the properly structured v2 patchset as soon as our
system administrator fixes the problem. Sorry for the inconvenience caused
by it.
Regards,
-Sergey
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] dt-bindings: hwmon: Add Baikal-T1 PVT sensor bindings
2020-03-06 13:26 ` [PATCH 1/2] dt-bindings: hwmon: Add Baikal-T1 PVT sensor bindings Sergey.Semin
@ 2020-03-12 22:13 ` Rob Herring
2020-03-13 21:36 ` Sergey Semin
0 siblings, 1 reply; 4+ messages in thread
From: Rob Herring @ 2020-03-12 22:13 UTC (permalink / raw)
To: Sergey.Semin
Cc: Jean Delvare, Guenter Roeck, Mark Rutland, Serge Semin,
Maxim Kaurkin, Alexey Malahov, Thomas Bogendoerfer, Paul Burton,
Ralf Baechle, linux-hwmon, devicetree, linux-kernel
On Fri, Mar 06, 2020 at 04:26:03PM +0300, Sergey.Semin@baikalelectronics.ru wrote:
> From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
>
> Baikal-T1 SoC is equipped with an embedded process, voltage and
> temperature sensor to monitor the chip internal environment like
> temperature, supply voltage and transistors performance.
>
> This bindings describes the external Baikal-T1 PVT control interfaces
> like MMIO registers space, interrupt request number and clocks source.
> These are then used by the corresponding hwmon device driver to
> implement the sysfs files-based access to the sensors functionality.
>
> Signed-off-by: Maxim Kaurkin <maxim.kaurkin@baikalelectronics.ru>
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: Paul Burton <paulburton@kernel.org>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> ---
> .../devicetree/bindings/hwmon/be,bt1-pvt.yaml | 100 ++++++++++++++++++
> 1 file changed, 100 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/hwmon/be,bt1-pvt.yaml
>
> diff --git a/Documentation/devicetree/bindings/hwmon/be,bt1-pvt.yaml b/Documentation/devicetree/bindings/hwmon/be,bt1-pvt.yaml
> new file mode 100644
> index 000000000000..d575d124d538
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/be,bt1-pvt.yaml
> @@ -0,0 +1,100 @@
> +# SPDX-License-Identifier: GPL-2.0
Dual license
> +#
> +# Copyright (C) 2019 BAIKAL ELECTRONICS, JSC
> +#
> +# Baikal-T1 Process, Voltage, Temperature Sensor Device Tree Bindings.
drop
> +#
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/hwmon/be,bt1-pvt.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Baikal-T1 PVT Sensor Device Tree Bindings
> +
> +maintainers:
> + - Serge Semin <fancer.lancer@gmail.com>
> +
> +description: |
> + Baikal-T1 SoC provides an embedded process, voltage and temperature
> + sensor to monitor an internal SoC environment (chip temperature, supply
> + voltage and process monitor) and on time detect critical situations,
> + which may cause the system instability and even damages. The IP-block
> + is based on the Analog Bits PVT sensor, but is equipped with a dedicated
> + control wrapper, which provides a MMIO registers-based access to the
> + sensor core functionality (APB3-bus based) and exposes an additional
> + functions like thresholds/data ready interrupts, its status and masks,
> + measurements timeout. Its internal structure is depicted on the next
> + diagram:
> + Analog Bits core Bakal-T1 PVT control block
> + +--------------------+ +------------------------+
> + | Temperature sensor |-+ +------| Sensors control |
> + |--------------------| |<---En---| |------------------------|
> + | Voltage sensor |-|<--Mode--| +--->| Sampled data |
> + |--------------------| |<--Trim--+ | |------------------------|
> + | Low-Vt sensor |-| | +--| Thresholds comparator |
> + |--------------------| |---Data----| | |------------------------|
> + | High-Vt sensor |-| | +->| Interrupts status |
> + |--------------------| |--Valid--+-+ | |------------------------|
> + | Standard-Vt sensor |-+ +---+--| Interrupts mask |
> + +--------------------+ |------------------------|
> + ^ | Interrupts timeout |
> + | +------------------------+
> + | ^ ^
> + Rclk-----+----------------------------------------+ |
> + APB3-------------------------------------------------+
> +
> + This bindings describes the external Baikal-T1 PVT control interfaces
> + like MMIO registers space, interrupt request number and clocks source.
> + These are then used by the corresponding hwmon device driver to
> + implement the sysfs files-based access to the sensors functionality.
> +
> +properties:
> + compatible:
> + const: be,bt1-pvt
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 1
> +
> + clocks:
> + items:
> + - description: PVT reference clock.
> + - description: APB3 interface clock.
> +
> + clock-names:
> + items:
> + - const: ref
> + - const: pclk
> +
> + "#thermal-sensor-cells":
> + description: Baikal-T1 can be referenced as the CPU thermal-sensor.
> + const: 0
> +
> +additionalProperties: false
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - clocks
> + - clock-names
> +
> +examples:
> + - |
> + #include <dt-bindings/interrupt-controller/mips-gic.h>
> + #include <dt-bindings/clock/bt1-ccu.h>
> +
> + pvt: pvt@1F200000 {
lowercase hex
> + compatible = "be,bt1-pvt";
> + reg = <0x1F200000 0x1000>;
> + #thermal-sensor-cells = <0>;
> +
> + interrupts = <GIC_SHARED 31 IRQ_TYPE_LEVEL_HIGH>;
> +
> + clocks = <&ccu_sys CCU_SYS_PVT_CLK>,
> + <&ccu_sys CCU_SYS_APB_CLK>;
> + clock-names = "ref", "pclk";
> + };
> +...
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] dt-bindings: hwmon: Add Baikal-T1 PVT sensor bindings
2020-03-12 22:13 ` Rob Herring
@ 2020-03-13 21:36 ` Sergey Semin
0 siblings, 0 replies; 4+ messages in thread
From: Sergey Semin @ 2020-03-13 21:36 UTC (permalink / raw)
To: Rob Herring
Cc: Jean Delvare, Guenter Roeck, Mark Rutland, Maxim Kaurkin,
Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle,
linux-hwmon, devicetree, linux-kernel
On Thu, Mar 12, 2020 at 05:13:04PM -0500, Rob Herring wrote:
> On Fri, Mar 06, 2020 at 04:26:03PM +0300, Sergey.Semin@baikalelectronics.ru wrote:
> > From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> >
> > Baikal-T1 SoC is equipped with an embedded process, voltage and
> > temperature sensor to monitor the chip internal environment like
> > temperature, supply voltage and transistors performance.
> >
> > This bindings describes the external Baikal-T1 PVT control interfaces
> > like MMIO registers space, interrupt request number and clocks source.
> > These are then used by the corresponding hwmon device driver to
> > implement the sysfs files-based access to the sensors functionality.
> >
> > Signed-off-by: Maxim Kaurkin <maxim.kaurkin@baikalelectronics.ru>
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> > Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> > Cc: Paul Burton <paulburton@kernel.org>
> > Cc: Ralf Baechle <ralf@linux-mips.org>
> > ---
> > .../devicetree/bindings/hwmon/be,bt1-pvt.yaml | 100 ++++++++++++++++++
> > 1 file changed, 100 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/hwmon/be,bt1-pvt.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/hwmon/be,bt1-pvt.yaml b/Documentation/devicetree/bindings/hwmon/be,bt1-pvt.yaml
> > new file mode 100644
> > index 000000000000..d575d124d538
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/hwmon/be,bt1-pvt.yaml
> > @@ -0,0 +1,100 @@
> > +# SPDX-License-Identifier: GPL-2.0
>
> Dual license
>
Ok. I'll add BSD-2-Clause here.
> > +#
> > +# Copyright (C) 2019 BAIKAL ELECTRONICS, JSC
> > +#
> > +# Baikal-T1 Process, Voltage, Temperature Sensor Device Tree Bindings.
>
> drop
>
Ok.
> > +#
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/hwmon/be,bt1-pvt.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Baikal-T1 PVT Sensor Device Tree Bindings
> > +
> > +maintainers:
> > + - Serge Semin <fancer.lancer@gmail.com>
> > +
> > +description: |
> > + Baikal-T1 SoC provides an embedded process, voltage and temperature
> > + sensor to monitor an internal SoC environment (chip temperature, supply
> > + voltage and process monitor) and on time detect critical situations,
> > + which may cause the system instability and even damages. The IP-block
> > + is based on the Analog Bits PVT sensor, but is equipped with a dedicated
> > + control wrapper, which provides a MMIO registers-based access to the
> > + sensor core functionality (APB3-bus based) and exposes an additional
> > + functions like thresholds/data ready interrupts, its status and masks,
> > + measurements timeout. Its internal structure is depicted on the next
> > + diagram:
> > + Analog Bits core Bakal-T1 PVT control block
> > + +--------------------+ +------------------------+
> > + | Temperature sensor |-+ +------| Sensors control |
> > + |--------------------| |<---En---| |------------------------|
> > + | Voltage sensor |-|<--Mode--| +--->| Sampled data |
> > + |--------------------| |<--Trim--+ | |------------------------|
> > + | Low-Vt sensor |-| | +--| Thresholds comparator |
> > + |--------------------| |---Data----| | |------------------------|
> > + | High-Vt sensor |-| | +->| Interrupts status |
> > + |--------------------| |--Valid--+-+ | |------------------------|
> > + | Standard-Vt sensor |-+ +---+--| Interrupts mask |
> > + +--------------------+ |------------------------|
> > + ^ | Interrupts timeout |
> > + | +------------------------+
> > + | ^ ^
> > + Rclk-----+----------------------------------------+ |
> > + APB3-------------------------------------------------+
> > +
> > + This bindings describes the external Baikal-T1 PVT control interfaces
> > + like MMIO registers space, interrupt request number and clocks source.
> > + These are then used by the corresponding hwmon device driver to
> > + implement the sysfs files-based access to the sensors functionality.
> > +
> > +properties:
> > + compatible:
> > + const: be,bt1-pvt
> > +
> > + reg:
> > + maxItems: 1
> > +
> > + interrupts:
> > + maxItems: 1
> > +
> > + clocks:
> > + items:
> > + - description: PVT reference clock.
> > + - description: APB3 interface clock.
> > +
> > + clock-names:
> > + items:
> > + - const: ref
> > + - const: pclk
> > +
> > + "#thermal-sensor-cells":
> > + description: Baikal-T1 can be referenced as the CPU thermal-sensor.
> > + const: 0
> > +
> > +additionalProperties: false
> > +
> > +required:
> > + - compatible
> > + - reg
> > + - interrupts
> > + - clocks
> > + - clock-names
> > +
> > +examples:
> > + - |
> > + #include <dt-bindings/interrupt-controller/mips-gic.h>
> > + #include <dt-bindings/clock/bt1-ccu.h>
> > +
> > + pvt: pvt@1F200000 {
>
> lowercase hex
>
Ok. I'll also remove the bt1-ccu.h inclusion here, since that header
doesn't exist in the kernel source tree at the moment.
Regards,
-Sergey
> > + compatible = "be,bt1-pvt";
> > + reg = <0x1F200000 0x1000>;
> > + #thermal-sensor-cells = <0>;
> > +
> > + interrupts = <GIC_SHARED 31 IRQ_TYPE_LEVEL_HIGH>;
> > +
> > + clocks = <&ccu_sys CCU_SYS_PVT_CLK>,
> > + <&ccu_sys CCU_SYS_APB_CLK>;
> > + clock-names = "ref", "pclk";
> > + };
> > +...
> > --
> > 2.25.1
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-03-13 21:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20200306132604.14312-1-Sergey.Semin@baikalelectronics.ru>
2020-03-06 13:26 ` [PATCH 1/2] dt-bindings: hwmon: Add Baikal-T1 PVT sensor bindings Sergey.Semin
2020-03-12 22:13 ` Rob Herring
2020-03-13 21:36 ` Sergey Semin
2020-03-10 0:25 ` [PATCH 0/2] hwmon: Add Baikal-T1 SoC Process, Voltage and Temp sensor support Sergey Semin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).