Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
protocol.h
Go to the documentation of this file.
1/*
2 * Copyright 2024 NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_PROTOCOL_H_
14#define _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_PROTOCOL_H_
15
22
23#include <zephyr/device.h>
25#include <stdint.h>
26#include <errno.h>
27
39#define SCMI_MESSAGE_HDR_MAKE(id, type, proto, token) \
40 (SCMI_FIELD_MAKE(id, GENMASK(7, 0), 0) | \
41 SCMI_FIELD_MAKE(type, GENMASK(1, 0), 8) | \
42 SCMI_FIELD_MAKE(proto, GENMASK(7, 0), 10) | \
43 SCMI_FIELD_MAKE(token, GENMASK(9, 0), 18))
44
45struct scmi_channel;
46
58
76
86
104
115
123int scmi_status_to_errno(int scmi_status);
124
146 struct scmi_message *msg, struct scmi_message *reply,
147 bool use_polling);
148
159
170
182 uint32_t message_id, uint32_t *attributes);
183
194
198
204
205#endif /* _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_PROTOCOL_H_ */
Header file for SCMI Utility Macros.
System error numbers.
scmi_message_type
SCMI message type.
Definition protocol.h:50
int scmi_protocol_message_attributes_get(struct scmi_protocol *proto, uint32_t message_id, uint32_t *attributes)
Get protocol message attributes.
scmi_status_code
SCMI status codes.
Definition protocol.h:62
scmi_common_cmd
SCMI common command.
Definition protocol.h:80
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_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_version_negotiate(struct scmi_protocol *proto, uint32_t version)
Negotiate protocol version.
int scmi_status_to_errno(int scmi_status)
Convert an SCMI status code to its Linux equivalent (if possible).
@ SCMI_NOTIFICATION
notification message
Definition protocol.h:56
@ SCMI_DELAYED_REPLY
delayed reply message
Definition protocol.h:54
@ SCMI_COMMAND
command message
Definition protocol.h:52
@ SCMI_SUCCESS
Definition protocol.h:63
@ SCMI_INVALID_PARAMETERS
Definition protocol.h:65
@ SCMI_BUSY
Definition protocol.h:69
@ SCMI_GENERIC_ERROR
Definition protocol.h:71
@ SCMI_HARDWARE_ERROR
Definition protocol.h:72
@ SCMI_OUT_OF_RANGE
Definition protocol.h:68
@ SCMI_PROTOCOL_ERROR
Definition protocol.h:73
@ SCMI_NOT_FOUND
Definition protocol.h:67
@ SCMI_DENIED
Definition protocol.h:66
@ SCMI_IN_USE
Definition protocol.h:74
@ SCMI_NOT_SUPPORTED
Definition protocol.h:64
@ SCMI_COMMS_ERROR
Definition protocol.h:70
@ SCMI_MSG_NEGOTIATE_PROTOCOL_VERSION
Definition protocol.h:84
@ SCMI_MSG_PROTOCOL_VERSION
Definition protocol.h:81
@ SCMI_MSG_PROTOCOL_ATTRIBUTES
Definition protocol.h:82
@ SCMI_MSG_MESSAGE_ATTRIBUTES
Definition protocol.h:83
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
SCMI channel structure.
Definition transport.h:53
SCMI message structure.
Definition protocol.h:110
uint32_t hdr
Definition protocol.h:111
uint32_t len
Definition protocol.h:112
void * content
Definition protocol.h:113
SCMI protocol structure.
Definition protocol.h:92
uint32_t version
protocol supported version
Definition protocol.h:102
const struct device * transport
transport layer device
Definition protocol.h:98
struct scmi_channel * tx
TX channel.
Definition protocol.h:96
void * data
protocol private data
Definition protocol.h:100
uint32_t id
protocol ID
Definition protocol.h:94