Lines Matching +full:icid +full:- +full:base
1 // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
3 * Copyright 2013-2016 Freescale Semiconductor Inc.
10 #include "fsl-mc-private.h"
20 * dprc_open() - Open DPRC object for use
43 cmd_params->container_id = cpu_to_le32(container_id); in dprc_open()
58 * dprc_close() - Close the control session of the object
84 * dprc_reset_container - Reset child container.
90 * - 0 (no bits set) - all the objects inside the container are
94 * - bit 0 set - all the objects inside the container are reset.
97 * In case a software context crashes or becomes non-responsive, the parent
146 cmd_params->child_container_id = cpu_to_le32(child_container_id); in dprc_reset_container()
147 cmd_params->options = cpu_to_le32(options); in dprc_reset_container()
155 * dprc_set_irq() - Set IRQ information for the DPRC to trigger an interrupt.
178 cmd_params->irq_val = cpu_to_le32(irq_cfg->val); in dprc_set_irq()
179 cmd_params->irq_index = irq_index; in dprc_set_irq()
180 cmd_params->irq_addr = cpu_to_le64(irq_cfg->paddr); in dprc_set_irq()
181 cmd_params->irq_num = cpu_to_le32(irq_cfg->irq_num); in dprc_set_irq()
188 * dprc_set_irq_enable() - Set overall interrupt state.
193 * @en: Interrupt state - enable = 1, disable = 0
215 cmd_params->enable = en & DPRC_ENABLE; in dprc_set_irq_enable()
216 cmd_params->irq_index = irq_index; in dprc_set_irq_enable()
223 * dprc_set_irq_mask() - Set interrupt mask.
251 cmd_params->mask = cpu_to_le32(mask); in dprc_set_irq_mask()
252 cmd_params->irq_index = irq_index; in dprc_set_irq_mask()
259 * dprc_get_irq_status() - Get the current status of any pending interrupts.
264 * @status: Returned interrupts status - one bit per cause:
285 cmd_params->status = cpu_to_le32(*status); in dprc_get_irq_status()
286 cmd_params->irq_index = irq_index; in dprc_get_irq_status()
295 *status = le32_to_cpu(rsp_params->status); in dprc_get_irq_status()
301 * dprc_clear_irq_status() - Clear a pending interrupt's status
306 * @status: bits to clear (W1C) - one bit per cause:
325 cmd_params->status = cpu_to_le32(status); in dprc_clear_irq_status()
326 cmd_params->irq_index = irq_index; in dprc_clear_irq_status()
333 * dprc_get_attributes() - Obtains container attributes
362 attr->container_id = le32_to_cpu(rsp_params->container_id); in dprc_get_attributes()
363 attr->icid = le32_to_cpu(rsp_params->icid); in dprc_get_attributes()
364 attr->options = le32_to_cpu(rsp_params->options); in dprc_get_attributes()
365 attr->portal_id = le32_to_cpu(rsp_params->portal_id); in dprc_get_attributes()
371 * dprc_get_obj_count() - Obtains the number of objects in the DPRC
399 *obj_count = le32_to_cpu(rsp_params->obj_count); in dprc_get_obj_count()
406 * dprc_get_obj() - Get general information on an object
436 cmd_params->obj_index = cpu_to_le32(obj_index); in dprc_get_obj()
445 obj_desc->id = le32_to_cpu(rsp_params->id); in dprc_get_obj()
446 obj_desc->vendor = le16_to_cpu(rsp_params->vendor); in dprc_get_obj()
447 obj_desc->irq_count = rsp_params->irq_count; in dprc_get_obj()
448 obj_desc->region_count = rsp_params->region_count; in dprc_get_obj()
449 obj_desc->state = le32_to_cpu(rsp_params->state); in dprc_get_obj()
450 obj_desc->ver_major = le16_to_cpu(rsp_params->version_major); in dprc_get_obj()
451 obj_desc->ver_minor = le16_to_cpu(rsp_params->version_minor); in dprc_get_obj()
452 obj_desc->flags = le16_to_cpu(rsp_params->flags); in dprc_get_obj()
453 strscpy_pad(obj_desc->type, rsp_params->type, 16); in dprc_get_obj()
454 strscpy_pad(obj_desc->label, rsp_params->label, 16); in dprc_get_obj()
460 * dprc_set_obj_irq() - Set IRQ information for object to trigger an interrupt.
487 cmd_params->irq_val = cpu_to_le32(irq_cfg->val); in dprc_set_obj_irq()
488 cmd_params->irq_index = irq_index; in dprc_set_obj_irq()
489 cmd_params->irq_addr = cpu_to_le64(irq_cfg->paddr); in dprc_set_obj_irq()
490 cmd_params->irq_num = cpu_to_le32(irq_cfg->irq_num); in dprc_set_obj_irq()
491 cmd_params->obj_id = cpu_to_le32(obj_id); in dprc_set_obj_irq()
492 strscpy_pad(cmd_params->obj_type, obj_type, 16); in dprc_set_obj_irq()
500 * dprc_get_obj_region() - Get region information for a specified object.
550 * descriptor: base_address. If the older API is in use then the base in dprc_get_obj_region()
562 cmd_params->obj_id = cpu_to_le32(obj_id); in dprc_get_obj_region()
563 cmd_params->region_index = region_index; in dprc_get_obj_region()
564 strscpy_pad(cmd_params->obj_type, obj_type, 16); in dprc_get_obj_region()
573 region_desc->base_offset = le64_to_cpu(rsp_params->base_offset); in dprc_get_obj_region()
574 region_desc->size = le32_to_cpu(rsp_params->size); in dprc_get_obj_region()
575 region_desc->type = rsp_params->type; in dprc_get_obj_region()
576 region_desc->flags = le32_to_cpu(rsp_params->flags); in dprc_get_obj_region()
578 region_desc->base_address = le64_to_cpu(rsp_params->base_addr); in dprc_get_obj_region()
580 region_desc->base_address = 0; in dprc_get_obj_region()
587 * dprc_get_api_version - Get Data Path Resource Container API version
619 * dprc_get_container_id - Get container ID associated with a given portal.
650 * dprc_get_connection() - Get connected endpoint and link status if connection
658 * 1 - link is up;
659 * 0 - link is down;
660 * -1 - no connection (endpoint2 information is irrelevant)
662 * Return: '0' on Success; -ENOTCONN if connection does not exist.
681 cmd_params->ep1_id = cpu_to_le32(endpoint1->id); in dprc_get_connection()
682 cmd_params->ep1_interface_id = cpu_to_le16(endpoint1->if_id); in dprc_get_connection()
684 cmd_params->ep1_type[i] = endpoint1->type[i]; in dprc_get_connection()
689 return -ENOTCONN; in dprc_get_connection()
693 endpoint2->id = le32_to_cpu(rsp_params->ep2_id); in dprc_get_connection()
694 endpoint2->if_id = le16_to_cpu(rsp_params->ep2_interface_id); in dprc_get_connection()
695 *state = le32_to_cpu(rsp_params->state); in dprc_get_connection()
697 endpoint2->type[i] = rsp_params->ep2_type[i]; in dprc_get_connection()