]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - drivers/staging/fsl-mc/bus/dpmcp-cmd.h
Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mirror_ubuntu-artful-kernel.git] / drivers / staging / fsl-mc / bus / dpmcp-cmd.h
1 /* Copyright 2013-2016 Freescale Semiconductor Inc.
2 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are met:
5 * * Redistributions of source code must retain the above copyright
6 * notice, this list of conditions and the following disclaimer.
7 * * Redistributions in binary form must reproduce the above copyright
8 * notice, this list of conditions and the following disclaimer in the
9 * documentation and/or other materials provided with the distribution.
10 * * Neither the name of the above-listed copyright holders nor the
11 * names of any contributors may be used to endorse or promote products
12 * derived from this software without specific prior written permission.
13 *
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_DPMCP_CMD_H
33 #define _FSL_DPMCP_CMD_H
34
35 /* Minimal supported DPMCP Version */
36 #define DPMCP_MIN_VER_MAJOR 3
37 #define DPMCP_MIN_VER_MINOR 0
38
39 /* Command IDs */
40 #define DPMCP_CMDID_CLOSE 0x800
41 #define DPMCP_CMDID_OPEN 0x80b
42 #define DPMCP_CMDID_CREATE 0x90b
43 #define DPMCP_CMDID_DESTROY 0x900
44
45 #define DPMCP_CMDID_GET_ATTR 0x004
46 #define DPMCP_CMDID_RESET 0x005
47
48 #define DPMCP_CMDID_SET_IRQ 0x010
49 #define DPMCP_CMDID_GET_IRQ 0x011
50 #define DPMCP_CMDID_SET_IRQ_ENABLE 0x012
51 #define DPMCP_CMDID_GET_IRQ_ENABLE 0x013
52 #define DPMCP_CMDID_SET_IRQ_MASK 0x014
53 #define DPMCP_CMDID_GET_IRQ_MASK 0x015
54 #define DPMCP_CMDID_GET_IRQ_STATUS 0x016
55
56 struct dpmcp_cmd_open {
57 __le32 dpmcp_id;
58 };
59
60 struct dpmcp_cmd_create {
61 __le32 portal_id;
62 };
63
64 struct dpmcp_cmd_set_irq {
65 /* cmd word 0 */
66 u8 irq_index;
67 u8 pad[3];
68 __le32 irq_val;
69 /* cmd word 1 */
70 __le64 irq_addr;
71 /* cmd word 2 */
72 __le32 irq_num;
73 };
74
75 struct dpmcp_cmd_get_irq {
76 __le32 pad;
77 u8 irq_index;
78 };
79
80 struct dpmcp_rsp_get_irq {
81 /* cmd word 0 */
82 __le32 irq_val;
83 __le32 pad;
84 /* cmd word 1 */
85 __le64 irq_paddr;
86 /* cmd word 2 */
87 __le32 irq_num;
88 __le32 type;
89 };
90
91 #define DPMCP_ENABLE 0x1
92
93 struct dpmcp_cmd_set_irq_enable {
94 u8 enable;
95 u8 pad[3];
96 u8 irq_index;
97 };
98
99 struct dpmcp_cmd_get_irq_enable {
100 __le32 pad;
101 u8 irq_index;
102 };
103
104 struct dpmcp_rsp_get_irq_enable {
105 u8 enabled;
106 };
107
108 struct dpmcp_cmd_set_irq_mask {
109 __le32 mask;
110 u8 irq_index;
111 };
112
113 struct dpmcp_cmd_get_irq_mask {
114 __le32 pad;
115 u8 irq_index;
116 };
117
118 struct dpmcp_rsp_get_irq_mask {
119 __le32 mask;
120 };
121
122 struct dpmcp_cmd_get_irq_status {
123 __le32 status;
124 u8 irq_index;
125 };
126
127 struct dpmcp_rsp_get_irq_status {
128 __le32 status;
129 };
130
131 struct dpmcp_rsp_get_attributes {
132 /* response word 0 */
133 __le32 pad;
134 __le32 id;
135 /* response word 1 */
136 __le16 version_major;
137 __le16 version_minor;
138 };
139
140 #endif /* _FSL_DPMCP_CMD_H */