]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/big-data-ipc-examples.git/blob - host_linux/simple_buffer_example/shared/TCI6638/rsc_table_dsp.h
host_linux: Add example for use case with host running linux
[processor-sdk/big-data-ipc-examples.git] / host_linux / simple_buffer_example / shared / TCI6638 / rsc_table_dsp.h
1 /*
2  * Copyright (c) 2012-2017, 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_table_tci6638.h ========
34  *
35  *  Include this table in each base image, which is read from remoteproc on
36  *  host side.
37  *
38  */
40 #ifndef _RSC_TABLE_DSP_H_
41 #define _RSC_TABLE_DSP_H_
43 #include <ti/ipc/remoteproc/rsc_types.h>
45 /* virtio ids: keep in sync with the linux "include/linux/virtio_ids.h" */
46 #define VIRTIO_ID_RPMSG         7 /* virtio remote processor messaging */
48 /* flip up bits whose indices represent features we support */
49 #define RPMSG_IPU_C0_FEATURES         1
51 #define RPMSG_VRING0_DA     0xA0000000
52 #define RPMSG_VRING1_DA     0xA0004000
54 /* NOTE: Make sure this matches what is configured in the linux device tree */
55 #define DSP_CMEM_IOBUFS 0xB0000000
56 #define PHYS_CMEM_IOBUFS 0xB0000000
57 #define DSP_CMEM_IOBUFS_SIZE (SZ_1M * 384)
59 /*
60  * sizes of the virtqueues (expressed in number of buffers supported,
61  * and must be power of 2)
62  */
63 #define RPMSG_VQ0_SIZE          256
64 #define RPMSG_VQ1_SIZE          256
66 struct my_resource_table {
67     struct resource_table base;
69     UInt32 offset[3];
71     /* rpmsg vdev entry */
72     struct fw_rsc_vdev rpmsg_vdev;
73     struct fw_rsc_vdev_vring rpmsg_vring0;
74     struct fw_rsc_vdev_vring rpmsg_vring1;
76     /* trace entry */
77     struct fw_rsc_trace trace;
78     /* devmem entry */
79     struct fw_rsc_devmem devmem0;
80 };
82 /* Add trace buffer information to the resource table */
83 //#define TRACEBUFADDR (UInt32)&xdc_runtime_SysMin_Module_State_0_outbuf__A
84 extern char ti_trace_SysMin_Module_State_0_outbuf__A;
85 #define TRACEBUFADDR (UInt32)&ti_trace_SysMin_Module_State_0_outbuf__A
86 #define TRACEBUFSIZE 0x8000
88 #define CARVEOUTADDR TRACEBUFADDR
89 #define CARVEOUTSIZE TRACEBUFSIZE
91 #pragma DATA_SECTION(ti_ipc_remoteproc_ResourceTable, ".resource_table")
92 #pragma DATA_ALIGN(ti_ipc_remoteproc_ResourceTable, 4096)
94 struct my_resource_table ti_ipc_remoteproc_ResourceTable = {
95     1, /* we're the first version that implements this */
96     3, /* number of entries in the table */
97     0, 0, /* reserved, must be zero */
98     /* offsets to entries */
99     {
100         offsetof(struct my_resource_table, rpmsg_vdev),
101         offsetof(struct my_resource_table, trace),
102         offsetof(struct my_resource_table, devmem0),
103     },
105     /* rpmsg vdev entry */
106     {
107         TYPE_VDEV, VIRTIO_ID_RPMSG, 0,
108         RPMSG_IPU_C0_FEATURES, 0, 0, 0, 2, { 0, 0 },
109         /* no config data */
110     },
111     /* the two vrings */
112     { RPMSG_VRING0_DA, 4096, RPMSG_VQ0_SIZE, 1, 0 },
113     { RPMSG_VRING1_DA, 4096, RPMSG_VQ1_SIZE, 2, 0 },
115     {
116         TYPE_TRACE, TRACEBUFADDR, TRACEBUFSIZE, 0, "trace:dsp",
117     },
118     {
119         TYPE_DEVMEM,
120         DSP_CMEM_IOBUFS, PHYS_CMEM_IOBUFS,
121         DSP_CMEM_IOBUFS_SIZE, 0, 0, "DSP_CMEM_IOBUFS",
122     },
123 };
125 #endif /* _RSC_TABLE_DSP_H_ */