This source file includes following definitions.
- ai_get_cccaps
- ai_get_pmurev
- ai_get_pmucaps
- ai_get_boardtype
- ai_get_boardvendor
- ai_get_chip_id
- ai_get_chiprev
- ai_get_chippkg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #ifndef _BRCM_AIUTILS_H_
18 #define _BRCM_AIUTILS_H_
19
20 #include <linux/bcma/bcma.h>
21
22 #include "types.h"
23
24
25
26
27
28
29 #define SI_CORE_SIZE 0x1000
30
31
32
33
34
35 #define SI_MAXCORES 16
36
37
38 #define SI_PCI_DMA_SZ 0x40000000
39
40
41 #define SI_PCIE_DMA_H32 0x80000000
42
43
44 #define SI_CC_IDX 0
45
46
47 #define SOCI_AI 1
48
49
50
51
52 #define SI_CLK_CTL_ST 0x1e0
53
54
55 #define CCS_FORCEALP 0x00000001
56 #define CCS_FORCEHT 0x00000002
57 #define CCS_FORCEILP 0x00000004
58 #define CCS_ALPAREQ 0x00000008
59 #define CCS_HTAREQ 0x00000010
60 #define CCS_FORCEHWREQOFF 0x00000020
61 #define CCS_ERSRC_REQ_MASK 0x00000700
62 #define CCS_ERSRC_REQ_SHIFT 8
63 #define CCS_ALPAVAIL 0x00010000
64 #define CCS_HTAVAIL 0x00020000
65 #define CCS_BP_ON_APL 0x00040000
66 #define CCS_BP_ON_HT 0x00080000
67 #define CCS_ERSRC_STS_MASK 0x07000000
68 #define CCS_ERSRC_STS_SHIFT 24
69
70
71 #define CCS0_HTAVAIL 0x00010000
72
73 #define CCS0_ALPAVAIL 0x00020000
74
75
76
77
78
79
80 #define FLASH_MIN 0x00020000
81
82 #define CC_SROM_OTP 0x800
83
84
85 #define GPIO_ONTIME_SHIFT 16
86
87
88 #define CLKD_OTP 0x000f0000
89 #define CLKD_OTP_SHIFT 16
90
91
92 #define LPOMINFREQ 25000
93 #define LPOMAXFREQ 43000
94 #define XTALMINFREQ 19800000
95 #define XTALMAXFREQ 20200000
96 #define PCIMINFREQ 25000000
97 #define PCIMAXFREQ 34000000
98
99 #define ILP_DIV_5MHZ 0
100 #define ILP_DIV_1MHZ 4
101
102
103 #define XTAL 0x1
104 #define PLL 0x2
105
106
107 #define GPIO_DRV_PRIORITY 0
108 #define GPIO_APP_PRIORITY 1
109 #define GPIO_HI_PRIORITY 2
110
111
112
113
114 #define GPIO_PULLUP 0
115 #define GPIO_PULLDN 1
116
117
118 #define GPIO_REGEVT 0
119 #define GPIO_REGEVT_INTMSK 1
120 #define GPIO_REGEVT_INTPOL 2
121
122
123 #define SI_DEVPATH_BUFSZ 16
124
125
126 #define SI_DOATTACH 1
127 #define SI_PCIDOWN 2
128 #define SI_PCIUP 3
129
130
131
132
133
134 struct si_pub {
135 int ccrev;
136 u32 cccaps;
137 int pmurev;
138 u32 pmucaps;
139 uint boardtype;
140 uint boardvendor;
141 uint chip;
142 uint chiprev;
143 uint chippkg;
144 };
145
146 struct pci_dev;
147
148 struct gpioh_item {
149 void *arg;
150 bool level;
151 void (*handler) (u32 stat, void *arg);
152 u32 event;
153 struct gpioh_item *next;
154 };
155
156
157 struct si_info {
158 struct si_pub pub;
159 struct bcma_bus *icbus;
160 struct pci_dev *pcibus;
161
162 u32 chipst;
163 };
164
165
166
167
168
169
170
171
172
173
174
175 u32 ai_core_cflags(struct bcma_device *core, u32 mask, u32 val);
176
177
178 struct si_pub *ai_attach(struct bcma_bus *pbus);
179 void ai_detach(struct si_pub *sih);
180 uint ai_cc_reg(struct si_pub *sih, uint regoff, u32 mask, u32 val);
181 void ai_clkctl_init(struct si_pub *sih);
182 u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih);
183 bool ai_clkctl_cc(struct si_pub *sih, enum bcma_clkmode mode);
184 bool ai_deviceremoved(struct si_pub *sih);
185
186
187 void ai_epa_4313war(struct si_pub *sih);
188
189 static inline u32 ai_get_cccaps(struct si_pub *sih)
190 {
191 return sih->cccaps;
192 }
193
194 static inline int ai_get_pmurev(struct si_pub *sih)
195 {
196 return sih->pmurev;
197 }
198
199 static inline u32 ai_get_pmucaps(struct si_pub *sih)
200 {
201 return sih->pmucaps;
202 }
203
204 static inline uint ai_get_boardtype(struct si_pub *sih)
205 {
206 return sih->boardtype;
207 }
208
209 static inline uint ai_get_boardvendor(struct si_pub *sih)
210 {
211 return sih->boardvendor;
212 }
213
214 static inline uint ai_get_chip_id(struct si_pub *sih)
215 {
216 return sih->chip;
217 }
218
219 static inline uint ai_get_chiprev(struct si_pub *sih)
220 {
221 return sih->chiprev;
222 }
223
224 static inline uint ai_get_chippkg(struct si_pub *sih)
225 {
226 return sih->chippkg;
227 }
228
229 #endif