1 /*
2 * Copyright (c) 2013-2020, 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 * ======== 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 __CUSTOM_RSC_TABLE_VAYU_IPU_H__
43 #define __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_IPC_DATA 0x9F000000
88 #define IPU_MEM_IPC_VRING 0x60000000
89 #define IPU_MEM_VRING_BUFS0 0x60040000
90 #define IPU_MEM_VRING_BUFS1 0x60080000
92 #define IPU_MEM_IPC_VRING_SIZE SZ_1M
93 #define IPU_MEM_IPC_DATA_SIZE SZ_1M
95 #define IPU_MEM_TEXT_SIZE (SZ_1M * 6)
97 /*
98 * IPU_MEM_DATA_SIZE contains the size of EXT_DATA + EXT_HEAP
99 * defined in the dce_ipu.cfg
100 */
101 #define IPU_MEM_DATA_SIZE (SZ_1M * 43)
103 /*
104 * Assign fixed RAM addresses to facilitate a fixed MMU table.
105 * PHYS_MEM_IPC_VRING & PHYS_MEM_IPC_DATA MUST be together.
106 */
107 /* See CMA BASE addresses in Linux side (for 3.8 & 3.12 kernels):
108 arch/arm/mach-omap2/remoteproc.c */
109 /* For 3.14 kernels version and above, look for CMA reserved memory node in
110 the board dts file. */
111 #define PHYS_MEM_IPC_VRING 0x95800000
113 /*
114 * Sizes of the virtqueues (expressed in number of buffers supported,
115 * and must be power of 2)
116 */
117 #define IPU_RPMSG_VQ0_SIZE 256
118 #define IPU_RPMSG_VQ1_SIZE 256
120 /* flip up bits whose indices represent features we support */
121 #define RPMSG_IPU_C0_FEATURES 1
124 #define RPMSG_VRING_ADDR_ANY FW_RSC_ADDR_ANY
126 struct my_resource_table {
127 struct resource_table base;
129 UInt32 offset[17]; /* Should match 'num' in actual definition */
131 /* rpmsg vdev entry */
132 struct fw_rsc_vdev rpmsg_vdev;
133 struct fw_rsc_vdev_vring rpmsg_vring0;
134 struct fw_rsc_vdev_vring rpmsg_vring1;
136 /* text carveout entry */
137 struct fw_rsc_carveout text_cout;
139 /* data carveout entry */
140 struct fw_rsc_carveout data_cout;
142 /* ipcdata carveout entry */
143 struct fw_rsc_carveout ipcdata_cout;
145 /* trace entry */
146 struct fw_rsc_trace trace;
148 /* devmem entry */
149 struct fw_rsc_devmem devmem0;
151 /* devmem entry */
152 struct fw_rsc_devmem devmem1;
154 /* devmem entry */
155 struct fw_rsc_devmem devmem2;
157 /* devmem entry */
158 struct fw_rsc_devmem devmem3;
160 /* devmem entry */
161 struct fw_rsc_devmem devmem4;
163 /* devmem entry */
164 struct fw_rsc_devmem devmem5;
166 /* devmem entry */
167 struct fw_rsc_devmem devmem6;
169 /* devmem entry */
170 struct fw_rsc_devmem devmem7;
172 /* devmem entry */
173 struct fw_rsc_devmem devmem8;
175 /* devmem entry */
176 struct fw_rsc_devmem devmem9;
178 /* devmem entry */
179 struct fw_rsc_devmem devmem10;
181 /* devmem entry */
182 struct fw_rsc_devmem devmem11;
183 };
185 extern char ti_trace_SysMin_Module_State_0_outbuf__A;
186 #define TRACEBUFADDR (UInt32)&ti_trace_SysMin_Module_State_0_outbuf__A
188 #pragma DATA_SECTION(ti_ipc_remoteproc_ResourceTable, ".resource_table")
189 #pragma DATA_ALIGN(ti_ipc_remoteproc_ResourceTable, 4096)
191 struct my_resource_table ti_ipc_remoteproc_ResourceTable = {
192 1, /* we're the first version that implements this */
193 17, /* number of entries in the table */
194 0, 0, /* reserved, must be zero */
195 /* offsets to entries */
196 {
197 offsetof(struct my_resource_table, rpmsg_vdev),
198 offsetof(struct my_resource_table, text_cout),
199 offsetof(struct my_resource_table, data_cout),
200 offsetof(struct my_resource_table, ipcdata_cout),
201 offsetof(struct my_resource_table, trace),
202 offsetof(struct my_resource_table, devmem0),
203 offsetof(struct my_resource_table, devmem1),
204 offsetof(struct my_resource_table, devmem2),
205 offsetof(struct my_resource_table, devmem3),
206 offsetof(struct my_resource_table, devmem4),
207 offsetof(struct my_resource_table, devmem5),
208 offsetof(struct my_resource_table, devmem6),
209 offsetof(struct my_resource_table, devmem7),
210 offsetof(struct my_resource_table, devmem8),
211 offsetof(struct my_resource_table, devmem9),
212 offsetof(struct my_resource_table, devmem10),
213 offsetof(struct my_resource_table, devmem11),
214 },
216 /* rpmsg vdev entry */
217 {
218 TYPE_VDEV, VIRTIO_ID_RPMSG, 0,
219 RPMSG_IPU_C0_FEATURES, 0, 0, 0, 2, { 0, 0 },
220 /* no config data */
221 },
222 /* the two vrings */
223 { RPMSG_VRING_ADDR_ANY, 4096, IPU_RPMSG_VQ0_SIZE, 1, 0 },
224 { RPMSG_VRING_ADDR_ANY, 4096, IPU_RPMSG_VQ1_SIZE, 2, 0 },
226 {
227 TYPE_CARVEOUT,
228 IPU_MEM_TEXT, 0,
229 IPU_MEM_TEXT_SIZE, 0, 0, "IPU_MEM_TEXT",
230 },
232 {
233 TYPE_CARVEOUT,
234 IPU_MEM_DATA, 0,
235 IPU_MEM_DATA_SIZE, 0, 0, "IPU_MEM_DATA",
236 },
238 {
239 TYPE_CARVEOUT,
240 IPU_MEM_IPC_DATA, 0,
241 IPU_MEM_IPC_DATA_SIZE, 0, 0, "IPU_MEM_IPC_DATA",
242 },
244 {
245 TYPE_TRACE, TRACEBUFADDR, 0x8000, 0, "trace:sysm3",
246 },
248 {
249 TYPE_DEVMEM,
250 IPU_MEM_IPC_VRING, PHYS_MEM_IPC_VRING,
251 IPU_MEM_IPC_VRING_SIZE, 0, 0, "IPU_MEM_IPC_VRING",
252 },
254 {
255 TYPE_DEVMEM,
256 IPU_TILER_MODE_0_1, L3_TILER_MODE_0_1,
257 SZ_256M, 0, 0, "IPU_TILER_MODE_0_1",
258 },
260 {
261 TYPE_DEVMEM,
262 IPU_TILER_MODE_2, L3_TILER_MODE_2,
263 SZ_128M, 0, 0, "IPU_TILER_MODE_2",
264 },
266 {
267 TYPE_DEVMEM,
268 IPU_TILER_MODE_3, L3_TILER_MODE_3,
269 SZ_128M, 0, 0, "IPU_TILER_MODE_3",
270 },
272 {
273 TYPE_DEVMEM,
274 IPU_PERIPHERAL_L4CFG, L4_PERIPHERAL_L4CFG,
275 SZ_16M, 0, 0, "IPU_PERIPHERAL_L4CFG",
276 },
278 {
279 TYPE_DEVMEM,
280 IPU_PERIPHERAL_L4PER1, L4_PERIPHERAL_L4PER1,
281 SZ_2M, 0, 0, "IPU_PERIPHERAL_L4PER1",
282 },
284 {
285 TYPE_DEVMEM,
286 IPU_PERIPHERAL_L4PER2, L4_PERIPHERAL_L4PER2,
287 SZ_4M, 0, 0, "IPU_PERIPHERAL_L4PER2",
288 },
290 {
291 TYPE_DEVMEM,
292 IPU_PERIPHERAL_L4PER3, L4_PERIPHERAL_L4PER3,
293 SZ_8M, 0, 0, "IPU_PERIPHERAL_L4PER3",
294 },
296 {
297 TYPE_DEVMEM,
298 IPU_PERIPHERAL_L4EMU, L4_PERIPHERAL_L4EMU,
299 SZ_16M, 0, 0, "IPU_PERIPHERAL_L4EMU",
300 },
302 {
303 TYPE_DEVMEM,
304 IPU_IVAHD_CONFIG, L3_IVAHD_CONFIG,
305 SZ_16M, 0, 0, "IPU_IVAHD_CONFIG",
306 },
308 {
309 TYPE_DEVMEM,
310 IPU_IVAHD_SL2, L3_IVAHD_SL2,
311 SZ_16M, 0, 0, "IPU_IVAHD_SL2",
312 },
314 {
315 TYPE_DEVMEM,
316 IPU_PERIPHERAL_DMM, L3_PERIPHERAL_DMM,
317 SZ_1M, 0, 0, "IPU_PERIPHERAL_DMM",
318 },
319 };
321 #endif /* __CUSTOM_RSC_TABLE_VAYU_IPU_H__ */