00001 /** ============================================================================ 00002 * @file dm6446gem_hal.h 00003 * 00004 * @path $(DSPLINK)/gpp/inc/sys/arch/DM6446GEM/ 00005 * 00006 * @brief Hardware Abstraction Layer for Power Controller (PWR) 00007 * module in Davinci. Declares necessary functions for 00008 * PSC request handling. 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 (DM6446GEM_HAL_H) 00046 #define DM6446GEM_HAL_H 00047 00048 00049 /* ----------------------------------- DSP/BIOS Link */ 00050 #include <dsplink.h> 00051 #include <_dsplink.h> 00052 00053 /* ----------------------------------- Trace & Debug */ 00054 #include <_trace.h> 00055 00056 /* ----------------------------------- Hardware Abstraction Layer */ 00057 #include <hal.h> 00058 00059 00060 #if defined (__cplusplus) 00061 extern "C" { 00062 #endif 00063 00064 00065 /* ============================================================================ 00066 * @macro REG 00067 * 00068 * @brief Regsiter access method. 00069 * ============================================================================ 00070 */ 00071 #define REG(x) *((volatile Uint32 *) (x)) 00072 00073 00074 /** ============================================================================ 00075 * @name DM6446GEM_HalObj 00076 * 00077 * @brief Hardware Abstraction object. 00078 * 00079 * @param interface 00080 * Pointer to HAL interface table. 00081 * @param baseCfgBus 00082 * base address of the configuration bus peripherals memory range. 00083 * @param offsetSysModule 00084 * Offset of the system module from CFG base. 00085 * ============================================================================ 00086 */ 00087 typedef struct DM6446GEM_HalObj_tag { 00088 HAL_Interface * interface ; 00089 Uint32 baseCfgBus ; 00090 Uint32 offsetSysModule ; 00091 } DM6446GEM_HalObj ; 00092 00093 00094 /** ============================================================================ 00095 * @func DM6446GEM_halInitialize 00096 * 00097 * @brief Initializes the HAL object. 00098 * 00099 * @param halObj. 00100 * Pointer to HAL object. 00101 * @param initParams. 00102 * Parameters for initialize (optional). 00103 * 00104 * @return DSP_SOK 00105 * Operation successfully completed. 00106 * DSP_EMEMORY 00107 * A memory allocation failure occurred. 00108 * DSP_EINVALIDARG 00109 * An invalid argument was specified. 00110 * 00111 * @pre None. 00112 * 00113 * @post None. 00114 * 00115 * @see None 00116 * ============================================================================ 00117 */ 00118 NORMAL_API 00119 DSP_STATUS 00120 DM6446GEM_halInit (IN Pvoid * halObj, 00121 IN Pvoid initParams) ; 00122 00123 00124 /** ============================================================================ 00125 * @func DM6446GEM_halExit 00126 * 00127 * @brief Finalizes the HAL object. 00128 * 00129 * @param halObj. 00130 * Pointer to HAL object. 00131 * 00132 * @return DSP_SOK 00133 * Operation successfully completed. 00134 * DSP_EFAIL 00135 * All other error conditions. 00136 * 00137 * @pre None. 00138 * 00139 * @post None. 00140 * 00141 * @see None 00142 * ============================================================================ 00143 */ 00144 NORMAL_API 00145 DSP_STATUS 00146 DM6446GEM_halExit (IN Pvoid * halObj) ; 00147 00148 00149 #if defined (__cplusplus) 00150 } 00151 #endif 00152 00153 00154 #endif /* !defined (DM6446GEM_HAL_H) */