00001 /** ============================================================================ 00002 * @file dm648_hal.h 00003 * 00004 * @path $(DSPLINK)/gpp/inc/sys/arch/DM648/ 00005 * 00006 * @brief Hardware Abstraction Layer for DM648. 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 (DM648_HAL_H) 00046 #define DM648_HAL_H 00047 00048 00049 /* ----------------------------------- DSP/BIOS Link */ 00050 #include <dsplink.h> 00051 #include <hal.h> 00052 #if (DM648_PHYINTERFACE == PCI_INTERFACE) 00053 #include <dm648_hal_pci.h> 00054 #endif /* if (DM648_PHYINTERFACE == PCI_INTERFACE) */ 00055 00056 #if defined (__cplusplus) 00057 extern "C" { 00058 #endif 00059 00060 00061 #if (DM648_PHYINTERFACE == PCI_INTERFACE) 00062 /** ============================================================================ 00063 * @name DM648_HalPciPhyObj 00064 * 00065 * @brief Forward declaration of PCI Physical Interface object. 00066 * ============================================================================ 00067 */ 00068 typedef struct DM648_HalPciPhyObj_tag DM648_HalPciPhyObj ; 00069 #endif /* if (DM648_PHYINTERFACE == PCI_INTERFACE) */ 00070 00071 00072 /** ============================================================================ 00073 * @name DM648_HalObj 00074 * 00075 * @brief Hardware Abstraction object. 00076 * 00077 * @param dspId 00078 * Processor Identifier. 00079 * @param phyType 00080 * Physical Interface type. 00081 * @param interface 00082 * Function table for hal functions. 00083 * @param isMapActive 00084 * tells whether user has mapped some area. 00085 * @param mapSize 00086 * Size of the mapped area. 00087 * @param lock 00088 * Lock for using DMA resource. 00089 * @param pci 00090 * Structure containging members related to PCI Phy. 00091 * Only on PCI platforms 00092 * ============================================================================ 00093 */ 00094 typedef struct DM648_HalObj_tag { 00095 ProcessorId dspId ; 00096 Uint32 phyType ; 00097 HAL_Interface * interface ; 00098 Bool isMapActive ; 00099 Uint32 mapSize ; 00100 Pvoid lock ; 00101 #if (DM648_PHYINTERFACE == PCI_INTERFACE) 00102 DM648_HalPciPhyObj pci ; 00103 #endif /* (DM648_PHYINTERFACE == PCI_INTERFACE) */ 00104 } DM648_HalObj ; 00105 00106 00107 /** ============================================================================ 00108 * @name DM648_InitParams 00109 * 00110 * @brief Initialize parameters for HAL init call. 00111 * 00112 * @param dspId 00113 * Processor Identifier. 00114 * @param phyType 00115 * Physical Interface type. 00116 * @param shMemEntry 00117 * Shared memory entry ID, this is mapped after initialzing the 00118 * physical interface. 00119 * @param arg1 00120 * Argument 1. 00121 * @param arg2 00122 * Argument 2. 00123 * @param arg3 00124 * Argument 3. 00125 * @param arg4 00126 * Argument 4. 00127 * @param arg5 00128 * Argument 5. 00129 * @param arg6 00130 * Argument 6. 00131 * ============================================================================ 00132 */ 00133 typedef struct DM648_InitParams_tag { 00134 ProcessorId dspId ; 00135 Uint32 phyType ; 00136 Uint32 shMemEntry ; 00137 Uint32 arg1 ; 00138 Uint32 arg2 ; 00139 Uint32 arg3 ; 00140 Uint32 arg4 ; 00141 Uint32 arg5 ; 00142 Uint32 arg6 ; 00143 } DM648_InitParams ; 00144 00145 00146 /** ============================================================================ 00147 * @func DM648_halInit 00148 * 00149 * @brief Initializes the HAL object and physical interface. 00150 * 00151 * @param halObject. 00152 * HAL Object 00153 * @param initParams. 00154 * Parameters for initialization. 00155 * 00156 * @return DSP_SOK 00157 * Operation successfully completed. 00158 * DSP_EFAIL 00159 * All other error conditions. 00160 * 00161 * @pre None. 00162 * 00163 * @post None. 00164 * 00165 * @see None 00166 * ============================================================================ 00167 */ 00168 NORMAL_API 00169 DSP_STATUS 00170 DM648_halInit (IN Pvoid * halObject, IN Pvoid initParams) ; 00171 00172 00173 /** ============================================================================ 00174 * @func DM648_halExit 00175 * 00176 * @brief Finializes the HAL object and physical interface. 00177 * 00178 * @param halObject. 00179 * HAL Object 00180 * 00181 * @return DSP_SOK 00182 * Operation successfully completed. 00183 * DSP_EFAIL 00184 * All other error conditions. 00185 * 00186 * @pre None. 00187 * 00188 * @post None. 00189 * 00190 * @see None 00191 * ============================================================================ 00192 */ 00193 NORMAL_API 00194 DSP_STATUS 00195 DM648_halExit (IN Pvoid * halObject) ; 00196 00197 00198 #if defined (__cplusplus) 00199 } 00200 #endif 00201 00202 00203 #endif /* !defined (DM648_HAL_H) */