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 #ifndef MMC_TNETW1150_API_H 38 #define MMC_TNETW1150_API_H 39 40 #undef CONFIG_CEE 41 #define CONFIG_CEE 42 43 #include "mmc_omap_api.h" 44 45 /* 46 First partition is used to access first 90K of memory 47 during FW download or 90K of data memory during WLAN driver 48 regular work (0x00000-0x167FF; 0x00C800-0x22FFF - two 49 regions with overlap). 50 */ 51 #define SDIO_DOWNLOAD_PARTITION_START (0x000000) 52 /* 90K*/ 53 #define SDIO_DOWNLOAD_PARTITION_SIZE (0x016800) 54 /*End of download partition is (0x0167FF) (90K)*/ 55 /* 60K*/ 56 #define SDIO_MEM_PARTITION_START (0x00F000) 57 /* 90K*/ 58 #define SDIO_MEM_PARTITION_SIZE (0x016800) 59 /*End of first partition is (0x025799) (150K)*/ 60 61 /* 62 Second partition is 34K of registers. 63 */ 64 /*3072K*/ 65 #define SDIO_REG_PARTITION_START (0x300000) 66 /* 34K*/ 67 #define SDIO_REG_PARTITION_SIZE (0x008800) 68 /*End of second partition is (0x3087FF) (3106K) */ 69 /* 90K*/ 70 #define SDIO_DRIVER_REG_PARTITION_START (0x016800) 71 72 #define AMAP_MAX_REGIONS 4 73 /*128K-64B*/ 74 #define AMAP_ONE_REGION (0x01FFC0) 75 76 /* Status Card Register (SCR) address mapping */ 77 typedef struct { 78 unsigned int reg_size; /* Region size */ 79 unsigned int scr_offset; /* Region offset in SCR address space */ 80 } address_mapping_region; 81 typedef struct { 82 unsigned int num_of_parts; /* number of partitions in use */ 83 /* h/w-dependant base addresses */ 84 address_mapping_region map_reg[AMAP_MAX_REGIONS]; /* CSR addresses */ 85 } SDIO_TNETWConfigParams; 86 87 /* 88 Initialization of TNETW memory configuration. 89 */ 90 SDIO_Status SDIO_TNETWInit(SDIO_TNETWConfigParams *); 91 92 /* 93 This function configures the slave SDIO device for the required 94 operation mode. 95 */ 96 SDIO_Status SDIO_TNETWConfig(SDIO_Handle, Peripheral_ConfigParams **); 97 98 /* 99 This function performs convertion of peripheral adddress into 17 bits 100 SDIO address. If found that the memory partition configuration must be 101 changed, the memory is re-mapped in accordance to requested address. 102 */ 103 SDIO_Address SDIO_ConvertTNETWToSDIOMaster(Peripheral_Address, SDIO_BufferLength); 104 105 /* 106 This function sets the ELP REG in the TNET 107 */ 108 SDIO_Status SDIO_TNETW_Set_ELP_Reg(SDIO_Handle sdioHandle, Peripheral_Address start_addr, unsigned int data); 109 110 /* 111 This function gets the ELP REG in the TNET 112 */ 113 SDIO_Status SDIO_TNETW_Get_ELP_Reg(SDIO_Handle sdioHandle, Peripheral_Address start_addr, unsigned int *data); 114 115 #endif /* MMC_TNETW1150_API_H */ 116