Skip to content

Commit e7c1bbc

Browse files
committed
Merge tag 'hwmon-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon updates from Guenter Roeck: "New drivers for: - Aquacomputer D5 Next - SB-RMI power module Added chip support to existing drivers: - Support for various Zen2 and Zen3 APUs and for Yellow Carp (SMU v13) added to k10temp driver - Support for Silicom n5010 PAC added to intel-m10-bmc driver - Support for BPD-RS600 added to pmbus/bpa-rs600 driver Other notable changes: - In k10temp, do not display Tdie on Zen CPUs if there is no difference between Tdie and Tctl - Converted adt7470 and dell-smm drivers to use devm_hwmon_device_register_with_info API - Support for temperature/pwm tables added to axi-fan-control driver - Enabled fan control for Dell Precision 7510 in dell-smm driver Various other minor improvements and fixes in several drivers" * tag 'hwmon-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (41 commits) hwmon: add driver for Aquacomputer D5 Next hwmon: (adt7470) Convert to devm_hwmon_device_register_with_info API hwmon: (adt7470) Convert to use regmap hwmon: (adt7470) Fix some style issues hwmon: (k10temp) Add support for yellow carp hwmon: (k10temp) Rework the temperature offset calculation hwmon: (k10temp) Don't show Tdie for all Zen/Zen2/Zen3 CPU/APU hwmon: (k10temp) Add additional missing Zen2 and Zen3 APUs hwmon: remove amd_energy driver in Makefile hwmon: (dell-smm) Rework SMM function debugging hwmon: (dell-smm) Mark i8k_get_fan_nominal_speed as __init hwmon: (dell-smm) Mark tables as __initconst hwmon: (pmbus/bpa-rs600) Add workaround for incorrect Pin max hwmon: (pmbus/bpa-rs600) Don't use rated limits as warn limits hwmon: (axi-fan-control) Support temperature vs pwm points hwmon: (axi-fan-control) Handle irqs in natural order hwmon: (axi-fan-control) Make sure the clock is enabled hwmon: (pmbus/ibm-cffps) Fix write bits for LED control hwmon: (w83781d) Match on device tree compatibles dt-bindings: hwmon: Add bindings for Winbond W83781D ...
2 parents 871dda4 + 0e35f63 commit e7c1bbc

25 files changed

+2276
-1177
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/hwmon/amd,sbrmi.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: >
8+
Sideband Remote Management Interface (SB-RMI) compliant
9+
AMD SoC power device.
10+
11+
maintainers:
12+
- Akshay Gupta <[email protected]>
13+
14+
description: |
15+
SB Remote Management Interface (SB-RMI) is an SMBus compatible
16+
interface that reports AMD SoC's Power (normalized Power) using,
17+
Mailbox Service Request and resembles a typical 8-pin remote power
18+
sensor's I2C interface to BMC. The power attributes in hwmon
19+
reports power in microwatts.
20+
21+
properties:
22+
compatible:
23+
enum:
24+
- amd,sbrmi
25+
26+
reg:
27+
maxItems: 1
28+
description: |
29+
I2C bus address of the device as specified in Section SBI SMBus Address
30+
of the SoC register reference. The SB-RMI address is normally 78h for
31+
socket 0 and 70h for socket 1, but it could vary based on hardware
32+
address select pins.
33+
\[open source SoC register reference\]
34+
https://www.amd.com/en/support/tech-docs?keyword=55898
35+
36+
required:
37+
- compatible
38+
- reg
39+
40+
additionalProperties: false
41+
42+
examples:
43+
- |
44+
i2c0 {
45+
#address-cells = <1>;
46+
#size-cells = <0>;
47+
48+
sbrmi@3c {
49+
compatible = "amd,sbrmi";
50+
reg = <0x3c>;
51+
};
52+
};
53+
...
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
5+
$id: http://devicetree.org/schemas/hwmon/winbond,w83781d.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: Winbond W83781 and compatible hardware monitor IC
9+
10+
maintainers:
11+
- Linus Walleij <[email protected]>
12+
13+
properties:
14+
compatible:
15+
enum:
16+
- winbond,w83781d
17+
- winbond,w83781g
18+
- winbond,w83782d
19+
- winbond,w83783s
20+
- asus,as99127f
21+
22+
reg:
23+
maxItems: 1
24+
25+
required:
26+
- compatible
27+
- reg
28+
29+
additionalProperties: false
30+
31+
examples:
32+
- |
33+
i2c {
34+
#address-cells = <1>;
35+
#size-cells = <0>;
36+
37+
temperature-sensor@28 {
38+
compatible = "winbond,w83781d";
39+
reg = <0x28>;
40+
};
41+
};
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
.. SPDX-License-Identifier: GPL-2.0-or-later
2+
3+
Kernel driver aquacomputer-d5next
4+
=================================
5+
6+
Supported devices:
7+
8+
* Aquacomputer D5 Next watercooling pump
9+
10+
Author: Aleksa Savic
11+
12+
Description
13+
-----------
14+
15+
This driver exposes hardware sensors of the Aquacomputer D5 Next watercooling
16+
pump, which communicates through a proprietary USB HID protocol.
17+
18+
Available sensors are pump and fan speed, power, voltage and current, as
19+
well as coolant temperature. Also available through debugfs are the serial
20+
number, firmware version and power-on count.
21+
22+
Attaching a fan is optional and allows it to be controlled using temperature
23+
curves directly from the pump. If it's not connected, the fan-related sensors
24+
will report zeroes.
25+
26+
The pump can be configured either through software or via its physical
27+
interface. Configuring the pump through this driver is not implemented, as it
28+
seems to require sending it a complete configuration. That includes addressable
29+
RGB LEDs, for which there is no standard sysfs interface. Thus, that task is
30+
better suited for userspace tools.
31+
32+
Usage notes
33+
-----------
34+
35+
The pump communicates via HID reports. The driver is loaded automatically by
36+
the kernel and supports hotswapping.
37+
38+
Sysfs entries
39+
-------------
40+
41+
============ =============================================
42+
temp1_input Coolant temperature (in millidegrees Celsius)
43+
fan1_input Pump speed (in RPM)
44+
fan2_input Fan speed (in RPM)
45+
power1_input Pump power (in micro Watts)
46+
power2_input Fan power (in micro Watts)
47+
in0_input Pump voltage (in milli Volts)
48+
in1_input Fan voltage (in milli Volts)
49+
in2_input +5V rail voltage (in milli Volts)
50+
curr1_input Pump current (in milli Amperes)
51+
curr2_input Fan current (in milli Amperes)
52+
============ =============================================
53+
54+
Debugfs entries
55+
---------------
56+
57+
================ ===============================================
58+
serial_number Serial number of the pump
59+
firmware_version Version of installed firmware
60+
power_cycles Count of how many times the pump was powered on
61+
================ ===============================================

