#ifndef _FSL_MC_PRIVATE_H_
#define _FSL_MC_PRIVATE_H_
#include <linux/fsl/mc.h>
#include <linux/mutex.h>
#include <linux/ioctl.h>
#include <linux/miscdevice.h>
#define DPMNG_CMD_BASE_VERSION …
#define DPMNG_CMD_ID_OFFSET …
#define DPMNG_CMD(id) …
#define DPMNG_CMDID_GET_VERSION …
struct dpmng_rsp_get_version { … };
#define DPMCP_MIN_VER_MAJOR …
#define DPMCP_MIN_VER_MINOR …
#define DPMCP_CMD_BASE_VERSION …
#define DPMCP_CMD_ID_OFFSET …
#define DPMCP_CMD(id) …
#define DPMCP_CMDID_CLOSE …
#define DPMCP_CMDID_RESET …
struct dpmcp_cmd_open { … };
int dpmcp_open(struct fsl_mc_io *mc_io,
u32 cmd_flags,
int dpmcp_id,
u16 *token);
int dpmcp_close(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token);
int dpmcp_reset(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token);
#define DPRC_MIN_VER_MAJOR …
#define DPRC_MIN_VER_MINOR …
#define DPRC_CMD_BASE_VERSION …
#define DPRC_CMD_2ND_VERSION …
#define DPRC_CMD_3RD_VERSION …
#define DPRC_CMD_ID_OFFSET …
#define DPRC_CMD(id) …
#define DPRC_CMD_V2(id) …
#define DPRC_CMD_V3(id) …
#define DPRC_CMDID_CLOSE …
#define DPRC_CMDID_GET_API_VERSION …
#define DPRC_CMDID_GET_ATTR …
#define DPRC_CMDID_RESET_CONT …
#define DPRC_CMDID_RESET_CONT_V2 …
#define DPRC_CMDID_SET_IRQ …
#define DPRC_CMDID_SET_IRQ_ENABLE …
#define DPRC_CMDID_SET_IRQ_MASK …
#define DPRC_CMDID_GET_IRQ_STATUS …
#define DPRC_CMDID_CLEAR_IRQ_STATUS …
#define DPRC_CMDID_GET_CONT_ID …
#define DPRC_CMDID_GET_OBJ_COUNT …
#define DPRC_CMDID_GET_OBJ …
#define DPRC_CMDID_GET_OBJ_REG …
#define DPRC_CMDID_GET_OBJ_REG_V2 …
#define DPRC_CMDID_GET_OBJ_REG_V3 …
#define DPRC_CMDID_SET_OBJ_IRQ …
#define DPRC_CMDID_GET_CONNECTION …
struct dprc_cmd_open { … };
struct dprc_cmd_reset_container { … };
struct dprc_cmd_set_irq { … };
#define DPRC_ENABLE …
struct dprc_cmd_set_irq_enable { … };
struct dprc_cmd_set_irq_mask { … };
struct dprc_cmd_get_irq_status { … };
struct dprc_rsp_get_irq_status { … };
struct dprc_cmd_clear_irq_status { … };
struct dprc_rsp_get_attributes { … };
struct dprc_rsp_get_obj_count { … };
struct dprc_cmd_get_obj { … };
struct dprc_rsp_get_obj { … };
struct dprc_cmd_get_obj_region { … };
struct dprc_rsp_get_obj_region { … };
struct dprc_cmd_set_obj_irq { … };
struct dprc_cmd_get_connection { … };
struct dprc_rsp_get_connection { … };
int dprc_open(struct fsl_mc_io *mc_io,
u32 cmd_flags,
int container_id,
u16 *token);
int dprc_close(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token);
#define DPRC_IRQ_EVENT_OBJ_ADDED …
#define DPRC_IRQ_EVENT_OBJ_REMOVED …
#define DPRC_IRQ_EVENT_CONTAINER_DESTROYED …
#define DPRC_IRQ_EVENT_OBJ_DESTROYED …
#define DPRC_IRQ_EVENT_OBJ_CREATED …
struct dprc_irq_cfg { … };
int dprc_set_irq(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token,
u8 irq_index,
struct dprc_irq_cfg *irq_cfg);
int dprc_set_irq_enable(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token,
u8 irq_index,
u8 en);
int dprc_set_irq_mask(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token,
u8 irq_index,
u32 mask);
int dprc_get_irq_status(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token,
u8 irq_index,
u32 *status);
int dprc_clear_irq_status(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token,
u8 irq_index,
u32 status);
struct dprc_attributes { … };
int dprc_get_attributes(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token,
struct dprc_attributes *attributes);
int dprc_get_obj_count(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token,
int *obj_count);
int dprc_get_obj(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token,
int obj_index,
struct fsl_mc_obj_desc *obj_desc);
int dprc_set_obj_irq(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token,
char *obj_type,
int obj_id,
u8 irq_index,
struct dprc_irq_cfg *irq_cfg);
enum dprc_region_type { … };
struct dprc_region_desc { … };
int dprc_get_obj_region(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token,
char *obj_type,
int obj_id,
u8 region_index,
struct dprc_region_desc *region_desc);
int dprc_get_api_version(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 *major_ver,
u16 *minor_ver);
int dprc_get_container_id(struct fsl_mc_io *mc_io,
u32 cmd_flags,
int *container_id);
struct dprc_endpoint { … };
int dprc_get_connection(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token,
const struct dprc_endpoint *endpoint1,
struct dprc_endpoint *endpoint2,
int *state);
#define DPBP_VER_MAJOR …
#define DPBP_VER_MINOR …
#define DPBP_CMD_BASE_VERSION …
#define DPBP_CMD_ID_OFFSET …
#define DPBP_CMD(id) …
#define DPBP_CMDID_CLOSE …
#define DPBP_CMDID_ENABLE …
#define DPBP_CMDID_DISABLE …
#define DPBP_CMDID_GET_ATTR …
#define DPBP_CMDID_RESET …
struct dpbp_cmd_open { … };
#define DPBP_ENABLE …
struct dpbp_rsp_get_attributes { … };
#define DPCON_VER_MAJOR …
#define DPCON_VER_MINOR …
#define DPCON_CMD_BASE_VERSION …
#define DPCON_CMD_ID_OFFSET …
#define DPCON_CMD(id) …
#define DPCON_CMDID_CLOSE …
#define DPCON_CMDID_ENABLE …
#define DPCON_CMDID_DISABLE …
#define DPCON_CMDID_GET_ATTR …
#define DPCON_CMDID_RESET …
#define DPCON_CMDID_SET_NOTIFICATION …
struct dpcon_cmd_open { … };
#define DPCON_ENABLE …
struct dpcon_rsp_get_attr { … };
struct dpcon_cmd_set_notification { … };
#define OBJ_CMD_BASE_VERSION …
#define OBJ_CMD_ID_OFFSET …
#define OBJ_CMD(id) …
#define DPRTC_CMDID_OPEN …
#define DPNI_CMDID_OPEN …
#define DPSW_CMDID_OPEN …
#define DPIO_CMDID_OPEN …
#define DPBP_CMDID_OPEN …
#define DPRC_CMDID_OPEN …
#define DPDMUX_CMDID_OPEN …
#define DPCI_CMDID_OPEN …
#define DPCON_CMDID_OPEN …
#define DPSECI_CMDID_OPEN …
#define DPAIOP_CMDID_OPEN …
#define DPMCP_CMDID_OPEN …
#define DPMAC_CMDID_OPEN …
#define DPDCEI_CMDID_OPEN …
#define DPDMAI_CMDID_OPEN …
#define DPDBG_CMDID_OPEN …
#define OBJ_CMDID_CLOSE …
#define OBJ_CMDID_RESET …
struct fsl_mc_obj_cmd_open { … };
struct fsl_mc_resource_pool { … };
struct fsl_mc_uapi { … };
struct fsl_mc_bus { … };
#define to_fsl_mc_bus(_mc_dev) …
int __must_check fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc,
struct fsl_mc_io *mc_io,
struct device *parent_dev,
struct fsl_mc_device **new_mc_dev);
void fsl_mc_device_remove(struct fsl_mc_device *mc_dev);
int __init dprc_driver_init(void);
void dprc_driver_exit(void);
int dprc_scan_objects(struct fsl_mc_device *mc_bus_dev,
bool alloc_interrupts);
int __init fsl_mc_allocator_driver_init(void);
void fsl_mc_allocator_driver_exit(void);
void fsl_mc_init_all_resource_pools(struct fsl_mc_device *mc_bus_dev);
void fsl_mc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev);
int __must_check fsl_mc_resource_allocate(struct fsl_mc_bus *mc_bus,
enum fsl_mc_pool_type pool_type,
struct fsl_mc_resource
**new_resource);
void fsl_mc_resource_free(struct fsl_mc_resource *resource);
int fsl_mc_msi_domain_alloc_irqs(struct device *dev,
unsigned int irq_count);
void fsl_mc_msi_domain_free_irqs(struct device *dev);
struct irq_domain *fsl_mc_find_msi_domain(struct device *dev);
int __must_check fsl_create_mc_io(struct device *dev,
phys_addr_t mc_portal_phys_addr,
u32 mc_portal_size,
struct fsl_mc_device *dpmcp_dev,
u32 flags, struct fsl_mc_io **new_mc_io);
void fsl_destroy_mc_io(struct fsl_mc_io *mc_io);
bool fsl_mc_is_root_dprc(struct device *dev);
void fsl_mc_get_root_dprc(struct device *dev,
struct device **root_dprc_dev);
struct fsl_mc_device *fsl_mc_device_lookup(struct fsl_mc_obj_desc *obj_desc,
struct fsl_mc_device *mc_bus_dev);
u16 mc_cmd_hdr_read_cmdid(struct fsl_mc_command *cmd);
#ifdef CONFIG_FSL_MC_UAPI_SUPPORT
int fsl_mc_uapi_create_device_file(struct fsl_mc_bus *mc_bus);
void fsl_mc_uapi_remove_device_file(struct fsl_mc_bus *mc_bus);
#else
static inline int fsl_mc_uapi_create_device_file(struct fsl_mc_bus *mc_bus)
{
return 0;
}
static inline void fsl_mc_uapi_remove_device_file(struct fsl_mc_bus *mc_bus)
{
}
#endif
int disable_dprc_irq(struct fsl_mc_device *mc_dev);
int enable_dprc_irq(struct fsl_mc_device *mc_dev);
int get_dprc_irq_state(struct fsl_mc_device *mc_dev);
#endif