1 /*****************************************************************************
3 (c) Cambridge Silicon Radio Limited 2011
4 All rights reserved and confidential information of CSR
6 Refer to LICENSE.txt included with this source for details
9 *****************************************************************************/
11 #ifndef CSR_WIFI_HIP_CHIPHELPER_PRIVATE_H__
12 #define CSR_WIFI_HIP_CHIPHELPER_PRIVATE_H__
15 #include "csr_wifi_hip_chiphelper.h"
19 #endif /* __cplusplus */
21 /* This GP stuff should be somewhere else? */
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 */
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)
43 /* Address value pairs */
47 const struct chip_helper_init_values *vals;
50 /* Just a (counted) u16 array */
60 const struct chip_helper_reset_values *vals;
63 /* The addresses of registers that are equivalent but on
64 different host transports. */
65 struct chip_map_address_t
73 const struct chip_map_address_t *vals;
76 struct chip_device_regs_per_transport_t
80 u16 window1_page; /* PROG_PMEM1 or GW1 */
81 u16 window2_page; /* PROG_PMEM2 or GW2 */
82 u16 window3_page; /* SHARED or GW3 */
86 struct chip_device_regs_t
91 struct chip_device_regs_per_transport_t host;
92 struct chip_device_regs_per_transport_t spi;
96 u16 dbg_reset_warn_value;
101 u16 watchdog_disable;
107 u16 shared_io_interrupt;
108 u16 sdio_hip_handshake;
109 u16 coex_status; /* Allows WAPI detection */
112 /* If allowed is false then this window does not provide this
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. */
118 struct window_shift_info_t
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
135 const struct window_shift_info_t *mode;
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. */
141 struct chip_version_t
149 struct chip_device_desc_t
151 struct chip_version_t chip_version;
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;
158 /* Initialisation values to write following a reset */
159 struct val_array_t init;
161 /* Binary sequence for hard reset */
162 struct reset_prog_t reset_prog;
164 /* The register map */
165 const struct chip_device_regs_t *regs;
167 /* Some misc. info on the chip */
171 u32 has_ext_sram : 1;
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;
183 /* The offsets into the program address space of the different types of memory.
184 The RAM offset is probably the most useful. */
193 /* The offsets into the data address space of interesting things. */
197 /* maybe add shared / page tables? */
200 /* Information on the different windows */
201 const struct window_info_t *windows[CHIP_HELPER_WINDOW_COUNT];
206 #endif /* __cplusplus */
208 #endif /* CSR_WIFI_HIP_CHIPHELPER_PRIVATE_H__ */