Skip to content

Commit

Permalink
Merge tag 'hwmon-for-v5.15' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/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
  ...
  • Loading branch information
torvalds committed Aug 31, 2021
2 parents 871dda4 + 0e35f63 commit e7c1bbc
Show file tree
Hide file tree
Showing 25 changed files with 2,276 additions and 1,177 deletions.
53 changes: 53 additions & 0 deletions Documentation/devicetree/bindings/hwmon/amd,sbrmi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/hwmon/amd,sbrmi.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: >
Sideband Remote Management Interface (SB-RMI) compliant
AMD SoC power device.
maintainers:
- Akshay Gupta <[email protected]>

description: |
SB Remote Management Interface (SB-RMI) is an SMBus compatible
interface that reports AMD SoC's Power (normalized Power) using,
Mailbox Service Request and resembles a typical 8-pin remote power
sensor's I2C interface to BMC. The power attributes in hwmon
reports power in microwatts.
properties:
compatible:
enum:
- amd,sbrmi

reg:
maxItems: 1
description: |
I2C bus address of the device as specified in Section SBI SMBus Address
of the SoC register reference. The SB-RMI address is normally 78h for
socket 0 and 70h for socket 1, but it could vary based on hardware
address select pins.
\[open source SoC register reference\]
https://www.amd.com/en/support/tech-docs?keyword=55898
required:
- compatible
- reg

additionalProperties: false

examples:
- |
i2c0 {
#address-cells = <1>;
#size-cells = <0>;
sbrmi@3c {
compatible = "amd,sbrmi";
reg = <0x3c>;
};
};
...
41 changes: 41 additions & 0 deletions Documentation/devicetree/bindings/hwmon/winbond,w83781d.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---

$id: http://devicetree.org/schemas/hwmon/winbond,w83781d.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Winbond W83781 and compatible hardware monitor IC

maintainers:
- Linus Walleij <[email protected]>

properties:
compatible:
enum:
- winbond,w83781d
- winbond,w83781g
- winbond,w83782d
- winbond,w83783s
- asus,as99127f

reg:
maxItems: 1

required:
- compatible
- reg

additionalProperties: false

examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
temperature-sensor@28 {
compatible = "winbond,w83781d";
reg = <0x28>;
};
};
61 changes: 61 additions & 0 deletions Documentation/hwmon/aquacomputer_d5next.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.. SPDX-License-Identifier: GPL-2.0-or-later
Kernel driver aquacomputer-d5next
=================================

Supported devices:

* Aquacomputer D5 Next watercooling pump

Author: Aleksa Savic

Description
-----------

This driver exposes hardware sensors of the Aquacomputer D5 Next watercooling
pump, which communicates through a proprietary USB HID protocol.

Available sensors are pump and fan speed, power, voltage and current, as
well as coolant temperature. Also available through debugfs are the serial
number, firmware version and power-on count.

Attaching a fan is optional and allows it to be controlled using temperature
curves directly from the pump. If it's not connected, the fan-related sensors
will report zeroes.

The pump can be configured either through software or via its physical
interface. Configuring the pump through this driver is not implemented, as it
seems to require sending it a complete configuration. That includes addressable
RGB LEDs, for which there is no standard sysfs interface. Thus, that task is
better suited for userspace tools.

Usage notes
-----------

The pump communicates via HID reports. The driver is loaded automatically by
the kernel and supports hotswapping.

Sysfs entries
-------------

============ =============================================
temp1_input Coolant temperature (in millidegrees Celsius)
fan1_input Pump speed (in RPM)
fan2_input Fan speed (in RPM)
power1_input Pump power (in micro Watts)
power2_input Fan power (in micro Watts)
in0_input Pump voltage (in milli Volts)
in1_input Fan voltage (in milli Volts)
in2_input +5V rail voltage (in milli Volts)
curr1_input Pump current (in milli Amperes)
curr2_input Fan current (in milli Amperes)
============ =============================================

Debugfs entries
---------------

