opensbi icon indicating copy to clipboard operation
opensbi copied to clipboard

SCMI protocols for power management

Open JeremyAngCH opened this issue 3 years ago • 11 comments

If the RISC-V platform is using SCMI protocols for power management, when we try to upstream the code, the SCMI code should be part of the library private to the specific platform (under '/platform/<platform_name>') or it can be a general library ( under '/lib/utils') ?

JeremyAngCH avatar Oct 16 '22 10:10 JeremyAngCH

It can be a general library under lib/utils if it useful to other platforms as well.

The SCMI protocol parts can be under lib/utils whereas SCMI transport can be under platform/.

Regards, Anup

avpatel avatar Oct 16 '22 12:10 avpatel

Thanks for the reply. The SCMI protocol library should be general enough to be used by other platforms as well.
Is it OK if the SCMI code is adapted/ported from ATF ?

JeremyAngCH avatar Oct 17 '22 01:10 JeremyAngCH

Yes, we can have a ported version of SCMI protocol library under lib/utils but please make sure that:

  1. Original sources are licensed under BSD 2-clause
  2. Preserve copyright of original authors. You may append additional copyright

General caution in-context of SCMI:

  1. SCMI is an ARM proprietary specification
  2. There could/will be portion of SCMI spec which refer to ARM ISA (e.g. MPIDR_EL1) which won't fit in RISC-V world.

Ideally, we should have some SCMI equivalent RISC-V specification for messaging interface.

Regards, Anup

avpatel avatar Oct 17 '22 15:10 avpatel

Thanks for the advise.
The SCMI code from ATF is BSD 3-clause, is that OK ?
I have seen some of the libraries used in OpenSBI are licensed under BSD 3-clause as well: https://github.com/riscv-software-src/opensbi/tree/bd355213bfbb209c047e8cc0df56936f6705477f/lib/utils/libquad

JeremyAngCH avatar Oct 18 '22 05:10 JeremyAngCH

Yes, BSD 3-clause should be fine.

avpatel avatar Oct 21 '22 03:10 avpatel

Here are my 2 cents: Just skimming through SCMI spec, It has numerous references to PSCI system reset & ACPI power states. Those will be different in RISC-V world.

If you plan to use SCMI, it can't be standardized in RISC-V in the future due to legal reasons. We had few rounds of discussion around this in 2020 during platform specification. The implementation can be added in OpenSBI but it will be partial implementation at best.

It would be great to have similar messaging protocol for RISC-V. In the beginning, it can be kept in OpenSBI as well. If ther eis more interest from other RISC-V vendors, we can try to standardize through RVI as well.

atishp04 avatar Oct 21 '22 06:10 atishp04

Thanks. I totally agree with you. The minimal or base SCMI implementation (sufficient for common use cases) will be part of the "3rd party" protocol in OpenSBI. Eventually, it shall be replaced with similar messaging protocol defined and standardized for RISC-V world.

JeremyAngCH avatar Oct 22 '22 08:10 JeremyAngCH

We (Ventana) are also interested in a SCMI-like messaging protocol which is RISC-V focused.

Maybe we can call it RISC-V SCMP ?

I would suggest having an initial draft of RISC-V SCMP spec under <opensbi_source>/docs directory. If more RISC-V members are interested then we can RISC-V International can standardise it in future.

Regards, Anup

avpatel avatar Oct 22 '22 12:10 avpatel

SCMP (System Control and Management Protocol) sounds good to me. Does it means we are going to have an equivalent "SCP-Firmware" (link below) as well in the future, right ?

https://github.com/ARM-software/SCP-firmware

JeremyAngCH avatar Oct 25 '22 07:10 JeremyAngCH

I think having an open RISC-V SCMP specification is a good starting point.

Typically SCP-style power management firmware have a lot of implementation specific details so SoC vendors (just like ARM world) may want to keep it closed source. In fact, the ARM SCP-firmware is mainly used for ARM evaluation boards and other companies (Qualcomm for example) have their own SCP-style firmware.

Regards, Anup

avpatel avatar Oct 25 '22 08:10 avpatel