00001 00043 #if !defined (HAL_H) 00044 #define HAL_H 00045 00046 00047 /* ----------------------------------- DSP/BIOS Link */ 00048 #include <dsplink.h> 00049 #include <_dspdefs.h> 00050 00051 #if defined (__cplusplus) 00052 extern "C" { 00053 #endif /* defined (__cplusplus) */ 00054 00055 00056 /* ============================================================================ 00057 * @func FnPhyInit 00058 * 00059 * @brief Signature of function that initializes PCI device. 00060 * 00061 * @param halObject. 00062 * HAL object. 00063 * 00064 * @return DSP_SOK 00065 * Operation successfully completed. 00066 * DSP_EFAIL 00067 * All other error conditions. 00068 * 00069 * @pre None. 00070 * 00071 * @post None. 00072 * 00073 * @see None 00074 * ============================================================================ 00075 */ 00076 typedef DSP_STATUS (*FnPhyInit) (IN Void * halObject) ; 00077 00078 00079 /* ============================================================================ 00080 * @func FnPhyExit 00081 * 00082 * @brief Signature of function that finalizes PCI device. 00083 * 00084 * @param halObject. 00085 * HAL object. 00086 * 00087 * @return DSP_SOK 00088 * Operation successfully completed. 00089 * DSP_EFAIL 00090 * All other error conditions. 00091 * 00092 * @pre None. 00093 * 00094 * @post None. 00095 * 00096 * @see None 00097 * ============================================================================ 00098 */ 00099 typedef DSP_STATUS (*FnPhyExit) (IN Void * halObject) ; 00100 00101 00102 /* ============================================================================ 00103 * @func FnBootCtrl 00104 * 00105 * @brief Signature of function that is Boot controller. 00106 * 00107 * @param halObject. 00108 * HAL Object 00109 * @param cmd. 00110 * Boot Command. 00111 * @param arg. 00112 * Command specific argument (Optional). 00113 * 00114 * @return DSP_SOK 00115 * Operation successfully completed. 00116 * DSP_EINVALIDARG 00117 * Unsupported interrupt control command. 00118 * 00119 * @pre None. 00120 * 00121 * @post None. 00122 * 00123 * @see None 00124 * ============================================================================ 00125 */ 00126 typedef DSP_STATUS (*FnBootCtrl) (IN Void * halObject, 00127 IN DSP_BootCtrlCmd cmd, 00128 IN OUT Pvoid arg) ; 00129 00130 00131 /* ============================================================================ 00132 * @func FnIntCtrl 00133 * 00134 * @brief Signature of function that is Interrupt Controller. 00135 * 00136 * @param halObject. 00137 * HAL Object 00138 * @param cmd. 00139 * Boot Command. 00140 * @param intId 00141 * Interrupt Identifier (Optional) 00142 * @param arg. 00143 * Command specific argument (Optional). 00144 * 00145 * @return DSP_SOK 00146 * Operation successfully completed. 00147 * DSP_EINVALIDARG 00148 * Unsupported interrupt control command. 00149 * 00150 * @pre None. 00151 * 00152 * @post None. 00153 * 00154 * @see None 00155 * ============================================================================ 00156 */ 00157 typedef DSP_STATUS (*FnIntCtrl) (IN Void * halObject, 00158 IN DSP_IntCtrlCmd cmd, 00159 IN Uint32 intId, 00160 IN OUT Pvoid arg) ; 00161 00162 00163 /* ============================================================================ 00164 * @func FnMmuCtrl 00165 * 00166 * @brief Signature of function that is Interrupt Controller. 00167 * 00168 * @param halObject. 00169 * HAL Object 00170 * @param cmd. 00171 * Boot Command. 00172 * @param memTable 00173 * Memory Table. 00174 * @param intId 00175 * Interrupt Identifier (Optional) 00176 * @param arg. 00177 * Command specific argument (Optional). 00178 * 00179 * @return DSP_SOK 00180 * Operation successfully completed. 00181 * DSP_EFAIL 00182 * All other error conditions. 00183 * 00184 * @pre None. 00185 * 00186 * @post None. 00187 * 00188 * @see None 00189 * ============================================================================ 00190 */ 00191 typedef DSP_STATUS (*FnMmuCtrl) (IN Void * halObject, 00192 IN DSP_MmuCtrlCmd cmd, 00193 IN LINKCFG_MemEntry * memTable, 00194 IN Uint32 memEntries, 00195 IN ProcMemMapInfo * mmuInfo) ; 00196 00197 00198 /* ============================================================================ 00199 * @func FnMapCtrl 00200 * 00201 * @brief Signature of function that is Mapping controller. 00202 * 00203 * @param halObject. 00204 * HAL Object 00205 * @param cmd. 00206 * MAP Command. 00207 * @param dspBufAddr. 00208 * DSP address to be mapped. 00209 * @param size. 00210 * Size of area to be mapped. 00211 * @param bufVirtPtr. 00212 * virtual address of mapped area. 00213 * @param bufPhysAddr. 00214 * Physical address of mapped area in HOST address space. 00215 * @param mappedSize. 00216 * Size of memory region mapped. 00217 * 00218 * @return DSP_SOK 00219 * Operation successfully completed. 00220 * DSP_ERANGE 00221 * A parameter is specified outside its valid range. 00222 * DSP_EINVALIDARG 00223 * Unsupported interrupt control command. 00224 * 00225 * @pre None. 00226 * 00227 * @post None. 00228 * 00229 * @see None 00230 * ============================================================================ 00231 */ 00232 typedef DSP_STATUS (*FnMapCtrl) (IN Void * halObject, 00233 IN DSP_MapCtrlCmd cmd, 00234 IN Uint32 dspBufAddr, 00235 IN Uint32 size, 00236 OUT Uint32 * bufVirtPtr, 00237 OUT Uint32 * bufPhysAddr, 00238 OUT Uint32 * mappedSize) ; 00239 00240 00241 /* ============================================================================ 00242 * @func FnPwrCtrl 00243 * 00244 * @brief Signature of function that is Power Controller. 00245 * 00246 * @param halObject. 00247 * HAL Object 00248 * @param cmd. 00249 * Boot Command. 00250 * @param arg. 00251 * Command specific argument (Optional). 00252 * 00253 * @return DSP_SOK 00254 * Operation successfully completed. 00255 * DSP_EINVALIDARG 00256 * Unsupported interrupt control command. 00257 * 00258 * @pre None. 00259 * 00260 * @post None. 00261 * 00262 * @see None 00263 * ============================================================================ 00264 */ 00265 typedef DSP_STATUS (*FnPwrCtrl) (IN Void * halObject, 00266 IN DSP_PwrCtrlCmd cmd, 00267 IN OUT Pvoid arg) ; 00268 00269 00270 /* ============================================================================ 00271 * @func FnRead 00272 * 00273 * @brief Signature of function that Reads a buffer from dsp memory (for now 00274 * this is done as bytes). 00275 * 00276 * @param halObject. 00277 * HAL Object 00278 * @param dspAddr. 00279 * DSP Address to be used as read address. 00280 * @param cBytes. 00281 * Number of bytes to transfer. 00282 * @param readBuffer. 00283 * Destination buffer. 00284 * 00285 * @return DSP_SOK 00286 * Operation successfully completed. 00287 * DSP_EFAIL 00288 * All other error conditions. 00289 * 00290 * @pre None. 00291 * 00292 * @post None. 00293 * 00294 * @see None 00295 * ============================================================================ 00296 */ 00297 typedef DSP_STATUS (*FnRead) (IN Void * halObject, 00298 IN Uint32 dspAddr, 00299 IN Uint32 cBytes, 00300 OUT Char8 * readBuffer) ; 00301 00302 00303 /* ============================================================================ 00304 * @func FnWrite 00305 * 00306 * @brief Signature of function that Write a buffer to dsp memory (for now 00307 * this is done as bytes). 00308 * 00309 * @param halObject. 00310 * HAL Object 00311 * @param dspAddr. 00312 * DSP Address to be used as read address. 00313 * @param cBytes. 00314 * Number of bytes to transfer. 00315 * @param writeBuffer. 00316 * Source buffer. 00317 * 00318 * @return DSP_SOK 00319 * Operation successfully completed. 00320 * DSP_EFAIL 00321 * All other error conditions. 00322 * 00323 * @pre None. 00324 * 00325 * @post None. 00326 * 00327 * @see None 00328 * ============================================================================ 00329 */ 00330 typedef DSP_STATUS (*FnWrite) (IN Void * halObject, 00331 IN Uint32 dspAddr, 00332 IN Uint32 cBytes, 00333 IN Char8 * writeBuffer) ; 00334 00335 00336 /* ============================================================================ 00337 * @func FnReadDMA 00338 * 00339 * @brief Signature of function that DMAs contents from DSP memory to GPP 00340 * Memory. Here read means DSP write. 00341 * 00342 * @param halObject. 00343 * HAL Object 00344 * @param srcAddr. 00345 * Source Address. 00346 * @param dstAddr. 00347 * Destination Address. 00348 * @param size. 00349 * Number of bytes to transfer. 00350 * 00351 * @return DSP_SOK 00352 * Operation successfully completed. 00353 * DSP_EFAIL 00354 * Not able to do read DMA for specified size. 00355 * 00356 * @pre None. 00357 * 00358 * @post None. 00359 * 00360 * @see None 00361 * ============================================================================ 00362 */ 00363 typedef DSP_STATUS (*FnReadDMA) (IN Void * halObject, 00364 IN Uint32 srcAddr, 00365 IN Uint32 dstAddr, 00366 IN Uint32 size) ; 00367 00368 00369 /* ============================================================================ 00370 * @func FnWriteDMA 00371 * 00372 * @brief Signature of function that DMAs contents from GPP memory to DSP 00373 * Memory. Here write means DSP read. 00374 * 00375 * @param halObject. 00376 * HAL Object 00377 * @param srcAddr. 00378 * Source Address. 00379 * @param dstAddr. 00380 * Destination Address. 00381 * @param size. 00382 * Number of bytes to transfer. 00383 * 00384 * @return DSP_SOK 00385 * Operation successfully completed. 00386 * DSP_EFAIL 00387 * Not able to do write DMA for specified size. 00388 * 00389 * @pre None. 00390 * 00391 * @post None. 00392 * 00393 * @see None 00394 * ============================================================================ 00395 */ 00396 typedef DSP_STATUS (*FnWriteDMA) (IN Void * halObject, 00397 IN Uint32 srcAddr, 00398 IN Uint32 dstAddr, 00399 IN Uint32 size) ; 00400 00401 00431 typedef struct HAL_Interface_tag { 00432 FnPhyInit phyInit ; 00433 FnPhyExit phyExit ; 00434 FnBootCtrl bootCtrl ; 00435 FnIntCtrl intCtrl ; 00436 FnMmuCtrl mmuCtrl ; 00437 FnMapCtrl mapCtrl ; 00438 FnPwrCtrl pwrCtrl ; 00439 FnRead read ; 00440 FnWrite write ; 00441 FnReadDMA readDMA ; 00442 FnWriteDMA writeDMA ; 00443 } HAL_Interface ; 00444 00445 00446 #if defined (__cplusplus) 00447 } 00448 #endif /* defined (__cplusplus) */ 00449 00450 00451 #endif /* !defined (HAL_H) */