Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
shmem.h
Go to the documentation of this file.
1/*
2 * Copyright 2024,2026 NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_SHMEM_H_
14#define _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_SHMEM_H_
15
16#include <zephyr/device.h>
17#include <zephyr/arch/cpu.h>
18#include <errno.h>
19
26
28
33#define SCMI_SHMEM_CHAN_STATUS_BUSY_BIT BIT(0)
38
42#define SCMI_SHMEM_CHAN_FLAG_IRQ_BIT BIT(0)
43
51struct scmi_shmem_layout {
53 volatile uint32_t res0;
55 volatile uint32_t chan_status;
57 volatile uint32_t res1[2];
59 volatile uint32_t chan_flags;
61 volatile uint32_t len;
63 volatile uint32_t msg_hdr;
64};
65
67
68struct scmi_message;
69
79int scmi_shmem_write_message(const struct device *shmem,
80 struct scmi_message *msg,
81 bool use_polling);
82
92int scmi_shmem_read_hdr(const struct device *shmem, uint32_t *hdr);
93
102int scmi_shmem_read_message(const struct device *shmem,
103 struct scmi_message *msg);
104
112void scmi_shmem_update_flags(const struct device *shmem,
113 uint32_t mask, uint32_t val);
114
121
129int scmi_shmem_vendor_write_message(struct scmi_shmem_layout *layout);
130
138int scmi_shmem_vendor_read_message(const struct scmi_shmem_layout *layout);
139
148void scmi_shmem_mark_channel_free(const struct device *dev);
149
153
154#endif /* _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_SHMEM_H_ */
System error numbers.
uint32_t scmi_shmem_channel_status(const struct device *shmem)
Read a channel's status.
int scmi_shmem_vendor_read_message(const struct scmi_shmem_layout *layout)
Process vendor specific features when reading message.
int scmi_shmem_read_hdr(const struct device *shmem, uint32_t *hdr)
Read a message header from a SHMEM area.
void scmi_shmem_update_flags(const struct device *shmem, uint32_t mask, uint32_t val)
Update the channel flags.
int scmi_shmem_vendor_write_message(struct scmi_shmem_layout *layout)
Process vendor specific features when writing message.
void scmi_shmem_mark_channel_free(const struct device *dev)
Mark a SHMEM channel as free (acknowledge message consumption).
int scmi_shmem_read_message(const struct device *shmem, struct scmi_message *msg)
Read a message from a SHMEM area.
int scmi_shmem_write_message(const struct device *shmem, struct scmi_message *msg, bool use_polling)
Write a message in the SHMEM area.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
SCMI message structure.
Definition protocol.h:194
uint32_t hdr
Message header (see SCMI_MESSAGE_HDR_MAKE).
Definition protocol.h:196