2 * Copyright 2013-2016 Freescale Semiconductor Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the above-listed copyright holders nor the
13 * names of any contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
16 * ALTERNATIVELY, this software may be distributed under the terms of the
17 * GNU General Public License ("GPL") as published by the Free Software
18 * Foundation, either version 2 of that License or (at your option) any
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
38 int dpio_open(struct fsl_mc_io *mc_io,
43 int dpio_close(struct fsl_mc_io *mc_io,
48 * enum dpio_channel_mode - DPIO notification channel mode
49 * @DPIO_NO_CHANNEL: No support for notification channel
50 * @DPIO_LOCAL_CHANNEL: Notifications on data availability can be received by a
51 * dedicated channel in the DPIO; user should point the queue's
52 * destination in the relevant interface to this DPIO
54 enum dpio_channel_mode {
56 DPIO_LOCAL_CHANNEL = 1,
60 * struct dpio_cfg - Structure representing DPIO configuration
61 * @channel_mode: Notification channel mode
62 * @num_priorities: Number of priorities for the notification channel (1-8);
63 * relevant only if 'channel_mode = DPIO_LOCAL_CHANNEL'
66 enum dpio_channel_mode channel_mode;
70 int dpio_enable(struct fsl_mc_io *mc_io,
74 int dpio_disable(struct fsl_mc_io *mc_io,
79 * struct dpio_attr - Structure representing DPIO attributes
81 * @qbman_portal_ce_offset: offset of the software portal cache-enabled area
82 * @qbman_portal_ci_offset: offset of the software portal cache-inhibited area
83 * @qbman_portal_id: Software portal ID
84 * @channel_mode: Notification channel mode
85 * @num_priorities: Number of priorities for the notification channel (1-8);
86 * relevant only if 'channel_mode = DPIO_LOCAL_CHANNEL'
87 * @qbman_version: QBMAN version
91 u64 qbman_portal_ce_offset;
92 u64 qbman_portal_ci_offset;
94 enum dpio_channel_mode channel_mode;
99 int dpio_get_attributes(struct fsl_mc_io *mc_io,
102 struct dpio_attr *attr);
104 int dpio_get_api_version(struct fsl_mc_io *mc_io,
109 #endif /* __FSL_DPIO_H */