80 lines · plain
1.. SPDX-License-Identifier: GPL-2.0-or-later2 3Kernel driver sbrmi4===================5 6Supported hardware:7 8 * Sideband Remote Management Interface (SB-RMI) compliant AMD SoC9 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-RMI16 support, the i2c bus number would be the bus connected from the board17 management controller (BMC) to the CPU.18 The SMBus address is really 7 bits. Some vendors and the SMBus19 specification show the address as 8 bits, left justified with the R/W20 bit as a write (0) making bit 0. Some vendors use only the 7 bits21 to describe the address.22 As mentioned in AMD's APML specification, The SB-RMI address is23 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 hardware25 address select pins.26 27 Datasheet: The SB-RMI interface and protocol along with the Advanced28 Platform Management Link (APML) Specification is available29 as part of the open source SoC register reference at:30 31 https://www.amd.com/en/support/tech-docs?keyword=5589832 33Author: Akshay Gupta <akshay.gupta@amd.com>34 35Description36-----------37 38The APML provides a way to communicate with the SB Remote Management interface39(SB-RMI) module from the external SMBus master that can be used to report socket40power on AMD platforms using mailbox command and resembles a typical 8-pin remote41power sensor's I2C interface to BMC.42 43This driver implements current power with power cap and power cap max.44 45sysfs-Interface46---------------47Power sensors can be queried and set via the standard ``hwmon`` interface48on ``sysfs``, under the directory ``/sys/class/hwmon/hwmonX`` for some value49of ``X`` (search for the ``X`` such that ``/sys/class/hwmon/hwmonX/name`` has50content ``sbrmi``)51 52================ ===== ========================================================53Name Perm Description54================ ===== ========================================================55power1_input RO Current Power consumed56power1_cap RW Power limit can be set between 0 and power1_cap_max57power1_cap_max RO Maximum powerlimit calculated and reported by the SMU FW58================ ===== ========================================================59 60The following example show how the 'Power' attribute from the i2c-addresses61can be monitored using the userspace utilities like ``sensors`` binary::62 63 # sensors64 sbrmi-i2c-1-3865 Adapter: bcm2835 I2C adapter66 power1: 61.00 W (cap = 225.00 W)67 68 sbrmi-i2c-1-3c69 Adapter: bcm2835 I2C adapter70 power1: 28.39 W (cap = 224.77 W)71 #72 73Also, Below shows how get and set the values from sysfs entries individually::74 # cat /sys/class/hwmon/hwmon1/power1_cap_max75 22500000076 77 # echo 180000000 > /sys/class/hwmon/hwmon1/power1_cap78 # cat /sys/class/hwmon/hwmon1/power1_cap79 18000000080