mbox series

[0/6] misc: add amd side-band functionality

Message ID 20240704111624.1583460-1-akshay.gupta@amd.com (mailing list archive)
Headers show
Series misc: add amd side-band functionality | expand

Message

Gupta, Akshay July 4, 2024, 11:16 a.m. UTC
AMD's APML interface provides system management functionality accessed by
the BMC. Sbrmi driver under hwmon subsystem, which is probed as an i2c
driver and reports power using APML specified protocol.

However, APML interface defines few other protocols to support
full system management functionality out-of-band.

This patchset is an attempt to add all APML core functionality in one place
and provide hwmon and user interface
1. Move the i2c client probe and sbrmi core functionality from drivers/hwmon
   to drivers/misc/
2. Add a platform device, which probes the hwmon/sbrmi and continues to
   report power using the symbol exported by the misc/sbrmi-core.
3. Convert i2c to regmap which provides multiple benefits
   over direct smbus APIs.
4. Register a misc device which provides 
    a. An ioctl interface through node /dev/sbrmiX
    b. Open-sourced and widely used https://github.com/amd/esmi_oob_library
       will continue to provide user-space programmable API.

Akshay Gupta (6):
  hwmon/misc sbrmi: Move core sbrmi from hwmon to misc
  misc: sbrmi: Add platform device add to create platform device
  misc: sbrmi: Use regmap subsystem
  misc: sbrmi: Clear sbrmi status register bit SwAlertSts
  misc/hwmon: sbrmi: Add support for APML protocols
  misc: sbrmi: Add support for EPYC platform Family: 0x1A and Model:
    0x0~0x1F

 drivers/hwmon/Kconfig            |   1 +
 drivers/hwmon/sbrmi.c            | 271 ++------------
 drivers/misc/Kconfig             |   1 +
 drivers/misc/Makefile            |   1 +
 drivers/misc/amd-sb/Kconfig      |   9 +
 drivers/misc/amd-sb/Makefile     |   3 +
 drivers/misc/amd-sb/sbrmi-core.c | 617 +++++++++++++++++++++++++++++++
 drivers/misc/amd-sb/sbrmi-core.h |  36 ++
 drivers/misc/amd-sb/sbrmi-i2c.c  | 239 ++++++++++++
 include/misc/amd-sb.h            |  57 +++
 include/uapi/linux/amd-apml.h    |  74 ++++
 11 files changed, 1072 insertions(+), 237 deletions(-)
 create mode 100644 drivers/misc/amd-sb/Kconfig
 create mode 100644 drivers/misc/amd-sb/Makefile
 create mode 100644 drivers/misc/amd-sb/sbrmi-core.c
 create mode 100644 drivers/misc/amd-sb/sbrmi-core.h
 create mode 100644 drivers/misc/amd-sb/sbrmi-i2c.c
 create mode 100644 include/misc/amd-sb.h
 create mode 100644 include/uapi/linux/amd-apml.h

Comments

Greg KH July 4, 2024, 11:48 a.m. UTC | #1
On Thu, Jul 04, 2024 at 11:16:18AM +0000, Akshay Gupta wrote:
> AMD's APML interface provides system management functionality accessed by
> the BMC. Sbrmi driver under hwmon subsystem, which is probed as an i2c
> driver and reports power using APML specified protocol.

What is "APML"?  What is "BMC"?

> However, APML interface defines few other protocols to support
> full system management functionality out-of-band.

What is out-of-band here?

> This patchset is an attempt to add all APML core functionality in one place
> and provide hwmon and user interface
> 1. Move the i2c client probe and sbrmi core functionality from drivers/hwmon
>    to drivers/misc/
> 2. Add a platform device, which probes the hwmon/sbrmi and continues to
>    report power using the symbol exported by the misc/sbrmi-core.

Are you sure this is a platform device?  It better not be a pci one...

> 3. Convert i2c to regmap which provides multiple benefits
>    over direct smbus APIs.

What are those?

> 4. Register a misc device which provides 
>     a. An ioctl interface through node /dev/sbrmiX

Why?

>     b. Open-sourced and widely used https://github.com/amd/esmi_oob_library
>        will continue to provide user-space programmable API.

Will this use the new ioctl api?  If it's not present, what will it use
instead?

thanks,

greg k-h
Gupta, Akshay July 4, 2024, 2:47 p.m. UTC | #2
On 7/4/2024 5:18 PM, Greg KH wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> On Thu, Jul 04, 2024 at 11:16:18AM +0000, Akshay Gupta wrote:
>> AMD's APML interface provides system management functionality accessed by
>> the BMC. Sbrmi driver under hwmon subsystem, which is probed as an i2c
>> driver and reports power using APML specified protocol.
> What is "APML"?  What is "BMC"?
My bad, I will provide expansion for the acronyms in the first usage.
>
>> However, APML interface defines few other protocols to support
>> full system management functionality out-of-band.
> What is out-of-band here?

Out-of-band management is term used for Baseboard Management Controller 
(BMC) talking to

system management unit(IP in the processor, AMD's documentation called 
this link as side band interface.

We are using the terms out-of-band and side band interface as per context.

>
>> This patchset is an attempt to add all APML core functionality in one place
>> and provide hwmon and user interface
>> 1. Move the i2c client probe and sbrmi core functionality from drivers/hwmon
>>     to drivers/misc/
>> 2. Add a platform device, which probes the hwmon/sbrmi and continues to
>>     report power using the symbol exported by the misc/sbrmi-core.
> Are you sure this is a platform device?  It better not be a pci one...
It is not a pci device, will remove the platform device and register 
hwmon device in misc.
>
>> 3. Convert i2c to regmap which provides multiple benefits
>>     over direct smbus APIs.
> What are those?
We are planning to add i2c/i3c support and 1byte/2 byte register addressing.
>
>> 4. Register a misc device which provides
>>      a. An ioctl interface through node /dev/sbrmiX
> Why?
>
>>      b. Open-sourced and widely used https://github.com/amd/esmi_oob_library
>>         will continue to provide user-space programmable API.
> Will this use the new ioctl api?  If it's not present, what will it use
> instead?

This is an attempt to upstream the out of tree kernel module(which 
defines this ioctl), open sourced at:

https://github.com/amd/apml_modules/ and continue to support 
https://github.com/amd/esmi_oob_library

which depends only on this ioctl.

Thanks,

Akshay

> thanks,
>
> greg k-h