Zephyr API Documentation
4.0.0
A Scalable Open Source RTOS
4.0.0
Toggle main menu visibility
Main Page
Related Pages
Topics
Data Structures
Data Structures
Data Structure Index
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
Files
File List
Globals
All
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
f
g
h
i
k
l
m
n
o
p
r
s
t
u
x
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Macros
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
▼
Zephyr API Documentation
►
Introduction
Deprecated List
►
Topics
►
Data Structures
▼
Files
▼
File List
►
doc
►
kernel
►
lib
►
subsys
▼
zephyr
►
acpi
►
app_memory
►
arch
►
audio
►
bluetooth
►
canbus
►
console
►
crypto
►
data
►
debug
►
devicetree
►
dfu
►
display
▼
drivers
►
adc
►
bluetooth
►
can
►
clock_control
►
comparator
►
console
►
dma
►
eeprom
►
ethernet
▼
firmware
▼
scmi
►
clk.h
►
pinctrl.h
►
protocol.h
►
shmem.h
►
transport.h
►
util.h
►
flash
►
gnss
►
gpio
►
haptics
►
i2c
►
i3c
►
ieee802154
►
interrupt_controller
►
led
►
led_strip
►
mfd
►
mipi_dsi
►
misc
►
mm
►
modem
►
mspi
►
pcie
►
pinctrl
►
pm_cpu_ops
►
power
►
pwm
►
regulator
►
rtc
►
sensor
►
serial
►
sip_svc
►
spi
►
stepper
►
timer
►
uart
►
usb
►
usb_c
►
virtualization
►
wifi
►
adc.h
►
auxdisplay.h
►
bbram.h
►
bluetooth.h
cache.h
►
can.h
►
cellular.h
►
charger.h
►
clock_control.h
►
comparator.h
►
coredump.h
►
counter.h
►
dac.h
►
dai.h
►
disk.h
►
display.h
►
dma.h
►
edac.h
►
eeprom.h
►
emul.h
►
emul_bbram.h
►
emul_fuel_gauge.h
►
emul_sensor.h
►
emul_stub_device.h
►
entropy.h
►
espi.h
►
espi_emul.h
►
espi_saf.h
►
flash.h
►
fpga.h
►
fuel_gauge.h
►
gnss.h
►
gpio.h
►
haptics.h
►
hwinfo.h
►
hwspinlock.h
►
i2c.h
►
i2c_emul.h
►
i2s.h
►
i3c.h
►
ipm.h
►
kscan.h
►
led.h
►
led_strip.h
►
loopback_disk.h
►
lora.h
►
mbox.h
►
mdio.h
►
mipi_dbi.h
►
mipi_dsi.h
►
mspi.h
►
mspi_emul.h
►
peci.h
►
pinctrl.h
►
pm_cpu_ops.h
►
ps2.h
►
ptp_clock.h
►
pwm.h
►
regulator.h
►
reset.h
►
retained_mem.h
►
rtc.h
►
sdhc.h
►
sensor.h
►
sensor_attribute_types.h
►
sensor_data_types.h
►
smbus.h
►
spi.h
►
spi_emul.h
►
stepper.h
►
swdp.h
►
syscon.h
►
tee.h
►
uart.h
►
uart_emul.h
►
uart_pipe.h
►
video-controls.h
►
video.h
►
w1.h
►
watchdog.h
►
dsp
►
dt-bindings
►
fs
►
input
►
internal
►
ipc
►
kernel
►
linker
►
llext
►
logging
►
lorawan
►
math
►
mem_mgmt
►
mgmt
►
misc
►
modbus
►
modem
►
multi_heap
►
net
►
platform
►
pm
►
posix
►
random
►
retention
►
rtio
►
sd
►
sensing
►
settings
►
shell
►
sip_svc
►
stats
►
storage
►
sys
►
task_wdt
►
timing
►
toolchain
►
tracing
►
usb
►
usb_c
►
xen
►
zbus
►
zvfs
►
bindesc.h
►
cache.h
►
device.h
►
devicetree.h
►
fatal.h
►
fatal_types.h
►
init.h
►
irq.h
►
irq_multilevel.h
►
irq_nextlevel.h
►
irq_offload.h
►
kernel.h
kernel_includes.h
►
kernel_structs.h
►
kernel_version.h
►
net_buf.h
►
shared_irq.h
►
smf.h
►
spinlock.h
►
sw_isr_table.h
►
sys_clock.h
►
syscall.h
►
toolchain.h
types.h
►
Globals
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
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
>
16
#include <
zephyr/drivers/firmware/scmi/util.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))
31
#define SCMI_MESSAGE_HDR_MAKE(id, type, proto, token) \
…
36
37
struct
scmi_channel
;
38
42
enum
scmi_message_type
{
44
SCMI_COMMAND
= 0x0,
46
SCMI_DELAYED_REPLY
= 0x2,
48
SCMI_NOTIFICATION
= 0x3,
49
};
42
enum
scmi_message_type
{
…
};
50
54
enum
scmi_status_code
{
55
SCMI_SUCCESS
= 0,
56
SCMI_NOT_SUPPORTED
= -1,
57
SCMI_INVALID_PARAMETERS
= -2,
58
SCMI_DENIED
= -3,
59
SCMI_NOT_FOUND
= -4,
60
SCMI_OUT_OF_RANGE
= -5,
61
SCMI_BUSY
= -6,
62
SCMI_COMMS_ERROR
= -7,
63
SCMI_GENERIC_ERROR
= -8,
64
SCMI_HARDWARE_ERROR
= -9,
65
SCMI_PROTOCOL_ERROR
= -10,
66
SCMI_IN_USE
= -11,
67
};
54
enum
scmi_status_code
{
…
};
68
74
struct
scmi_protocol
{
76
uint32_t
id
;
78
struct
scmi_channel
*
tx
;
80
const
struct
device
*
transport
;
82
void
*
data
;
83
};
74
struct
scmi_protocol
{
…
};
84
90
struct
scmi_message
{
91
uint32_t
hdr
;
92
uint32_t
len
;
93
void
*
content
;
94
};
90
struct
scmi_message
{
…
};
95
103
int
scmi_status_to_errno
(
int
scmi_status);
104
119
int
scmi_send_message
(
struct
scmi_protocol
*proto,
120
struct
scmi_message
*msg,
struct
scmi_message
*reply);
121
122
#endif
/* _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_PROTOCOL_H_ */
device.h
util.h
ARM SCMI utility header.
errno.h
System error numbers.
scmi_message_type
scmi_message_type
SCMI message type.
Definition
protocol.h:42
SCMI_NOTIFICATION
@ SCMI_NOTIFICATION
notification message
Definition
protocol.h:48
SCMI_DELAYED_REPLY
@ SCMI_DELAYED_REPLY
delayed reply message
Definition
protocol.h:46
SCMI_COMMAND
@ SCMI_COMMAND
command message
Definition
protocol.h:44
scmi_status_code
scmi_status_code
SCMI status codes.
Definition
protocol.h:54
SCMI_SUCCESS
@ SCMI_SUCCESS
Definition
protocol.h:55
SCMI_INVALID_PARAMETERS
@ SCMI_INVALID_PARAMETERS
Definition
protocol.h:57
SCMI_BUSY
@ SCMI_BUSY
Definition
protocol.h:61
SCMI_GENERIC_ERROR
@ SCMI_GENERIC_ERROR
Definition
protocol.h:63
SCMI_HARDWARE_ERROR
@ SCMI_HARDWARE_ERROR
Definition
protocol.h:64
SCMI_OUT_OF_RANGE
@ SCMI_OUT_OF_RANGE
Definition
protocol.h:60
SCMI_PROTOCOL_ERROR
@ SCMI_PROTOCOL_ERROR
Definition
protocol.h:65
SCMI_NOT_FOUND
@ SCMI_NOT_FOUND
Definition
protocol.h:59
SCMI_DENIED
@ SCMI_DENIED
Definition
protocol.h:58
SCMI_IN_USE
@ SCMI_IN_USE
Definition
protocol.h:66
SCMI_NOT_SUPPORTED
@ SCMI_NOT_SUPPORTED
Definition
protocol.h:56
SCMI_COMMS_ERROR
@ SCMI_COMMS_ERROR
Definition
protocol.h:62
scmi_send_message
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.
scmi_status_to_errno
int scmi_status_to_errno(int scmi_status)
Convert an SCMI status code to its Linux equivalent (if possible)
stdint.h
uint32_t
__UINT32_TYPE__ uint32_t
Definition
stdint.h:90
device
Runtime device structure (in ROM) per driver instance.
Definition
device.h:412
scmi_channel
SCMI channel structure.
Definition
transport.h:45
scmi_message
SCMI message structure.
Definition
protocol.h:90
scmi_message::hdr
uint32_t hdr
Definition
protocol.h:91
scmi_message::len
uint32_t len
Definition
protocol.h:92
scmi_message::content
void * content
Definition
protocol.h:93
scmi_protocol
SCMI protocol structure.
Definition
protocol.h:74
scmi_protocol::transport
const struct device * transport
transport layer device
Definition
protocol.h:80
scmi_protocol::tx
struct scmi_channel * tx
TX channel.
Definition
protocol.h:78
scmi_protocol::data
void * data
protocol private data
Definition
protocol.h:82
scmi_protocol::id
uint32_t id
protocol ID
Definition
protocol.h:76
zephyr
drivers
firmware
scmi
protocol.h
Generated on Sat Nov 16 2024 04:55:03 for Zephyr API Documentation by
1.12.0