1 /**************************************************************************** 2 **+-----------------------------------------------------------------------+** 3 **| |** 4 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |** 5 **| All rights reserved. |** 6 **| |** 7 **| Redistribution and use in source and binary forms, with or without |** 8 **| modification, are permitted provided that the following conditions |** 9 **| are met: |** 10 **| |** 11 **| * Redistributions of source code must retain the above copyright |** 12 **| notice, this list of conditions and the following disclaimer. |** 13 **| * Redistributions in binary form must reproduce the above copyright |** 14 **| notice, this list of conditions and the following disclaimer in |** 15 **| the documentation and/or other materials provided with the |** 16 **| distribution. |** 17 **| * Neither the name Texas Instruments nor the names of its |** 18 **| contributors may be used to endorse or promote products derived |** 19 **| from this software without specific prior written permission. |** 20 **| |** 21 **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |** 22 **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |** 23 **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |** 24 **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |** 25 **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |** 26 **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |** 27 **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |** 28 **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |** 29 **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |** 30 **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |** 31 **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |** 32 **| |** 33 **+-----------------------------------------------------------------------+** 34 ****************************************************************************/ 35 36 /**************************************************************************** 37 * 38 * MODULE: whalBus_Api.h 39 * PURPOSE: Bus access component API 40 * 41 ****************************************************************************/ 42 43 #ifndef _WHAL_BUS_API_H 44 #define _WHAL_BUS_API_H 45 46 #include "whalCtrl_api.h" 47 #include "whalCommon.h" 48 #include "whalHwDefs.h" 49 #include "whalBus_Defs.h" 50 #include "memMngrEx.h" 51 #include "commonTypes.h" 52 53 /* 54 * -------------------------------------------------------------- 55 * Creation/Configuration API 56 * -------------------------------------------------------------- 57 */ 58 TI_HANDLE whalBus_Create (TI_HANDLE hOs); 59 int whalBus_Destroy (TI_HANDLE hWhalBus); 60 TI_STATUS whalBus_Config (TI_HANDLE hWhalBus, 61 TI_HANDLE hWhalCtrl, 62 UINT8 AccessMode, 63 UINT32 RegBaseAddr, 64 UINT32 MemBaseAddr, 65 TI_HANDLE hReport, 66 TI_HANDLE hMemMgr, 67 fnotify_t fCb, 68 TI_HANDLE hCb); 69 TI_HANDLE whalBus_GetTnentwifHandle (TI_HANDLE hWhalBus); 70 int whalBus_ExitFromInitMode (TI_HANDLE hWhalBus); 71 int whalBus_ReConfig (TI_HANDLE hWhalBus); 72 73 /* 74 * -------------------------------------------------------------- 75 * Registers/Memory access API 76 * -------------------------------------------------------------- 77 */ 78 UINT32 whalBus_MacRegRead (TI_HANDLE hWhalBus, UINT32 RegAddr); 79 void whalBus_MacRegWrite (TI_HANDLE hWhalBus, UINT32 RegAddr, UINT32 Val); 80 void whalBus_PhyRegWrite (TI_HANDLE hWhalBus, UINT32 PhyRegAddr, UINT32 DataVal); 81 UINT32 whalBus_PhyRegRead (TI_HANDLE hWhalBus, UINT32 PhyRegAddr); 82 void whalBus_MemWrite (TI_HANDLE hWhalBus, UINT32 Addr, char *data, int Len); 83 void whalBus_MemRead (TI_HANDLE hWhalBus, UINT32 Addr, char *data, int Len); 84 85 /* 86 * -------------------------------------------------------------- 87 * Firmware control API 88 * -------------------------------------------------------------- 89 */ 90 typedef struct 91 { 92 UINT32 radioType; 93 UINT8 MacClock; 94 UINT8 ArmClock; 95 BOOL FirmwareDebug; 96 UINT32 minorE2Ver; 97 UINT32 majorE2Ver; 98 UINT32 bugfixE2Ver; 99 } BootAttr_T; 100 101 102 TI_STATUS whalBus_FwCtrl_Boot (TI_HANDLE hWhalBus, TI_HANDLE hHwCtrl, BootAttr_T *pBootAttr); 103 int whalBus_FwCtrl_Reset (TI_HANDLE hWhalBus); 104 int whalBus_FwCtrl_isCardIn (TI_HANDLE hWhalBus); 105 void whalBus_FwCtrl_Halt (TI_HANDLE hWhalBus); 106 UINT32 whalBus_FwCtrl_GetRadioStandByState 107 (TI_HANDLE hWhalBus); 108 109 /* 110 * -------------------------------------------------------------- 111 * Interrupt handler API 112 * -------------------------------------------------------------- 113 */ 114 115 /* states */ 116 typedef enum 117 { 118 STATE_INIT = 0, 119 STATE_DPC , 120 STATE_OPERATIONAL , 121 STATE_WAIT_FOR_DPC , 122 }whalHwIntr_states; 123 124 /* Callback template */ 125 typedef void (*whal_hwIntrCB)(void *pObj); 126 127 /*Power Ctrl Callback template */ 128 #define PWRCTRL_CB_TYPE_INTR_WAS_ISSUE 0 129 #define PWRCTRL_CB_TYPE_INTR_STARTED 1 130 typedef void (*whal_PwrCtrlCB)(TI_HANDLE pObj, int CbType); 131 132 133 void whalBus_TNETWIF_HandleBusTxn_Complete (TI_HANDLE hWhalBus); 134 135 /* 136 * -------------------------------------------------------------- 137 * TNETWIF API 138 * -------------------------------------------------------------- 139 */ 140 int whalBus_TNETWIF_ElpCtrl_SetMode(TI_HANDLE hWhalBus, elpCtrl_Mode_e mode); 141 142 /* 143 * -------------------------------------------------------------- 144 * Debug API 145 * -------------------------------------------------------------- 146 */ 147 void whalBus_performHealthMonitorTest(TI_HANDLE hWhalBus, UINT32 TEST); 148 /* 149 * General 150 */ 151 152 #define BUS_PRINT_ALL 1 153 154 /* 155 * Control 156 */ 157 #define BUS_PRINT_MBOX_INFO 10 158 #define BUS_PRINT_INTR_INFO 11 159 #define BUS_PRINT_ACCESS_INFO 12 160 #define BUS_PRINT_EEPROM 13 161 #define BUS_PRINT_TRACE_A_B 14 162 #define BUS_PRINT_ARBITER 15 163 164 /* 165 * Tx 166 */ 167 #define BUS_PRINT_TX_INFO 20 168 #define BUS_PRINT_TX 21 169 #define BUS_PRINT_TX_QUEUE 22 170 171 /* 172 * Rx 173 */ 174 #define BUS_PRINT_RX_INFO 30 175 #define BUS_CLEAR_RX_INFO 31 176 177 /* 178 * Debug 179 */ 180 #define BUS_PRINT_REG_DUMP 40 181 #define BUS_PRINT_RX_REGS 41 182 #define BUS_PRINT_TX_REGS 42 183 #define BUS_PRINT_SCR_PAD_REGS 43 184 #define BUS_PRINT_LIST_REGS 44 185 #define BUS_PRINT_MEM 45 186 187 void whalBus_PrintInfo(TI_HANDLE hWhalBus, UINT32 funcType, void *pParam); 188 /*************************************************************************************************** 189 ************************************* New Hal ****************************************************** 190 ***************************************************************************************************/ 191 192 #endif /* _WHAL_BUS_API_H */ 193