• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * host_platform.h
3  *
4  * Copyright(c) 1998 - 2010 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  Module:      host_platform_sdio.h
36 
37  Purpose:     This module defines unified interface to the host platform specific
38               sources and services.
39 
40 --------------------------------------------------------------------------*/
41 
42 #ifndef __HOST_PLATFORM_SDIO__H__
43 #define __HOST_PLATFORM_SDIO__H__
44 
45 #include <mach/hardware.h>
46 
47 
48 #define OMAP_HSMMC1_BASE		0x4809C000
49 #define OMAP_HSMMC2_BASE		0x480B4000
50 #define OMAP_HSMMC3_BASE		0x480AD000
51 
52 #if 0
53 #define CONTROL_PADCONF_CAM_D1		0x48002118	/* WLAN_EN */
54 #define CONTROL_PADCONF_MCBSP1_CLKX	0x48002198	/* WLAN_IRQ */
55 
56 #define CONTROL_PADCONF_MMC3_CLK   	0x480025D8	/* mmc3_cmd */
57 #define CONTROL_PADCONF_MMC3_CMD   	0x480021D0	/* mmc3_cmd */
58 
59 #define CONTROL_PADCONF_MMC3_DAT0	0x480025E4	/* mmc3_dat0, mmc3_dat1 */
60 #define CONTROL_PADCONF_MMC3_DAT2	0x480025E8	/* mmc3_dat2 */
61 #define CONTROL_PADCONF_MMC3_DAT3	0x480025E0	/* mmc3_dat3 */
62 #endif
63 
64 #define INT_MMC2_IRQ			86
65 #define INT_MMC3_IRQ			94
66 
67 /* Zoom2 */
68 #define PMENA_GPIO                      101
69 #define IRQ_GPIO                        162
70 
71 /* Sholes */
72 /*
73 #define PMENA_GPIO                      186
74 #define IRQ_GPIO                        65
75 */
76 
77 #define TNETW_IRQ                       (OMAP_GPIO_IRQ(IRQ_GPIO))
78 #define TIWLAN_IRQ_POLL_INTERVAL	HZ/100
79 #define HZ_IN_MSEC			HZ/1000
80 #define TIWLAN_IRQ_POLL_INTERVAL_MS	TIWLAN_IRQ_POLL_INTERVAL/HZ_IN_MSEC
81 
82 int
83 hPlatform_initInterrupt(
84 	void* tnet_drv,
85 	void* handle_add
86 	);
87 
88 void*
89 hPlatform_hwGetRegistersAddr(
90     TI_HANDLE OsContext
91     );
92 
93 void*
94 hPlatform_hwGetMemoryAddr(
95     TI_HANDLE OsContext
96     );
97 
98 void hPlatform_freeInterrupt(void *tnet_drv);
99 
100 int  hPlatform_hardResetTnetw(void);
101 int  hPlatform_Wlan_Hardware_Init(void *tnet_drv);
102 void hPlatform_Wlan_Hardware_DeInit(void);
103 int  hPlatform_DevicePowerOff(void);
104 int  hPlatform_DevicePowerOffSetLongerDelay(void);
105 int  hPlatform_DevicePowerOn(void);
106 #endif /* __HOST_PLATFORM_SDIO__H__ */
107