Linux Documentation
 help / color / mirror / Atom feed
* [PATCH v1 0/4] misc: amd-sbi: add DIMM thermal sensors to sbrmi
@ 2026-11-16 12:02 Akshay Gupta
  2026-11-16 12:02 ` [PATCH v1 1/4] misc: amd-sbi: use guard() for data->lock mutex Akshay Gupta
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Akshay Gupta @ 2026-11-16 12:02 UTC (permalink / raw)
  To: linux-hwmon, devicetree, linux-kernel, linux-doc
  Cc: linux, robh, krzk+dt, conor+dt, corbet, skhan, rdunlap, arnd,
	gregkh, naveenkrishna.chatradhi, Anand.Umarji, Akshay Gupta

The sbrmi hwmon device reports socket power. SB-RMI can also read the
TS0 and TS1 thermal sensors on each DIMM, which a BMC needs beside the
power attributes. This series reports those sensors as temperature
channels on the same hwmon device.

The read is mailbox command 0x48 with a Mode 1 DIMM_ADDRESS:

  bit[7]   1 (Mode 1)
  bit[6]   sensor select (0 = TS0, 1 = TS1)
  bit[5]   reserved
  bit[4]   DIMM slot
  bit[3:0] memory channel

Up to 16 DIMMs are reported, two sensors each. DIMM n is temp(n+1)
for TS0 and temp(n+17) for TS1. Each channel is labelled
DIMM_TS<t>_UMC<n>. With one DIMM per channel, n is the memory channel.
With two, n is channel * 2 + slot, and the addresses interleave
(0x80, 0x90, 0x81, ...). The temp index is the DIMM number, so a DIMM
keeps the same tempN when other sensors are left out of the map.

DataOut[31:21] is an 11-bit two's complement value in steps of
0.25 degC. The driver reports it to hwmon in millidegrees Celsius.

Boards differ in how many DIMMs are fitted per memory channel and in
which sensors are populated. Two optional firmware properties describe
that:

  amd,dpc        DIMMs per channel, 1 or 2. The default is 1.
  amd,dimm-ids   Mode 1 address of each sensor to expose. Only those
                 channels are visible. If the property is absent, all
                 32 channels are exposed, and a read of a sensor that
                 is not fitted returns the firmware error.

The binding and the driver reject an address without bit[7], with the
reserved bit[5], with the slot bit set when amd,dpc is 1, with a
memory channel above 7 when amd,dpc is 2, or listed twice. An empty
or unreadable amd,dimm-ids property is rejected as well. With one DIMM
per channel the allowed values are 0x80-0x8f and 0xc0-0xcf. With two
they are 0x80-0x87, 0x90-0x97, 0xc0-0xc7 and 0xd0-0xd7.

The mailbox transaction and the existing hwmon registration both live
in drivers/misc/amd-sbi, so the new channels are added there, on the
hwmon device the driver already publishes.

Patches:

  1. Switch sbrmi_data->lock to guard(). No functional change. The
     DIMM reads go through rmi_mailbox_xfer(), and this lets the error
     paths in that function return directly. The patch stands on its
     own.

  2. Add amd,dpc and amd,dimm-ids to the amd,sbrmi binding, and mention
     the DIMM sensors in the title, description and example.

  3. Report the sensors from rmi-hwmon: tempX_input and tempX_label,
     visibility taken from the DIMM map, and the 0.25 degC conversion.

  4. Document the temperature attributes and the DIMM-to-temp mapping
     in Documentation/hwmon/sbrmi.rst, and point to it from the SB-RMI
     section of Documentation/misc-devices/amd-sbi.rst.

Thanks,
Akshay Gupta

Prathima Lk (4):
  misc: amd-sbi: use guard() for data->lock mutex
  dt-bindings: hwmon: add DIMM thermal sensor properties
  misc: amd-sbi: add DIMM thermal sensor support
  Documentation: hwmon: document DIMM thermal sensor channels

 .../devicetree/bindings/hwmon/amd,sbrmi.yaml  |  59 ++++-
 Documentation/hwmon/sbrmi.rst                 |  37 +++
 Documentation/misc-devices/amd-sbi.rst        |   4 +-
 drivers/misc/amd-sbi/rmi-core.c               | 148 ++++++-----
 drivers/misc/amd-sbi/rmi-core.h               |  10 +
 drivers/misc/amd-sbi/rmi-hwmon.c              | 236 ++++++++++++++++--
 6 files changed, 395 insertions(+), 99 deletions(-)
-- 
2.34.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-16 12:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 12:02 [PATCH v1 0/4] misc: amd-sbi: add DIMM thermal sensors to sbrmi Akshay Gupta
2026-11-16 12:02 ` [PATCH v1 1/4] misc: amd-sbi: use guard() for data->lock mutex Akshay Gupta
2026-11-16 12:02 ` [PATCH v1 2/4] dt-bindings: hwmon: add DIMM thermal sensor properties Akshay Gupta
2026-11-16 12:02 ` [PATCH v1 3/4] misc: amd-sbi: add DIMM thermal sensor support Akshay Gupta
2026-11-16 12:02 ` [PATCH v1 4/4] Documentation: hwmon: document DIMM thermal sensor channels Akshay Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox