sbrmi.rst 3.0 KB

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