Lines Matching +full:scmi +full:- +full:shmem
1 /* SPDX-License-Identifier: GPL-2.0 */
3 * System Control and Management Interface (SCMI) Message Protocol
5 * and function prototypes used in all the different SCMI protocols.
7 * Copyright (C) 2018-2021 ARM Ltd.
43 * struct scmi_msg_resp_prot_version - Response for a message
75 * maximum number of in-flight messages on a specific platform, but such value
83 * struct scmi_msg_hdr - Message(Tx/Rx) header
87 * @type: The SCMI type for this message
105 * pack_scmi_header() - packs and returns 32-bit header
110 * Return: 32-bit packed message header to be sent to the platform.
114 return FIELD_PREP(MSG_ID_MASK, hdr->id) | in pack_scmi_header()
115 FIELD_PREP(MSG_TYPE_MASK, hdr->type) | in pack_scmi_header()
116 FIELD_PREP(MSG_TOKEN_ID_MASK, hdr->seq) | in pack_scmi_header()
117 FIELD_PREP(MSG_PROTOCOL_ID_MASK, hdr->protocol_id); in pack_scmi_header()
121 * unpack_scmi_header() - unpacks and records message and protocol id
123 * @msg_hdr: 32-bit packed message header sent from the platform
128 hdr->id = MSG_XTRACT_ID(msg_hdr); in unpack_scmi_header()
129 hdr->protocol_id = MSG_XTRACT_PROT_ID(msg_hdr); in unpack_scmi_header()
130 hdr->type = MSG_XTRACT_TYPE(msg_hdr); in unpack_scmi_header()
134 * struct scmi_msg - Message(Tx/Rx) structure
145 * struct scmi_xfer - Structure representing a message flow
150 * @rx: Receive message, the buffer should be pre-allocated to store
151 * message. If request-ACK protocol is used, we can reuse the same
164 * though the timed-out transaction will anyway cause the command
165 * request to be reported as failed by time-out, the underlying xfer
171 * - SCMI_XFER_SENT_OK -> SCMI_XFER_RESP_OK [ -> SCMI_XFER_DRESP_OK ]
172 * - SCMI_XFER_SENT_OK -> SCMI_XFER_DRESP_OK
209 if (xfer_->hdr.seq == k_) \
217 * struct scmi_protocol_handle - Reference to an initialized protocol instance
219 * @dev: A reference to the associated SCMI instance device (handle->dev).
221 * can be used by the protocol implementation to generate SCMI messages.
225 * This structure represents a protocol initialized against specific SCMI
227 * - as a parameter fed from the core to the protocol initialization code so
228 * that it can access the core xfer operations to build and generate SCMI
230 * - as an opaque handle fed by an SCMI driver user when it tries to access
233 * with the related protocol operations when the SCMI driver tries to access
244 * struct scmi_xfer_ops - References to the core SCMI xfer operations.
248 * @do_xfer: Do the SCMI transfer.
249 * @do_xfer_with_response: Do the SCMI transfer waiting for a response.
283 * struct scmi_protocol - Protocol descriptor
287 * @instance_deinit: Optional protocol de-initialization function.
335 /* SCMI Transport */
337 * struct scmi_chan_info - Structure representing a SCMI channel information
339 * @dev: Reference to device in the SCMI hierarchy corresponding to this
341 * @handle: Pointer to SCMI entity handle
351 * struct scmi_transport_ops - Structure representing a SCMI transport ops
391 * struct scmi_desc - Description of SoC integration
394 * initialize some transport-specific setup during SCMI core
395 * initialization, so ahead of SCMI core probing.
397 * de-initialize some transport-specific setup during SCMI core
398 * de-initialization, so after SCMI core removal.
428 /* shmem related declarations */
431 void shmem_tx_prepare(struct scmi_shared_mem __iomem *shmem,
433 u32 shmem_read_header(struct scmi_shared_mem __iomem *shmem);
434 void shmem_fetch_response(struct scmi_shared_mem __iomem *shmem,
436 void shmem_fetch_notification(struct scmi_shared_mem __iomem *shmem,
438 void shmem_clear_channel(struct scmi_shared_mem __iomem *shmem);
439 bool shmem_poll_done(struct scmi_shared_mem __iomem *shmem,