hwmon: xgene: Add support for X-Gene hwmon driver
Subsystems (4)
v4 cover hwmon: xgene: Add support for X-Gene hwmon driver
This patch set adds hardware temperature and power reading support for APM X-Gene SoC using the mailbox communication interface. For device tree, it is the standard DT mailbox.
For ACPI, it is the PCC mailbox.
For ACPI, this patch is built on top and depends on patch[1]:
[1] http://www.spinics.net/lists/linux-acpi/msg66041.html
- [PATCH v3] mailbox: pcc: Support HW-Reduced Communication Subspace type 2
v4
- Return 0 if driver registers successfully
v3
- Order include files alphabetically
- Use sign_extend32() to decode temperature
- Use DEVICE_ATTR_RO() for temperature and power attributes
- Temperature and power attributes start with index 1
- Use !!amsg->param2
- Fix checkpatch WARNING with --strict flag
- Use hwmon_device_register_with_groups()
- Check invalid sensor data
v2
- Increase power reading accurateness by using 2 registers
(a register for Watt, another for milli-Watt)
- Remove power reading for SoC
- Fix review comments from Guenter
v1
- Initial
Hoan Tran (3):
Documentation: dtb: xgene: Add hwmon dts binding documentation
hwmon: xgene: Add hwmon driver
arm64: dts: apm: Add X-Gene SoC hwmon to device tree
.../devicetree/bindings/hwmon/apm-xgene-hwmon.txt | 14 + Documentation/hwmon/xgene-hwmon | 30 + arch/arm64/boot/dts/apm/apm-shadowcat.dtsi | 5 + arch/arm64/boot/dts/apm/apm-storm.dtsi | 5 + drivers/hwmon/Kconfig | 7 + drivers/hwmon/Makefile | 1 + drivers/hwmon/xgene-hwmon.c | 755 +++++++++++++++++++++ 7 files changed, 817 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/apm-xgene-hwmon.txt create mode 100644 Documentation/hwmon/xgene-hwmon create mode 100644 drivers/hwmon/xgene-hwmon.c
Signature · 1 line
1.9.1
PATCH v4 1/3 Documentation: dtb: xgene: Add hwmon dts binding documentation
This patch adds the APM X-Gene hwmon device tree node documentation.
--- .../devicetree/bindings/hwmon/apm-xgene-hwmon.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/apm-xgene-hwmon.txt
Documentation/devicetree/bindings/hwmon/apm-xgene-hwmon.txt new file +14 -0
@@ -0,0 +1,14 @@ +APM X-Gene hwmon driver + +APM X-Gene SOC sensors are accessed over the "SLIMpro" mailbox. + +Required properties : + - compatible : should be "apm,xgene-slimpro-hwmon" + - mboxes : use the label reference for the mailbox as the first parameter. + The second parameter is the channel number. + +Example : + hwmonslimpro { + compatible = "apm,xgene-slimpro-hwmon"; + mboxes = <&mailbox 7>; + };
Signature · 1 line
1.9.1
PATCH v4 2/3 hwmon: xgene: Add hwmon driver
In reply to Hoan TranThis patch adds hardware temperature and power reading support for APM X-Gene SoC using the mailbox communication interface.
--- Documentation/hwmon/xgene-hwmon | 30 ++ drivers/hwmon/Kconfig | 7 + drivers/hwmon/Makefile | 1 + drivers/hwmon/xgene-hwmon.c | 755 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 793 insertions(+) create mode 100644 Documentation/hwmon/xgene-hwmon create mode 100644 drivers/hwmon/xgene-hwmon.c
Documentation/hwmon/xgene-hwmon new file +30 -0
@@ -0,0 +1,30 @@ +Kernel driver xgene-hwmon +======================== + +Supported chips: + * APM X-Gene SoC + +Description +----------- + +This driver adds hardware temperature and power reading support for +APM X-Gene SoC using the mailbox communication interface. +For device tree, it is the standard DT mailbox. +For ACPI, it is the PCC mailbox. + +The following sensors are supported + + * Temperature + - SoC on-die temperature in milli-degree C + - Alarm when high/over temperature occurs + * Power + - CPU power in uW + - IO power in uW + +sysfs-Interface +--------------- + +temp0_input - SoC on-die temperature (milli-degree C) +temp0_critical_alarm - An 1 would indicates on-die temperature exceeded threshold +power0_input - CPU power in (uW) +power1_input - IO power in (uW)
drivers/hwmon/Kconfig +7 -0
@@ -1787,6 +1787,13 @@ config SENSORS_ULTRA45 This driver provides support for the Ultra45 workstation environmental sensors. +config SENSORS_XGENE + tristate "APM X-Gene SoC hardware monitoring driver" + depends on XGENE_SLIMPRO_MBOX || PCC + help + If you say yes here you get support for the temperature + and power sensors for APM X-Gene SoC. + if ACPI comment "ACPI drivers"
drivers/hwmon/Makefile +1 -0
@@ -162,6 +162,7 @@ obj-$(CONFIG_SENSORS_W83L785TS) += w83l785ts.o obj-$(CONFIG_SENSORS_W83L786NG) += w83l786ng.o obj-$(CONFIG_SENSORS_WM831X) += wm831x-hwmon.o obj-$(CONFIG_SENSORS_WM8350) += wm8350-hwmon.o +obj-$(CONFIG_SENSORS_XGENE) += xgene-hwmon.o obj-$(CONFIG_PMBUS) += pmbus/
drivers/hwmon/xgene-hwmon.c new file +755 -0
755 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v4 3/3 arm64: dts: apm: Add X-Gene SoC hwmon to device tree
In reply to Hoan TranThis patch adds DT node to enable hwmon driver for APM X-Gene SoC.
--- arch/arm64/boot/dts/apm/apm-shadowcat.dtsi | 5 +++++ arch/arm64/boot/dts/apm/apm-storm.dtsi | 5 +++++ 2 files changed, 10 insertions(+)
arch/arm64/boot/dts/apm/apm-shadowcat.dtsi +5 -0
@@ -472,6 +472,11 @@ mboxes = <&mailbox 0>; }; + hwmonslimpro { + compatible = "apm,xgene-slimpro-hwmon"; + mboxes = <&mailbox 7>; + }; + serial0: serial at 10600000 { device_type = "serial"; compatible = "ns16550";
arch/arm64/boot/dts/apm/apm-storm.dtsi +5 -0
@@ -716,6 +716,11 @@ mboxes = <&mailbox 0>; }; + hwmonslimpro { + compatible = "apm,xgene-slimpro-hwmon"; + mboxes = <&mailbox 7>; + }; + serial0: serial at 1c020000 { status = "disabled"; device_type = "serial";
Signature · 1 line
1.9.1
Guenter Roeck
maintainerQuoted 9 lines · Hoan Tran
This patch set adds hardware temperature and power reading support for APM X-Gene SoC using the mailbox communication interface. For device tree, it is the standard DT mailbox.
For ACPI, it is the PCC mailbox.For ACPI, this patch is built on top and depends on patch[1]:
[1] http://www.spinics.net/lists/linux-acpi/msg66041.html
- [PATCH v3] mailbox: pcc: Support HW-Reduced Communication Subspace type 2
One thought: You might consider taking ACPI support out of the driver for now, and add it back in after the dependent patch was accepted.
Guenter
Quoted 39 lines
v4
- Return 0 if driver registers successfullyv3
- Order include files alphabetically
- Usesign_extend32()to decode temperature
- UseDEVICE_ATTR_RO()for temperature and power attributes
- Temperature and power attributes start with index 1
- Use !!amsg->param2
- Fix checkpatch WARNING with --strict flag
- Usehwmon_device_register_with_groups()
- Check invalid sensor datav2
- Increase power reading accurateness by using 2 registers
(a register for Watt, another for milli-Watt)
- Remove power reading for SoC
- Fix review comments from Guenterv1
- InitialHoan Tran (3):
Documentation: dtb: xgene: Add hwmon dts binding documentation
hwmon: xgene: Add hwmon driver
arm64: dts: apm: Add X-Gene SoC hwmon to device tree.../devicetree/bindings/hwmon/apm-xgene-hwmon.txt | 14 + Documentation/hwmon/xgene-hwmon | 30 + arch/arm64/boot/dts/apm/apm-shadowcat.dtsi | 5 + arch/arm64/boot/dts/apm/apm-storm.dtsi | 5 + drivers/hwmon/Kconfig | 7 + drivers/hwmon/Makefile | 1 + drivers/hwmon/xgene-hwmon.c | 755 +++++++++++++++++++++ 7 files changed, 817 insertions(+)create mode 100644
Documentation/devicetree/bindings/hwmon/apm-xgene-hwmon.txtcreate mode 100644Documentation/hwmon/xgene-hwmon
create mode 100644drivers/hwmon/xgene-hwmon.c
Hi Guenter,
Quoted 13 lines · Guenter Roeck
Quoted 11 lines · Hoan Tran
This patch set adds hardware temperature and power reading support for APM X-Gene SoC using the mailbox communication interface. For device tree, it is the standard DT mailbox.
For ACPI, it is the PCC mailbox.For ACPI, this patch is built on top and depends on patch[1]:
[1] http://www.spinics.net/lists/linux-acpi/msg66041.html
- [PATCH v3] mailbox: pcc: Support HW-Reduced Communication Subspace
type 2
Quoted 4 lines
One thought: You might consider taking ACPI support out of the driver for now,
and add it back in after the dependent patch was accepted.
Thanks for your suggestion. Rafael agreed to apply this patch as the link below but he didn't do it yet.
http://www.spinics.net/lists/linux-acpi/msg67100.html
Let me check with him again.
Thanks
Hoan
Quoted 45 lines
Guenter
Quoted 41 lines
v4
- Return 0 if driver registers successfullyv3
- Order include files alphabetically
- Usesign_extend32()to decode temperature
- UseDEVICE_ATTR_RO()for temperature and power attributes
- Temperature and power attributes start with index 1
- Use !!amsg->param2
- Fix checkpatch WARNING with --strict flag
- Usehwmon_device_register_with_groups()
- Check invalid sensor datav2
- Increase power reading accurateness by using 2 registers
(a register for Watt, another for milli-Watt)
- Remove power reading for SoC
- Fix review comments from Guenterv1
- InitialHoan Tran (3):
Documentation: dtb: xgene: Add hwmon dts binding documentation
hwmon: xgene: Add hwmon driver
arm64: dts: apm: Add X-Gene SoC hwmon to device tree.../devicetree/bindings/hwmon/apm-xgene-hwmon.txt | 14 + Documentation/hwmon/xgene-hwmon | 30 + arch/arm64/boot/dts/apm/apm-shadowcat.dtsi | 5 + arch/arm64/boot/dts/apm/apm-storm.dtsi | 5 + drivers/hwmon/Kconfig | 7 + drivers/hwmon/Makefile | 1 + drivers/hwmon/xgene-hwmon.c | 755 +++++++++++++++++++++ 7 files changed, 817 insertions(+)create mode 100644
Documentation/devicetree/bindings/hwmon/apm-xgene-hwmon.txt
create mode 100644Documentation/hwmon/xgene-hwmoncreate mode 100644drivers/hwmon/xgene-hwmon.c