blob: aa10fab4dd8be99b936eaaf90066340ce98ac0db [file] [log] [blame]
Chandan Nath56551082011-10-14 02:58:22 +00001/*
2 * cpu.h
3 *
4 * AM33xx specific header file
5 *
6 * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
7 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02008 * SPDX-License-Identifier: GPL-2.0+
Chandan Nath56551082011-10-14 02:58:22 +00009 */
10
11#ifndef _AM33XX_CPU_H
12#define _AM33XX_CPU_H
13
14#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
15#include <asm/types.h>
16#endif /* !(__KERNEL_STRICT_NAMES || __ASSEMBLY__) */
17
18#include <asm/arch/hardware.h>
19
20#define BIT(x) (1 << x)
21#define CL_BIT(x) (0 << x)
22
23/* Timer register bits */
24#define TCLR_ST BIT(0) /* Start=1 Stop=0 */
25#define TCLR_AR BIT(1) /* Auto reload */
26#define TCLR_PRE BIT(5) /* Pre-scaler enable */
27#define TCLR_PTV_SHIFT (2) /* Pre-scaler shift value */
28#define TCLR_PRE_DISABLE CL_BIT(5) /* Pre-scalar disable */
Hannes Petermaier25b0a722014-06-04 10:19:26 +020029#define TCLR_CE BIT(6) /* compare mode enable */
30#define TCLR_SCPWM BIT(7) /* pwm outpin behaviour */
31#define TCLR_TCM BIT(8) /* edge detection of input pin*/
32#define TCLR_TRG_SHIFT (10) /* trigmode on pwm outpin */
33#define TCLR_PT BIT(12) /* pulse/toggle mode of outpin*/
34#define TCLR_CAPTMODE BIT(13) /* capture mode */
35#define TCLR_GPOCFG BIT(14) /* 0=output,1=input */
Chandan Nath56551082011-10-14 02:58:22 +000036
Hannes Petermaier25b0a722014-06-04 10:19:26 +020037#define TCFG_RESET BIT(0) /* software reset */
38#define TCFG_EMUFREE BIT(1) /* behaviour of tmr on debug */
39#define TCFG_IDLEMOD_SHIFT (2) /* power management */
Chandan Nath56551082011-10-14 02:58:22 +000040/* device type */
41#define DEVICE_MASK (BIT(8) | BIT(9) | BIT(10))
42#define TST_DEVICE 0x0
43#define EMU_DEVICE 0x1
44#define HS_DEVICE 0x2
45#define GP_DEVICE 0x3
46
Matt Porter8b029f22013-03-15 10:07:06 +000047/* cpu-id for AM33XX and TI81XX family */
Chandan Nath56551082011-10-14 02:58:22 +000048#define AM335X 0xB944
Matt Porter8b029f22013-03-15 10:07:06 +000049#define TI81XX 0xB81E
50#define DEVICE_ID (CTRL_BASE + 0x0600)
Tom Rini52879462013-08-30 16:28:45 -040051#define DEVICE_ID_MASK 0x1FFF
52
53/* MPU max frequencies */
54#define AM335X_ZCZ_300 0x1FEF
55#define AM335X_ZCZ_600 0x1FAF
56#define AM335X_ZCZ_720 0x1F2F
57#define AM335X_ZCZ_800 0x1E2F
58#define AM335X_ZCZ_1000 0x1C2F
59#define AM335X_ZCE_300 0x1FDF
60#define AM335X_ZCE_600 0x1F9F
Chandan Nath56551082011-10-14 02:58:22 +000061
62/* This gives the status of the boot mode pins on the evm */
63#define SYSBOOT_MASK (BIT(0) | BIT(1) | BIT(2)\
64 | BIT(3) | BIT(4))
65
Chandan Nath56551082011-10-14 02:58:22 +000066#define PRM_RSTCTRL_RESET 0x01
Lokesh Vutla70239502012-05-29 19:26:41 +000067#define PRM_RSTST_WARM_RESET_MASK 0x232
Chandan Nath56551082011-10-14 02:58:22 +000068
Heiko Schocher988ea352013-08-19 16:38:59 +020069/*
70 * Watchdog:
71 * Using the prescaler, the OMAP watchdog could go for many
72 * months before firing. These limits work without scaling,
73 * with the 60 second default assumed by most tools and docs.
74 */
75#define TIMER_MARGIN_MAX (24 * 60 * 60) /* 1 day */
76#define TIMER_MARGIN_DEFAULT 60 /* 60 secs */
77#define TIMER_MARGIN_MIN 1
78
79#define PTV 0 /* prescale */
80#define GET_WLDR_VAL(secs) (0xffffffff - ((secs) * (32768/(1<<PTV))) + 1)
81#define WDT_WWPS_PEND_WCLR BIT(0)
82#define WDT_WWPS_PEND_WLDR BIT(2)
83#define WDT_WWPS_PEND_WTGR BIT(3)
84#define WDT_WWPS_PEND_WSPR BIT(4)
85
86#define WDT_WCLR_PRE BIT(5)
87#define WDT_WCLR_PTV_OFF 2
88
Chandan Nath56551082011-10-14 02:58:22 +000089#ifndef __KERNEL_STRICT_NAMES
90#ifndef __ASSEMBLY__
Ilya Yanok8eb16b72012-11-06 13:06:30 +000091
Ilya Yanok8eb16b72012-11-06 13:06:30 +000092
Lokesh Vutlac06e4982013-07-30 11:36:28 +053093#ifndef CONFIG_AM43XX
Chandan Nath56551082011-10-14 02:58:22 +000094/* Encapsulating core pll registers */
95struct cm_wkuppll {
96 unsigned int wkclkstctrl; /* offset 0x00 */
97 unsigned int wkctrlclkctrl; /* offset 0x04 */
Tom Rinid88bc042012-05-21 06:46:31 +000098 unsigned int wkgpio0clkctrl; /* offset 0x08 */
Chandan Nath56551082011-10-14 02:58:22 +000099 unsigned int wkl4wkclkctrl; /* offset 0x0c */
Hannes Petermaier25b0a722014-06-04 10:19:26 +0200100 unsigned int timer0clkctrl; /* offset 0x10 */
101 unsigned int resv2[3];
Chandan Nath56551082011-10-14 02:58:22 +0000102 unsigned int idlestdpllmpu; /* offset 0x20 */
103 unsigned int resv3[2];
104 unsigned int clkseldpllmpu; /* offset 0x2c */
105 unsigned int resv4[1];
106 unsigned int idlestdpllddr; /* offset 0x34 */
107 unsigned int resv5[2];
108 unsigned int clkseldpllddr; /* offset 0x40 */
109 unsigned int resv6[4];
110 unsigned int clkseldplldisp; /* offset 0x54 */
111 unsigned int resv7[1];
112 unsigned int idlestdpllcore; /* offset 0x5c */
113 unsigned int resv8[2];
114 unsigned int clkseldpllcore; /* offset 0x68 */
115 unsigned int resv9[1];
116 unsigned int idlestdpllper; /* offset 0x70 */
Ilya Yanok7df5cf32012-11-06 13:48:23 +0000117 unsigned int resv10[2];
118 unsigned int clkdcoldodpllper; /* offset 0x7c */
Chandan Nath56551082011-10-14 02:58:22 +0000119 unsigned int divm4dpllcore; /* offset 0x80 */
120 unsigned int divm5dpllcore; /* offset 0x84 */
121 unsigned int clkmoddpllmpu; /* offset 0x88 */
122 unsigned int clkmoddpllper; /* offset 0x8c */
123 unsigned int clkmoddpllcore; /* offset 0x90 */
124 unsigned int clkmoddpllddr; /* offset 0x94 */
125 unsigned int clkmoddplldisp; /* offset 0x98 */
126 unsigned int clkseldpllper; /* offset 0x9c */
127 unsigned int divm2dpllddr; /* offset 0xA0 */
128 unsigned int divm2dplldisp; /* offset 0xA4 */
129 unsigned int divm2dpllmpu; /* offset 0xA8 */
130 unsigned int divm2dpllper; /* offset 0xAC */
131 unsigned int resv11[1];
132 unsigned int wkup_uart0ctrl; /* offset 0xB4 */
Patil, Rachnab4116ed2012-01-22 23:47:01 +0000133 unsigned int wkup_i2c0ctrl; /* offset 0xB8 */
Hannes Petermaier072cefe2014-02-07 14:06:50 +0100134 unsigned int wkup_adctscctrl; /* offset 0xBC */
Hannes Petermaier25b0a722014-06-04 10:19:26 +0200135 unsigned int resv12;
136 unsigned int timer1clkctrl; /* offset 0xC4 */
137 unsigned int resv13[4];
Chandan Nath56551082011-10-14 02:58:22 +0000138 unsigned int divm6dpllcore; /* offset 0xD8 */
139};
140
141/**
142 * Encapsulating peripheral functional clocks
143 * pll registers
144 */
145struct cm_perpll {
146 unsigned int l4lsclkstctrl; /* offset 0x00 */
147 unsigned int l3sclkstctrl; /* offset 0x04 */
148 unsigned int l4fwclkstctrl; /* offset 0x08 */
149 unsigned int l3clkstctrl; /* offset 0x0c */
Chandan Nathfb072a32012-01-09 20:38:56 +0000150 unsigned int resv1;
151 unsigned int cpgmac0clkctrl; /* offset 0x14 */
Tom Rinid88bc042012-05-21 06:46:31 +0000152 unsigned int lcdclkctrl; /* offset 0x18 */
153 unsigned int usb0clkctrl; /* offset 0x1C */
154 unsigned int resv2;
155 unsigned int tptc0clkctrl; /* offset 0x24 */
Chandan Nath56551082011-10-14 02:58:22 +0000156 unsigned int emifclkctrl; /* offset 0x28 */
157 unsigned int ocmcramclkctrl; /* offset 0x2c */
Chandan Nathfb072a32012-01-09 20:38:56 +0000158 unsigned int gpmcclkctrl; /* offset 0x30 */
Tom Rinid88bc042012-05-21 06:46:31 +0000159 unsigned int mcasp0clkctrl; /* offset 0x34 */
160 unsigned int uart5clkctrl; /* offset 0x38 */
Chandan Nathfb072a32012-01-09 20:38:56 +0000161 unsigned int mmc0clkctrl; /* offset 0x3C */
162 unsigned int elmclkctrl; /* offset 0x40 */
163 unsigned int i2c2clkctrl; /* offset 0x44 */
164 unsigned int i2c1clkctrl; /* offset 0x48 */
165 unsigned int spi0clkctrl; /* offset 0x4C */
166 unsigned int spi1clkctrl; /* offset 0x50 */
Tom Rinid88bc042012-05-21 06:46:31 +0000167 unsigned int resv3[3];
Chandan Nath56551082011-10-14 02:58:22 +0000168 unsigned int l4lsclkctrl; /* offset 0x60 */
169 unsigned int l4fwclkctrl; /* offset 0x64 */
Tom Rinid88bc042012-05-21 06:46:31 +0000170 unsigned int mcasp1clkctrl; /* offset 0x68 */
171 unsigned int uart1clkctrl; /* offset 0x6C */
172 unsigned int uart2clkctrl; /* offset 0x70 */
173 unsigned int uart3clkctrl; /* offset 0x74 */
174 unsigned int uart4clkctrl; /* offset 0x78 */
175 unsigned int timer7clkctrl; /* offset 0x7C */
Chandan Nath56551082011-10-14 02:58:22 +0000176 unsigned int timer2clkctrl; /* offset 0x80 */
Tom Rinid88bc042012-05-21 06:46:31 +0000177 unsigned int timer3clkctrl; /* offset 0x84 */
178 unsigned int timer4clkctrl; /* offset 0x88 */
179 unsigned int resv4[8];
180 unsigned int gpio1clkctrl; /* offset 0xAC */
Chandan Nathfb072a32012-01-09 20:38:56 +0000181 unsigned int gpio2clkctrl; /* offset 0xB0 */
Tom Rinid88bc042012-05-21 06:46:31 +0000182 unsigned int gpio3clkctrl; /* offset 0xB4 */
183 unsigned int resv5;
184 unsigned int tpccclkctrl; /* offset 0xBC */
185 unsigned int dcan0clkctrl; /* offset 0xC0 */
186 unsigned int dcan1clkctrl; /* offset 0xC4 */
Hannes Petermaier072cefe2014-02-07 14:06:50 +0100187 unsigned int resv6;
188 unsigned int epwmss1clkctrl; /* offset 0xCC */
Chandan Nath56551082011-10-14 02:58:22 +0000189 unsigned int emiffwclkctrl; /* offset 0xD0 */
Heiko Schocher14c01582013-08-19 16:38:57 +0200190 unsigned int epwmss0clkctrl; /* offset 0xD4 */
191 unsigned int epwmss2clkctrl; /* offset 0xD8 */
Chandan Nath56551082011-10-14 02:58:22 +0000192 unsigned int l3instrclkctrl; /* offset 0xDC */
193 unsigned int l3clkctrl; /* Offset 0xE0 */
Hannes Petermaier25b0a722014-06-04 10:19:26 +0200194 unsigned int resv8[2];
195 unsigned int timer5clkctrl; /* offset 0xEC */
196 unsigned int timer6clkctrl; /* offset 0xF0 */
Tom Rinid88bc042012-05-21 06:46:31 +0000197 unsigned int mmc1clkctrl; /* offset 0xF4 */
198 unsigned int mmc2clkctrl; /* offset 0xF8 */
199 unsigned int resv9[8];
Chandan Nath56551082011-10-14 02:58:22 +0000200 unsigned int l4hsclkstctrl; /* offset 0x11C */
201 unsigned int l4hsclkctrl; /* offset 0x120 */
Chandan Nathfb072a32012-01-09 20:38:56 +0000202 unsigned int resv10[8];
Tom Rinid88bc042012-05-21 06:46:31 +0000203 unsigned int cpswclkstctrl; /* offset 0x144 */
Heiko Schocher14c01582013-08-19 16:38:57 +0200204 unsigned int lcdcclkstctrl; /* offset 0x148 */
Chandan Nath56551082011-10-14 02:58:22 +0000205};
Lokesh Vutla7ca1b2a2013-12-10 15:02:11 +0530206
207/* Encapsulating Display pll registers */
208struct cm_dpll {
Hannes Petermaier25b0a722014-06-04 10:19:26 +0200209 unsigned int resv1;
210 unsigned int clktimer7clk; /* offset 0x04 */
Lokesh Vutla7ca1b2a2013-12-10 15:02:11 +0530211 unsigned int clktimer2clk; /* offset 0x08 */
Hannes Petermaier25b0a722014-06-04 10:19:26 +0200212 unsigned int clktimer3clk; /* offset 0x0C */
213 unsigned int clktimer4clk; /* offset 0x10 */
214 unsigned int resv2;
215 unsigned int clktimer5clk; /* offset 0x18 */
216 unsigned int clktimer6clk; /* offset 0x1C */
217 unsigned int resv3[2];
218 unsigned int clktimer1clk; /* offset 0x28 */
219 unsigned int resv4[2];
Lokesh Vutla7ca1b2a2013-12-10 15:02:11 +0530220 unsigned int clklcdcpixelclk; /* offset 0x34 */
221};
Lokesh Vutlac06e4982013-07-30 11:36:28 +0530222#else
223/* Encapsulating core pll registers */
224struct cm_wkuppll {
225 unsigned int resv0[136];
226 unsigned int wkl4wkclkctrl; /* offset 0x220 */
227 unsigned int resv1[55];
228 unsigned int wkclkstctrl; /* offset 0x300 */
229 unsigned int resv2[15];
230 unsigned int wkup_i2c0ctrl; /* offset 0x340 */
231 unsigned int resv3;
232 unsigned int wkup_uart0ctrl; /* offset 0x348 */
233 unsigned int resv4[5];
234 unsigned int wkctrlclkctrl; /* offset 0x360 */
235 unsigned int resv5;
236 unsigned int wkgpio0clkctrl; /* offset 0x368 */
237
238 unsigned int resv6[109];
239 unsigned int clkmoddpllcore; /* offset 0x520 */
240 unsigned int idlestdpllcore; /* offset 0x524 */
241 unsigned int resv61;
242 unsigned int clkseldpllcore; /* offset 0x52C */
243 unsigned int resv7[2];
244 unsigned int divm4dpllcore; /* offset 0x538 */
245 unsigned int divm5dpllcore; /* offset 0x53C */
246 unsigned int divm6dpllcore; /* offset 0x540 */
247
248 unsigned int resv8[7];
249 unsigned int clkmoddpllmpu; /* offset 0x560 */
250 unsigned int idlestdpllmpu; /* offset 0x564 */
251 unsigned int resv9;
252 unsigned int clkseldpllmpu; /* offset 0x56c */
253 unsigned int divm2dpllmpu; /* offset 0x570 */
254
255 unsigned int resv10[11];
256 unsigned int clkmoddpllddr; /* offset 0x5A0 */
257 unsigned int idlestdpllddr; /* offset 0x5A4 */
258 unsigned int resv11;
259 unsigned int clkseldpllddr; /* offset 0x5AC */
260 unsigned int divm2dpllddr; /* offset 0x5B0 */
261
262 unsigned int resv12[11];
263 unsigned int clkmoddpllper; /* offset 0x5E0 */
264 unsigned int idlestdpllper; /* offset 0x5E4 */
265 unsigned int resv13;
266 unsigned int clkseldpllper; /* offset 0x5EC */
267 unsigned int divm2dpllper; /* offset 0x5F0 */
268 unsigned int resv14[8];
269 unsigned int clkdcoldodpllper; /* offset 0x614 */
270
271 unsigned int resv15[2];
272 unsigned int clkmoddplldisp; /* offset 0x620 */
273 unsigned int resv16[2];
274 unsigned int clkseldplldisp; /* offset 0x62C */
275 unsigned int divm2dplldisp; /* offset 0x630 */
276};
277
278/*
279 * Encapsulating peripheral functional clocks
280 * pll registers
281 */
282struct cm_perpll {
283 unsigned int l3clkstctrl; /* offset 0x00 */
284 unsigned int resv0[7];
285 unsigned int l3clkctrl; /* Offset 0x20 */
286 unsigned int resv1[7];
287 unsigned int l3instrclkctrl; /* offset 0x40 */
288 unsigned int resv2[3];
289 unsigned int ocmcramclkctrl; /* offset 0x50 */
290 unsigned int resv3[9];
291 unsigned int tpccclkctrl; /* offset 0x78 */
292 unsigned int resv4;
293 unsigned int tptc0clkctrl; /* offset 0x80 */
294
295 unsigned int resv5[7];
296 unsigned int l4hsclkctrl; /* offset 0x0A0 */
297 unsigned int resv6;
298 unsigned int l4fwclkctrl; /* offset 0x0A8 */
299 unsigned int resv7[85];
300 unsigned int l3sclkstctrl; /* offset 0x200 */
301 unsigned int resv8[7];
302 unsigned int gpmcclkctrl; /* offset 0x220 */
303 unsigned int resv9[5];
304 unsigned int mcasp0clkctrl; /* offset 0x238 */
305 unsigned int resv10;
306 unsigned int mcasp1clkctrl; /* offset 0x240 */
307 unsigned int resv11;
308 unsigned int mmc2clkctrl; /* offset 0x248 */
Sourav Poddarb56e71e2013-12-21 12:50:12 +0530309 unsigned int resv12[3];
310 unsigned int qspiclkctrl; /* offset 0x258 */
311 unsigned int resv121;
Lokesh Vutlac06e4982013-07-30 11:36:28 +0530312 unsigned int usb0clkctrl; /* offset 0x260 */
313 unsigned int resv13[103];
314 unsigned int l4lsclkstctrl; /* offset 0x400 */
315 unsigned int resv14[7];
316 unsigned int l4lsclkctrl; /* offset 0x420 */
317 unsigned int resv15;
318 unsigned int dcan0clkctrl; /* offset 0x428 */
319 unsigned int resv16;
320 unsigned int dcan1clkctrl; /* offset 0x430 */
321 unsigned int resv17[13];
322 unsigned int elmclkctrl; /* offset 0x468 */
323
324 unsigned int resv18[3];
325 unsigned int gpio1clkctrl; /* offset 0x478 */
326 unsigned int resv19;
327 unsigned int gpio2clkctrl; /* offset 0x480 */
328 unsigned int resv20;
329 unsigned int gpio3clkctrl; /* offset 0x488 */
Dave Gerlachcd8341b2014-02-10 11:41:49 -0500330 unsigned int resv41;
331 unsigned int gpio4clkctrl; /* offset 0x490 */
332 unsigned int resv42;
333 unsigned int gpio5clkctrl; /* offset 0x498 */
334 unsigned int resv21[3];
Lokesh Vutlac06e4982013-07-30 11:36:28 +0530335
336 unsigned int i2c1clkctrl; /* offset 0x4A8 */
337 unsigned int resv22;
338 unsigned int i2c2clkctrl; /* offset 0x4B0 */
339 unsigned int resv23[3];
340 unsigned int mmc0clkctrl; /* offset 0x4C0 */
341 unsigned int resv24;
342 unsigned int mmc1clkctrl; /* offset 0x4C8 */
343
344 unsigned int resv25[13];
345 unsigned int spi0clkctrl; /* offset 0x500 */
346 unsigned int resv26;
347 unsigned int spi1clkctrl; /* offset 0x508 */
348 unsigned int resv27[9];
349 unsigned int timer2clkctrl; /* offset 0x530 */
350 unsigned int resv28;
351 unsigned int timer3clkctrl; /* offset 0x538 */
352 unsigned int resv29;
353 unsigned int timer4clkctrl; /* offset 0x540 */
354 unsigned int resv30[5];
355 unsigned int timer7clkctrl; /* offset 0x558 */
356
357 unsigned int resv31[9];
358 unsigned int uart1clkctrl; /* offset 0x580 */
359 unsigned int resv32;
360 unsigned int uart2clkctrl; /* offset 0x588 */
361 unsigned int resv33;
362 unsigned int uart3clkctrl; /* offset 0x590 */
363 unsigned int resv34;
364 unsigned int uart4clkctrl; /* offset 0x598 */
365 unsigned int resv35;
366 unsigned int uart5clkctrl; /* offset 0x5A0 */
367 unsigned int resv36[87];
368
369 unsigned int emifclkstctrl; /* offset 0x700 */
370 unsigned int resv361[7];
371 unsigned int emifclkctrl; /* offset 0x720 */
372 unsigned int resv37[3];
373 unsigned int emiffwclkctrl; /* offset 0x730 */
374 unsigned int resv371;
375 unsigned int otfaemifclkctrl; /* offset 0x738 */
376 unsigned int resv38[57];
377 unsigned int lcdclkctrl; /* offset 0x820 */
378 unsigned int resv39[183];
379 unsigned int cpswclkstctrl; /* offset 0xB00 */
380 unsigned int resv40[7];
381 unsigned int cpgmac0clkctrl; /* offset 0xB20 */
382};
Chandan Nath56551082011-10-14 02:58:22 +0000383
Lokesh Vutlad3daba12013-12-10 15:02:22 +0530384struct cm_device_inst {
385 unsigned int cm_clkout1_ctrl;
386 unsigned int cm_dll_ctrl;
387};
388
Chandan Nath56551082011-10-14 02:58:22 +0000389struct cm_dpll {
Lokesh Vutla7ca1b2a2013-12-10 15:02:11 +0530390 unsigned int resv1;
391 unsigned int clktimer2clk; /* offset 0x04 */
Chandan Nath56551082011-10-14 02:58:22 +0000392};
Lokesh Vutla7ca1b2a2013-12-10 15:02:11 +0530393#endif /* CONFIG_AM43XX */
Chandan Nath56551082011-10-14 02:58:22 +0000394
Vaibhav Hiremath000820b2012-03-08 17:15:47 +0530395/* Control Module RTC registers */
396struct cm_rtc {
397 unsigned int rtcclkctrl; /* offset 0x0 */
398 unsigned int clkstctrl; /* offset 0x4 */
399};
400
Chandan Nath56551082011-10-14 02:58:22 +0000401/* Watchdog timer registers */
402struct wd_timer {
403 unsigned int resv1[4];
404 unsigned int wdtwdsc; /* offset 0x010 */
405 unsigned int wdtwdst; /* offset 0x014 */
406 unsigned int wdtwisr; /* offset 0x018 */
407 unsigned int wdtwier; /* offset 0x01C */
408 unsigned int wdtwwer; /* offset 0x020 */
409 unsigned int wdtwclr; /* offset 0x024 */
410 unsigned int wdtwcrr; /* offset 0x028 */
411 unsigned int wdtwldr; /* offset 0x02C */
412 unsigned int wdtwtgr; /* offset 0x030 */
413 unsigned int wdtwwps; /* offset 0x034 */
414 unsigned int resv2[3];
415 unsigned int wdtwdly; /* offset 0x044 */
416 unsigned int wdtwspr; /* offset 0x048 */
417 unsigned int resv3[1];
418 unsigned int wdtwqeoi; /* offset 0x050 */
419 unsigned int wdtwqstar; /* offset 0x054 */
420 unsigned int wdtwqsta; /* offset 0x058 */
421 unsigned int wdtwqens; /* offset 0x05C */
422 unsigned int wdtwqenc; /* offset 0x060 */
423 unsigned int resv4[39];
424 unsigned int wdt_unfr; /* offset 0x100 */
425};
426
Chandan Nath56551082011-10-14 02:58:22 +0000427/* Timer 32 bit registers */
428struct gptimer {
429 unsigned int tidr; /* offset 0x00 */
Chandan Nathfb072a32012-01-09 20:38:56 +0000430 unsigned char res1[12];
Chandan Nath56551082011-10-14 02:58:22 +0000431 unsigned int tiocp_cfg; /* offset 0x10 */
Chandan Nathfb072a32012-01-09 20:38:56 +0000432 unsigned char res2[12];
Chandan Nath56551082011-10-14 02:58:22 +0000433 unsigned int tier; /* offset 0x20 */
434 unsigned int tistatr; /* offset 0x24 */
435 unsigned int tistat; /* offset 0x28 */
436 unsigned int tisr; /* offset 0x2c */
437 unsigned int tcicr; /* offset 0x30 */
438 unsigned int twer; /* offset 0x34 */
439 unsigned int tclr; /* offset 0x38 */
440 unsigned int tcrr; /* offset 0x3c */
441 unsigned int tldr; /* offset 0x40 */
442 unsigned int ttgr; /* offset 0x44 */
443 unsigned int twpc; /* offset 0x48 */
444 unsigned int tmar; /* offset 0x4c */
445 unsigned int tcar1; /* offset 0x50 */
446 unsigned int tscir; /* offset 0x54 */
447 unsigned int tcar2; /* offset 0x58 */
448};
449
450/* UART Registers */
451struct uart_sys {
452 unsigned int resv1[21];
453 unsigned int uartsyscfg; /* offset 0x54 */
454 unsigned int uartsyssts; /* offset 0x58 */
455};
456
457/* VTP Registers */
458struct vtp_reg {
459 unsigned int vtp0ctrlreg;
460};
461
462/* Control Status Register */
463struct ctrl_stat {
464 unsigned int resv1[16];
465 unsigned int statusreg; /* ofset 0x40 */
Satyanarayana, Sandhya6995a282012-08-09 18:29:57 +0000466 unsigned int resv2[51];
467 unsigned int secure_emif_sdram_config; /* offset 0x0110 */
Lokesh Vutlacf04d032013-12-10 15:02:20 +0530468 unsigned int resv3[319];
469 unsigned int dev_attr;
Chandan Nath56551082011-10-14 02:58:22 +0000470};
Steve Sakoman3b971522012-06-04 05:35:34 +0000471
472/* AM33XX GPIO registers */
473#define OMAP_GPIO_REVISION 0x0000
474#define OMAP_GPIO_SYSCONFIG 0x0010
475#define OMAP_GPIO_SYSSTATUS 0x0114
476#define OMAP_GPIO_IRQSTATUS1 0x002c
477#define OMAP_GPIO_IRQSTATUS2 0x0030
478#define OMAP_GPIO_CTRL 0x0130
479#define OMAP_GPIO_OE 0x0134
480#define OMAP_GPIO_DATAIN 0x0138
481#define OMAP_GPIO_DATAOUT 0x013c
482#define OMAP_GPIO_LEVELDETECT0 0x0140
483#define OMAP_GPIO_LEVELDETECT1 0x0144
484#define OMAP_GPIO_RISINGDETECT 0x0148
485#define OMAP_GPIO_FALLINGDETECT 0x014c
486#define OMAP_GPIO_DEBOUNCE_EN 0x0150
487#define OMAP_GPIO_DEBOUNCE_VAL 0x0154
488#define OMAP_GPIO_CLEARDATAOUT 0x0190
489#define OMAP_GPIO_SETDATAOUT 0x0194
490
Chandan Nathe79cd8e2012-07-24 12:22:17 +0000491/* Control Device Register */
492struct ctrl_dev {
493 unsigned int deviceid; /* offset 0x00 */
Ilya Yanok7df5cf32012-11-06 13:48:23 +0000494 unsigned int resv1[7];
495 unsigned int usb_ctrl0; /* offset 0x20 */
496 unsigned int resv2;
497 unsigned int usb_ctrl1; /* offset 0x28 */
498 unsigned int resv3;
Chandan Nathe79cd8e2012-07-24 12:22:17 +0000499 unsigned int macid0l; /* offset 0x30 */
500 unsigned int macid0h; /* offset 0x34 */
501 unsigned int macid1l; /* offset 0x38 */
502 unsigned int macid1h; /* offset 0x3c */
Ilya Yanok7df5cf32012-11-06 13:48:23 +0000503 unsigned int resv4[4];
Chandan Nathe79cd8e2012-07-24 12:22:17 +0000504 unsigned int miisel; /* offset 0x50 */
Tom Rini52879462013-08-30 16:28:45 -0400505 unsigned int resv5[106];
506 unsigned int efuse_sma; /* offset 0x1FC */
Chandan Nathe79cd8e2012-07-24 12:22:17 +0000507};
Heiko Schocherdafd4db2013-08-19 16:38:56 +0200508
509/* gmii_sel register defines */
510#define GMII1_SEL_MII 0x0
511#define GMII1_SEL_RMII 0x1
512#define GMII1_SEL_RGMII 0x2
513#define GMII2_SEL_MII 0x0
514#define GMII2_SEL_RMII 0x4
515#define GMII2_SEL_RGMII 0x8
516#define RGMII1_IDMODE BIT(4)
517#define RGMII2_IDMODE BIT(5)
518#define RMII1_IO_CLK_EN BIT(6)
519#define RMII2_IO_CLK_EN BIT(7)
520
521#define MII_MODE_ENABLE (GMII1_SEL_MII | GMII2_SEL_MII)
522#define RMII_MODE_ENABLE (GMII1_SEL_RMII | GMII2_SEL_RMII)
523#define RGMII_MODE_ENABLE (GMII1_SEL_RGMII | GMII2_SEL_RGMII)
524#define RGMII_INT_DELAY (RGMII1_IDMODE | RGMII2_IDMODE)
525#define RMII_CHIPCKL_ENABLE (RMII1_IO_CLK_EN | RMII2_IO_CLK_EN)
526
Heiko Schocher14c01582013-08-19 16:38:57 +0200527/* PWMSS */
528struct pwmss_regs {
529 unsigned int idver;
530 unsigned int sysconfig;
531 unsigned int clkconfig;
532 unsigned int clkstatus;
533};
534#define ECAP_CLK_EN BIT(0)
535#define ECAP_CLK_STOP_REQ BIT(1)
536
537struct pwmss_ecap_regs {
538 unsigned int tsctr;
539 unsigned int ctrphs;
540 unsigned int cap1;
541 unsigned int cap2;
542 unsigned int cap3;
543 unsigned int cap4;
544 unsigned int resv1[4];
545 unsigned short ecctl1;
546 unsigned short ecctl2;
547};
548
549/* Capture Control register 2 */
550#define ECTRL2_SYNCOSEL_MASK (0x03 << 6)
551#define ECTRL2_MDSL_ECAP BIT(9)
552#define ECTRL2_CTRSTP_FREERUN BIT(4)
553#define ECTRL2_PLSL_LOW BIT(10)
554#define ECTRL2_SYNC_EN BIT(5)
555
Chandan Nath56551082011-10-14 02:58:22 +0000556#endif /* __ASSEMBLY__ */
557#endif /* __KERNEL_STRICT_NAMES */
558
559#endif /* _AM33XX_CPU_H */