aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Reeder2015-10-13 11:10:37 -0500
committerJason Reeder2015-10-13 11:10:37 -0500
commit4ad7a84a98f5244e4dff5deccd74486c4b99d0ec (patch)
treeccf17807c97355335d78b213bafe5053fdbb1a1e /examples/am335x/PRU_RPMsg_Echo_Interrupt0/resource_table_0.h
parenteb4c8e01f6a047fc2b50a7c8c9ef4d692aa71935 (diff)
downloadpru-software-support-package-4ad7a84a98f5244e4dff5deccd74486c4b99d0ec.tar.gz
pru-software-support-package-4ad7a84a98f5244e4dff5deccd74486c4b99d0ec.tar.xz
pru-software-support-package-4ad7a84a98f5244e4dff5deccd74486c4b99d0ec.zip
Copy examples into device-specific folders
Added example folders for the AM335x and AM437x devices and copied the existing examples into these two folders. Signed-off-by: Jason Reeder <jreeder@ti.com>
Diffstat (limited to 'examples/am335x/PRU_RPMsg_Echo_Interrupt0/resource_table_0.h')
-rwxr-xr-xexamples/am335x/PRU_RPMsg_Echo_Interrupt0/resource_table_0.h148
1 files changed, 148 insertions, 0 deletions
diff --git a/examples/am335x/PRU_RPMsg_Echo_Interrupt0/resource_table_0.h b/examples/am335x/PRU_RPMsg_Echo_Interrupt0/resource_table_0.h
new file mode 100755
index 0000000..177b7c1
--- /dev/null
+++ b/examples/am335x/PRU_RPMsg_Echo_Interrupt0/resource_table_0.h
@@ -0,0 +1,148 @@
1/*
2 * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
3 *
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
15 * distribution.
16 *
17 * * Neither the name of Texas Instruments Incorporated nor the names of
18 * its contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34/*
35 * ======== rsc_table_am335x_pru.h ========
36 *
37 * Define the resource table entries for all PRU cores. This will be
38 * incorporated into corresponding base images, and used by the remoteproc
39 * on the host-side to allocated/reserve resources.
40 *
41 */
42
43
44#ifndef _RSC_TABLE_PRU_H_
45#define _RSC_TABLE_PRU_H_
46
47#include <stddef.h>
48#include <rsc_types.h>
49#include "pru_virtio_ids.h"
50
51/*
52 * Sizes of the virtqueues (expressed in number of buffers supported,
53 * and must be power of 2)
54 */
55#define PRU_RPMSG_VQ0_SIZE 16
56#define PRU_RPMSG_VQ1_SIZE 16
57
58/*
59 * The feature bitmap for virtio rpmsg
60 */
61#define VIRTIO_RPMSG_F_NS 0 //name service notifications
62
63/* This firmware supports name service notifications as one of its features */
64#define RPMSG_PRU_C0_FEATURES (1 << VIRTIO_RPMSG_F_NS)
65
66/* Definition for unused interrupts */
67#define HOST_UNUSED 255
68
69/* Mapping sysevts to a channel. Each pair contains a sysevt, channel
70 * Mapping event 60 (Mbox0 mailbox interrupt for pru0) to channel 0
71 * */
72struct ch_map pru_intc_map[] = { {60, 0},
73 };
74
75struct my_resource_table {
76 struct resource_table base;
77
78 uint32_t offset[2]; /* Should match 'num' in actual definition */
79
80 /* rpmsg vdev entry */
81 struct fw_rsc_vdev rpmsg_vdev;
82 struct fw_rsc_vdev_vring rpmsg_vring0;
83 struct fw_rsc_vdev_vring rpmsg_vring1;
84
85 /* intc definition */
86 struct fw_rsc_custom pru_ints;
87};
88
89#pragma DATA_SECTION(resourceTable, ".resource_table")
90#pragma RETAIN(resourceTable)
91struct my_resource_table resourceTable = {
92 1, /* Resource table version: only version 1 is supported by the current driver */
93 2, /* number of entries in the table */
94 0, 0, /* reserved, must be zero */
95 /* offsets to entries */
96 {
97 offsetof(struct my_resource_table, rpmsg_vdev),
98 offsetof(struct my_resource_table, pru_ints),
99 },
100
101 /* rpmsg vdev entry */
102 {
103 (uint32_t)TYPE_VDEV, //type
104 (uint32_t)VIRTIO_ID_RPMSG, //id
105 (uint32_t)0, //notifyid
106 (uint32_t)RPMSG_PRU_C0_FEATURES, //dfeatures
107 (uint32_t)0, //gfeatures
108 (uint32_t)0, //config_len
109 (uint8_t)0, //status
110 (uint8_t)2, //num_of_vrings, only two is supported
111 { (uint8_t)0, (uint8_t)0 }, //reserved
112 /* no config data */
113 },
114 /* the two vrings */
115 {
116 0, //da, will be populated by host, can't pass it in
117 16, //align (bytes),
118 PRU_RPMSG_VQ0_SIZE, //num of descriptors
119 0, //notifyid, will be populated, can't pass right now
120 0 //reserved
121 },
122 {
123 0, //da, will be populated by host, can't pass it in
124 16, //align (bytes),
125 PRU_RPMSG_VQ1_SIZE, //num of descriptors
126 0, //notifyid, will be populated, can't pass right now
127 0 //reserved
128 },
129
130 {
131 TYPE_CUSTOM, TYPE_PRU_INTS,
132 sizeof(struct fw_rsc_custom_ints),
133 { /* PRU_INTS version */
134 0x0000,
135 /* Channel-to-host mapping, 255 for unused
136 * Mapping Channel-0 to Host-0 (PRU0/1 R31 bit 30)
137 * */
138 0, HOST_UNUSED, HOST_UNUSED, HOST_UNUSED, HOST_UNUSED,
139 HOST_UNUSED, HOST_UNUSED, HOST_UNUSED, HOST_UNUSED, HOST_UNUSED,
140 /* Number of evts being mapped to channels */
141 (sizeof(pru_intc_map) / sizeof(struct ch_map)),
142 /* Pointer to the structure containing mapped events */
143 pru_intc_map,
144 },
145 },
146};
147
148#endif /* _RSC_TABLE_PRU_H_ */