xref: /freebsd/sys/dev/dpaa2/dpaa2_con.h (revision 4cd966142822ce24c12751c863a073a8b7cb9c14)
1*ba7319e9SDmitry Salychev /*-
2*ba7319e9SDmitry Salychev  * SPDX-License-Identifier: BSD-2-Clause
3*ba7319e9SDmitry Salychev  *
4*ba7319e9SDmitry Salychev  * Copyright © 2021-2022 Dmitry Salychev
5*ba7319e9SDmitry Salychev  *
6*ba7319e9SDmitry Salychev  * Redistribution and use in source and binary forms, with or without
7*ba7319e9SDmitry Salychev  * modification, are permitted provided that the following conditions
8*ba7319e9SDmitry Salychev  * are met:
9*ba7319e9SDmitry Salychev  * 1. Redistributions of source code must retain the above copyright
10*ba7319e9SDmitry Salychev  *    notice, this list of conditions and the following disclaimer.
11*ba7319e9SDmitry Salychev  * 2. Redistributions in binary form must reproduce the above copyright
12*ba7319e9SDmitry Salychev  *    notice, this list of conditions and the following disclaimer in the
13*ba7319e9SDmitry Salychev  *    documentation and/or other materials provided with the distribution.
14*ba7319e9SDmitry Salychev  *
15*ba7319e9SDmitry Salychev  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16*ba7319e9SDmitry Salychev  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17*ba7319e9SDmitry Salychev  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18*ba7319e9SDmitry Salychev  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19*ba7319e9SDmitry Salychev  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20*ba7319e9SDmitry Salychev  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21*ba7319e9SDmitry Salychev  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22*ba7319e9SDmitry Salychev  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23*ba7319e9SDmitry Salychev  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24*ba7319e9SDmitry Salychev  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25*ba7319e9SDmitry Salychev  * SUCH DAMAGE.
26*ba7319e9SDmitry Salychev  */
27*ba7319e9SDmitry Salychev 
28*ba7319e9SDmitry Salychev #ifndef	_DPAA2_CON_H
29*ba7319e9SDmitry Salychev #define	_DPAA2_CON_H
30*ba7319e9SDmitry Salychev 
31*ba7319e9SDmitry Salychev #include <sys/rman.h>
32*ba7319e9SDmitry Salychev #include <sys/bus.h>
33*ba7319e9SDmitry Salychev #include <sys/queue.h>
34*ba7319e9SDmitry Salychev 
35*ba7319e9SDmitry Salychev #include "dpaa2_types.h"
36*ba7319e9SDmitry Salychev #include "dpaa2_mcp.h"
37*ba7319e9SDmitry Salychev 
38*ba7319e9SDmitry Salychev /* Maximum resources per DPCON: 1 DPMCP. */
39*ba7319e9SDmitry Salychev #define DPAA2_CON_MAX_RESOURCES	1
40*ba7319e9SDmitry Salychev 
41*ba7319e9SDmitry Salychev /**
42*ba7319e9SDmitry Salychev  * @brief Attributes of the DPCON object.
43*ba7319e9SDmitry Salychev  *
44*ba7319e9SDmitry Salychev  * id:		DPCON object ID.
45*ba7319e9SDmitry Salychev  * chan_id:	QBMan channel ID to be used for dequeue operations.
46*ba7319e9SDmitry Salychev  * prior_num:	Number of priorities for the DPCON channel (1-8).
47*ba7319e9SDmitry Salychev  */
48*ba7319e9SDmitry Salychev struct dpaa2_con_attr {
49*ba7319e9SDmitry Salychev 	uint32_t		 id;
50*ba7319e9SDmitry Salychev 	uint16_t		 chan_id;
51*ba7319e9SDmitry Salychev 	uint8_t			 prior_num;
52*ba7319e9SDmitry Salychev };
53*ba7319e9SDmitry Salychev 
54*ba7319e9SDmitry Salychev /**
55*ba7319e9SDmitry Salychev  * @brief Software context for the DPAA2 Concentrator driver.
56*ba7319e9SDmitry Salychev  */
57*ba7319e9SDmitry Salychev struct dpaa2_con_softc {
58*ba7319e9SDmitry Salychev 	device_t		 dev;
59*ba7319e9SDmitry Salychev 	struct resource 	*res[DPAA2_CON_MAX_RESOURCES];
60*ba7319e9SDmitry Salychev 	struct dpaa2_con_attr	 attr;
61*ba7319e9SDmitry Salychev };
62*ba7319e9SDmitry Salychev 
63*ba7319e9SDmitry Salychev extern struct resource_spec dpaa2_con_spec[];
64*ba7319e9SDmitry Salychev 
65*ba7319e9SDmitry Salychev #endif /* _DPAA2_CON_H */
66