aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/bcmdhd/include/siutils.h
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
commitfcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch)
treea57612d1888735a2ec7972891b68c1ac5ec8faea /drivers/net/wireless/bcmdhd/include/siutils.h
parent8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff)
Added missing tegra files.HEADmaster
Diffstat (limited to 'drivers/net/wireless/bcmdhd/include/siutils.h')
-rw-r--r--drivers/net/wireless/bcmdhd/include/siutils.h247
1 files changed, 247 insertions, 0 deletions
diff --git a/drivers/net/wireless/bcmdhd/include/siutils.h b/drivers/net/wireless/bcmdhd/include/siutils.h
new file mode 100644
index 00000000000..c5a33832b58
--- /dev/null
+++ b/drivers/net/wireless/bcmdhd/include/siutils.h
@@ -0,0 +1,247 @@
1/*
2 * Misc utility routines for accessing the SOC Interconnects
3 * of Broadcom HNBU chips.
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: siutils.h,v 13.251.2.10 2011-02-04 05:06:32 Exp $
26 */
27
28
29#ifndef _siutils_h_
30#define _siutils_h_
31
32
33struct si_pub {
34 uint socitype;
35
36 uint bustype;
37 uint buscoretype;
38 uint buscorerev;
39 uint buscoreidx;
40 int ccrev;
41 uint32 cccaps;
42 uint32 cccaps_ext;
43 int pmurev;
44 uint32 pmucaps;
45 uint boardtype;
46 uint boardvendor;
47 uint boardflags;
48 uint boardflags2;
49 uint chip;
50 uint chiprev;
51 uint chippkg;
52 uint32 chipst;
53 bool issim;
54 uint socirev;
55 bool pci_pr32414;
56
57};
58
59
60typedef const struct si_pub si_t;
61
62
63#define SI_OSH NULL
64
65#define BADIDX (SI_MAXCORES + 1)
66
67
68#define XTAL 0x1
69#define PLL 0x2
70
71
72#define CLK_FAST 0
73#define CLK_DYNAMIC 2
74
75
76#define GPIO_DRV_PRIORITY 0
77#define GPIO_APP_PRIORITY 1
78#define GPIO_HI_PRIORITY 2
79
80
81#define GPIO_PULLUP 0
82#define GPIO_PULLDN 1
83
84
85#define GPIO_REGEVT 0
86#define GPIO_REGEVT_INTMSK 1
87#define GPIO_REGEVT_INTPOL 2
88
89
90#define SI_DEVPATH_BUFSZ 16
91
92
93#define SI_DOATTACH 1
94#define SI_PCIDOWN 2
95#define SI_PCIUP 3
96
97#define ISSIM_ENAB(sih) 0
98
99
100#if defined(BCMPMUCTL)
101#define PMUCTL_ENAB(sih) (BCMPMUCTL)
102#else
103#define PMUCTL_ENAB(sih) ((sih)->cccaps & CC_CAP_PMU)
104#endif
105
106
107#if defined(BCMPMUCTL) && BCMPMUCTL
108#define CCCTL_ENAB(sih) (0)
109#define CCPLL_ENAB(sih) (0)
110#else
111#define CCCTL_ENAB(sih) ((sih)->cccaps & CC_CAP_PWR_CTL)
112#define CCPLL_ENAB(sih) ((sih)->cccaps & CC_CAP_PLL_MASK)
113#endif
114
115typedef void (*gpio_handler_t)(uint32 stat, void *arg);
116
117
118
119extern si_t *si_attach(uint pcidev, osl_t *osh, void *regs, uint bustype,
120 void *sdh, char **vars, uint *varsz);
121extern si_t *si_kattach(osl_t *osh);
122extern void si_detach(si_t *sih);
123extern bool si_pci_war16165(si_t *sih);
124
125extern uint si_corelist(si_t *sih, uint coreid[]);
126extern uint si_coreid(si_t *sih);
127extern uint si_flag(si_t *sih);
128extern uint si_intflag(si_t *sih);
129extern uint si_coreidx(si_t *sih);
130extern uint si_coreunit(si_t *sih);
131extern uint si_corevendor(si_t *sih);
132extern uint si_corerev(si_t *sih);
133extern void *si_osh(si_t *sih);
134extern void si_setosh(si_t *sih, osl_t *osh);
135extern uint si_corereg(si_t *sih, uint coreidx, uint regoff, uint mask, uint val);
136extern void *si_coreregs(si_t *sih);
137extern uint si_wrapperreg(si_t *sih, uint32 offset, uint32 mask, uint32 val);
138extern uint32 si_core_cflags(si_t *sih, uint32 mask, uint32 val);
139extern void si_core_cflags_wo(si_t *sih, uint32 mask, uint32 val);
140extern uint32 si_core_sflags(si_t *sih, uint32 mask, uint32 val);
141extern bool si_iscoreup(si_t *sih);
142extern uint si_findcoreidx(si_t *sih, uint coreid, uint coreunit);
143extern void *si_setcoreidx(si_t *sih, uint coreidx);
144extern void *si_setcore(si_t *sih, uint coreid, uint coreunit);
145extern void *si_switch_core(si_t *sih, uint coreid, uint *origidx, uint *intr_val);
146extern void si_restore_core(si_t *sih, uint coreid, uint intr_val);
147extern int si_numaddrspaces(si_t *sih);
148extern uint32 si_addrspace(si_t *sih, uint asidx);
149extern uint32 si_addrspacesize(si_t *sih, uint asidx);
150extern int si_corebist(si_t *sih);
151extern void si_core_reset(si_t *sih, uint32 bits, uint32 resetbits);
152extern void si_core_disable(si_t *sih, uint32 bits);
153extern uint32 si_clock_rate(uint32 pll_type, uint32 n, uint32 m);
154extern bool si_read_pmu_autopll(si_t *sih);
155extern uint32 si_clock(si_t *sih);
156extern uint32 si_alp_clock(si_t *sih);
157extern uint32 si_ilp_clock(si_t *sih);
158extern void si_pci_setup(si_t *sih, uint coremask);
159extern void si_pcmcia_init(si_t *sih);
160extern void si_setint(si_t *sih, int siflag);
161extern bool si_backplane64(si_t *sih);
162extern void si_register_intr_callback(si_t *sih, void *intrsoff_fn, void *intrsrestore_fn,
163 void *intrsenabled_fn, void *intr_arg);
164extern void si_deregister_intr_callback(si_t *sih);
165extern void si_clkctl_init(si_t *sih);
166extern uint16 si_clkctl_fast_pwrup_delay(si_t *sih);
167extern bool si_clkctl_cc(si_t *sih, uint mode);
168extern int si_clkctl_xtal(si_t *sih, uint what, bool on);
169extern uint32 si_gpiotimerval(si_t *sih, uint32 mask, uint32 val);
170extern void si_btcgpiowar(si_t *sih);
171extern bool si_deviceremoved(si_t *sih);
172extern uint32 si_socram_size(si_t *sih);
173extern uint32 si_socdevram_size(si_t *sih);
174extern void si_socdevram(si_t *sih, bool set, uint8 *ennable, uint8 *protect);
175extern bool si_socdevram_pkg(si_t *sih);
176
177extern void si_watchdog(si_t *sih, uint ticks);
178extern void si_watchdog_ms(si_t *sih, uint32 ms);
179extern void *si_gpiosetcore(si_t *sih);
180extern uint32 si_gpiocontrol(si_t *sih, uint32 mask, uint32 val, uint8 priority);
181extern uint32 si_gpioouten(si_t *sih, uint32 mask, uint32 val, uint8 priority);
182extern uint32 si_gpioout(si_t *sih, uint32 mask, uint32 val, uint8 priority);
183extern uint32 si_gpioin(si_t *sih);
184extern uint32 si_gpiointpolarity(si_t *sih, uint32 mask, uint32 val, uint8 priority);
185extern uint32 si_gpiointmask(si_t *sih, uint32 mask, uint32 val, uint8 priority);
186extern uint32 si_gpioled(si_t *sih, uint32 mask, uint32 val);
187extern uint32 si_gpioreserve(si_t *sih, uint32 gpio_num, uint8 priority);
188extern uint32 si_gpiorelease(si_t *sih, uint32 gpio_num, uint8 priority);
189extern uint32 si_gpiopull(si_t *sih, bool updown, uint32 mask, uint32 val);
190extern uint32 si_gpioevent(si_t *sih, uint regtype, uint32 mask, uint32 val);
191extern uint32 si_gpio_int_enable(si_t *sih, bool enable);
192
193
194extern void *si_gpio_handler_register(si_t *sih, uint32 e, bool lev, gpio_handler_t cb, void *arg);
195extern void si_gpio_handler_unregister(si_t *sih, void* gpioh);
196extern void si_gpio_handler_process(si_t *sih);
197
198
199extern bool si_pci_pmecap(si_t *sih);
200struct osl_info;
201extern bool si_pci_fastpmecap(struct osl_info *osh);
202extern bool si_pci_pmestat(si_t *sih);
203extern void si_pci_pmeclr(si_t *sih);
204extern void si_pci_pmeen(si_t *sih);
205extern uint si_pcie_readreg(void *sih, uint addrtype, uint offset);
206
207extern void si_sdio_init(si_t *sih);
208
209extern uint16 si_d11_devid(si_t *sih);
210extern int si_corepciid(si_t *sih, uint func, uint16 *pcivendor, uint16 *pcidevice,
211 uint8 *pciclass, uint8 *pcisubclass, uint8 *pciprogif, uint8 *pciheader);
212
213#define si_eci(sih) 0
214#define si_eci_init(sih) (0)
215#define si_eci_notify_bt(sih, type, val) (0)
216
217
218
219extern int si_devpath(si_t *sih, char *path, int size);
220
221extern char *si_getdevpathvar(si_t *sih, const char *name);
222extern int si_getdevpathintvar(si_t *sih, const char *name);
223
224
225extern uint8 si_pcieclkreq(si_t *sih, uint32 mask, uint32 val);
226extern uint32 si_pcielcreg(si_t *sih, uint32 mask, uint32 val);
227extern void si_war42780_clkreq(si_t *sih, bool clkreq);
228extern void si_pci_sleep(si_t *sih);
229extern void si_pci_down(si_t *sih);
230extern void si_pci_up(si_t *sih);
231extern void si_pcie_war_ovr_update(si_t *sih, uint8 aspm);
232extern void si_pcie_extendL1timer(si_t *sih, bool extend);
233extern int si_pci_fixcfg(si_t *sih);
234extern uint si_pll_reset(si_t *sih);
235
236
237
238extern bool si_taclear(si_t *sih, bool details);
239
240
241
242extern uint32 si_pciereg(si_t *sih, uint32 offset, uint32 mask, uint32 val, uint type);
243extern uint32 si_pcieserdesreg(si_t *sih, uint32 mdioslave, uint32 offset, uint32 mask, uint32 val);
244
245char *si_getnvramflvar(si_t *sih, const char *name);
246
247#endif