Lines Matching +full:resource +full:- +full:id

1 /* SPDX-License-Identifier: GPL-2.0 */
5 * Copyright (C) 2014-2016 Freescale Semiconductor, Inc.
6 * Copyright 2019-2020 NXP
27 * struct fsl_mc_driver - MC object device driver object
44 * with a DPRC bus. This structure is to be embedded in each device-specific
62 * enum fsl_mc_pool_type - Types of allocatable MC bus resources
64 * Entries in these enum are used as indices in the array of resource
74 * NOTE: New resource pool types must be added before this entry
80 * struct fsl_mc_resource - MC generic resource
81 * @type: type of resource
82 * @id: unique MC resource Id within the resources of the same type
83 * @data: pointer to resource-specific data if the resource is currently
84 * allocated, or NULL if the resource is not currently allocated.
85 * @parent_pool: pointer to the parent resource pool from which this
86 * resource is allocated from.
87 * @node: Node in the free list of the corresponding resource pool
90 * MC resource structures.
94 s32 id; member
101 * struct fsl_mc_device_irq - MC object device message-based interrupt
104 * @dev_irq_index: device-relative IRQ index
105 * @resource: MC generic resource associated with the interrupt
111 struct fsl_mc_resource resource; member
115 container_of(_mc_resource, struct fsl_mc_device_irq, resource)
117 /* Opened state - Indicates that an object is open by at least one owner */
119 /* Plugged state - Indicates that the object is plugged */
123 * Shareability flag - Object flag indicating no memory shareability.
131 * struct fsl_mc_obj_desc - Object descriptor
133 * @id: ID of logical object resource
145 int id; member
169 * struct fsl_mc_device - MC object device object
173 * @icid: Isolation context ID for the device
180 * @resource: generic resource associated with this MC object device, if any.
189 * - For a non-DPRC object its icid is the same as its parent DPRC's icid.
190 * - The SMMU notifier callback gets invoked after device_add() has been
191 * called for an MC object device, but before the device-specific probe
193 * - DP_OBJ_DPRC objects are the only MC objects that have built-in MC
196 * - Some types of MC objects (e.g., DP_OBJ_DPBP, DP_OBJ_DPCON) are
198 * corresponding resource pool in the object's parent DPRC, using the
201 * fsl_mc_device's 'resource' points to the associated resource object.
203 * 'resource' is NULL.
213 struct resource *regions;
215 struct fsl_mc_resource *resource; member
263 hdr->cmd_id = cpu_to_le16(cmd_id); in mc_encode_cmd_header()
264 hdr->token = cpu_to_le16(token); in mc_encode_cmd_header()
265 hdr->status = MC_CMD_STATUS_READY; in mc_encode_cmd_header()
267 hdr->flags_hw = MC_CMD_FLAG_PRI; in mc_encode_cmd_header()
269 hdr->flags_sw = MC_CMD_FLAG_INTR_DIS; in mc_encode_cmd_header()
276 struct mc_cmd_header *hdr = (struct mc_cmd_header *)&cmd->header; in mc_cmd_hdr_read_token()
277 u16 token = le16_to_cpu(hdr->token); in mc_cmd_hdr_read_token()
295 rsp_params = (struct mc_rsp_create *)cmd->params; in mc_cmd_read_object_id()
296 return le32_to_cpu(rsp_params->object_id); in mc_cmd_read_object_id()
305 rsp_params = (struct mc_rsp_api_ver *)cmd->params; in mc_cmd_read_api_version()
306 *major_ver = le16_to_cpu(rsp_params->major_ver); in mc_cmd_read_api_version()
307 *minor_ver = le16_to_cpu(rsp_params->minor_ver); in mc_cmd_read_api_version()
316 * struct fsl_mc_io - MC I/O object to be passed-in to mc_send_command()
329 * fsl_mc_io object must be made only from non-atomic context.
336 * fsl_mc_io object can be made from atomic or non-atomic context.
363 #define dev_is_fsl_mc(_dev) ((_dev)->bus == &fsl_mc_bus_type)
365 /* If fsl-mc bus is not present device cannot belong to fsl-mc bus */
370 #define fsl_mc_is_cont_dev(_dev) (to_fsl_mc_device(_dev)->flags & \
375 (_dev) : (_dev)->parent)
378 * module_fsl_mc_driver() - Helper macro for drivers that don't do
459 return mc_dev->dev.type == &fsl_mc_bus_dprc_type; in is_fsl_mc_bus_dprc()
464 return mc_dev->dev.type == &fsl_mc_bus_dpni_type; in is_fsl_mc_bus_dpni()
469 return mc_dev->dev.type == &fsl_mc_bus_dpio_type; in is_fsl_mc_bus_dpio()
474 return mc_dev->dev.type == &fsl_mc_bus_dpsw_type; in is_fsl_mc_bus_dpsw()
479 return mc_dev->dev.type == &fsl_mc_bus_dpdmux_type; in is_fsl_mc_bus_dpdmux()
484 return mc_dev->dev.type == &fsl_mc_bus_dpbp_type; in is_fsl_mc_bus_dpbp()
489 return mc_dev->dev.type == &fsl_mc_bus_dpcon_type; in is_fsl_mc_bus_dpcon()
494 return mc_dev->dev.type == &fsl_mc_bus_dpmcp_type; in is_fsl_mc_bus_dpmcp()
499 return mc_dev->dev.type == &fsl_mc_bus_dpmac_type; in is_fsl_mc_bus_dpmac()
504 return mc_dev->dev.type == &fsl_mc_bus_dprtc_type; in is_fsl_mc_bus_dprtc()
509 return mc_dev->dev.type == &fsl_mc_bus_dpseci_type; in is_fsl_mc_bus_dpseci()
514 return mc_dev->dev.type == &fsl_mc_bus_dpdcei_type; in is_fsl_mc_bus_dpdcei()
519 return mc_dev->dev.type == &fsl_mc_bus_dpaiop_type; in is_fsl_mc_bus_dpaiop()
524 return mc_dev->dev.type == &fsl_mc_bus_dpci_type; in is_fsl_mc_bus_dpci()
529 return mc_dev->dev.type == &fsl_mc_bus_dpdmai_type; in is_fsl_mc_bus_dpdmai()
551 * Maximum number of total IRQs that can be pre-allocated for an MC bus'
588 * struct dpbp_attr - Structure representing DPBP attributes
589 * @id: DPBP object ID
590 * @bpid: Hardware buffer pool ID; should be used as an argument in
594 int id; member
610 #define DPCON_INVALID_DPIO_ID (int)(-1)
648 * struct dpcon_attr - Structure representing DPCON attributes
649 * @id: DPCON object ID
650 * @qbman_ch_id: Channel ID to be used by dequeue operation
651 * @num_priorities: Number of priorities for the DPCON channel (1-8)
654 int id; member
665 * struct dpcon_notification_cfg - Structure representing notification params
666 * @dpio_id: DPIO object ID; must be configured with a notification channel;
669 * are 0-7, depending on the number of priorities in that channel