00001 /** ============================================================================ 00002 * @file dm6437_hal.h 00003 * 00004 * @path $(DSPLINK)/gpp/inc/sys/arch/DM6437/ 00005 * 00006 * @brief Hardware Abstraction Layer for 64LC_PCI. 00007 * Define the Platform specific HAL (Hardware Abstraction Layer) 00008 * object. 00009 * 00010 * @ver 1.65.00.03 00011 * ============================================================================ 00012 * @copyright Copyright (C) 2002-2009, Texas Instruments Incorporated - 00013 * http://www.ti.com/ 00014 * 00015 * Redistribution and use in source and binary forms, with or without 00016 * modification, are permitted provided that the following conditions 00017 * are met: 00018 * 00019 * * Redistributions of source code must retain the above copyright 00020 * notice, this list of conditions and the following disclaimer. 00021 * 00022 * * Redistributions in binary form must reproduce the above copyright 00023 * notice, this list of conditions and the following disclaimer in the 00024 * documentation and/or other materials provided with the distribution. 00025 * 00026 * * Neither the name of Texas Instruments Incorporated nor the names of 00027 * its contributors may be used to endorse or promote products derived 00028 * from this software without specific prior written permission. 00029 * 00030 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00031 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00032 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00033 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00034 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00035 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00036 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00037 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00038 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00039 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00040 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00041 * ============================================================================ 00042 */ 00043 00044 00045 #if !defined (DM6437_HAL_H) 00046 #define DM6437_HAL_H 00047 00048 00049 /* ----------------------------------- DSP/BIOS Link */ 00050 #include <dsplink.h> 00051 #include <hal.h> 00052 #if (DM6437_PHYINTERFACE == PCI_INTERFACE) 00053 #include <dm6437_hal_pci.h> 00054 #endif /* if (DM6437_PHYINTERFACE == PCI_INTERFACE) */ 00055 #if (DM6437_PHYINTERFACE == VLYNQ_INTERFACE) 00056 #include <dm6437_hal_vlynq.h> 00057 #endif /* if (DM6437_PHYINTERFACE == VLYNQ_INTERFACE) */ 00058 00059 #if defined (__cplusplus) 00060 extern "C" { 00061 #endif 00062 00063 00064 #if (DM6437_PHYINTERFACE == PCI_INTERFACE) 00065 /** ============================================================================ 00066 * @name DM6437_HalPciPhyObj 00067 * 00068 * @brief Forward declaration of PCI Physical Interface object. 00069 * ============================================================================ 00070 */ 00071 typedef struct DM6437_HalPciPhyObj_tag DM6437_HalPciPhyObj ; 00072 #endif /* if (DM6437_PHYINTERFACE == PCI_INTERFACE) */ 00073 00074 00075 #if (DM6437_PHYINTERFACE == VLYNQ_INTERFACE) 00076 /** ============================================================================ 00077 * @name DM6437_HalVlynqPhyObj 00078 * 00079 * @brief Forward declaration of VLYNQ Physical Interface object. 00080 * ============================================================================ 00081 */ 00082 typedef struct DM6437_HalVlynqPhyObj_tag DM6437_HalVlynqPhyObj ; 00083 #endif /* if (DM6437_PHYINTERFACE == VLYNQ_INTERFACE) */ 00084 00085 /** ============================================================================ 00086 * @name DM6437_HalObj 00087 * 00088 * @brief Hardware Abstraction object. 00089 * 00090 * @param dspId 00091 * Processor Identifier. 00092 * @param phyType 00093 * Physical Interface type. 00094 * @param interface 00095 * Function table for hal functions. 00096 * @param isMapActive 00097 * tells whether user has mapped some area. 00098 * @param mapSize 00099 * Size of the mapped area. 00100 * @param pci 00101 * Structure containging members related to PCI Phy. 00102 * Only on PCI platforms 00103 * @param lock 00104 * Lock for using DMA resource. 00105 * @param vlynq 00106 * Structure containging members related to VLYNQ Phy. 00107 * Only on VLYNQ Platforms 00108 * @param shMemDspAddr 00109 * Shared memory base address in DSP address space. 00110 * @param shMemVirtAddr 00111 * Shared memory virtual base address . 00112 * @param shMemPhysAddr 00113 * Shared memory physical base address . 00114 * ============================================================================ 00115 */ 00116 typedef struct DM6437_HalObj_tag { 00117 ProcessorId dspId ; 00118 Uint32 phyType ; 00119 HAL_Interface * interface ; 00120 Bool isMapActive ; 00121 Uint32 mapSize ; 00122 Uint32 shMemDspAddr ; 00123 Uint32 shMemVirtAddr ; 00124 Uint32 shMemPhysAddr ; 00125 Pvoid lock ; 00126 #if (DM6437_PHYINTERFACE == PCI_INTERFACE) 00127 DM6437_HalPciPhyObj pci ; 00128 #endif /* (DM6437_PHYINTERFACE == PCI_INTERFACE) */ 00129 #if (DM6437_PHYINTERFACE == VLYNQ_INTERFACE) 00130 DM6437_HalVlynqPhyObj vlynq ; 00131 #endif /* (DM6437_PHYINTERFACE == VLYNQ_INTERFACE) */ 00132 } DM6437_HalObj ; 00133 00134 00135 /** ============================================================================ 00136 * @name DM6437_InitParams 00137 * 00138 * @brief Initialize parameters for HAL init call. 00139 * 00140 * @param dspId 00141 * Processor Identifier. 00142 * @param phyType 00143 * Physical Interface type. 00144 * @param shMemEntry 00145 * Shared memory entry ID, this is mapped after initialzing the 00146 * physical interface. 00147 * @param arg1 00148 * Argument 1. 00149 * @param arg2 00150 * Argument 2. 00151 * @param arg3 00152 * Argument 3. 00153 * @param arg4 00154 * Argument 4. 00155 * @param arg5 00156 * Argument 5. 00157 * @param arg5 00158 * Argument 6. 00159 * ============================================================================ 00160 */ 00161 typedef struct DM6437_InitParams_tag { 00162 ProcessorId dspId ; 00163 Uint32 phyType ; 00164 Uint32 shMemEntry ; 00165 Uint32 arg1 ; 00166 Uint32 arg2 ; 00167 Uint32 arg3 ; 00168 Uint32 arg4 ; 00169 Uint32 arg5 ; 00170 Uint32 arg6 ; 00171 } DM6437_InitParams ; 00172 00173 00174 /** ============================================================================ 00175 * @func DM6437_halInit 00176 * 00177 * @brief Initializes the HAL object and physical interface. 00178 * 00179 * @param halObject. 00180 * HAL Object 00181 * @param initParams. 00182 * Parameters for initialization. 00183 * 00184 * @return DSP_SOK 00185 * Operation successfully completed. 00186 * DSP_EMEMORY 00187 * Out of memory error. 00188 * DSP_EINVALIDARG 00189 * Invalid argument. 00190 * 00191 * @pre None. 00192 * 00193 * @post None. 00194 * 00195 * @see None 00196 * ============================================================================ 00197 */ 00198 NORMAL_API 00199 DSP_STATUS 00200 DM6437_halInit (IN Pvoid * halObject, IN Pvoid initParams) ; 00201 00202 00203 /** ============================================================================ 00204 * @func DM6437_halExit 00205 * 00206 * @brief Finializes the HAL object and physical interface. 00207 * 00208 * @param halObject. 00209 * HAL Object 00210 * 00211 * @return DSP_SOK 00212 * Operation successfully completed. 00213 * DSP_EFAIL 00214 * All other error conditions. 00215 * 00216 * @pre None. 00217 * 00218 * @post None. 00219 * 00220 * @see None 00221 * ============================================================================ 00222 */ 00223 NORMAL_API 00224 DSP_STATUS 00225 DM6437_halExit (IN Pvoid * halObject) ; 00226 00227 00228 #if defined (__cplusplus) 00229 } 00230 #endif 00231 00232 00233 #endif /* !defined (DM6437_HAL_H) */