aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/bcmdhd/include/sbhnddma.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/bcmdhd/include/sbhnddma.h')
-rw-r--r--drivers/net/wireless/bcmdhd/include/sbhnddma.h327
1 files changed, 327 insertions, 0 deletions
diff --git a/drivers/net/wireless/bcmdhd/include/sbhnddma.h b/drivers/net/wireless/bcmdhd/include/sbhnddma.h
new file mode 100644
index 00000000000..05d0587bc20
--- /dev/null
+++ b/drivers/net/wireless/bcmdhd/include/sbhnddma.h
@@ -0,0 +1,327 @@
1/*
2 * Generic Broadcom Home Networking Division (HND) DMA engine HW interface
3 * This supports the following chips: BCM42xx, 44xx, 47xx .
4 *
5 * Copyright (C) 1999-2011, Broadcom Corporation
6 *
7 * Unless you and Broadcom execute a separate written software license
8 * agreement governing use of this software, this software is licensed to you
9 * under the terms of the GNU General Public License version 2 (the "GPL"),
10 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
11 * following added to such license:
12 *
13 * As a special exception, the copyright holders of this software give you
14 * permission to link this software with independent modules, and to copy and
15 * distribute the resulting executable under terms of your choice, provided that
16 * you also meet, for each linked independent module, the terms and conditions of
17 * the license of that module. An independent module is a module which is not
18 * derived from this software. The special exception does not apply to any
19 * modifications of the software.
20 *
21 * Notwithstanding the above, under no circumstances may you combine this
22 * software in any way with any other Broadcom software provided under a license
23 * other than the GPL, without Broadcom's express prior written consent.
24 *
25 * $Id: sbhnddma.h,v 13.20.2.3 2010-10-14 22:21:29 Exp $
26 */
27
28
29#ifndef _sbhnddma_h_
30#define _sbhnddma_h_
31
32
33
34
35
36
37
38typedef volatile struct {
39 uint32 control;
40 uint32 addr;
41 uint32 ptr;
42 uint32 status;
43} dma32regs_t;
44
45typedef volatile struct {
46 dma32regs_t xmt;
47 dma32regs_t rcv;
48} dma32regp_t;
49
50typedef volatile struct {
51 uint32 fifoaddr;
52 uint32 fifodatalow;
53 uint32 fifodatahigh;
54 uint32 pad;
55} dma32diag_t;
56
57
58typedef volatile struct {
59 uint32 ctrl;
60 uint32 addr;
61} dma32dd_t;
62
63
64#define D32RINGALIGN_BITS 12
65#define D32MAXRINGSZ (1 << D32RINGALIGN_BITS)
66#define D32RINGALIGN (1 << D32RINGALIGN_BITS)
67
68#define D32MAXDD (D32MAXRINGSZ / sizeof (dma32dd_t))
69
70
71#define XC_XE ((uint32)1 << 0)
72#define XC_SE ((uint32)1 << 1)
73#define XC_LE ((uint32)1 << 2)
74#define XC_FL ((uint32)1 << 4)
75#define XC_PD ((uint32)1 << 11)
76#define XC_AE ((uint32)3 << 16)
77#define XC_AE_SHIFT 16
78#define XC_BL_MASK 0x001C0000
79#define XC_BL_SHIFT 18
80
81
82#define XP_LD_MASK 0xfff
83
84
85#define XS_CD_MASK 0x0fff
86#define XS_XS_MASK 0xf000
87#define XS_XS_SHIFT 12
88#define XS_XS_DISABLED 0x0000
89#define XS_XS_ACTIVE 0x1000
90#define XS_XS_IDLE 0x2000
91#define XS_XS_STOPPED 0x3000
92#define XS_XS_SUSP 0x4000
93#define XS_XE_MASK 0xf0000
94#define XS_XE_SHIFT 16
95#define XS_XE_NOERR 0x00000
96#define XS_XE_DPE 0x10000
97#define XS_XE_DFU 0x20000
98#define XS_XE_BEBR 0x30000
99#define XS_XE_BEDA 0x40000
100#define XS_AD_MASK 0xfff00000
101#define XS_AD_SHIFT 20
102
103
104#define RC_RE ((uint32)1 << 0)
105#define RC_RO_MASK 0xfe
106#define RC_RO_SHIFT 1
107#define RC_FM ((uint32)1 << 8)
108#define RC_SH ((uint32)1 << 9)
109#define RC_OC ((uint32)1 << 10)
110#define RC_PD ((uint32)1 << 11)
111#define RC_AE ((uint32)3 << 16)
112#define RC_AE_SHIFT 16
113#define RC_BL_MASK 0x001C0000
114#define RC_BL_SHIFT 18
115
116
117#define RP_LD_MASK 0xfff
118
119
120#define RS_CD_MASK 0x0fff
121#define RS_RS_MASK 0xf000
122#define RS_RS_SHIFT 12
123#define RS_RS_DISABLED 0x0000
124#define RS_RS_ACTIVE 0x1000
125#define RS_RS_IDLE 0x2000
126#define RS_RS_STOPPED 0x3000
127#define RS_RE_MASK 0xf0000
128#define RS_RE_SHIFT 16
129#define RS_RE_NOERR 0x00000
130#define RS_RE_DPE 0x10000
131#define RS_RE_DFO 0x20000
132#define RS_RE_BEBW 0x30000
133#define RS_RE_BEDA 0x40000
134#define RS_AD_MASK 0xfff00000
135#define RS_AD_SHIFT 20
136
137
138#define FA_OFF_MASK 0xffff
139#define FA_SEL_MASK 0xf0000
140#define FA_SEL_SHIFT 16
141#define FA_SEL_XDD 0x00000
142#define FA_SEL_XDP 0x10000
143#define FA_SEL_RDD 0x40000
144#define FA_SEL_RDP 0x50000
145#define FA_SEL_XFD 0x80000
146#define FA_SEL_XFP 0x90000
147#define FA_SEL_RFD 0xc0000
148#define FA_SEL_RFP 0xd0000
149#define FA_SEL_RSD 0xe0000
150#define FA_SEL_RSP 0xf0000
151
152
153#define CTRL_BC_MASK 0x00001fff
154#define CTRL_AE ((uint32)3 << 16)
155#define CTRL_AE_SHIFT 16
156#define CTRL_PARITY ((uint32)3 << 18)
157#define CTRL_EOT ((uint32)1 << 28)
158#define CTRL_IOC ((uint32)1 << 29)
159#define CTRL_EOF ((uint32)1 << 30)
160#define CTRL_SOF ((uint32)1 << 31)
161
162
163#define CTRL_CORE_MASK 0x0ff00000
164
165
166
167
168typedef volatile struct {
169 uint32 control;
170 uint32 ptr;
171 uint32 addrlow;
172 uint32 addrhigh;
173 uint32 status0;
174 uint32 status1;
175} dma64regs_t;
176
177typedef volatile struct {
178 dma64regs_t tx;
179 dma64regs_t rx;
180} dma64regp_t;
181
182typedef volatile struct {
183 uint32 fifoaddr;
184 uint32 fifodatalow;
185 uint32 fifodatahigh;
186 uint32 pad;
187} dma64diag_t;
188
189
190typedef volatile struct {
191 uint32 ctrl1;
192 uint32 ctrl2;
193 uint32 addrlow;
194 uint32 addrhigh;
195} dma64dd_t;
196
197
198#define D64RINGALIGN_BITS 13
199#define D64MAXRINGSZ (1 << D64RINGALIGN_BITS)
200#define D64RINGALIGN (1 << D64RINGALIGN_BITS)
201
202#define D64MAXDD (D64MAXRINGSZ / sizeof (dma64dd_t))
203
204
205#define D64_DEF_USBBURSTLEN 2
206#define D64_DEF_SDIOBURSTLEN 1
207
208
209#define D64_XC_XE 0x00000001
210#define D64_XC_SE 0x00000002
211#define D64_XC_LE 0x00000004
212#define D64_XC_FL 0x00000010
213#define D64_XC_PD 0x00000800
214#define D64_XC_AE 0x00030000
215#define D64_XC_AE_SHIFT 16
216#define D64_XC_BL_MASK 0x001C0000
217#define D64_XC_BL_SHIFT 18
218
219
220#define D64_XP_LD_MASK 0x00000fff
221
222
223#define D64_XS0_CD_MASK 0x00001fff
224#define D64_XS0_XS_MASK 0xf0000000
225#define D64_XS0_XS_SHIFT 28
226#define D64_XS0_XS_DISABLED 0x00000000
227#define D64_XS0_XS_ACTIVE 0x10000000
228#define D64_XS0_XS_IDLE 0x20000000
229#define D64_XS0_XS_STOPPED 0x30000000
230#define D64_XS0_XS_SUSP 0x40000000
231
232#define D64_XS1_AD_MASK 0x00001fff
233#define D64_XS1_XE_MASK 0xf0000000
234#define D64_XS1_XE_SHIFT 28
235#define D64_XS1_XE_NOERR 0x00000000
236#define D64_XS1_XE_DPE 0x10000000
237#define D64_XS1_XE_DFU 0x20000000
238#define D64_XS1_XE_DTE 0x30000000
239#define D64_XS1_XE_DESRE 0x40000000
240#define D64_XS1_XE_COREE 0x50000000
241
242
243#define D64_RC_RE 0x00000001
244#define D64_RC_RO_MASK 0x000000fe
245#define D64_RC_RO_SHIFT 1
246#define D64_RC_FM 0x00000100
247#define D64_RC_SH 0x00000200
248#define D64_RC_OC 0x00000400
249#define D64_RC_PD 0x00000800
250#define D64_RC_AE 0x00030000
251#define D64_RC_AE_SHIFT 16
252#define D64_RC_BL_MASK 0x001C0000
253#define D64_RC_BL_SHIFT 18
254
255
256#define DMA_CTRL_PEN (1 << 0)
257#define DMA_CTRL_ROC (1 << 1)
258#define DMA_CTRL_RXMULTI (1 << 2)
259#define DMA_CTRL_UNFRAMED (1 << 3)
260#define DMA_CTRL_USB_BOUNDRY4KB_WAR (1 << 4)
261
262
263#define D64_RP_LD_MASK 0x00000fff
264
265
266#define D64_RS0_CD_MASK 0x00001fff
267#define D64_RS0_RS_MASK 0xf0000000
268#define D64_RS0_RS_SHIFT 28
269#define D64_RS0_RS_DISABLED 0x00000000
270#define D64_RS0_RS_ACTIVE 0x10000000
271#define D64_RS0_RS_IDLE 0x20000000
272#define D64_RS0_RS_STOPPED 0x30000000
273#define D64_RS0_RS_SUSP 0x40000000
274
275#define D64_RS1_AD_MASK 0x0001ffff
276#define D64_RS1_RE_MASK 0xf0000000
277#define D64_RS1_RE_SHIFT 28
278#define D64_RS1_RE_NOERR 0x00000000
279#define D64_RS1_RE_DPO 0x10000000
280#define D64_RS1_RE_DFU 0x20000000
281#define D64_RS1_RE_DTE 0x30000000
282#define D64_RS1_RE_DESRE 0x40000000
283#define D64_RS1_RE_COREE 0x50000000
284
285
286#define D64_FA_OFF_MASK 0xffff
287#define D64_FA_SEL_MASK 0xf0000
288#define D64_FA_SEL_SHIFT 16
289#define D64_FA_SEL_XDD 0x00000
290#define D64_FA_SEL_XDP 0x10000
291#define D64_FA_SEL_RDD 0x40000
292#define D64_FA_SEL_RDP 0x50000
293#define D64_FA_SEL_XFD 0x80000
294#define D64_FA_SEL_XFP 0x90000
295#define D64_FA_SEL_RFD 0xc0000
296#define D64_FA_SEL_RFP 0xd0000
297#define D64_FA_SEL_RSD 0xe0000
298#define D64_FA_SEL_RSP 0xf0000
299
300
301#define D64_CTRL_COREFLAGS 0x0ff00000
302#define D64_CTRL1_EOT ((uint32)1 << 28)
303#define D64_CTRL1_IOC ((uint32)1 << 29)
304#define D64_CTRL1_EOF ((uint32)1 << 30)
305#define D64_CTRL1_SOF ((uint32)1 << 31)
306
307
308#define D64_CTRL2_BC_MASK 0x00007fff
309#define D64_CTRL2_AE 0x00030000
310#define D64_CTRL2_AE_SHIFT 16
311#define D64_CTRL2_PARITY 0x00040000
312
313
314#define D64_CTRL_CORE_MASK 0x0ff00000
315
316#define D64_RX_FRM_STS_LEN 0x0000ffff
317#define D64_RX_FRM_STS_OVFL 0x00800000
318#define D64_RX_FRM_STS_DSCRCNT 0x0f000000
319#define D64_RX_FRM_STS_DATATYPE 0xf0000000
320
321
322typedef volatile struct {
323 uint16 len;
324 uint16 flags;
325} dma_rxh_t;
326
327#endif