Interfaces for ARM System Control and Management Interface (SCMI) .
More...
|
| | Protocols |
| | Standard SCMI Protocol definitions .
|
| |
| | Transport |
| | SCMI Transport Layer abstraction and definitions .
|
| |
| | Utilities |
| | Helper macros and utilities for SCMI drivers .
|
| |
|
| file | protocol.h |
| | Header file for the SCMI (System Control and Management Interface) driver API.
|
| |
|
| enum | scmi_message_type { SCMI_COMMAND = 0x0
, SCMI_DELAYED_REPLY = 0x2
, SCMI_NOTIFICATION = 0x3
} |
| | SCMI message type. More...
|
| |
| enum | scmi_status_code {
SCMI_SUCCESS = 0
, SCMI_NOT_SUPPORTED = -1
, SCMI_INVALID_PARAMETERS = -2
, SCMI_DENIED = -3
,
SCMI_NOT_FOUND = -4
, SCMI_OUT_OF_RANGE = -5
, SCMI_BUSY = -6
, SCMI_COMMS_ERROR = -7
,
SCMI_GENERIC_ERROR = -8
, SCMI_HARDWARE_ERROR = -9
, SCMI_PROTOCOL_ERROR = -10
, SCMI_IN_USE = -11
} |
| | SCMI status codes. More...
|
| |
| enum | scmi_common_cmd { SCMI_MSG_PROTOCOL_VERSION = 0x0
, SCMI_MSG_PROTOCOL_ATTRIBUTES = 0x1
, SCMI_MSG_MESSAGE_ATTRIBUTES = 0x2
, SCMI_MSG_NEGOTIATE_PROTOCOL_VERSION = 0x10
} |
| | SCMI common command. More...
|
| |
Interfaces for ARM System Control and Management Interface (SCMI) .
◆ SCMI_MESSAGE_HDR_MAKE
| #define SCMI_MESSAGE_HDR_MAKE |
( |
| id, |
|
|
| type, |
|
|
| proto, |
|
|
| token ) |
#include <zephyr/drivers/firmware/scmi/protocol.h>
Value:
SCMI_FIELD_MAKE(type,
GENMASK(1, 0), 8) | \
SCMI_FIELD_MAKE(proto,
GENMASK(7, 0), 10) | \
SCMI_FIELD_MAKE(token,
GENMASK(9, 0), 18))
#define SCMI_FIELD_MAKE(x, mask, shift)
Create an SCMI message field.
Definition util.h:285
#define GENMASK(h, l)
Create a contiguous bitmask starting at bit position l and ending at position h.
Definition util.h:80
Build an SCMI message header.
Builds an SCMI message header based on the fields that make it up.
- Parameters
-
| id | message ID |
| type | message type |
| proto | protocol ID |
| token | message token |
◆ scmi_common_cmd
#include <zephyr/drivers/firmware/scmi/protocol.h>
SCMI common command.
| Enumerator |
|---|
| SCMI_MSG_PROTOCOL_VERSION | |
| SCMI_MSG_PROTOCOL_ATTRIBUTES | |
| SCMI_MSG_MESSAGE_ATTRIBUTES | |
| SCMI_MSG_NEGOTIATE_PROTOCOL_VERSION | |
◆ scmi_message_type
◆ scmi_status_code
#include <zephyr/drivers/firmware/scmi/protocol.h>
SCMI status codes.
| Enumerator |
|---|
| SCMI_SUCCESS | |
| SCMI_NOT_SUPPORTED | |
| SCMI_INVALID_PARAMETERS | |
| SCMI_DENIED | |
| SCMI_NOT_FOUND | |
| SCMI_OUT_OF_RANGE | |
| SCMI_BUSY | |
| SCMI_COMMS_ERROR | |
| SCMI_GENERIC_ERROR | |
| SCMI_HARDWARE_ERROR | |
| SCMI_PROTOCOL_ERROR | |
| SCMI_IN_USE | |
◆ scmi_protocol_attributes_get()
#include <zephyr/drivers/firmware/scmi/protocol.h>
Get protocol attributes.
- Parameters
-
| proto | Protocol instance |
| attributes | Pointer to store protocol attributes |
- Return values
-
| 0 | if successful |
| negative | errno if failure |
◆ scmi_protocol_get_version()
#include <zephyr/drivers/firmware/scmi/protocol.h>
Get protocol version.
- Parameters
-
| proto | Protocol instance |
| version | Pointer to store protocol version |
- Return values
-
| 0 | if successful |
| negative | errno if failure |
◆ scmi_protocol_message_attributes_get()
#include <zephyr/drivers/firmware/scmi/protocol.h>
Get protocol message attributes.
- Parameters
-
| proto | Protocol instance |
| message_id | Message ID to query |
| attributes | Pointer to store message attributes |
- Return values
-
| 0 | if successful |
| negative | errno if failure |
◆ scmi_protocol_version_negotiate()
#include <zephyr/drivers/firmware/scmi/protocol.h>
Negotiate protocol version.
- Parameters
-
| proto | Protocol instance |
| version | Desired protocol version |
- Return values
-
| 0 | if successful |
| negative | errno if failure |
◆ scmi_send_message()
#include <zephyr/drivers/firmware/scmi/protocol.h>
Send an SCMI message and wait for its reply.
Blocking function used to send an SCMI message over a given channel and wait for its reply
- Parameters
-
| proto | pointer to SCMI protocol |
| msg | pointer to SCMI message to send |
| reply | pointer to SCMI message in which the reply is to be written |
- Return values
-
| 0 | if successful |
| negative | errno if failure |
- Parameters
-
| use_polling | Specifies the communication mechanism used by the scmi platform to interact with agents.
- true: Polling mode — the platform actively checks the message status to determine if it has been processed
- false: Interrupt mode — the platform relies on SCMI interrupts to detect when a message has been handled.
|
◆ scmi_status_to_errno()
| int scmi_status_to_errno |
( |
int | scmi_status | ) |
|
#include <zephyr/drivers/firmware/scmi/protocol.h>
Convert an SCMI status code to its Linux equivalent (if possible)
- Parameters
-
| scmi_status | SCMI status code as shown in enum scmi_status_code |
- Return values
-
| Linux | equivalent status code |