1 /*
2 * Copyright (c) 2011-2012, 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 fw_rsc_carveout {
93 UInt32 type;
94 UInt32 da;
95 UInt32 pa;
96 UInt32 len;
97 UInt32 flags;
98 UInt32 reserved;
99 Char name[32];
100 };
102 struct fw_rsc_devmem {
103 UInt32 type;
104 UInt32 da;
105 UInt32 pa;
106 UInt32 len;
107 UInt32 flags;
108 UInt32 reserved;
109 Char name[32];
110 };
112 struct fw_rsc_trace {
113 UInt32 type;
114 UInt32 da;
115 UInt32 len;
116 UInt32 reserved;
117 Char name[32];
118 };
120 struct fw_rsc_vdev_vring {
121 UInt32 da; /* device address */
122 UInt32 align;
123 UInt32 num;
124 UInt32 notifyid;
125 UInt32 reserved;
126 };
128 struct fw_rsc_vdev {
129 UInt32 type;
130 UInt32 id;
131 UInt32 notifyid;
132 UInt32 dfeatures;
133 UInt32 gfeatures;
134 UInt32 config_len;
135 Char status;
136 Char num_of_vrings;
137 Char reserved[2];
138 };
140 #endif /* _RSC_TYPES_H_ */