PSDK QNX API Guide
ipc_rsctypes.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2020, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
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,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
42 /*
43  * \file ipc_rsctypes.h
44  *
45  * \brief Include common definitions for sizes and type of resources
46  * used by the the resource table in each base image, which is
47  * read from remoteproc on host side.
48  *
49  */
50 
51 #ifndef IPC_RSCTYPES_H_
52 #define IPC_RSCTYPES_H_
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
59 
60 /* Virtio Ids: keep in sync with the linux "include/linux/virtio_ids.h" */
62 #define VIRTIO_ID_CONSOLE 3
63 
65 #define VIRTIO_ID_RPMSG 7
66 
67 /* Indices of rpmsg virtio features we support */
69 #define VIRTIO_RPMSG_F_NS 0
71 #define VIRTIO_RING_F_SYMMETRIC 30
72 
81 #define IPC_RP_MBOX_READY ((uint32_t)0xFFFFFF00U)
82 #define IPC_RP_MBOX_PENDING_MSG ((uint32_t)0xFFFFFF01U)
83 #define IPC_RP_MBOX_CRASH ((uint32_t)0xFFFFFF02U)
84 #define IPC_RP_MBOX_ECHO_REQUEST ((uint32_t)0xFFFFFF03U)
85 #define IPC_RP_MBOX_ECHO_REPLY ((uint32_t)0xFFFFFF04U)
86 #define IPC_RP_MBOX_ABORT_REQUEST ((uint32_t)0xFFFFFF05U)
87 #define IPC_RP_MBOX_SUSPEND_AUTO ((uint32_t)0xFFFFFF10U)
88 #define IPC_RP_MBOX_SUSPEND_SYSTEM ((uint32_t)0xFFFFFF11U)
89 #define IPC_RP_MBOX_SUSPEND_ACK ((uint32_t)0xFFFFFF12U)
90 #define IPC_RP_MBOX_SUSPEND_CANCEL ((uint32_t)0xFFFFFF13U)
91 #define IPC_RP_MBOX_SHUTDOWN ((uint32_t)0xFFFFFF14U)
92 #define IPC_RP_MBOX_SHUTDOWN_ACK ((uint32_t)0xFFFFFF15U)
93 #define IPC_RP_MBOX_END_MSG ((uint32_t)0xFFFFFF16U)
94 /* @} */
95 
96 /* Resource info: Must match include/linux/remoteproc.h: */
98 #define TYPE_CARVEOUT 0U
100 #define TYPE_DEVMEM 1U
102 #define TYPE_TRACE 2U
104 #define TYPE_VDEV 3U
105 
106 /* Linux kernel defines this as (-1), below define avoids compile warnings */
108 #define FW_RSC_ADDR_ANY (~0)
109 
111 #define NUM_ENTRIES 2
112 
114 #define NAME_LEN 32
115 
116 
117 #define TRACE_INTS_VER0 (0 << 16)
118 #define TRACE_INTS_VER1 (1 << 16)
119 
120 /* ========================================================================== */
121 /* Structure Declarations */
122 /* ========================================================================== */
123 
127 typedef struct
128 {
129  uint32_t ver;
132  uint32_t num;
135  uint32_t reserved[2];
137 }Ipc_Hdr;
138 
142 typedef struct
143 {
144  uint32_t type;
147 #if defined(BUILD_C7X)
148  /* Add padding members below to fix PORTING.STORAGE.STRUCT KW issue */
149  uint32_t padding;
151  uint64_t da;
152 #else
153  uint32_t da;
154 #endif
157  uint32_t len;
160  uint32_t reserved;
163  uint8_t name[NAME_LEN];
165 }Ipc_Trace;
166 
170 typedef struct
171 {
172  uint32_t da;
175  uint32_t align;
178  uint32_t num;
181  uint32_t notifyid;
184  uint32_t reserved;
187  /* Add padding members below to fix PORTING.STORAGE.STRUCT KW issue */
188  uint32_t padding;
192 
196 typedef struct
197 {
198  uint32_t type;
201  uint32_t id;
204  uint32_t notifyid;
207  uint32_t dfeatures;
210  uint32_t gfeatures;
213  uint32_t config_len;
216  uint8_t status;
219  uint8_t num_of_vrings;
222  uint8_t reserved[2];
225  /* Add padding members below to fix PORTING.STORAGE.STRUCT KW issue */
226  uint32_t padding;
229 }Ipc_VDev;
230 
234 typedef struct
235 {
239  uint32_t offset[NUM_ENTRIES];
251  /* trace entry */
256 
257 
258 #ifdef __cplusplus
259 }
260 #endif
261 
262 #endif /* IPC_RSCTYPES_H_ */
263 
264 /* @} */
uint32_t padding
Definition: ipc_rsctypes.h:226
uint32_t num
Definition: ipc_rsctypes.h:132
uint32_t notifyid
Definition: ipc_rsctypes.h:204
uint32_t config_len
Definition: ipc_rsctypes.h:213
#define NUM_ENTRIES
Number of e ntries.
Definition: ipc_rsctypes.h:111
uint32_t dfeatures
Definition: ipc_rsctypes.h:207
uint32_t padding
Definition: ipc_rsctypes.h:188
uint32_t gfeatures
Definition: ipc_rsctypes.h:210
uint32_t len
Definition: ipc_rsctypes.h:157
uint32_t da
Definition: ipc_rsctypes.h:153
#define NAME_LEN
Name Length.
Definition: ipc_rsctypes.h:114
uint32_t ver
Definition: ipc_rsctypes.h:129
uint32_t notifyid
Definition: ipc_rsctypes.h:181
uint32_t type
Definition: ipc_rsctypes.h:198
uint32_t id
Definition: ipc_rsctypes.h:201
uint32_t reserved
Definition: ipc_rsctypes.h:160
Ipc_VDevVRing rpmsg_vring0
Definition: ipc_rsctypes.h:245
uint32_t da
Definition: ipc_rsctypes.h:172
uint32_t num
Definition: ipc_rsctypes.h:178
Ipc_VDevVRing rpmsg_vring1
Definition: ipc_rsctypes.h:248
uint32_t align
Definition: ipc_rsctypes.h:175
Ipc_VDev rpmsg_vdev
Definition: ipc_rsctypes.h:242
Ipc_Hdr base
Definition: ipc_rsctypes.h:236
Ipc_Trace trace
Definition: ipc_rsctypes.h:252
uint32_t reserved
Definition: ipc_rsctypes.h:184
uint8_t num_of_vrings
Definition: ipc_rsctypes.h:219
uint8_t status
Definition: ipc_rsctypes.h:216
uint32_t type
Definition: ipc_rsctypes.h:144
data types definitions for ipc module.
IPC Resource Table Header.
Definition: ipc_rsctypes.h:128
IPC Resource Table used by IPC app.
Definition: ipc_rsctypes.h:235
Structure used for remoteproc trace.
Definition: ipc_rsctypes.h:143
Resource Table Device VRing Structure.
Definition: ipc_rsctypes.h:171
VDEV structure. Must match with Linux.
Definition: ipc_rsctypes.h:197