7f6704b8627366108652d3bd5e70ed73314229f6
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 <xdc/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 resource_table {
79 UInt32 ver;
80 UInt32 num;
81 UInt32 reserved[2];
82 };
84 struct fw_rsc_carveout {
85 UInt32 type;
86 UInt32 da;
87 UInt32 pa;
88 UInt32 len;
89 UInt32 flags;
90 UInt32 reserved;
91 Char name[32];
92 };
94 struct fw_rsc_intmem {
95 UInt32 type;
96 UInt32 da;
97 UInt32 pa;
98 UInt32 len;
99 UInt32 reserved[2];
100 Char name[32];
101 };
103 struct fw_rsc_devmem {
104 UInt32 type;
105 UInt32 da;
106 UInt32 pa;
107 UInt32 len;
108 UInt32 flags;
109 UInt32 reserved;
110 Char name[32];
111 };
113 struct fw_rsc_trace {
114 UInt32 type;
115 UInt32 da;
116 UInt32 len;
117 UInt32 reserved;
118 Char name[32];
119 };
121 struct fw_rsc_vdev_vring {
122 UInt32 da; /* device address */
123 UInt32 align;
124 UInt32 num;
125 UInt32 notifyid;
126 UInt32 reserved;
127 };
129 struct fw_rsc_vdev {
130 UInt32 type;
131 UInt32 id;
132 UInt32 notifyid;
133 UInt32 dfeatures;
134 UInt32 gfeatures;
135 UInt32 config_len;
136 Char status;
137 Char num_of_vrings;
138 Char reserved[2];
139 };
141 #endif /* _RSC_TYPES_H_ */