1
2
3
4
5
6 #ifndef _SBCHIPC_H
7 #define _SBCHIPC_H
8
9 #include "defs.h"
10
11 #define CHIPCREGOFFS(field) offsetof(struct chipcregs, field)
12
13 struct chipcregs {
14 u32 chipid;
15 u32 capabilities;
16 u32 corecontrol;
17 u32 bist;
18
19
20 u32 otpstatus;
21 u32 otpcontrol;
22 u32 otpprog;
23 u32 otplayout;
24
25
26 u32 intstatus;
27 u32 intmask;
28
29
30 u32 chipcontrol;
31 u32 chipstatus;
32
33
34 u32 jtagcmd;
35 u32 jtagir;
36 u32 jtagdr;
37 u32 jtagctrl;
38
39
40 u32 flashcontrol;
41 u32 flashaddress;
42 u32 flashdata;
43 u32 PAD[1];
44
45
46 u32 broadcastaddress;
47 u32 broadcastdata;
48
49
50 u32 gpiopullup;
51 u32 gpiopulldown;
52 u32 gpioin;
53 u32 gpioout;
54 u32 gpioouten;
55 u32 gpiocontrol;
56 u32 gpiointpolarity;
57 u32 gpiointmask;
58
59
60 u32 gpioevent;
61 u32 gpioeventintmask;
62
63
64 u32 watchdog;
65
66
67 u32 gpioeventintpolarity;
68
69
70 u32 gpiotimerval;
71 u32 gpiotimeroutmask;
72
73
74 u32 clockcontrol_n;
75 u32 clockcontrol_sb;
76 u32 clockcontrol_pci;
77 u32 clockcontrol_m2;
78 u32 clockcontrol_m3;
79 u32 clkdiv;
80 u32 gpiodebugsel;
81 u32 capabilities_ext;
82
83
84 u32 pll_on_delay;
85 u32 fref_sel_delay;
86 u32 slow_clk_ctl;
87 u32 PAD;
88
89
90 u32 system_clk_ctl;
91 u32 clkstatestretch;
92 u32 PAD[2];
93
94
95 u32 bp_addrlow;
96 u32 bp_addrhigh;
97 u32 bp_data;
98 u32 PAD;
99 u32 bp_indaccess;
100 u32 PAD[3];
101
102
103 u32 clkdiv2;
104 u32 PAD[2];
105
106
107 u32 eromptr;
108
109
110 u32 pcmcia_config;
111 u32 pcmcia_memwait;
112 u32 pcmcia_attrwait;
113 u32 pcmcia_iowait;
114 u32 ide_config;
115 u32 ide_memwait;
116 u32 ide_attrwait;
117 u32 ide_iowait;
118 u32 prog_config;
119 u32 prog_waitcount;
120 u32 flash_config;
121 u32 flash_waitcount;
122 u32 SECI_config;
123 u32 PAD[3];
124
125
126 u32 eci_output;
127 u32 eci_control;
128 u32 eci_inputlo;
129 u32 eci_inputmi;
130 u32 eci_inputhi;
131 u32 eci_inputintpolaritylo;
132 u32 eci_inputintpolaritymi;
133 u32 eci_inputintpolarityhi;
134 u32 eci_intmasklo;
135 u32 eci_intmaskmi;
136 u32 eci_intmaskhi;
137 u32 eci_eventlo;
138 u32 eci_eventmi;
139 u32 eci_eventhi;
140 u32 eci_eventmasklo;
141 u32 eci_eventmaskmi;
142 u32 eci_eventmaskhi;
143 u32 PAD[3];
144
145
146 u32 sromcontrol;
147 u32 sromaddress;
148 u32 sromdata;
149 u32 PAD[17];
150
151
152 u32 clk_ctl_st;
153 u32 hw_war;
154 u32 PAD[70];
155
156
157 u8 uart0data;
158 u8 uart0imr;
159 u8 uart0fcr;
160 u8 uart0lcr;
161 u8 uart0mcr;
162 u8 uart0lsr;
163 u8 uart0msr;
164 u8 uart0scratch;
165 u8 PAD[248];
166
167 u8 uart1data;
168 u8 uart1imr;
169 u8 uart1fcr;
170 u8 uart1lcr;
171 u8 uart1mcr;
172 u8 uart1lsr;
173 u8 uart1msr;
174 u8 uart1scratch;
175 u32 PAD[62];
176
177
178 u32 sr_capability;
179 u32 sr_control0;
180 u32 sr_control1;
181 u32 gpio_control;
182 u32 PAD[60];
183
184
185 u32 pmucontrol;
186 u32 pmucapabilities;
187 u32 pmustatus;
188 u32 res_state;
189 u32 res_pending;
190 u32 pmutimer;
191 u32 min_res_mask;
192 u32 max_res_mask;
193 u32 res_table_sel;
194 u32 res_dep_mask;
195 u32 res_updn_timer;
196 u32 res_timer;
197 u32 clkstretch;
198 u32 pmuwatchdog;
199 u32 gpiosel;
200 u32 gpioenable;
201 u32 res_req_timer_sel;
202 u32 res_req_timer;
203 u32 res_req_mask;
204 u32 pmucapabilities_ext;
205 u32 chipcontrol_addr;
206 u32 chipcontrol_data;
207 u32 regcontrol_addr;
208 u32 regcontrol_data;
209 u32 pllcontrol_addr;
210 u32 pllcontrol_data;
211 u32 pmustrapopt;
212 u32 pmu_xtalfreq;
213 u32 retention_ctl;
214 u32 PAD[3];
215 u32 retention_grpidx;
216 u32 retention_grpctl;
217 u32 PAD[94];
218 u16 sromotp[768];
219 };
220
221
222 #define CID_ID_MASK 0x0000ffff
223 #define CID_REV_MASK 0x000f0000
224 #define CID_REV_SHIFT 16
225 #define CID_PKG_MASK 0x00f00000
226 #define CID_PKG_SHIFT 20
227 #define CID_CC_MASK 0x0f000000
228 #define CID_CC_SHIFT 24
229 #define CID_TYPE_MASK 0xf0000000
230 #define CID_TYPE_SHIFT 28
231
232
233 #define CC_CAP_UARTS_MASK 0x00000003
234 #define CC_CAP_MIPSEB 0x00000004
235 #define CC_CAP_UCLKSEL 0x00000018
236
237 #define CC_CAP_UINTCLK 0x00000008
238 #define CC_CAP_UARTGPIO 0x00000020
239 #define CC_CAP_EXTBUS_MASK 0x000000c0
240 #define CC_CAP_EXTBUS_NONE 0x00000000
241 #define CC_CAP_EXTBUS_FULL 0x00000040
242 #define CC_CAP_EXTBUS_PROG 0x00000080
243 #define CC_CAP_FLASH_MASK 0x00000700
244 #define CC_CAP_PLL_MASK 0x00038000
245 #define CC_CAP_PWR_CTL 0x00040000
246 #define CC_CAP_OTPSIZE 0x00380000
247 #define CC_CAP_OTPSIZE_SHIFT 19
248 #define CC_CAP_OTPSIZE_BASE 5
249 #define CC_CAP_JTAGP 0x00400000
250 #define CC_CAP_ROM 0x00800000
251 #define CC_CAP_BKPLN64 0x08000000
252 #define CC_CAP_PMU 0x10000000
253 #define CC_CAP_SROM 0x40000000
254
255 #define CC_CAP_NFLASH 0x80000000
256
257 #define CC_CAP2_SECI 0x00000001
258
259 #define CC_CAP2_GSIO 0x00000002
260
261
262 #define CC_SR_CTL0_ENABLE_MASK BIT(0)
263 #define CC_SR_CTL0_ENABLE_SHIFT 0
264 #define CC_SR_CTL0_EN_SR_ENG_CLK_SHIFT 1
265 #define CC_SR_CTL0_RSRC_TRIGGER_SHIFT 2
266
267
268 #define CC_SR_CTL0_MIN_DIV_SHIFT 6
269
270
271 #define CC_SR_CTL0_EN_SBC_STBY_SHIFT 16
272 #define CC_SR_CTL0_EN_SR_ALP_CLK_MASK_SHIFT 18
273 #define CC_SR_CTL0_EN_SR_HT_CLK_SHIFT 19
274 #define CC_SR_CTL0_ALLOW_PIC_SHIFT 20
275
276
277 #define CC_SR_CTL0_MAX_SR_LQ_CLK_CNT_SHIFT 25
278 #define CC_SR_CTL0_EN_MEM_DISABLE_FOR_SLEEP 30
279
280
281 #define PCAP_REV_MASK 0x000000ff
282 #define PCAP_RC_MASK 0x00001f00
283 #define PCAP_RC_SHIFT 8
284 #define PCAP_TC_MASK 0x0001e000
285 #define PCAP_TC_SHIFT 13
286 #define PCAP_PC_MASK 0x001e0000
287 #define PCAP_PC_SHIFT 17
288 #define PCAP_VC_MASK 0x01e00000
289 #define PCAP_VC_SHIFT 21
290 #define PCAP_CC_MASK 0x1e000000
291 #define PCAP_CC_SHIFT 25
292 #define PCAP5_PC_MASK 0x003e0000
293 #define PCAP5_PC_SHIFT 17
294 #define PCAP5_VC_MASK 0x07c00000
295 #define PCAP5_VC_SHIFT 22
296 #define PCAP5_CC_MASK 0xf8000000
297 #define PCAP5_CC_SHIFT 27
298
299 #define PCAPEXT_SR_SUPPORTED_MASK (1 << 1)
300
301 #define PMU_RCTL_MACPHY_DISABLE_MASK (1 << 26)
302 #define PMU_RCTL_LOGIC_DISABLE_MASK (1 << 27)
303
304
305
306
307
308
309 #define PMU_MAX_TRANSITION_DLY 15000
310
311 #endif