Documentation/hwmon/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Hardware Monitoring Kernel Drivers
3939
adt7475
4040
aht10
4141
amc6821
42+
aquacomputer_d5next
4243
asb100
4344
asc7621
4445
aspeed-pwm-tacho
@@ -160,6 +161,7 @@ Hardware Monitoring Kernel Drivers
160161
pwm-fan
161162
q54sj108a2
162163
raspberrypi-hwmon
164+
sbrmi
163165
sbtsi_temp
164166
sch5627
165167
sch5636

Documentation/hwmon/sbrmi.rst

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
.. SPDX-License-Identifier: GPL-2.0-or-later
2+
3+
Kernel driver sbrmi
4+
===================
5+
6+
Supported hardware:
7+
8+
* Sideband Remote Management Interface (SB-RMI) compliant AMD SoC
9+
device connected to the BMC via the APML.
10+
11+
Prefix: 'sbrmi'
12+
13+
Addresses scanned: This driver doesn't support address scanning.
14+
15+
To instantiate this driver on an AMD CPU with SB-RMI
16+
support, the i2c bus number would be the bus connected from the board
17+
management controller (BMC) to the CPU.
18+
The SMBus address is really 7 bits. Some vendors and the SMBus
19+
specification show the address as 8 bits, left justified with the R/W
20+
bit as a write (0) making bit 0. Some vendors use only the 7 bits
21+
to describe the address.
22+
As mentioned in AMD's APML specification, The SB-RMI address is
23+
normally 78h(0111 100W) or 3Ch(011 1100) for socket 0 and 70h(0111 000W)
24+
or 38h(011 1000) for socket 1, but it could vary based on hardware
25+
address select pins.
26+
27+
Datasheet: The SB-RMI interface and protocol along with the Advanced
28+
Platform Management Link (APML) Specification is available
29+
as part of the open source SoC register reference at:
30+
31+
https://www.amd.com/en/support/tech-docs?keyword=55898
32+
33+
Author: Akshay Gupta <[email protected]>
34+
35+
Description
36+
-----------
37+
38+
The APML provides a way to communicate with the SB Remote Management interface
39+
(SB-RMI) module from the external SMBus master that can be used to report socket
40+
power on AMD platforms using mailbox command and resembles a typical 8-pin remote
41+
power sensor's I2C interface to BMC.
42+
43+
This driver implements current power with power cap and power cap max.
44+
45+
sysfs-Interface
46+
---------------
47+
Power sensors can be queried and set via the standard ``hwmon`` interface
48+
on ``sysfs``, under the directory ``/sys/class/hwmon/hwmonX`` for some value
49+
of ``X`` (search for the ``X`` such that ``/sys/class/hwmon/hwmonX/name`` has
50+
content ``sbrmi``)
51+
52+
================ ===== ========================================================
53+
Name Perm Description
54+
================ ===== ========================================================
55+
power1_input RO Current Power consumed
56+
power1_cap RW Power limit can be set between 0 and power1_cap_max
57+
power1_cap_max RO Maximum powerlimit calculated and reported by the SMU FW
58+
================ ===== ========================================================
59+
60+
The following example show how the 'Power' attribute from the i2c-addresses
61+
can be monitored using the userspace utilities like ``sensors`` binary::
62+
63+
# sensors
64+
sbrmi-i2c-1-38
65+
Adapter: bcm2835 I2C adapter
66+
power1: 61.00 W (cap = 225.00 W)
67+
68+
sbrmi-i2c-1-3c
69+
Adapter: bcm2835 I2C adapter
70+
power1: 28.39 W (cap = 224.77 W)
71+
#
72+
73+
Also, Below shows how get and set the values from sysfs entries individually::
74+
# cat /sys/class/hwmon/hwmon1/power1_cap_max
75+
225000000
76+
77+
# echo 180000000 > /sys/class/hwmon/hwmon1/power1_cap
78+
# cat /sys/class/hwmon/hwmon1/power1_cap
79+
180000000

