1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19#ifndef _AM33XX_CPU_H
20#define _AM33XX_CPU_H
21
22#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
23#include <asm/types.h>
24#endif
25
26#include <asm/arch/hardware.h>
27
28#define BIT(x) (1 << x)
29#define CL_BIT(x) (0 << x)
30
31
32#define TCLR_ST BIT(0)
33#define TCLR_AR BIT(1)
34#define TCLR_PRE BIT(5)
35#define TCLR_PTV_SHIFT (2)
36#define TCLR_PRE_DISABLE CL_BIT(5)
37
38
39#define DEVICE_MASK (BIT(8) | BIT(9) | BIT(10))
40#define TST_DEVICE 0x0
41#define EMU_DEVICE 0x1
42#define HS_DEVICE 0x2
43#define GP_DEVICE 0x3
44
45
46#define AM335X 0xB944
47#define DEVICE_ID 0x44E10600
48
49
50#define SYSBOOT_MASK (BIT(0) | BIT(1) | BIT(2)\
51 | BIT(3) | BIT(4))
52
53
54#ifdef CONFIG_AM33XX
55#define PRM_RSTCTRL 0x44E00F00
56#define PRM_RSTST 0x44E00F08
57#endif
58#define PRM_RSTCTRL_RESET 0x01
59#define PRM_RSTST_WARM_RESET_MASK 0x232
60
61#ifndef __KERNEL_STRICT_NAMES
62#ifndef __ASSEMBLY__
63struct gpmc_cs {
64 u32 config1;
65 u32 config2;
66 u32 config3;
67 u32 config4;
68 u32 config5;
69 u32 config6;
70 u32 config7;
71 u32 nand_cmd;
72 u32 nand_adr;
73 u32 nand_dat;
74 u8 res[8];
75};
76
77struct bch_res_0_3 {
78 u32 bch_result_x[4];
79};
80
81struct gpmc {
82 u8 res1[0x10];
83 u32 sysconfig;
84 u8 res2[0x4];
85 u32 irqstatus;
86 u32 irqenable;
87 u8 res3[0x20];
88 u32 timeout_control;
89 u8 res4[0xC];
90 u32 config;
91 u32 status;
92 u8 res5[0x8];
93 struct gpmc_cs cs[8];
94 u8 res6[0x14];
95 u32 ecc_config;
96 u32 ecc_control;
97 u32 ecc_size_config;
98 u32 ecc1_result;
99 u32 ecc2_result;
100 u32 ecc3_result;
101 u32 ecc4_result;
102 u32 ecc5_result;
103 u32 ecc6_result;
104 u32 ecc7_result;
105 u32 ecc8_result;
106 u32 ecc9_result;
107 u8 res7[12];
108 u32 testmomde_ctrl;
109 u8 res8[12];
110 struct bch_res_0_3 bch_result_0_3[2];
111};
112
113
114extern struct gpmc *gpmc_cfg;
115
116
117struct cm_wkuppll {
118 unsigned int wkclkstctrl;
119 unsigned int wkctrlclkctrl;
120 unsigned int wkgpio0clkctrl;
121 unsigned int wkl4wkclkctrl;
122 unsigned int resv2[4];
123 unsigned int idlestdpllmpu;
124 unsigned int resv3[2];
125 unsigned int clkseldpllmpu;
126 unsigned int resv4[1];
127 unsigned int idlestdpllddr;
128 unsigned int resv5[2];
129 unsigned int clkseldpllddr;
130 unsigned int resv6[4];
131 unsigned int clkseldplldisp;
132 unsigned int resv7[1];
133 unsigned int idlestdpllcore;
134 unsigned int resv8[2];
135 unsigned int clkseldpllcore;
136 unsigned int resv9[1];
137 unsigned int idlestdpllper;
138 unsigned int resv10[2];
139 unsigned int clkdcoldodpllper;
140 unsigned int divm4dpllcore;
141 unsigned int divm5dpllcore;
142 unsigned int clkmoddpllmpu;
143 unsigned int clkmoddpllper;
144 unsigned int clkmoddpllcore;
145 unsigned int clkmoddpllddr;
146 unsigned int clkmoddplldisp;
147 unsigned int clkseldpllper;
148 unsigned int divm2dpllddr;
149 unsigned int divm2dplldisp;
150 unsigned int divm2dpllmpu;
151 unsigned int divm2dpllper;
152 unsigned int resv11[1];
153 unsigned int wkup_uart0ctrl;
154 unsigned int wkup_i2c0ctrl;
155 unsigned int resv12[7];
156 unsigned int divm6dpllcore;
157};
158
159
160
161
162
163struct cm_perpll {
164 unsigned int l4lsclkstctrl;
165 unsigned int l3sclkstctrl;
166 unsigned int l4fwclkstctrl;
167 unsigned int l3clkstctrl;
168 unsigned int resv1;
169 unsigned int cpgmac0clkctrl;
170 unsigned int lcdclkctrl;
171 unsigned int usb0clkctrl;
172 unsigned int resv2;
173 unsigned int tptc0clkctrl;
174 unsigned int emifclkctrl;
175 unsigned int ocmcramclkctrl;
176 unsigned int gpmcclkctrl;
177 unsigned int mcasp0clkctrl;
178 unsigned int uart5clkctrl;
179 unsigned int mmc0clkctrl;
180 unsigned int elmclkctrl;
181 unsigned int i2c2clkctrl;
182 unsigned int i2c1clkctrl;
183 unsigned int spi0clkctrl;
184 unsigned int spi1clkctrl;
185 unsigned int resv3[3];
186 unsigned int l4lsclkctrl;
187 unsigned int l4fwclkctrl;
188 unsigned int mcasp1clkctrl;
189 unsigned int uart1clkctrl;
190 unsigned int uart2clkctrl;
191 unsigned int uart3clkctrl;
192 unsigned int uart4clkctrl;
193 unsigned int timer7clkctrl;
194 unsigned int timer2clkctrl;
195 unsigned int timer3clkctrl;
196 unsigned int timer4clkctrl;
197 unsigned int resv4[8];
198 unsigned int gpio1clkctrl;
199 unsigned int gpio2clkctrl;
200 unsigned int gpio3clkctrl;
201 unsigned int resv5;
202 unsigned int tpccclkctrl;
203 unsigned int dcan0clkctrl;
204 unsigned int dcan1clkctrl;
205 unsigned int resv6[2];
206 unsigned int emiffwclkctrl;
207 unsigned int resv7[2];
208 unsigned int l3instrclkctrl;
209 unsigned int l3clkctrl;
210 unsigned int resv8[4];
211 unsigned int mmc1clkctrl;
212 unsigned int mmc2clkctrl;
213 unsigned int resv9[8];
214 unsigned int l4hsclkstctrl;
215 unsigned int l4hsclkctrl;
216 unsigned int resv10[8];
217 unsigned int cpswclkstctrl;
218};
219
220
221struct cm_dpll {
222 unsigned int resv1[2];
223 unsigned int clktimer2clk;
224};
225
226
227struct cm_rtc {
228 unsigned int rtcclkctrl;
229 unsigned int clkstctrl;
230};
231
232
233struct wd_timer {
234 unsigned int resv1[4];
235 unsigned int wdtwdsc;
236 unsigned int wdtwdst;
237 unsigned int wdtwisr;
238 unsigned int wdtwier;
239 unsigned int wdtwwer;
240 unsigned int wdtwclr;
241 unsigned int wdtwcrr;
242 unsigned int wdtwldr;
243 unsigned int wdtwtgr;
244 unsigned int wdtwwps;
245 unsigned int resv2[3];
246 unsigned int wdtwdly;
247 unsigned int wdtwspr;
248 unsigned int resv3[1];
249 unsigned int wdtwqeoi;
250 unsigned int wdtwqstar;
251 unsigned int wdtwqsta;
252 unsigned int wdtwqens;
253 unsigned int wdtwqenc;
254 unsigned int resv4[39];
255 unsigned int wdt_unfr;
256};
257
258
259struct gptimer {
260 unsigned int tidr;
261 unsigned char res1[12];
262 unsigned int tiocp_cfg;
263 unsigned char res2[12];
264 unsigned int tier;
265 unsigned int tistatr;
266 unsigned int tistat;
267 unsigned int tisr;
268 unsigned int tcicr;
269 unsigned int twer;
270 unsigned int tclr;
271 unsigned int tcrr;
272 unsigned int tldr;
273 unsigned int ttgr;
274 unsigned int twpc;
275 unsigned int tmar;
276 unsigned int tcar1;
277 unsigned int tscir;
278 unsigned int tcar2;
279};
280
281
282struct rtc_regs {
283 unsigned int res[21];
284 unsigned int osc;
285 unsigned int res2[5];
286 unsigned int kick0r;
287 unsigned int kick1r;
288};
289
290
291struct uart_sys {
292 unsigned int resv1[21];
293 unsigned int uartsyscfg;
294 unsigned int uartsyssts;
295};
296
297
298struct vtp_reg {
299 unsigned int vtp0ctrlreg;
300};
301
302
303struct ctrl_stat {
304 unsigned int resv1[16];
305 unsigned int statusreg;
306 unsigned int resv2[51];
307 unsigned int secure_emif_sdram_config;
308};
309
310
311#define OMAP_GPIO_REVISION 0x0000
312#define OMAP_GPIO_SYSCONFIG 0x0010
313#define OMAP_GPIO_SYSSTATUS 0x0114
314#define OMAP_GPIO_IRQSTATUS1 0x002c
315#define OMAP_GPIO_IRQSTATUS2 0x0030
316#define OMAP_GPIO_CTRL 0x0130
317#define OMAP_GPIO_OE 0x0134
318#define OMAP_GPIO_DATAIN 0x0138
319#define OMAP_GPIO_DATAOUT 0x013c
320#define OMAP_GPIO_LEVELDETECT0 0x0140
321#define OMAP_GPIO_LEVELDETECT1 0x0144
322#define OMAP_GPIO_RISINGDETECT 0x0148
323#define OMAP_GPIO_FALLINGDETECT 0x014c
324#define OMAP_GPIO_DEBOUNCE_EN 0x0150
325#define OMAP_GPIO_DEBOUNCE_VAL 0x0154
326#define OMAP_GPIO_CLEARDATAOUT 0x0190
327#define OMAP_GPIO_SETDATAOUT 0x0194
328
329
330struct ctrl_dev {
331 unsigned int deviceid;
332 unsigned int resv1[7];
333 unsigned int usb_ctrl0;
334 unsigned int resv2;
335 unsigned int usb_ctrl1;
336 unsigned int resv3;
337 unsigned int macid0l;
338 unsigned int macid0h;
339 unsigned int macid1l;
340 unsigned int macid1h;
341 unsigned int resv4[4];
342 unsigned int miisel;
343};
344#endif
345#endif
346
347#endif
348