Zephyr API Documentation 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 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#define SCMI_SHMEM_CHAN_FLAG_IRQ_BIT BIT(0)
39
47struct scmi_shmem_layout {
49 volatile uint32_t res0;
51 volatile uint32_t chan_status;
53 volatile uint32_t res1[2];
55 volatile uint32_t chan_flags;
57 volatile uint32_t len;
59 volatile uint32_t msg_hdr;
60};
61
63
64struct scmi_message;
65
75int scmi_shmem_write_message(const struct device *shmem,
76 struct scmi_message *msg,
77 bool use_polling);
78
87int scmi_shmem_read_message(const struct device *shmem,
88 struct scmi_message *msg);
89
97void scmi_shmem_update_flags(const struct device *shmem,
98 uint32_t mask, uint32_t val);
99
106
114int scmi_shmem_vendor_write_message(struct scmi_shmem_layout *layout);
115
123int scmi_shmem_vendor_read_message(const struct scmi_shmem_layout *layout);
124
128
129#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.
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.
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:142