Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
|
ARM SCMI utility header. More...
Go to the source code of this file.
Macros | |
#define | SCMI_PROTOCOL_NAME(proto) |
Build protocol name from its ID. | |
#define | DT_SCMI_TRANSPORT_CHANNELS_DECLARE(node_id) |
#define | DT_SCMI_PROTOCOL_DATA_DEFINE(node_id, proto, pdata) |
#define | DT_INST_SCMI_TRANSPORT_DEFINE(inst, pm, data, config, level, prio, api) |
Define an SCMI transport driver. | |
#define | DT_SCMI_PROTOCOL_DEFINE(node_id, init_fn, pm, data, config, level, prio, api) |
Define an SCMI protocol. | |
#define | DT_INST_SCMI_PROTOCOL_DEFINE(inst, init_fn, pm, data, config, level, prio, api) |
Just like DT_SCMI_PROTOCOL_DEFINE(), but uses an instance of a DT_DRV_COMPAT compatible instead of a node identifier. | |
#define | DT_SCMI_PROTOCOL_DEFINE_NODEV(node_id, data) |
Define an SCMI protocol with no device. | |
#define | SCMI_FIELD_MAKE(x, mask, shift) |
Create an SCMI message field. | |
#define | SCMI_PROTOCOL_BASE 16 |
SCMI protocol IDs. | |
#define | SCMI_PROTOCOL_POWER_DOMAIN 17 |
#define | SCMI_PROTOCOL_SYSTEM 18 |
#define | SCMI_PROTOCOL_PERF 19 |
#define | SCMI_PROTOCOL_CLOCK 20 |
#define | SCMI_PROTOCOL_SENSOR 21 |
#define | SCMI_PROTOCOL_RESET_DOMAIN 22 |
#define | SCMI_PROTOCOL_VOLTAGE_DOMAIN 23 |
#define | SCMI_PROTOCOL_PCAP_MONITOR 24 |
#define | SCMI_PROTOCOL_PINCTRL 25 |
ARM SCMI utility header.
Contains various utility macros and macros used for protocol and transport "registration".
#define DT_INST_SCMI_PROTOCOL_DEFINE | ( | inst, | |
init_fn, | |||
pm, | |||
data, | |||
config, | |||
level, | |||
prio, | |||
api ) |
Just like DT_SCMI_PROTOCOL_DEFINE(), but uses an instance of a DT_DRV_COMPAT
compatible instead of a node identifier.
inst | instance number |
init_fn | pointer to protocol's initialization function |
api | pointer to protocol's subsystem API |
pm | pointer to the protocol's power management resources |
data | pointer to protocol's private data |
config | pointer to protocol's private constant data |
level | protocol initialization level |
prio | protocol's priority within its initialization level |
#define DT_INST_SCMI_TRANSPORT_DEFINE | ( | inst, | |
pm, | |||
data, | |||
config, | |||
level, | |||
prio, | |||
api ) |
Define an SCMI transport driver.
This is merely a wrapper over DEVICE_DT_INST_DEFINE(), but is required since transport layer drivers are not allowed to place their own init() function in the init section. Instead, transport layer drivers place the scmi_core_transport_init() function in the init section, which, in turn, will call the transport layer driver init() function. This is required because the SCMI core needs to perform channel binding and setup during the transport layer driver's initialization.
#define DT_SCMI_PROTOCOL_DATA_DEFINE | ( | node_id, | |
proto, | |||
pdata ) |
#define DT_SCMI_PROTOCOL_DEFINE | ( | node_id, | |
init_fn, | |||
pm, | |||
data, | |||
config, | |||
level, | |||
prio, | |||
api ) |
Define an SCMI protocol.
This macro performs three important functions: 1) It defines a struct scmi_protocol
, which is needed by all protocol drivers to work with the SCMI API.
2) It declares the static channels bound to the protocol. This is only applicable if the transport layer driver supports static channels.
3) It creates a struct device
a sets the data
field to the newly defined struct scmi_protocol
. This is needed because the protocol driver needs to work with the SCMI API and the subsystem API.
node_id | protocol node identifier |
init_fn | pointer to protocol's initialization function |
api | pointer to protocol's subsystem API |
pm | pointer to the protocol's power management resources |
data | pointer to protocol's private data |
config | pointer to protocol's private constant data |
level | protocol initialization level |
prio | protocol's priority within its initialization level |
#define DT_SCMI_PROTOCOL_DEFINE_NODEV | ( | node_id, | |
data ) |
Define an SCMI protocol with no device.
Variant of DT_SCMI_PROTOCOL_DEFINE(), but no struct device
is created and no initialization function is called during system initialization. This is useful for protocols that are not really part of a subsystem with an API (e.g: pinctrl).
node_id | protocol node identifier |
data | protocol private data |
#define DT_SCMI_TRANSPORT_CHANNELS_DECLARE | ( | node_id | ) |
#define SCMI_FIELD_MAKE | ( | x, | |
mask, | |||
shift ) |
Create an SCMI message field.
Data might not necessarily be encoded in the first x bits of an SCMI message parameter/return value. This comes in handy when building said parameters/ return values.
x | value to encode |
mask | value to perform bitwise-and with x |
shift | value to left-shift masked x |
#define SCMI_PROTOCOL_BASE 16 |
SCMI protocol IDs.
Each SCMI protocol is identified by an ID. Each of these IDs needs to be in decimal since they might be used to build protocol and static channel names.
#define SCMI_PROTOCOL_CLOCK 20 |
#define SCMI_PROTOCOL_NAME | ( | proto | ) |
Build protocol name from its ID.
Given a protocol ID, this macro builds the protocol name. This is done by concatenating the scmi_protocol_ construct with the given protocol ID.
proto | protocol ID in decimal format |
#define SCMI_PROTOCOL_PCAP_MONITOR 24 |
#define SCMI_PROTOCOL_PERF 19 |
#define SCMI_PROTOCOL_PINCTRL 25 |
#define SCMI_PROTOCOL_POWER_DOMAIN 17 |
#define SCMI_PROTOCOL_RESET_DOMAIN 22 |
#define SCMI_PROTOCOL_SENSOR 21 |
#define SCMI_PROTOCOL_SYSTEM 18 |
#define SCMI_PROTOCOL_VOLTAGE_DOMAIN 23 |