]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blob - processor_audio_sdk_1_00_00_00/psdk_cust/ipc_3_43_00_00_eng/docs/cdoc/ti/ipc/remoteproc/Resource-src.html
Change directory names in eclipse folder for RTSC plugin -- missing feature.xml
[processor-sdk/performance-audio-sr.git] / processor_audio_sdk_1_00_00_00 / psdk_cust / ipc_3_43_00_00_eng / docs / cdoc / ti / ipc / remoteproc / Resource-src.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html><head><title>module ti.ipc.remoteproc.Resource</title>
3 <meta name="googlebot" content="noindex,nofollow">
4 <link rel="stylesheet" type="text/css" href="../../../src.css"/>
5 </head>
6 <body>
7 <pre class=src>
8      1    <span class="comment">/*
9 </span>     2    <span class="comment"> * Copyright (c) 2011-2013, Texas Instruments Incorporated
10 </span>     3    <span class="comment"> * All rights reserved.
11 </span>     4    <span class="comment"> *
12 </span>     5    <span class="comment"> * Redistribution and use in source and binary forms, with or without
13 </span>     6    <span class="comment"> * modification, are permitted provided that the following conditions
14 </span>     7    <span class="comment"> * are met:
15 </span>     8    <span class="comment"> *
16 </span>     9    <span class="comment"> * *  Redistributions of source code must retain the above copyright
17 </span>    10    <span class="comment"> *    notice, this list of conditions and the following disclaimer.
18 </span>    11    <span class="comment"> *
19 </span>    12    <span class="comment"> * *  Redistributions in binary form must reproduce the above copyright
20 </span>    13    <span class="comment"> *    notice, this list of conditions and the following disclaimer in the
21 </span>    14    <span class="comment"> *    documentation and/or other materials provided with the distribution.
22 </span>    15    <span class="comment"> *
23 </span>    16    <span class="comment"> * *  Neither the name of Texas Instruments Incorporated nor the names of
24 </span>    17    <span class="comment"> *    its contributors may be used to endorse or promote products derived
25 </span>    18    <span class="comment"> *    from this software without specific prior written permission.
26 </span>    19    <span class="comment"> *
27 </span>    20    <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28 </span>    21    <span class="comment"> * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
29 </span>    22    <span class="comment"> * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 </span>    23    <span class="comment"> * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
31 </span>    24    <span class="comment"> * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
32 </span>    25    <span class="comment"> * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
33 </span>    26    <span class="comment"> * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
34 </span>    27    <span class="comment"> * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
35 </span>    28    <span class="comment"> * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
36 </span>    29    <span class="comment"> * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
37 </span>    30    <span class="comment"> * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 </span>    31    <span class="comment"> */</span>
39     32    
40     33    <span class="comment">/*
41 </span>    34    <span class="comment"> *  ======== Resource.xdc ========
42 </span>    35    <span class="comment"> */</span>
43     36    
44     37    <span class="xdoc">/*!
45 </span>    38    <span class="xdoc"> *  ======== Resource ========
46 </span>    39    <span class="xdoc"> *  Resource Module
47 </span>    40    <span class="xdoc"> */</span>
48     41    
49     42    @Template(<span class="string">"./Resource.xdt"</span>)
50     43    @ModuleStartup
51     44    <span class=key>module</span> Resource {
52     45    
53     46        <span class="xdoc">/*!
54 </span>    47    <span class="xdoc">     *  <b>@def</b>    Resource_loadAddr
55 </span>    48    <span class="xdoc">     *  <b>@brief</b>  Default load address for the Resource table
56 </span>    49    <span class="xdoc">     */</span>
57     50        <span class=key>metaonly</span> <span class=key>config</span> UInt loadAddr = 0x3000;
58     51    
59     52        <span class="xdoc">/*!
60 </span>    53    <span class="xdoc">     *  <b>@def</b>    Resource_loadSegment
61 </span>    54    <span class="xdoc">     *  <b>@brief</b>  If loadSegment is defined, loadAddr is overridden with the base
62 </span>    55    <span class="xdoc">     *          address of the loadSegment
63 </span>    56    <span class="xdoc">     */</span>
64     57        <span class=key>metaonly</span> <span class=key>config</span> String loadSegment;
65     58    
66     59        <span class="xdoc">/*!
67 </span>    60    <span class="xdoc">     *  <b>@def</b>    Resource_traceOnly
68 </span>    61    <span class="xdoc">     *  <b>@brief</b>  Set traceOnly to true in order to get an image with trace
69 </span>    62    <span class="xdoc">     *          resources only, and without VRINGs.
70 </span>    63    <span class="xdoc">     *          Implemented only for the Keystone II (TCI6638) platform.
71 </span>    64    <span class="xdoc">     */</span>
72     65        <span class=key>metaonly</span> <span class=key>config</span> Bool traceOnly = <span class=key>false</span>;
73     66    
74     67        <span class="xdoc">/*!
75 </span>    68    <span class="xdoc">     *  Flag to indicate the user will provide a custom resource table
76 </span>    69    <span class="xdoc">     *
77 </span>    70    <span class="xdoc">     *  If false (the default), a default resource table will be
78 </span>    71    <span class="xdoc">     *  created during configuration.
79 </span>    72    <span class="xdoc">     *
80 </span>    73    <span class="xdoc">     *  If true, the user must supply their own resource table.
81 </span>    74    <span class="xdoc">     *  Fundamentally, this amounts to providing a well-formed
82 </span>    75    <span class="xdoc">     *  resource_table structure named 'ti_ipc_remoteproc_ResourceTable'.
83 </span>    76    <span class="xdoc">     */</span>
84     77        <span class=key>metaonly</span> <span class=key>config</span> Bool customTable = <span class=key>false</span>;
85     78    
86     79        <span class="xdoc">/*!
87 </span>    80    <span class="xdoc">     *  <b>@def</b>    Resource_S_SUCCESS
88 </span>    81    <span class="xdoc">     *  <b>@brief</b>  Operation is successful.
89 </span>    82    <span class="xdoc">     */</span>
90     83        <span class=key>const</span> Int S_SUCCESS  = 0;
91     84    
92     85        <span class="xdoc">/*!
93 </span>    86    <span class="xdoc">     *  <b>@def</b>    Resource_E_NOTFOUND
94 </span>    87    <span class="xdoc">     *  <b>@brief</b>  Element was not found in table
95 </span>    88    <span class="xdoc">     */</span>
96     89        <span class=key>const</span> Int E_NOTFOUND = -1;
97     90    
98     91        <span class="xdoc">/*!
99 </span>    92    <span class="xdoc">     *  <b>@def</b>       Resource_RscTable
100 </span>    93    <span class="xdoc">     *
101 </span>    94    <span class="xdoc">     *  <b>@brief</b>     An open-ended type-length-value based resource table
102 </span>    95    <span class="xdoc">     */</span>
103     96        <span class=key>struct</span> RscTable {
104     97            UInt32 ver;
105     98            UInt32 num;
106     99            UInt32 reserved[2];
107    100            UInt32 offset[1];
108    101        };
109    102    
110    103        <span class="xdoc">/*!
111 </span>   104    <span class="xdoc">     *  <b>@def</b>       Resource_MemEntry
112 </span>   105    <span class="xdoc">     *
113 </span>   106    <span class="xdoc">     *  <b>@brief</b>     A Resource Table memory type record
114 </span>   107    <span class="xdoc">     */</span>
115    108        <span class=key>struct</span> MemEntry {
116    109            UInt32 type;
117    110            UInt32 da;       <span class="comment">/* Device Virtual Address */</span>
118    111            UInt32 pa;       <span class="comment">/* Physical Address */</span>
119    112            UInt32 len;
120    113            UInt32 flags;
121    114            UInt32 reserved;
122    115            Char   name[32];
123    116        };
124    117    
125    118        <span class="xdoc">/*!
126 </span>   119    <span class="xdoc">     *  <b>@brief</b>      Virtual to Physical address translation function
127 </span>   120    <span class="xdoc">     *
128 </span>   121    <span class="xdoc">     *  <b>@sa</b>         Resource_physToVirt
129 </span>   122    <span class="xdoc">     */</span>
130    123        @DirectCall
131    124        Int virtToPhys(UInt32 da, UInt32 *pa);
132    125    
133    126        <span class="xdoc">/*!
134 </span>   127    <span class="xdoc">     *  <b>@brief</b>      Physical to Virtual address translation function
135 </span>   128    <span class="xdoc">     *
136 </span>   129    <span class="xdoc">     *  <b>@sa</b>         Resource_virtToPhys
137 </span>   130    <span class="xdoc">     */</span>
138    131        @DirectCall
139    132        Int physToVirt(UInt32 pa, UInt32 *da);
140    133    
141    134        <span class="xdoc">/*!
142 </span>   135    <span class="xdoc">     *  <b>@brief</b>      Get the Trace Buffer address from resource table.
143 </span>   136    <span class="xdoc">     *
144 </span>   137    <span class="xdoc">     *  <b>@return</b>     Pointer to trace buffer, or NULL if not found.
145 </span>   138    <span class="xdoc">     */</span>
146    139        @DirectCall
147    140        Ptr getTraceBufPtr();
148    141    
149    142        <span class="xdoc">/*!
150 </span>   143    <span class="xdoc">     *  <b>@brief</b>      Get the status field of the VDEV, given the fw_rsc_vdev id.
151 </span>   144    <span class="xdoc">     *
152 </span>   145    <span class="xdoc">     *  <b>@return</b>     status value which is set by Virtio device on HLOS.
153 </span>   146    <span class="xdoc">     */</span>
154    147        @DirectCall
155    148        Char getVdevStatus(UInt32 id);
156    149    
157    150        <span class="xdoc">/*!
158 </span>   151    <span class="xdoc">     *  <b>@brief</b>      Get the nth (vqId) vring address from the VDEV struct.
159 </span>   152    <span class="xdoc">     *
160 </span>   153    <span class="xdoc">     *  <b>@return</b>     NULL if no VDEV found, or vqId is not found.
161 </span>   154    <span class="xdoc">     */</span>
162    155        @DirectCall
163    156        Ptr getVringDA(UInt32 vqId);
164    157    
165    158    <span class=key>internal</span>:   <span class="comment">/* not for client use */</span>
166    159    
167    160        <span class="xdoc">/*!
168 </span>   161    <span class="xdoc">     *  <b>@brief</b>      Use resource and resourceLen so table could be properly
169 </span>   162    <span class="xdoc">     *              allocated
170 </span>   163    <span class="xdoc">     *
171 </span>   164    <span class="xdoc">     */</span>
172    165        Void init();
173    166    
174    167        <span class="xdoc">/*!
175 </span>   168    <span class="xdoc">     *  <b>@brief</b>      Return the i-th entry in the resource table if the entry
176 </span>   169    <span class="xdoc">     *              is of type CARVEOUT or DEVMEM, or NULL otherwise.
177 </span>   170    <span class="xdoc">     *
178 </span>   171    <span class="xdoc">     */</span>
179    172        MemEntry *getMemEntry(UInt index);
180    173    
181    174        <span class=key>struct</span> Module_State {
182    175            RscTable    *pTable;  <span class="comment">/* Resource Resource Table pointer */</span>
183    176        };
184    177    }
185 </pre>
186 </body></html>