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-2024 ARM Ltd.
38 SCMI_ERR_SUPPORT = -1, /* Not supported */
39 SCMI_ERR_PARAMS = -2, /* Invalid Parameters */
40 SCMI_ERR_ACCESS = -3, /* Invalid access/permission denied */
41 SCMI_ERR_ENTRY = -4, /* Not found */
42 SCMI_ERR_RANGE = -5, /* Value out of range */
43 SCMI_ERR_BUSY = -6, /* Device busy */
44 SCMI_ERR_COMMS = -7, /* Communication Error */
45 SCMI_ERR_GENERIC = -8, /* Generic Error */
46 SCMI_ERR_HARDWARE = -9, /* Hardware Error */
47 SCMI_ERR_PROTOCOL = -10,/* Protocol Error */
53 -EOPNOTSUPP, /* SCMI_ERR_SUPPORT */
54 -EINVAL, /* SCMI_ERR_PARAM */
55 -EACCES, /* SCMI_ERR_ACCESS */
56 -ENOENT, /* SCMI_ERR_ENTRY */
57 -ERANGE, /* SCMI_ERR_RANGE */
58 -EBUSY, /* SCMI_ERR_BUSY */
59 -ECOMM, /* SCMI_ERR_COMMS */
60 -EIO, /* SCMI_ERR_GENERIC */
61 -EREMOTEIO, /* SCMI_ERR_HARDWARE */
62 -EPROTO, /* SCMI_ERR_PROTOCOL */
67 int err_idx = -errno; in scmi_to_linux_errno()
71 return -EIO; in scmi_to_linux_errno()
90 * maximum number of in-flight messages on a specific platform, but such value
98 * pack_scmi_header() - packs and returns 32-bit header
103 * Return: 32-bit packed message header to be sent to the platform.
107 return FIELD_PREP(MSG_ID_MASK, hdr->id) | in pack_scmi_header()
108 FIELD_PREP(MSG_TYPE_MASK, hdr->type) | in pack_scmi_header()
109 FIELD_PREP(MSG_TOKEN_ID_MASK, hdr->seq) | in pack_scmi_header()
110 FIELD_PREP(MSG_PROTOCOL_ID_MASK, hdr->protocol_id); in pack_scmi_header()
114 * unpack_scmi_header() - unpacks and records message and protocol id
116 * @msg_hdr: 32-bit packed message header sent from the platform
121 hdr->id = MSG_XTRACT_ID(msg_hdr); in unpack_scmi_header()
122 hdr->protocol_id = MSG_XTRACT_PROT_ID(msg_hdr); in unpack_scmi_header()
123 hdr->type = MSG_XTRACT_TYPE(msg_hdr); in unpack_scmi_header()
136 if (xfer_->hdr.seq == k_) \
160 /* SCMI Transport */
162 * struct scmi_chan_info - Structure representing a SCMI channel information
166 * @dev: Reference to device in the SCMI hierarchy corresponding to this
171 * @handle: Pointer to SCMI entity handle
174 * This can be dynamically set by transports at run-time
190 * struct scmi_transport_ops - Structure representing a SCMI transport ops
224 * struct scmi_desc - Description of SoC integration
232 * @atomic_threshold: Optional system wide DT-configured threshold, expressed
234 * Only SCMI synchronous commands reported by the platform
235 * to have an execution latency lesser-equal to the threshold
237 * decision is finally left up to the SCMI drivers.
238 * @force_polling: Flag to force this whole transport to use SCMI core polling
241 * synchronous-command messages are atomically
265 return cinfo->no_completion_irq || desc->force_polling; in is_polling_required()
270 return desc->ops->poll_done || desc->sync_cmds_completed_on_ret; in is_transport_polling_capable()
318 MSG_UNEXPECTED = -1,
319 MSG_INVALID = -2,
320 MSG_UNKNOWN = -3,
321 MSG_NOMEM = -4,
322 MSG_MBOX_SPURIOUS = -5,
334 * struct scmi_shmem_io_ops - I/O operations to read from/write to
345 /* shmem related declarations */
349 * struct scmi_shared_mem_operations - Transport core operations for
352 * @tx_prepare: Prepare the @xfer message for transmission on the chosen @shmem
353 * @read_header: Read header of the message currently hold in @shmem
354 * @fetch_response: Copy the message response from @shmem into @xfer
355 * @fetch_notification: Copy the message notification from @shmem into @xfer
356 * @clear_channel: Clear the @shmem channel busy flag
357 * @poll_done: Check if poll has completed for @xfer on @shmem
358 * @channel_free: Check if @shmem channel is marked as free
359 * @channel_intr_enabled: Check is @shmem channel has requested a completion irq
363 void (*tx_prepare)(struct scmi_shared_mem __iomem *shmem,
367 u32 (*read_header)(struct scmi_shared_mem __iomem *shmem);
369 void (*fetch_response)(struct scmi_shared_mem __iomem *shmem,
372 void (*fetch_notification)(struct scmi_shared_mem __iomem *shmem,
375 void (*clear_channel)(struct scmi_shared_mem __iomem *shmem);
376 bool (*poll_done)(struct scmi_shared_mem __iomem *shmem,
378 bool (*channel_free)(struct scmi_shared_mem __iomem *shmem);
379 bool (*channel_intr_enabled)(struct scmi_shared_mem __iomem *shmem);
395 * struct scmi_message_operations - Transport core operations for Message
418 * struct scmi_transport_core_operations - Transpoert core operations
422 * @shmem: Datagram operations for shared memory based transports
430 const struct scmi_shared_mem_operations *shmem; member
435 * struct scmi_transport - A structure representing a configured transport
438 * the core SCMI stack
440 * @core_ops: A pointer to a pointer used by the core SCMI stack to make the
459 struct device *dev = &pdev->dev; \
464 spdev = platform_device_alloc("arm-scmi", PLATFORM_DEVID_AUTO); \
466 return -ENOMEM; \
468 device_set_of_node_from_dev(&spdev->dev, dev); \