================ ===============================================
serial_number Serial number of the pump
firmware_version Version of installed firmware
power_cycles Count of how many times the pump was powered on
================ ===============================================
2 changes: 2 additions & 0 deletions Documentation/hwmon/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Hardware Monitoring Kernel Drivers
adt7475
aht10
amc6821
aquacomputer_d5next
asb100
asc7621
aspeed-pwm-tacho
Expand Down Expand Up @@ -160,6 +161,7 @@ Hardware Monitoring Kernel Drivers
pwm-fan
q54sj108a2
raspberrypi-hwmon
sbrmi
sbtsi_temp
sch5627
sch5636
Expand Down
79 changes: 79 additions & 0 deletions Documentation/hwmon/sbrmi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
.. SPDX-License-Identifier: GPL-2.0-or-later
Kernel driver sbrmi
===================

Supported hardware:

* Sideband Remote Management Interface (SB-RMI) compliant AMD SoC
device connected to the BMC via the APML.

Prefix: 'sbrmi'

Addresses scanned: This driver doesn't support address scanning.

To instantiate this driver on an AMD CPU with SB-RMI
support, the i2c bus number would be the bus connected from the board
management controller (BMC) to the CPU.
The SMBus address is really 7 bits. Some vendors and the SMBus
specification show the address as 8 bits, left justified with the R/W
bit as a write (0) making bit 0. Some vendors use only the 7 bits
to describe the address.
As mentioned in AMD's APML specification, The SB-RMI address is
normally 78h(0111 100W) or 3Ch(011 1100) for socket 0 and 70h(0111 000W)
or 38h(011 1000) for socket 1, but it could vary based on hardware
address select pins.

Datasheet: The SB-RMI interface and protocol along with the Advanced
Platform Management Link (APML) Specification is available
as part of the open source SoC register reference at:

https://www.amd.com/en/support/tech-docs?keyword=55898

Author: Akshay Gupta <[email protected]>

Description
-----------

The APML provides a way to communicate with the SB Remote Management interface
(SB-RMI) module from the external SMBus master that can be used to report socket
power on AMD platforms using mailbox command and resembles a typical 8-pin remote
power sensor's I2C interface to BMC.

This driver implements current power with power cap and power cap max.

sysfs-Interface
---------------
Power sensors can be queried and set via the standard ``hwmon`` interface
on ``sysfs``, under the directory ``/sys/class/hwmon/hwmonX`` for some value
of ``X`` (search for the ``X`` such that ``/sys/class/hwmon/hwmonX/name`` has
content ``sbrmi``)

================ ===== ========================================================
Name Perm Description
================ ===== ========================================================
power1_input RO Current Power consumed
power1_cap RW Power limit can be set between 0 and power1_cap_max
power1_cap_max RO Maximum powerlimit calculated and reported by the SMU FW
================ ===== ========================================================

The following example show how the 'Power' attribute from the i2c-addresses
can be monitored using the userspace utilities like ``sensors`` binary::

# sensors
sbrmi-i2c-1-38
Adapter: bcm2835 I2C adapter
power1: 61.00 W (cap = 225.00 W)

sbrmi-i2c-1-3c
Adapter: bcm2835 I2C adapter
power1: 28.39 W (cap = 224.77 W)
#

Also, Below shows how get and set the values from sysfs entries individually::
# cat /sys/class/hwmon/hwmon1/power1_cap_max
225000000

# echo 180000000 > /sys/class/hwmon/hwmon1/power1_cap
# cat /sys/class/hwmon/hwmon1/power1_cap
180000000
2 changes: 1 addition & 1 deletion Documentation/hwmon/scpi-hwmon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ Usage Notes

The driver relies on device tree node to indicate the presence of SCPI
support in the kernel. See
Documentation/devicetree/bindings/arm/arm,scpi.txt for details of the
Documentation/devicetree/bindings/firmware/arm,scpi.yaml for details of the
devicetree node.
2 changes: 1 addition & 1 deletion Documentation/hwmon/sht4x.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ humidity1_input Measured humidity in %H
update_interval The minimum interval for polling the sensor,
in milliseconds. Writable. Must be at least
2000.
============== =============================================
=============== ============================================
7 changes: 7 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,13 @@ L: [email protected]
S: Maintained
F: drivers/media/i2c/aptina-pll.*

AQUACOMPUTER D5 NEXT PUMP SENSOR DRIVER
M: Aleksa Savic <[email protected]>
L: [email protected]
S: Maintained
F: Documentation/hwmon/aquacomputer_d5next.rst
F: drivers/hwmon/aquacomputer_d5next.c

