Zephyr API Documentation
4.2.99
A Scalable Open Source RTOS
4.2.99
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
modules
subsys
zephyr
acpi
app_memory
arch
audio
bluetooth
canbus
console
crypto
data
debug
devicetree
dfu
display
drivers
adc
bluetooth
can
clock_control
comparator
console
dac
dma
edac
eeprom
ethernet
firmware
scmi
nxp
clk.h
pinctrl.h
power.h
protocol.h
shmem.h
transport.h
util.h
tisci
flash
gnss
gpio
haptics
i2c
i3c
ieee802154
interrupt_controller
led
led_strip
mfd
mic_privacy
mipi_dsi
misc
mm
modem
mspi
pcie
pinctrl
pm_cpu_ops
power
psi5
pwm
regulator
retained_mem
rtc
sensor
sent
serial
sip_svc
spi
stepper
timer
uart
usb
usb_c
video
virtio
virtualization
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
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_clock.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
virtio.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
pmci
portability
posix
psa
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
util.h
Go to the documentation of this file.
1
/*
2
* Copyright 2024 NXP
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
14
15
#ifndef _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_UTIL_H_
16
#define _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_UTIL_H_
17
29
#define SCMI_PROTOCOL_NAME(proto) CONCAT(scmi_protocol_, proto)
30
31
#ifdef CONFIG_ARM_SCMI_TRANSPORT_HAS_STATIC_CHANNELS
32
33
#ifdef CONFIG_ARM_SCMI_MAILBOX_TRANSPORT
47
#define DT_SCMI_TRANSPORT_PROTO_HAS_CHAN(node_id, idx)\
48
DT_PROP_HAS_IDX(node_id, shmem, idx)
49
#else
/* CONFIG_ARM_SCMI_MAILBOX_TRANSPORT */
50
#error "Transport with static channels needs to define HAS_CHAN macro"
51
#endif
/* CONFIG_ARM_SCMI_MAILBOX_TRANSPORT */
52
53
#define SCMI_TRANSPORT_CHAN_NAME(proto, idx) CONCAT(scmi_channel_, proto, _, idx)
54
66
#define DT_SCMI_TRANSPORT_TX_CHAN_DECLARE(node_id) \
67
COND_CODE_1(DT_SCMI_TRANSPORT_PROTO_HAS_CHAN(node_id, 0), \
68
(extern struct scmi_channel \
69
SCMI_TRANSPORT_CHAN_NAME(DT_REG_ADDR_RAW(node_id), 0);), \
70
(extern struct scmi_channel \
71
SCMI_TRANSPORT_CHAN_NAME(SCMI_PROTOCOL_BASE, 0);)) \
72
85
#define DT_SCMI_TRANSPORT_CHANNELS_DECLARE(node_id) \
86
DT_SCMI_TRANSPORT_TX_CHAN_DECLARE(node_id) \
87
96
#define DT_INST_SCMI_TRANSPORT_CHANNELS_DECLARE(inst) \
97
DT_SCMI_TRANSPORT_CHANNELS_DECLARE(DT_INST(inst, DT_DRV_COMPAT))
98
111
#define DT_SCMI_TRANSPORT_TX_CHAN(node_id) \
112
COND_CODE_1(DT_SCMI_TRANSPORT_PROTO_HAS_CHAN(node_id, 0), \
113
(&SCMI_TRANSPORT_CHAN_NAME(DT_REG_ADDR_RAW(node_id), 0)), \
114
(&SCMI_TRANSPORT_CHAN_NAME(SCMI_PROTOCOL_BASE, 0)))
115
128
#define DT_SCMI_TRANSPORT_CHAN_DEFINE(node_id, idx, proto, pdata) \
129
struct scmi_channel SCMI_TRANSPORT_CHAN_NAME(proto, idx) = \
130
{ \
131
.data = pdata, \
132
}
133
149
#define DT_SCMI_PROTOCOL_DATA_DEFINE(node_id, proto, pdata) \
150
STRUCT_SECTION_ITERABLE(scmi_protocol, SCMI_PROTOCOL_NAME(proto)) = \
151
{ \
152
.id = proto, \
153
.tx = DT_SCMI_TRANSPORT_TX_CHAN(node_id), \
154
.data = pdata, \
155
}
156
157
#else
/* CONFIG_ARM_SCMI_TRANSPORT_HAS_STATIC_CHANNELS */
158
159
#define DT_SCMI_TRANSPORT_CHANNELS_DECLARE(node_id)
160
161
#define DT_SCMI_PROTOCOL_DATA_DEFINE(node_id, proto, pdata) \
162
STRUCT_SECTION_ITERABLE(scmi_protocol, SCMI_PROTOCOL_NAME(proto)) = \
163
{ \
164
.id = proto, \
165
.data = pdata, \
166
}
161
#define DT_SCMI_PROTOCOL_DATA_DEFINE(node_id, proto, pdata) \
…
167
168
#endif
/* CONFIG_ARM_SCMI_TRANSPORT_HAS_STATIC_CHANNELS */
169
182
#define DT_INST_SCMI_TRANSPORT_DEFINE(inst, pm, data, config, level, prio, api) \
183
DEVICE_DT_INST_DEFINE(inst, &scmi_core_transport_init, \
184
pm, data, config, level, prio, api)
182
#define DT_INST_SCMI_TRANSPORT_DEFINE(inst, pm, data, config, level, prio, api) \
…
185
211
#define DT_SCMI_PROTOCOL_DEFINE(node_id, init_fn, pm, data, config, \
212
level, prio, api) \
213
DT_SCMI_TRANSPORT_CHANNELS_DECLARE(node_id) \
214
DT_SCMI_PROTOCOL_DATA_DEFINE(node_id, DT_REG_ADDR_RAW(node_id), data); \
215
DEVICE_DT_DEFINE(node_id, init_fn, pm, \
216
&SCMI_PROTOCOL_NAME(DT_REG_ADDR_RAW(node_id)), \
217
config, level, prio, api)
218
232
#define DT_INST_SCMI_PROTOCOL_DEFINE(inst, init_fn, pm, data, config, \
233
level, prio, api) \
234
DT_SCMI_PROTOCOL_DEFINE(DT_INST(inst, DT_DRV_COMPAT), init_fn, pm, \
235
data, config, level, prio, api)
236
248
#define DT_SCMI_PROTOCOL_DEFINE_NODEV(node_id, data) \
249
DT_SCMI_TRANSPORT_CHANNELS_DECLARE(node_id) \
250
DT_SCMI_PROTOCOL_DATA_DEFINE(node_id, DT_REG_ADDR_RAW(node_id), data)
248
#define DT_SCMI_PROTOCOL_DEFINE_NODEV(node_id, data) \
…
251
264
#define SCMI_FIELD_MAKE(x, mask, shift)\
265
(((uint32_t)(x) & (mask)) << (shift))
264
#define SCMI_FIELD_MAKE(x, mask, shift)\
…
266
275
#define SCMI_PROTOCOL_BASE 16
276
#define SCMI_PROTOCOL_POWER_DOMAIN 17
277
#define SCMI_PROTOCOL_SYSTEM 18
278
#define SCMI_PROTOCOL_PERF 19
279
#define SCMI_PROTOCOL_CLOCK 20
280
#define SCMI_PROTOCOL_SENSOR 21
281
#define SCMI_PROTOCOL_RESET_DOMAIN 22
282
#define SCMI_PROTOCOL_VOLTAGE_DOMAIN 23
283
#define SCMI_PROTOCOL_PCAP_MONITOR 24
284
#define SCMI_PROTOCOL_PINCTRL 25
285
286
#endif
/* _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_UTIL_H_ */
zephyr
drivers
firmware
scmi
util.h
Generated on
for Zephyr API Documentation by
1.14.0