1 /**
2 * @file rm_public_lld.h
3 *
4 * @brief
5 * This is the RM LLD include file for other LLDs.
6 *
7 * \par
8 * ============================================================================
9 * @n (C) Copyright 2012, Texas Instruments, Inc.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 *
15 * Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 *
18 * Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the
21 * distribution.
22 *
23 * Neither the name of Texas Instruments Incorporated nor the names of
24 * its contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 *
39 * \par
40 */
42 #ifndef RM_PUBLIC_LLD_H_
43 #define RM_PUBLIC_LLD_H_
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
49 /* QMSS type include */
50 #include <ti/drv/qmss/qmss_qm.h>
52 /* CPPI type include */
53 #include <ti/csl/csl_cppi.h>
55 /**
56 @addtogroup RM_LLD_SYMBOL
57 @{
58 */
60 /** RM Permission Return And Error Codes */
61 /** RM LLD Permission Approved Base */
62 #define RM_APPROVED_BASE 0
63 /** Resource initialization permission approved */
64 #define RM_INIT_PERMISSION_APPROVED (RM_APPROVED_BASE+1)
65 /** Resource usage permission approved */
66 #define RM_USE_PERMISSION_APPROVED (RM_APPROVED_BASE+2)
68 /** RM LLD Permission Denied Base */
69 #define RM_DENIED_BASE (-64)
70 /** Resource initialization permission denied */
71 #define RM_INIT_PERMISSION_DENIED (RM_DENIED_BASE-1)
72 /** Resource usage permission denied */
73 #define RM_USE_PERMISSION_DENIED (RM_DENIED_BASE-2)
75 /**
76 @}
77 */
79 /**
80 @addtogroup RM_LLD_ENUM
81 @{
82 */
84 /**
85 * @brief LLD resource type
86 */
87 typedef enum
88 {
89 /** QMSS Firmware Type */
90 Rm_resource_QMSS_FIRMWARE_PDSP = 0,
91 /** QMSS Queue Type */
92 Rm_resource_QMSS_QUEUE,
93 /** QMSS Memory Region Type */
94 Rm_resource_QMSS_MEMORY_REGION,
95 /** QMSS Linking RAM Control Type */
96 Rm_resource_QMSS_LINKING_RAM_CONTROL,
97 /** QMSS Linking RAM Type */
98 Rm_resource_QMSS_LINKING_RAM,
99 /** QMSS Accumulator Channel Type */
100 Rm_resource_QMSS_ACCUM_CH,
101 /** QMSS QOS PDSP Timer */
102 Rm_resource_QMSS_QOS_TIMER,
103 /** QMSS QOS Cluster Type */
104 Rm_resource_QMSS_QOS_CLUSTER,
105 /** QMSS QOS Queue Type */
106 Rm_resource_QMSS_QOS_QUEUE,
107 /** CPPI Transmit Channel Type */
108 Rm_resource_CPPI_TX_CH,
109 /** CPPI Receive Channel Type */
110 Rm_resource_CPPI_RX_CH,
111 /** CPPI Receive Flow Type */
112 Rm_resource_CPPI_RX_FLOW,
113 /** PA Firmware Type */
114 Rm_resource_PA_FIRMWARE,
115 /** PA LUT Type */
116 Rm_resource_PA_LUT
117 }Rm_ResourceType;
119 /**
120 @}
121 */
123 /** @addtogroup RM_LLD_DATASTRUCT
124 @{
125 */
127 /**
128 * @brief Structure specifying the Linking RAM start and end indices
129 */
130 typedef struct
131 {
132 uint32_t linkRamStartIndex;
133 uint32_t linkRamEndIndex;
134 } Rm_ResourceLinkRamInfo;
136 /**
137 * @brief Structure specifying the CPPI rx channel, tx channel, and flow ID information
138 */
139 typedef struct
140 {
141 Cppi_CpDma dmaNum;
142 int32_t cppiChNumOrFlowId;
143 } Rm_ResourceCpDmaInfo;
145 /**
146 * @brief Structure specifying the LLD resource to have permissions checked by RM
147 */
148 typedef struct
149 {
150 /** LLD resource type to be checked */
151 Rm_ResourceType resourceType;
153 /** Resource parameters union. */
154 union
155 {
156 /** QMSS Resource Data */
157 uint16_t pdspNum;
158 int queNum;
159 Qmss_MemRegion memRegion;
160 Rm_ResourceLinkRamInfo linkRamData;
161 uint8_t accumCh;
162 uint32_t qosCluster;
163 uint32_t qosQueue;
165 /** CPPI Resource Data */
166 Rm_ResourceCpDmaInfo cpDmaData;
168 /** PA Resource Data */
169 int32_t lutEntry;
170 } res_info;
171 } Rm_ResourceInfo;
173 /**
174 * @brief RM return result
175 */
176 typedef int32_t Rm_Result;
178 /**
179 * @brief Structure of LLD function callouts for permissions checks
180 */
181 typedef struct
182 {
183 /** Init permissions check function */
184 Rm_Result (*rmInitPermissionsCheck)(Rm_ResourceInfo *resourceData);
185 /** Use permissions check function */
186 Rm_Result (*rmUsePermissionsCheck)(Rm_ResourceInfo *resourceData);
187 }Rm_LldPermCallouts;
189 /**
190 @}
191 */
193 #ifdef __cplusplus
194 }
195 #endif
197 #endif /* RM_PUBLIC_LLD_H_ */