1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
3 * Copyright 2013-2016 Freescale Semiconductor Inc.
4 * Copyright 2016-2017 NXP
10 #include <rte_compat.h>
12 /* Data Path I/O Portal API
13 * Contains initialization APIs and runtime control APIs for DPIO
19 int dpio_open(struct fsl_mc_io *mc_io,
25 int dpio_close(struct fsl_mc_io *mc_io,
30 * enum dpio_channel_mode - DPIO notification channel mode
31 * @DPIO_NO_CHANNEL: No support for notification channel
32 * @DPIO_LOCAL_CHANNEL: Notifications on data availability can be received by a
33 * dedicated channel in the DPIO; user should point the queue's
34 * destination in the relevant interface to this DPIO
36 enum dpio_channel_mode {
38 DPIO_LOCAL_CHANNEL = 1,
42 * struct dpio_cfg - Structure representing DPIO configuration
43 * @channel_mode: Notification channel mode
44 * @num_priorities: Number of priorities for the notification channel (1-8);
45 * relevant only if 'channel_mode = DPIO_LOCAL_CHANNEL'
48 enum dpio_channel_mode channel_mode;
49 uint8_t num_priorities;
53 int dpio_create(struct fsl_mc_io *mc_io,
56 const struct dpio_cfg *cfg,
59 int dpio_destroy(struct fsl_mc_io *mc_io,
65 int dpio_enable(struct fsl_mc_io *mc_io,
70 int dpio_disable(struct fsl_mc_io *mc_io,
74 int dpio_is_enabled(struct fsl_mc_io *mc_io,
80 int dpio_reset(struct fsl_mc_io *mc_io,
85 int dpio_set_stashing_destination(struct fsl_mc_io *mc_io,
90 int dpio_get_stashing_destination(struct fsl_mc_io *mc_io,
96 int dpio_add_static_dequeue_channel(struct fsl_mc_io *mc_io,
100 uint8_t *channel_index);
103 int dpio_remove_static_dequeue_channel(struct fsl_mc_io *mc_io,
109 * struct dpio_attr - Structure representing DPIO attributes
110 * @id: DPIO object ID
111 * @qbman_portal_ce_offset: Offset of the software portal cache-enabled area
112 * @qbman_portal_ci_offset: Offset of the software portal
113 * cache-inhibited area
114 * @qbman_portal_id: Software portal ID
115 * @channel_mode: Notification channel mode
116 * @num_priorities: Number of priorities for the notification
117 * channel (1-8); relevant only if
118 * 'channel_mode = DPIO_LOCAL_CHANNEL'
119 * @qbman_version: QBMAN version
123 uint64_t qbman_portal_ce_offset;
124 uint64_t qbman_portal_ci_offset;
125 uint16_t qbman_portal_id;
126 enum dpio_channel_mode channel_mode;
127 uint8_t num_priorities;
128 uint32_t qbman_version;
133 int dpio_get_attributes(struct fsl_mc_io *mc_io,
136 struct dpio_attr *attr);
138 int dpio_get_api_version(struct fsl_mc_io *mc_io,
141 uint16_t *minor_ver);
143 #endif /* __FSL_DPIO_H */