1 /*
2 * Copyright (c) 2011-2013, 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_CRASHDUMP 4
77 /*
78 * Use flags to define memory access for each resource
79 * Must match include/linux/rproc_drm.h
80 */
81 enum rproc_memregion {
82 RPROC_MEMREGION_UNKNOWN,
83 RPROC_MEMREGION_2D,
84 RPROC_MEMREGION_SMEM,
85 RPROC_MEMREGION_CODE,
86 RPROC_MEMREGION_DATA,
87 RPROC_MEMREGION_1D,
88 RPROC_MEMREGION_VRING
89 };
91 /* Common Resource Structure Types */
92 struct resource_table {
93 UInt32 ver;
94 UInt32 num;
95 UInt32 reserved[2];
96 };
98 struct fw_rsc_carveout {
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_devmem {
109 UInt32 type;
110 UInt32 da;
111 UInt32 pa;
112 UInt32 len;
113 UInt32 flags;
114 UInt32 memregion;
115 Char name[32];
116 };
118 struct fw_rsc_trace {
119 UInt32 type;
120 UInt32 da;
121 UInt32 len;
122 UInt32 reserved;
123 Char name[32];
124 };
126 struct fw_rsc_vdev_vring {
127 UInt32 da; /* device address */
128 UInt32 align;
129 UInt32 num;
130 UInt32 notifyid;
131 UInt32 reserved;
132 };
134 struct fw_rsc_vdev {
135 UInt32 type;
136 UInt32 id;
137 UInt32 notifyid;
138 UInt32 dfeatures;
139 UInt32 gfeatures;
140 UInt32 config_len;
141 Char status;
142 Char num_of_vrings;
143 Char reserved[2];
144 };
146 #endif /* _RSC_TYPES_H_ */