Documentation/hwmon/scpi-hwmon.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ Usage Notes
3232

3333
The driver relies on device tree node to indicate the presence of SCPI
3434
support in the kernel. See
35-
Documentation/devicetree/bindings/arm/arm,scpi.txt for details of the
35+
Documentation/devicetree/bindings/firmware/arm,scpi.yaml for details of the
3636
devicetree node.

Documentation/hwmon/sht4x.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ humidity1_input Measured humidity in %H
4242
update_interval The minimum interval for polling the sensor,
4343
in milliseconds. Writable. Must be at least
4444
2000.
45-
============== =============================================
45+
=============== ============================================

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,6 +1316,13 @@ L: [email protected]
13161316
S: Maintained
13171317
F: drivers/media/i2c/aptina-pll.*
13181318

1319+
AQUACOMPUTER D5 NEXT PUMP SENSOR DRIVER
1320+
M: Aleksa Savic <[email protected]>
1321+
1322+
S: Maintained
1323+
F: Documentation/hwmon/aquacomputer_d5next.rst
1324+
F: drivers/hwmon/aquacomputer_d5next.c
1325+
13191326
AQUANTIA ETHERNET DRIVER (atlantic)
13201327
M: Igor Russkikh <[email protected]>
13211328

arch/x86/kernel/amd_nb.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#define PCI_DEVICE_ID_AMD_17H_M60H_DF_F4 0x144c
2626
#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F4 0x1444
2727
#define PCI_DEVICE_ID_AMD_19H_DF_F4 0x1654
28+
#define PCI_DEVICE_ID_AMD_19H_M40H_ROOT 0x14b5
29+
#define PCI_DEVICE_ID_AMD_19H_M40H_DF_F4 0x167d
2830
#define PCI_DEVICE_ID_AMD_19H_M50H_DF_F4 0x166e
2931

3032
/* Protect the PCI config register pairs used for SMN and DF indirect access. */
@@ -37,6 +39,7 @@ static const struct pci_device_id amd_root_ids[] = {
3739
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M10H_ROOT) },
3840
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_ROOT) },
3941
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M60H_ROOT) },
42+
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_ROOT) },
4043
{}
4144
};
4245

@@ -58,6 +61,7 @@ static const struct pci_device_id amd_nb_misc_ids[] = {
5861
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) },
5962
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F3) },
6063
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_DF_F3) },
64+
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F3) },
6165
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F3) },
6266
{}
6367
};
@@ -74,6 +78,7 @@ static const struct pci_device_id amd_nb_link_ids[] = {
7478
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M60H_DF_F4) },
7579
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F4) },
7680
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_DF_F4) },
81+
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F4) },
7782
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F4) },
7883
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F4) },
7984
{}

drivers/hwmon/Kconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,16 @@ config SENSORS_AHT10
254254
This driver can also be built as a module. If so, the module
255255
will be called aht10.
256256

257+
config SENSORS_AQUACOMPUTER_D5NEXT
258+
tristate "Aquacomputer D5 Next watercooling pump"
259+
depends on USB_HID
260+
help
261+
If you say yes here you get support for the Aquacomputer D5 Next
262+
watercooling pump sensors.
263+
264+
This driver can also be built as a module. If so, the module
265+
will be called aquacomputer_d5next.
266+
257267
config SENSORS_AS370
258268
tristate "Synaptics AS370 SoC hardware monitoring driver"
259269
help
@@ -1551,6 +1561,16 @@ config SENSORS_SBTSI
15511561
This driver can also be built as a module. If so, the module will
15521562
be called sbtsi_temp.
15531563

1564+
config SENSORS_SBRMI
1565+
tristate "Emulated SB-RMI sensor"
1566+
depends on I2C
1567+
help
1568+
If you say yes here you get support for emulated RMI
1569+
sensors on AMD SoCs with APML interface connected to a BMC device.
1570+
1571+
This driver can also be built as a module. If so, the module will
1572+
be called sbrmi.
1573+
15541574
config SENSORS_SHT15
15551575
tristate "Sensiron humidity and temperature sensors. SHT15 and compat."
15561576
depends on GPIOLIB || COMPILE_TEST

0 commit comments

Comments
 (0)