1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
3 * Copyright 2013-2016 Freescale Semiconductor Inc.
4 * Copyright 2016-2017 NXP
10 /* Data Path I/O Portal API
11 * Contains initialization APIs and runtime control APIs for DPIO
16 int dpio_open(struct fsl_mc_io *mc_io,
21 int dpio_close(struct fsl_mc_io *mc_io,
26 * enum dpio_channel_mode - DPIO notification channel mode
27 * @DPIO_NO_CHANNEL: No support for notification channel
28 * @DPIO_LOCAL_CHANNEL: Notifications on data availability can be received by a
29 * dedicated channel in the DPIO; user should point the queue's
30 * destination in the relevant interface to this DPIO
32 enum dpio_channel_mode {
34 DPIO_LOCAL_CHANNEL = 1,
38 * struct dpio_cfg - Structure representing DPIO configuration
39 * @channel_mode: Notification channel mode
40 * @num_priorities: Number of priorities for the notification channel (1-8);
41 * relevant only if 'channel_mode = DPIO_LOCAL_CHANNEL'
44 enum dpio_channel_mode channel_mode;
45 uint8_t num_priorities;
49 int dpio_create(struct fsl_mc_io *mc_io,
52 const struct dpio_cfg *cfg,
55 int dpio_destroy(struct fsl_mc_io *mc_io,
60 int dpio_enable(struct fsl_mc_io *mc_io,
64 int dpio_disable(struct fsl_mc_io *mc_io,
68 int dpio_is_enabled(struct fsl_mc_io *mc_io,
73 int dpio_reset(struct fsl_mc_io *mc_io,
77 int dpio_set_stashing_destination(struct fsl_mc_io *mc_io,
82 int dpio_get_stashing_destination(struct fsl_mc_io *mc_io,
87 int dpio_add_static_dequeue_channel(struct fsl_mc_io *mc_io,
91 uint8_t *channel_index);
93 int dpio_remove_static_dequeue_channel(struct fsl_mc_io *mc_io,
99 * struct dpio_attr - Structure representing DPIO attributes
100 * @id: DPIO object ID
101 * @qbman_portal_ce_offset: Offset of the software portal cache-enabled area
102 * @qbman_portal_ci_offset: Offset of the software portal
103 * cache-inhibited area
104 * @qbman_portal_id: Software portal ID
105 * @channel_mode: Notification channel mode
106 * @num_priorities: Number of priorities for the notification
107 * channel (1-8); relevant only if
108 * 'channel_mode = DPIO_LOCAL_CHANNEL'
109 * @qbman_version: QBMAN version
113 uint64_t qbman_portal_ce_offset;
114 uint64_t qbman_portal_ci_offset;
115 uint16_t qbman_portal_id;
116 enum dpio_channel_mode channel_mode;
117 uint8_t num_priorities;
118 uint32_t qbman_version;
122 int dpio_get_attributes(struct fsl_mc_io *mc_io,
125 struct dpio_attr *attr);
127 int dpio_get_api_version(struct fsl_mc_io *mc_io,
130 uint16_t *minor_ver);
132 #endif /* __FSL_DPIO_H */