• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2013-2016 Freescale Semiconductor Inc.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  * * Redistributions of source code must retain the above copyright
7  * notice, this list of conditions and the following disclaimer.
8  * * Redistributions in binary form must reproduce the above copyright
9  * notice, this list of conditions and the following disclaimer in the
10  * documentation and/or other materials provided with the distribution.
11  * * Neither the name of the above-listed copyright holders nor the
12  * names of any contributors may be used to endorse or promote products
13  * derived from this software without specific prior written permission.
14  *
15  * ALTERNATIVELY, this software may be distributed under the terms of the
16  * GNU General Public License ("GPL") as published by the Free Software
17  * Foundation, either version 2 of that License or (at your option) any
18  * later version.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 #ifndef _FSL_DPCON_CMD_H
33 #define _FSL_DPCON_CMD_H
34 
35 /* DPCON Version */
36 #define DPCON_VER_MAJOR				3
37 #define DPCON_VER_MINOR				2
38 
39 /* Command versioning */
40 #define DPCON_CMD_BASE_VERSION			1
41 #define DPCON_CMD_ID_OFFSET			4
42 
43 #define DPCON_CMD(id)	(((id) << DPCON_CMD_ID_OFFSET) | DPCON_CMD_BASE_VERSION)
44 
45 /* Command IDs */
46 #define DPCON_CMDID_CLOSE			DPCON_CMD(0x800)
47 #define DPCON_CMDID_OPEN			DPCON_CMD(0x808)
48 #define DPCON_CMDID_GET_API_VERSION		DPCON_CMD(0xa08)
49 
50 #define DPCON_CMDID_ENABLE			DPCON_CMD(0x002)
51 #define DPCON_CMDID_DISABLE			DPCON_CMD(0x003)
52 #define DPCON_CMDID_GET_ATTR			DPCON_CMD(0x004)
53 #define DPCON_CMDID_RESET			DPCON_CMD(0x005)
54 #define DPCON_CMDID_IS_ENABLED			DPCON_CMD(0x006)
55 
56 #define DPCON_CMDID_SET_NOTIFICATION		DPCON_CMD(0x100)
57 
58 struct dpcon_cmd_open {
59 	__le32 dpcon_id;
60 };
61 
62 #define DPCON_ENABLE			1
63 
64 struct dpcon_rsp_is_enabled {
65 	u8 enabled;
66 };
67 
68 struct dpcon_rsp_get_attr {
69 	/* response word 0 */
70 	__le32 id;
71 	__le16 qbman_ch_id;
72 	u8 num_priorities;
73 	u8 pad;
74 };
75 
76 struct dpcon_cmd_set_notification {
77 	/* cmd word 0 */
78 	__le32 dpio_id;
79 	u8 priority;
80 	u8 pad[3];
81 	/* cmd word 1 */
82 	__le64 user_ctx;
83 };
84 
85 #endif /* _FSL_DPCON_CMD_H */
86