1 /*
2 * Copyright (c) 2015, 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 */
33 /*
34 * ======== qnx_custom_rsc_table_vayu_ipu.h ========
35 *
36 * Define the VAYU/DRA7xx custom resource table entries for all IPU cores. This will be
37 * incorporated into corresponding base images, and used by the remoteproc
38 * on the host-side to allocated/reserve resources.
39 *
40 */
42 #ifndef __QNX_CUSTOM_RSC_TABLE_VAYU_IPU_H__
43 #define __QNX_CUSTOM_RSC_TABLE_VAYU_IPU_H__
45 #include <ti/ipc/remoteproc/rsc_types.h>
47 /* IPU Memory Map */
48 #define L4_DRA7XX_BASE 0x4A000000
50 /* L4_CFG & L4_WKUP */
51 #define L4_PERIPHERAL_L4CFG (L4_DRA7XX_BASE)
52 #define IPU_PERIPHERAL_L4CFG 0x6A000000
54 #define L4_PERIPHERAL_L4PER1 0x48000000
55 #define IPU_PERIPHERAL_L4PER1 0x68000000
57 #define L4_PERIPHERAL_L4PER2 0x48400000
58 #define IPU_PERIPHERAL_L4PER2 0x68400000
60 #define L4_PERIPHERAL_L4PER3 0x48800000
61 #define IPU_PERIPHERAL_L4PER3 0x68800000
63 #define L4_PERIPHERAL_L4EMU 0x54000000
64 #define IPU_PERIPHERAL_L4EMU 0x74000000
66 #define L3_PERIPHERAL_DMM 0x4E000000
67 #define IPU_PERIPHERAL_DMM 0x6E000000
69 #define L3_IVAHD_CONFIG 0x5A000000
70 #define IPU_IVAHD_CONFIG 0x7A000000
72 #define L3_IVAHD_SL2 0x5B000000
73 #define IPU_IVAHD_SL2 0x7B000000
75 #define L3_TILER_MODE_0_1 0x60000000
76 #define IPU_TILER_MODE_0_1 0xA0000000
78 #define L3_TILER_MODE_2 0x70000000
79 #define IPU_TILER_MODE_2 0xB0000000
81 #define L3_TILER_MODE_3 0x78000000
82 #define IPU_TILER_MODE_3 0xB8000000
84 #define IPU_MEM_TEXT 0x0
85 #define IPU_MEM_DATA 0x80000000
87 #define IPU_MEM_IOBUFS 0x90000000
89 #define IPU_MEM_IPC_DATA 0x9F000000
90 #define IPU_MEM_IPC_VRING 0x60000000
91 #define IPU_MEM_RPMSG_VRING0 0x60000000
92 #define IPU_MEM_RPMSG_VRING1 0x60004000
93 #define IPU_MEM_VRING_BUFS0 0x60040000
94 #define IPU_MEM_VRING_BUFS1 0x60080000
96 #define IPU_MEM_IPC_VRING_SIZE SZ_1M
97 #define IPU_MEM_IPC_DATA_SIZE SZ_1M
99 #define IPU_MEM_TEXT_SIZE (SZ_1M * 6)
101 /*
102 * IPU_MEM_DATA_SIZE contains the size of EXT_DATA + EXT_HEAP
103 * defined in the dce_ipu.cfg
104 */
105 #define IPU_MEM_DATA_SIZE (SZ_1M * 43)
107 /*
108 * IPU_MEM_IOBUFS_SIZE is the IPUMM carveout memory.
109 */
110 #define IPU_MEM_IOBUFS_SIZE (SZ_1M * 90)
112 /*
113 * Assign fixed RAM addresses to facilitate a fixed MMU table.
114 * PHYS_MEM_IPC_VRING & PHYS_MEM_IPC_DATA MUST be together.
115 */
116 #define PHYS_MEM_IPC_VRING 0x95800000
117 #define PHYS_MEM_IOBUFS 0xBA300000
119 /*
120 * Sizes of the virtqueues (expressed in number of buffers supported,
121 * and must be power of 2)
122 */
123 #define IPU_RPMSG_VQ0_SIZE 256
124 #define IPU_RPMSG_VQ1_SIZE 256
126 /* flip up bits whose indices represent features we support */
127 #define RPMSG_IPU_C0_FEATURES 1
129 struct my_resource_table {
130 struct resource_table base;
132 UInt32 offset[18]; /* Should match 'num' in actual definition */
134 /* rpmsg vdev entry */
135 struct fw_rsc_vdev rpmsg_vdev;
136 struct fw_rsc_vdev_vring rpmsg_vring0;
137 struct fw_rsc_vdev_vring rpmsg_vring1;
139 /* text carveout entry */
140 struct fw_rsc_carveout text_cout;
142 /* data carveout entry */
143 struct fw_rsc_carveout data_cout;
145 /* ipcdata carveout entry */
146 struct fw_rsc_carveout ipcdata_cout;
148 /* trace entry */
149 struct fw_rsc_trace trace;
151 /* devmem entry */
152 struct fw_rsc_devmem devmem0;
154 /* devmem entry */
155 struct fw_rsc_devmem devmem1;
157 /* devmem entry */
158 struct fw_rsc_devmem devmem2;
160 /* devmem entry */
161 struct fw_rsc_devmem devmem3;
163 /* devmem entry */
164 struct fw_rsc_devmem devmem4;
166 /* devmem entry */
167 struct fw_rsc_devmem devmem5;
169 /* devmem entry */
170 struct fw_rsc_devmem devmem6;
172 /* devmem entry */
173 struct fw_rsc_devmem devmem7;
175 /* devmem entry */
176 struct fw_rsc_devmem devmem8;
178 /* devmem entry */
179 struct fw_rsc_devmem devmem9;
181 /* devmem entry */
182 struct fw_rsc_devmem devmem10;
184 /* devmem entry */
185 struct fw_rsc_devmem devmem11;
187 /* devmem entry */
188 struct fw_rsc_devmem devmem12;
189 };
191 extern char ti_trace_SysMin_Module_State_0_outbuf__A;
192 #define TRACEBUFADDR (UInt32)&ti_trace_SysMin_Module_State_0_outbuf__A
194 #pragma DATA_SECTION(ti_ipc_remoteproc_ResourceTable, ".resource_table")
195 #pragma DATA_ALIGN(ti_ipc_remoteproc_ResourceTable, 4096)
197 struct my_resource_table ti_ipc_remoteproc_ResourceTable = {
198 1, /* Ver is used to differentiate the changes of the resource table format */
199 18, /* number of entries in the table */
200 0, 0, /* reserved, must be zero */
201 /* offsets to entries */
202 {
203 offsetof(struct my_resource_table, rpmsg_vdev),
204 offsetof(struct my_resource_table, text_cout),
205 offsetof(struct my_resource_table, data_cout),
206 offsetof(struct my_resource_table, ipcdata_cout),
207 offsetof(struct my_resource_table, trace),
208 offsetof(struct my_resource_table, devmem0),
209 offsetof(struct my_resource_table, devmem1),
210 offsetof(struct my_resource_table, devmem2),
211 offsetof(struct my_resource_table, devmem3),
212 offsetof(struct my_resource_table, devmem4),
213 offsetof(struct my_resource_table, devmem5),
214 offsetof(struct my_resource_table, devmem6),
215 offsetof(struct my_resource_table, devmem7),
216 offsetof(struct my_resource_table, devmem8),
217 offsetof(struct my_resource_table, devmem9),
218 offsetof(struct my_resource_table, devmem10),
219 offsetof(struct my_resource_table, devmem11),
220 offsetof(struct my_resource_table, devmem12),
221 },
223 /* rpmsg vdev entry */
224 {
225 TYPE_VDEV, VIRTIO_ID_RPMSG, 0,
226 RPMSG_IPU_C0_FEATURES, 0, 0, 0, 2, { 0, 0 },
227 /* no config data */
228 },
229 /* the two vrings */
230 { IPU_MEM_RPMSG_VRING0, 4096, IPU_RPMSG_VQ0_SIZE, 1, 0 },
231 { IPU_MEM_RPMSG_VRING1, 4096, IPU_RPMSG_VQ1_SIZE, 2, 0 },
233 {
234 TYPE_CARVEOUT,
235 IPU_MEM_TEXT, 0,
236 IPU_MEM_TEXT_SIZE, 0, 0, "IPU_MEM_TEXT",
237 },
239 {
240 TYPE_CARVEOUT,
241 IPU_MEM_DATA, 0,
242 IPU_MEM_DATA_SIZE, 0, 0, "IPU_MEM_DATA",
243 },
245 {
246 TYPE_CARVEOUT,
247 IPU_MEM_IPC_DATA, 0,
248 IPU_MEM_IPC_DATA_SIZE, 0, 0, "IPU_MEM_IPC_DATA",
249 },
251 {
252 TYPE_TRACE, TRACEBUFADDR, 0x8000, 0, "trace:sysm3",
253 },
255 {
256 TYPE_DEVMEM,
257 IPU_MEM_IPC_VRING, PHYS_MEM_IPC_VRING,
258 IPU_MEM_IPC_VRING_SIZE, 0, 0, "IPU_MEM_IPC_VRING",
259 },
261 {
262 TYPE_DEVMEM,
263 IPU_MEM_IOBUFS, PHYS_MEM_IOBUFS,
264 IPU_MEM_IOBUFS_SIZE, 0, 0, "IPU_MEM_IOBUFS",
265 },
267 {
268 TYPE_DEVMEM,
269 IPU_TILER_MODE_0_1, L3_TILER_MODE_0_1,
270 SZ_256M, 0, 0, "IPU_TILER_MODE_0_1",
271 },
273 {
274 TYPE_DEVMEM,
275 IPU_TILER_MODE_2, L3_TILER_MODE_2,
276 SZ_128M, 0, 0, "IPU_TILER_MODE_2",
277 },
279 {
280 TYPE_DEVMEM,
281 IPU_TILER_MODE_3, L3_TILER_MODE_3,
282 SZ_128M, 0, 0, "IPU_TILER_MODE_3",
283 },
285 {
286 TYPE_DEVMEM,
287 IPU_PERIPHERAL_L4CFG, L4_PERIPHERAL_L4CFG,
288 SZ_16M, 0, 0, "IPU_PERIPHERAL_L4CFG",
289 },
291 {
292 TYPE_DEVMEM,
293 IPU_PERIPHERAL_L4PER1, L4_PERIPHERAL_L4PER1,
294 SZ_2M, 0, 0, "IPU_PERIPHERAL_L4PER1",
295 },
297 {
298 TYPE_DEVMEM,
299 IPU_PERIPHERAL_L4PER2, L4_PERIPHERAL_L4PER2,
300 SZ_4M, 0, 0, "IPU_PERIPHERAL_L4PER2",
301 },
303 {
304 TYPE_DEVMEM,
305 IPU_PERIPHERAL_L4PER3, L4_PERIPHERAL_L4PER3,
306 SZ_8M, 0, 0, "IPU_PERIPHERAL_L4PER3",
307 },
309 {
310 TYPE_DEVMEM,
311 IPU_PERIPHERAL_L4EMU, L4_PERIPHERAL_L4EMU,
312 SZ_16M, 0, 0, "IPU_PERIPHERAL_L4EMU",
313 },
315 {
316 TYPE_DEVMEM,
317 IPU_IVAHD_CONFIG, L3_IVAHD_CONFIG,
318 SZ_16M, 0, 0, "IPU_IVAHD_CONFIG",
319 },
321 {
322 TYPE_DEVMEM,
323 IPU_IVAHD_SL2, L3_IVAHD_SL2,
324 SZ_16M, 0, 0, "IPU_IVAHD_SL2",
325 },
327 {
328 TYPE_DEVMEM,
329 IPU_PERIPHERAL_DMM, L3_PERIPHERAL_DMM,
330 SZ_1M, 0, 0, "IPU_PERIPHERAL_DMM",
331 },
332 };
334 #endif /* __QNX_CUSTOM_RSC_TABLE_VAYU_IPU_H__ */