Zephyr Project API 4.4.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
29#define SCMI_SHORT_NAME_MAX_SIZE 16
30
42#define SCMI_MESSAGE_HDR_MAKE(id, type, proto, token) \
43 (SCMI_FIELD_MAKE(id, GENMASK(7, 0), 0) | \
44 SCMI_FIELD_MAKE(type, GENMASK(1, 0), 8) | \
45 SCMI_FIELD_MAKE(proto, GENMASK(7, 0), 10) | \
46 SCMI_FIELD_MAKE(token, GENMASK(9, 0), 18))
47
48struct scmi_channel;
49
61
79
97
110 union {
113 struct {
118 };
119 };
120};
121
132
140int scmi_status_to_errno(int scmi_status);
141
163 struct scmi_message *msg, struct scmi_message *reply,
164 bool use_polling);
165
176
187
199 uint32_t message_id, uint32_t *attributes);
200
211
215
221
222#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:53
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:65
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:59
@ SCMI_DELAYED_REPLY
delayed reply message
Definition protocol.h:57
@ SCMI_COMMAND
command message
Definition protocol.h:55
@ SCMI_SUCCESS
Definition protocol.h:66
@ SCMI_INVALID_PARAMETERS
Definition protocol.h:68
@ SCMI_BUSY
Definition protocol.h:72
@ SCMI_GENERIC_ERROR
Definition protocol.h:74
@ SCMI_HARDWARE_ERROR
Definition protocol.h:75
@ SCMI_OUT_OF_RANGE
Definition protocol.h:71
@ SCMI_PROTOCOL_ERROR
Definition protocol.h:76
@ SCMI_NOT_FOUND
Definition protocol.h:70
@ SCMI_DENIED
Definition protocol.h:69
@ SCMI_IN_USE
Definition protocol.h:77
@ SCMI_NOT_SUPPORTED
Definition protocol.h:67
@ SCMI_COMMS_ERROR
Definition protocol.h:73
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
SCMI channel structure.
Definition transport.h:52
SCMI message structure.
Definition protocol.h:127
uint32_t hdr
Definition protocol.h:128
uint32_t len
Definition protocol.h:129
void * content
Definition protocol.h:130
SCMI protocol version.
Definition protocol.h:108
uint16_t major
minor protocol revision
Definition protocol.h:117
uint16_t minor
major protocol revision
Definition protocol.h:115
uint32_t raw
Raw 32-bit protocol version value.
Definition protocol.h:112
SCMI protocol structure.
Definition protocol.h:85
uint32_t version
protocol supported version
Definition protocol.h:95
const struct device * transport
transport layer device
Definition protocol.h:91
struct scmi_channel * tx
TX channel.
Definition protocol.h:89
void * data
protocol private data
Definition protocol.h:93
uint32_t id
protocol ID
Definition protocol.h:87