|
Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
|
SCMI protocol generic functions and structures. More...
#include <zephyr/device.h>#include <zephyr/drivers/firmware/scmi/util.h>#include <stdint.h>#include <errno.h>Go to the source code of this file.
Data Structures | |
| struct | scmi_protocol |
| SCMI protocol structure. More... | |
| SCMI message structure. More... | |
Macros | |
| #define | SCMI_MESSAGE_HDR_MAKE(id, type, proto, token) |
| Build an SCMI message header. | |
Enumerations | |
| 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... | |
Functions | |
| int | scmi_status_to_errno (int scmi_status) |
| Convert an SCMI status code to its Linux equivalent (if possible). | |
| int | scmi_send_message (struct scmi_protocol *proto, struct scmi_message *msg, struct scmi_message *reply, bool use_polling) |
| Send an SCMI message and wait for its reply. | |
| int | scmi_protocol_get_version (struct scmi_protocol *proto, uint32_t *version) |
| Get protocol version. | |
| int | scmi_protocol_attributes_get (struct scmi_protocol *proto, uint32_t *attributes) |
| Get protocol attributes. | |
| int | scmi_protocol_message_attributes_get (struct scmi_protocol *proto, uint32_t message_id, uint32_t *attributes) |
| Get protocol message attributes. | |
| int | scmi_protocol_version_negotiate (struct scmi_protocol *proto, uint32_t version) |
| Negotiate protocol version. | |
SCMI protocol generic functions and structures.
| #define SCMI_MESSAGE_HDR_MAKE | ( | id, | |
| type, | |||
| proto, | |||
| token ) |
Build an SCMI message header.
Builds an SCMI message header based on the fields that make it up.
| id | message ID |
| type | message type |
| proto | protocol ID |
| token | message token |
| enum scmi_common_cmd |
| enum scmi_message_type |
| enum scmi_status_code |
| int scmi_protocol_attributes_get | ( | struct scmi_protocol * | proto, |
| uint32_t * | attributes ) |
Get protocol attributes.
| proto | Protocol instance |
| attributes | Pointer to store protocol attributes |
| 0 | if successful |
| negative | errno if failure |
| int scmi_protocol_get_version | ( | struct scmi_protocol * | proto, |
| uint32_t * | version ) |
Get protocol version.
| proto | Protocol instance |
| version | Pointer to store protocol version |
| 0 | if successful |
| negative | errno if failure |
| int scmi_protocol_message_attributes_get | ( | struct scmi_protocol * | proto, |
| uint32_t | message_id, | ||
| uint32_t * | attributes ) |
Get protocol message attributes.
| proto | Protocol instance |
| message_id | Message ID to query |
| attributes | Pointer to store message attributes |
| 0 | if successful |
| negative | errno if failure |
| int scmi_protocol_version_negotiate | ( | struct scmi_protocol * | proto, |
| uint32_t | version ) |
Negotiate protocol version.
| proto | Protocol instance |
| version | Desired protocol version |
| 0 | if successful |
| negative | errno if failure |
| int scmi_send_message | ( | struct scmi_protocol * | proto, |
| struct scmi_message * | msg, | ||
| struct scmi_message * | reply, | ||
| bool | use_polling ) |
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
| 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 |
| 0 | if successful |
| negative | errno if failure |
| use_polling | Specifies the communication mechanism used by the scmi platform to interact with agents.
|
| int scmi_status_to_errno | ( | int | scmi_status | ) |
Convert an SCMI status code to its Linux equivalent (if possible).
| scmi_status | SCMI status code as shown in enum scmi_status_code |
| Linux | equivalent status code |