Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
csr_wifi_hip_chiphelper_private.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  (c) Cambridge Silicon Radio Limited 2011
4  All rights reserved and confidential information of CSR
5 
6  Refer to LICENSE.txt included with this source for details
7  on the license terms.
8 
9 *****************************************************************************/
10 
11 #ifndef CSR_WIFI_HIP_CHIPHELPER_PRIVATE_H__
12 #define CSR_WIFI_HIP_CHIPHELPER_PRIVATE_H__
13 
14 
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
20 
21 /* This GP stuff should be somewhere else? */
22 
23 /* Memory spaces encoded in top byte of Generic Pointer type */
24 #define UNIFI_SH_DMEM 0x01 /* Shared Data Memory */
25 #define UNIFI_EXT_FLASH 0x02 /* External FLASH */
26 #define UNIFI_EXT_SRAM 0x03 /* External SRAM */
27 #define UNIFI_REGISTERS 0x04 /* Registers */
28 #define UNIFI_PHY_DMEM 0x10 /* PHY Data Memory */
29 #define UNIFI_PHY_PMEM 0x11 /* PHY Program Memory */
30 #define UNIFI_PHY_ROM 0x12 /* PHY ROM */
31 #define UNIFI_MAC_DMEM 0x20 /* MAC Data Memory */
32 #define UNIFI_MAC_PMEM 0x21 /* MAC Program Memory */
33 #define UNIFI_MAC_ROM 0x22 /* MAC ROM */
34 #define UNIFI_BT_DMEM 0x30 /* BT Data Memory */
35 #define UNIFI_BT_PMEM 0x31 /* BT Program Memory */
36 #define UNIFI_BT_ROM 0x32 /* BT ROM */
37 
38 #define MAKE_GP(R, O) (((UNIFI_ ## R) << 24) | (O))
39 #define GP_OFFSET(GP) ((GP) & 0xFFFFFF)
40 #define GP_SPACE(GP) (((GP) >> 24) & 0xFF)
41 
42 
43 /* Address value pairs */
45 {
48 };
49 
50 /* Just a (counted) u16 array */
52 {
54  const u16 *vals;
55 };
56 
58 {
61 };
62 
63 /* The addresses of registers that are equivalent but on
64  different host transports. */
66 {
68 };
69 
71 {
73  const struct chip_map_address_t *vals;
74 };
75 
77 {
80  u16 window1_page; /* PROG_PMEM1 or GW1 */
81  u16 window2_page; /* PROG_PMEM2 or GW2 */
82  u16 window3_page; /* SHARED or GW3 */
84 };
85 
87 {
109  u16 coex_status; /* Allows WAPI detection */
110 };
111 
112 /* If allowed is false then this window does not provide this
113  type of access.
114  This describes how addresses should be shifted to make the
115  "page" address. The address is shifted left by 'page_shift'
116  and then has 'page_offset' added. This value should then be
117  written to the page register. */
119 {
123 };
124 
125 /* Each window has an address and size. These are obvious. It then
126  has a description for each type of memory that might be accessed
127  through it. There might also be a start to the offset of the window.
128  This means that that number of addresses at the start of the window
129  are unusable. */
131 {
135  const struct window_shift_info_t *mode;
136 };
137 
138 /* If GBL_CHIP_VERSION and'ed with 'mask' and is equal to 'result'
139  then this is the correct set of info. If pre_bc7 is true then the
140  address of GBL_CHIP_VERSION is FF9A, else its FE81. */
142 {
147 };
148 
150 {
152 
153  /* This is a text string that a human might find useful (BC02, UF105x) */
154  const char *friendly_name;
155  /* This is what we show to customers */
156  const char *marketing_name;
157 
158  /* Initialisation values to write following a reset */
160 
161  /* Binary sequence for hard reset */
163 
164  /* The register map */
165  const struct chip_device_regs_t *regs;
166 
167  /* Some misc. info on the chip */
168  struct
169  {
173  u32 has_bt : 1;
175  } bools;
176 
177  /* This table is used to remap register addresses depending on what
178  host interface is used. On the BC7 and later chips there are
179  multiple sets of memory window registers, on for each host
180  interafce (SDIO / SPI). The correct one is needed. */
181  struct map_array_t map;
182 
183  /* The offsets into the program address space of the different types of memory.
184  The RAM offset is probably the most useful. */
185  struct
186  {
191  } prog_offset;
192 
193  /* The offsets into the data address space of interesting things. */
194  struct
195  {
197  /* maybe add shared / page tables? */
198  } data_offset;
199 
200  /* Information on the different windows */
202 };
203 
204 #ifdef __cplusplus
205 }
206 #endif /* __cplusplus */
207 
208 #endif /* CSR_WIFI_HIP_CHIPHELPER_PRIVATE_H__ */