Zephyr API Documentation 4.0.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#ifndef _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_PROTOCOL_H_
13#define _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_PROTOCOL_H_
14
15#include <zephyr/device.h>
17#include <stdint.h>
18#include <errno.h>
19
31#define SCMI_MESSAGE_HDR_MAKE(id, type, proto, token) \
32 (SCMI_FIELD_MAKE(id, GENMASK(7, 0), 0) | \
33 SCMI_FIELD_MAKE(type, GENMASK(1, 0), 8) | \
34 SCMI_FIELD_MAKE(proto, GENMASK(7, 0), 10) | \
35 SCMI_FIELD_MAKE(token, GENMASK(9, 0), 18))
36
37struct scmi_channel;
38
50
68
80 const struct device *transport;
82 void *data;
83};
84
95
103int scmi_status_to_errno(int scmi_status);
104
120 struct scmi_message *msg, struct scmi_message *reply);
121
122#endif /* _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_PROTOCOL_H_ */
ARM SCMI utility header.
System error numbers.
scmi_message_type
SCMI message type.
Definition protocol.h:42
@ SCMI_NOTIFICATION
notification message
Definition protocol.h:48
@ SCMI_DELAYED_REPLY
delayed reply message
Definition protocol.h:46
@ SCMI_COMMAND
command message
Definition protocol.h:44
scmi_status_code
SCMI status codes.
Definition protocol.h:54
@ SCMI_SUCCESS
Definition protocol.h:55
@ SCMI_INVALID_PARAMETERS
Definition protocol.h:57
@ SCMI_BUSY
Definition protocol.h:61
@ SCMI_GENERIC_ERROR
Definition protocol.h:63
@ SCMI_HARDWARE_ERROR
Definition protocol.h:64
@ SCMI_OUT_OF_RANGE
Definition protocol.h:60
@ SCMI_PROTOCOL_ERROR
Definition protocol.h:65
@ SCMI_NOT_FOUND
Definition protocol.h:59
@ SCMI_DENIED
Definition protocol.h:58
@ SCMI_IN_USE
Definition protocol.h:66
@ SCMI_NOT_SUPPORTED
Definition protocol.h:56
@ SCMI_COMMS_ERROR
Definition protocol.h:62
int scmi_send_message(struct scmi_protocol *proto, struct scmi_message *msg, struct scmi_message *reply)
Send an SCMI message and wait for its reply.
int scmi_status_to_errno(int scmi_status)
Convert an SCMI status code to its Linux equivalent (if possible)
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Runtime device structure (in ROM) per driver instance.
Definition device.h:412
SCMI channel structure.
Definition transport.h:45
SCMI message structure.
Definition protocol.h:90
uint32_t hdr
Definition protocol.h:91
uint32_t len
Definition protocol.h:92
void * content
Definition protocol.h:93
SCMI protocol structure.
Definition protocol.h:74
const struct device * transport
transport layer device
Definition protocol.h:80
struct scmi_channel * tx
TX channel.
Definition protocol.h:78
void * data
protocol private data
Definition protocol.h:82
uint32_t id
protocol ID
Definition protocol.h:76