fix(scmi): relax requirement for exact protocol version

Currently, for the supported SCMI protocols, the version returned by the SCMI
platform agent must be exactly matching the driver's version (major version).

The recent change for the required version of Power Domain protocol means that
the platform must return version 2.0. This can be however a limitation in some
cases, where a SCMI-v1.0 platform can still be considered compatible with the
driver supported in firmware.

Relax the protocol version requirement such that any version older than the
one supported by the drivers can still be compatible.

Note: For now this has effect only on Power Domain protocol, as the other
drivers still require the "base" version 1.0.

Signed-off-by: Nicola Mazzucato <nicola.mazzucato@arm.com>
Change-Id: I310ae1869c2e952991a8d733f394029ab64087bf
This commit is contained in:
Nicola Mazzucato 2021-06-07 22:53:27 +01:00
parent fa1e016766
commit 125868c941
1 changed files with 8 additions and 2 deletions

View File

@ -25,10 +25,16 @@
#define MAKE_SCMI_VERSION(maj, min) \
((((maj) & 0xffff) << 16) | ((min) & 0xffff))
/* Macro to check if the driver is compatible with the SCMI version reported */
/*
* Check that the driver's version is same or higher than the reported SCMI
* version. We accept lower major version numbers, as all affected protocols
* so far stay backwards compatible. This might need to be revisited in the
* future.
*/
#define is_scmi_version_compatible(drv, scmi) \
((GET_SCMI_MAJOR_VER(drv) > GET_SCMI_MAJOR_VER(scmi)) || \
((GET_SCMI_MAJOR_VER(drv) == GET_SCMI_MAJOR_VER(scmi)) && \
(GET_SCMI_MINOR_VER(drv) <= GET_SCMI_MINOR_VER(scmi)))
(GET_SCMI_MINOR_VER(drv) <= GET_SCMI_MINOR_VER(scmi))))
/* SCMI Protocol identifiers */
#define SCMI_PWR_DMN_PROTO_ID 0x11