AQUANTIA ETHERNET DRIVER (atlantic)
M: Igor Russkikh <[email protected]>
L: [email protected]
Expand Down
5 changes: 5 additions & 0 deletions arch/x86/kernel/amd_nb.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#define PCI_DEVICE_ID_AMD_17H_M60H_DF_F4 0x144c
#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F4 0x1444
#define PCI_DEVICE_ID_AMD_19H_DF_F4 0x1654
#define PCI_DEVICE_ID_AMD_19H_M40H_ROOT 0x14b5
#define PCI_DEVICE_ID_AMD_19H_M40H_DF_F4 0x167d
#define PCI_DEVICE_ID_AMD_19H_M50H_DF_F4 0x166e

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

Expand All @@ -58,6 +61,7 @@ static const struct pci_device_id amd_nb_misc_ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F3) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_DF_F3) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F3) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F3) },
{}
};
Expand All @@ -74,6 +78,7 @@ static const struct pci_device_id amd_nb_link_ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M60H_DF_F4) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F4) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_DF_F4) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F4) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F4) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F4) },
{}
Expand Down
20 changes: 20 additions & 0 deletions drivers/hwmon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,16 @@ config SENSORS_AHT10
This driver can also be built as a module. If so, the module
will be called aht10.

config SENSORS_AQUACOMPUTER_D5NEXT
tristate "Aquacomputer D5 Next watercooling pump"
depends on USB_HID
help
If you say yes here you get support for the Aquacomputer D5 Next
watercooling pump sensors.

This driver can also be built as a module. If so, the module
will be called aquacomputer_d5next.

config SENSORS_AS370
tristate "Synaptics AS370 SoC hardware monitoring driver"
help
Expand Down Expand Up @@ -1551,6 +1561,16 @@ config SENSORS_SBTSI
This driver can also be built as a module. If so, the module will
be called sbtsi_temp.

config SENSORS_SBRMI
tristate "Emulated SB-RMI sensor"
depends on I2C
help
If you say yes here you get support for emulated RMI
sensors on AMD SoCs with APML interface connected to a BMC device.

This driver can also be built as a module. If so, the module will
be called sbrmi.

config SENSORS_SHT15
tristate "Sensiron humidity and temperature sensors. SHT15 and compat."
depends on GPIOLIB || COMPILE_TEST
Expand Down
3 changes: 2 additions & 1 deletion drivers/hwmon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ obj-$(CONFIG_SENSORS_ADT7462) += adt7462.o
obj-$(CONFIG_SENSORS_ADT7470) += adt7470.o
obj-$(CONFIG_SENSORS_ADT7475) += adt7475.o
obj-$(CONFIG_SENSORS_AHT10) += aht10.o
obj-$(CONFIG_SENSORS_AMD_ENERGY) += amd_energy.o
obj-$(CONFIG_SENSORS_APPLESMC) += applesmc.o
obj-$(CONFIG_SENSORS_AQUACOMPUTER_D5NEXT) += aquacomputer_d5next.o
obj-$(CONFIG_SENSORS_ARM_SCMI) += scmi-hwmon.o
obj-$(CONFIG_SENSORS_ARM_SCPI) += scpi-hwmon.o
obj-$(CONFIG_SENSORS_AS370) += as370-hwmon.o
Expand Down Expand Up @@ -164,6 +164,7 @@ obj-$(CONFIG_SENSORS_PWM_FAN) += pwm-fan.o
obj-$(CONFIG_SENSORS_RASPBERRYPI_HWMON) += raspberrypi-hwmon.o
obj-$(CONFIG_SENSORS_S3C) += s3c-hwmon.o
obj-$(CONFIG_SENSORS_SBTSI) += sbtsi_temp.o
obj-$(CONFIG_SENSORS_SBRMI) += sbrmi.o
obj-$(CONFIG_SENSORS_SCH56XX_COMMON)+= sch56xx-common.o
obj-$(CONFIG_SENSORS_SCH5627) += sch5627.o
obj-$(CONFIG_SENSORS_SCH5636) += sch5636.o
Expand Down
Loading

0 comments on commit e7c1bbc

Please sign in to comment.