OLD | NEW |
1 //------------------------------------------------------------------------------ | 1 //------------------------------------------------------------------------------ |
2 // <copyright file="hif_sdio_common.h" company="Atheros"> | 2 // Copyright (c) 2009-2010 Atheros Corporation. All rights reserved. |
3 // Copyright (c) 2009 Atheros Corporation. All rights reserved. | |
4 // | 3 // |
5 // This program is free software; you can redistribute it and/or modify | |
6 // it under the terms of the GNU General Public License version 2 as | |
7 // published by the Free Software Foundation; | |
8 // | 4 // |
9 // Software distributed under the License is distributed on an "AS | 5 // Permission to use, copy, modify, and/or distribute this software for any |
10 // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or | 6 // purpose with or without fee is hereby granted, provided that the above |
11 // implied. See the License for the specific language governing | 7 // copyright notice and this permission notice appear in all copies. |
12 // rights and limitations under the License. | 8 // |
| 9 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 10 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 11 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 12 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 13 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 14 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 15 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
13 // | 16 // |
14 // | 17 // |
15 //------------------------------------------------------------------------------ | 18 //------------------------------------------------------------------------------ |
16 //============================================================================== | 19 //============================================================================== |
17 // common header file for HIF modules designed for SDIO | 20 // common header file for HIF modules designed for SDIO |
18 // | 21 // |
19 // Author(s): ="Atheros" | 22 // Author(s): ="Atheros" |
20 //============================================================================== | 23 //============================================================================== |
21 | 24 |
22 #ifndef HIF_SDIO_COMMON_H_ | 25 #ifndef HIF_SDIO_COMMON_H_ |
23 #define HIF_SDIO_COMMON_H_ | 26 #define HIF_SDIO_COMMON_H_ |
24 | 27 |
25 /* SDIO manufacturer ID and Codes */ | 28 /* SDIO manufacturer ID and Codes */ |
26 #define MANUFACTURER_ID_AR6001_BASE 0x100 | |
27 #define MANUFACTURER_ID_AR6002_BASE 0x200 | 29 #define MANUFACTURER_ID_AR6002_BASE 0x200 |
28 #define MANUFACTURER_ID_AR6003_BASE 0x300 | 30 #define MANUFACTURER_ID_AR6003_BASE 0x300 |
29 #define MANUFACTURER_ID_AR6K_BASE_MASK 0xFF00 | 31 #define MANUFACTURER_ID_AR6K_BASE_MASK 0xFF00 |
30 #define FUNCTION_CLASS 0x0 | 32 #define FUNCTION_CLASS 0x0 |
31 #define MANUFACTURER_CODE 0x271 /* Atheros */ | 33 #define MANUFACTURER_CODE 0x271 /* Atheros */ |
32 | 34 |
33 /* Mailbox address in SDIO address space */ | 35 /* Mailbox address in SDIO address space */ |
34 #define HIF_MBOX_BASE_ADDR 0x800 | 36 #define HIF_MBOX_BASE_ADDR 0x800 |
35 #define HIF_MBOX_WIDTH 0x800 | 37 #define HIF_MBOX_WIDTH 0x800 |
36 #define HIF_MBOX_START_ADDR(mbox) \ | 38 #define HIF_MBOX_START_ADDR(mbox) \ |
(...skipping 15 matching lines...) Expand all Loading... |
52 #define HIF_GMBOX_BASE_ADDR 0x7000 | 54 #define HIF_GMBOX_BASE_ADDR 0x7000 |
53 #define HIF_GMBOX_WIDTH 0x4000 | 55 #define HIF_GMBOX_WIDTH 0x4000 |
54 | 56 |
55 /* for SDIO we recommend a 128-byte block size */ | 57 /* for SDIO we recommend a 128-byte block size */ |
56 #define HIF_DEFAULT_IO_BLOCK_SIZE 128 | 58 #define HIF_DEFAULT_IO_BLOCK_SIZE 128 |
57 | 59 |
58 /* set extended MBOX window information for SDIO interconnects */ | 60 /* set extended MBOX window information for SDIO interconnects */ |
59 static INLINE void SetExtendedMboxWindowInfo(A_UINT16 Manfid, HIF_DEVICE_MBOX_IN
FO *pInfo) | 61 static INLINE void SetExtendedMboxWindowInfo(A_UINT16 Manfid, HIF_DEVICE_MBOX_IN
FO *pInfo) |
60 { | 62 { |
61 switch (Manfid & MANUFACTURER_ID_AR6K_BASE_MASK) { | 63 switch (Manfid & MANUFACTURER_ID_AR6K_BASE_MASK) { |
62 case MANUFACTURER_ID_AR6001_BASE : | |
63 /* no extended MBOX */ | |
64 break; | |
65 case MANUFACTURER_ID_AR6002_BASE : | 64 case MANUFACTURER_ID_AR6002_BASE : |
66 /* MBOX 0 has an extended range */ | 65 /* MBOX 0 has an extended range */ |
67 pInfo->MboxProp[0].ExtendedAddress = HIF_MBOX0_EXTENDED_BASE_ADDR;
| 66 pInfo->MboxProp[0].ExtendedAddress = HIF_MBOX0_EXTENDED_BASE_ADDR;
|
68 pInfo->MboxProp[0].ExtendedSize = HIF_MBOX0_EXTENDED_WIDTH_AR6002; | 67 pInfo->MboxProp[0].ExtendedSize = HIF_MBOX0_EXTENDED_WIDTH_AR6002; |
69 break; | 68 break; |
70 case MANUFACTURER_ID_AR6003_BASE : | 69 case MANUFACTURER_ID_AR6003_BASE : |
71 /* MBOX 0 has an extended range */ | 70 /* MBOX 0 has an extended range */ |
72 pInfo->MboxProp[0].ExtendedAddress = HIF_MBOX0_EXTENDED_BASE_ADDR_AR
6003_V1; | 71 pInfo->MboxProp[0].ExtendedAddress = HIF_MBOX0_EXTENDED_BASE_ADDR_AR
6003_V1; |
73 pInfo->MboxProp[0].ExtendedSize = HIF_MBOX0_EXTENDED_WIDTH_AR6003_V1
; | 72 pInfo->MboxProp[0].ExtendedSize = HIF_MBOX0_EXTENDED_WIDTH_AR6003_V1
; |
74 pInfo->GMboxAddress = HIF_GMBOX_BASE_ADDR; | 73 pInfo->GMboxAddress = HIF_GMBOX_BASE_ADDR; |
75 pInfo->GMboxSize = HIF_GMBOX_WIDTH; | 74 pInfo->GMboxSize = HIF_GMBOX_WIDTH; |
76 break; | 75 break; |
77 default: | 76 default: |
78 A_ASSERT(FALSE); | 77 A_ASSERT(FALSE); |
79 break; | 78 break; |
80 } | 79 } |
81 } | 80 } |
82 | 81 |
83 /* special CCCR (func 0) registers */ | 82 /* special CCCR (func 0) registers */ |
84 | 83 |
85 #define CCCR_SDIO_IRQ_MODE_REG 0xF0 /* interrupt mode register */ | 84 #define CCCR_SDIO_IRQ_MODE_REG 0xF0 /* interrupt mode register */ |
86 #define SDIO_IRQ_MODE_ASYNC_4BIT_IRQ (1 << 0) /* mode to enable special 4-b
it interrupt assertion without clock*/ | 85 #define SDIO_IRQ_MODE_ASYNC_4BIT_IRQ (1 << 0) /* mode to enable special 4-b
it interrupt assertion without clock*/ |
87 | 86 |
88 #endif /*HIF_SDIO_COMMON_H_*/ | 87 #endif /*HIF_SDIO_COMMON_H_*/ |
OLD | NEW |