4dda9e26a8dc62097a98bf8316ff43a629efc4ca
1 /*
2 * Copyright (c) 2011-2014, 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 /*
33 * ======== rsc_types.h ========
34 *
35 * Include common definitions for sizes and type of resources
36 * used by the the resource table in each base image, which is
37 * read from remoteproc on host side.
38 *
39 */
41 #ifndef _RSC_TYPES_H_
42 #define _RSC_TYPES_H_
44 #include <ti/syslink/Std.h>
46 /* Size constants must match those used on host: include/asm-generic/sizes.h */
47 #define SZ_64K 0x00010000
48 #define SZ_128K 0x00020000
49 #define SZ_256K 0x00040000
50 #define SZ_512K 0x00080000
51 #define SZ_1M 0x00100000
52 #define SZ_2M 0x00200000
53 #define SZ_4M 0x00400000
54 #define SZ_8M 0x00800000
55 #define SZ_16M 0x01000000
56 #define SZ_32M 0x02000000
57 #define SZ_64M 0x04000000
58 #define SZ_128M 0x08000000
59 #define SZ_256M 0x10000000
60 #define SZ_512M 0x20000000
62 /* Virtio Ids: keep in sync with the linux "include/linux/virtio_ids.h" */
63 #define VIRTIO_ID_CONSOLE 3 /* virtio console */
64 #define VIRTIO_ID_RPMSG 7 /* virtio remote processor messaging */
66 /* Indices of rpmsg virtio features we support */
67 #define VIRTIO_RPMSG_F_NS 0 /* RP supports name service notifications */
68 #define VIRTIO_RING_F_SYMMETRIC 30 /* We support symmetric vring */
70 /* Resource info: Must match include/linux/remoteproc.h: */
71 #define TYPE_CARVEOUT 0
72 #define TYPE_DEVMEM 1
73 #define TYPE_TRACE 2
74 #define TYPE_VDEV 3
75 #define TYPE_INTMEM 4
77 /* Common Resource Structure Types */
78 struct fw_rsc_carveout {
79 UInt32 type;
80 UInt32 da;
81 UInt32 pa;
82 UInt32 len;
83 UInt32 flags;
84 UInt32 reserved;
85 Char name[32];
86 };
88 struct fw_rsc_intmem {
89 UInt32 type;
90 UInt32 version;
91 UInt32 da;
92 UInt32 pa;
93 UInt32 len;
94 UInt32 reserved;
95 Char name[32];
96 };
98 struct fw_rsc_devmem {
99 UInt32 type;
100 UInt32 da;
101 UInt32 pa;
102 UInt32 len;
103 UInt32 flags;
104 UInt32 reserved;
105 Char name[32];
106 };
108 struct fw_rsc_trace {
109 UInt32 type;
110 UInt32 da;
111 UInt32 len;
112 UInt32 reserved;
113 Char name[32];
114 };
116 struct fw_rsc_vdev_vring {
117 UInt32 da; /* device address */
118 UInt32 align;
119 UInt32 num;
120 UInt32 notifyid;
121 UInt32 reserved;
122 };
124 struct fw_rsc_vdev {
125 UInt32 type;
126 UInt32 id;
127 UInt32 notifyid;
128 UInt32 dfeatures;
129 UInt32 gfeatures;
130 UInt32 config_len;
131 Char status;
132 Char num_of_vrings;
133 Char reserved[2];
134 };
136 #endif /* _RSC_TYPES_H_ */