]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/arm/include/asm/arch-am33xx/cpu.h
karo: merge with Ka-Ro specific tree for secure boot support
[karo-tx-uboot.git] / arch / arm / include / asm / arch-am33xx / cpu.h
1 /*
2  * cpu.h
3  *
4  * AM33xx specific header file
5  *
6  * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
7  *
8  * SPDX-License-Identifier:     GPL-2.0+
9  */
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 */
29 #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 */
36
37 #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 */
40 /* 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
47 /* cpu-id for AM33XX and TI81XX family */
48 #define AM335X                          0xB944
49 #define TI81XX                          0xB81E
50 #define DEVICE_ID                       (CTRL_BASE + 0x0600)
51 #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
61
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
66 #define PRM_RSTCTRL_RESET               0x01
67 #define PRM_RSTST_WARM_RESET_MASK       0x232
68
69 /*
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
89 #ifndef __KERNEL_STRICT_NAMES
90 #ifndef __ASSEMBLY__
91
92
93 #ifndef CONFIG_AM43XX
94 /* Encapsulating core pll registers */
95 struct cm_wkuppll {
96         unsigned int wkclkstctrl;       /* offset 0x00 */
97         unsigned int wkctrlclkctrl;     /* offset 0x04 */
98         unsigned int wkgpio0clkctrl;    /* offset 0x08 */
99         unsigned int wkl4wkclkctrl;     /* offset 0x0c */
100         unsigned int timer0clkctrl;     /* offset 0x10 */
101         unsigned int resv2[3];
102         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 autoidledplldisp;  /* offset 0x44 */
110         unsigned int idlestdplldisp;    /* offset 0x48 */
111         unsigned int resv6[2];
112         unsigned int clkseldplldisp;    /* offset 0x54 */
113         unsigned int resv7[1];
114         unsigned int idlestdpllcore;    /* offset 0x5c */
115         unsigned int resv8[2];
116         unsigned int clkseldpllcore;    /* offset 0x68 */
117         unsigned int resv9[1];
118         unsigned int idlestdpllper;     /* offset 0x70 */
119         unsigned int resv10[2];
120         unsigned int clkdcoldodpllper;  /* offset 0x7c */
121         unsigned int divm4dpllcore;     /* offset 0x80 */
122         unsigned int divm5dpllcore;     /* offset 0x84 */
123         unsigned int clkmoddpllmpu;     /* offset 0x88 */
124         unsigned int clkmoddpllper;     /* offset 0x8c */
125         unsigned int clkmoddpllcore;    /* offset 0x90 */
126         unsigned int clkmoddpllddr;     /* offset 0x94 */
127         unsigned int clkmoddplldisp;    /* offset 0x98 */
128         unsigned int clkseldpllper;     /* offset 0x9c */
129         unsigned int divm2dpllddr;      /* offset 0xA0 */
130         unsigned int divm2dplldisp;     /* offset 0xA4 */
131         unsigned int divm2dpllmpu;      /* offset 0xA8 */
132         unsigned int divm2dpllper;      /* offset 0xAC */
133         unsigned int resv11[1];
134         unsigned int wkup_uart0ctrl;    /* offset 0xB4 */
135         unsigned int wkup_i2c0ctrl;     /* offset 0xB8 */
136         unsigned int wkup_adctscctrl;   /* offset 0xBC */
137         unsigned int resv12;
138         unsigned int timer1clkctrl;     /* offset 0xC4 */
139         unsigned int resv13[4];
140         unsigned int divm6dpllcore;     /* offset 0xD8 */
141 };
142
143 /**
144  * Encapsulating peripheral functional clocks
145  * pll registers
146  */
147 struct cm_perpll {
148         unsigned int l4lsclkstctrl;     /* offset 0x00 */
149         unsigned int l3sclkstctrl;      /* offset 0x04 */
150         unsigned int l4fwclkstctrl;     /* offset 0x08 */
151         unsigned int l3clkstctrl;       /* offset 0x0c */
152         unsigned int resv1;
153         unsigned int cpgmac0clkctrl;    /* offset 0x14 */
154         unsigned int lcdclkctrl;        /* offset 0x18 */
155         unsigned int usb0clkctrl;       /* offset 0x1c */
156         unsigned int resv2;
157         unsigned int tptc0clkctrl;      /* offset 0x24 */
158         unsigned int emifclkctrl;       /* offset 0x28 */
159         unsigned int ocmcramclkctrl;    /* offset 0x2c */
160         unsigned int gpmcclkctrl;       /* offset 0x30 */
161         unsigned int mcasp0clkctrl;     /* offset 0x34 */
162         unsigned int uart5clkctrl;      /* offset 0x38 */
163         unsigned int mmc0clkctrl;       /* offset 0x3C */
164         unsigned int elmclkctrl;        /* offset 0x40 */
165         unsigned int i2c2clkctrl;       /* offset 0x44 */
166         unsigned int i2c1clkctrl;       /* offset 0x48 */
167         unsigned int spi0clkctrl;       /* offset 0x4C */
168         unsigned int spi1clkctrl;       /* offset 0x50 */
169         unsigned int resv3[3];
170         unsigned int l4lsclkctrl;       /* offset 0x60 */
171         unsigned int l4fwclkctrl;       /* offset 0x64 */
172         unsigned int mcasp1clkctrl;     /* offset 0x68 */
173         unsigned int uart1clkctrl;      /* offset 0x6C */
174         unsigned int uart2clkctrl;      /* offset 0x70 */
175         unsigned int uart3clkctrl;      /* offset 0x74 */
176         unsigned int uart4clkctrl;      /* offset 0x78 */
177         unsigned int timer7clkctrl;     /* offset 0x7C */
178         unsigned int timer2clkctrl;     /* offset 0x80 */
179         unsigned int timer3clkctrl;     /* offset 0x84 */
180         unsigned int timer4clkctrl;     /* offset 0x88 */
181         unsigned int resv4[8];
182         unsigned int gpio1clkctrl;      /* offset 0xAC */
183         unsigned int gpio2clkctrl;      /* offset 0xB0 */
184         unsigned int gpio3clkctrl;      /* offset 0xB4 */
185         unsigned int resv5;
186         unsigned int tpccclkctrl;       /* offset 0xBC */
187         unsigned int dcan0clkctrl;      /* offset 0xC0 */
188         unsigned int dcan1clkctrl;      /* offset 0xC4 */
189         unsigned int resv6;
190         unsigned int epwmss1clkctrl;    /* offset 0xCC */
191         unsigned int emiffwclkctrl;     /* offset 0xD0 */
192         unsigned int epwmss0clkctrl;    /* offset 0xD4 */
193         unsigned int epwmss2clkctrl;    /* offset 0xD8 */
194         unsigned int l3instrclkctrl;    /* offset 0xDC */
195         unsigned int l3clkctrl;         /* Offset 0xE0 */
196         unsigned int resv8[2];
197         unsigned int timer5clkctrl;     /* offset 0xEC */
198         unsigned int timer6clkctrl;     /* offset 0xF0 */
199         unsigned int mmc1clkctrl;       /* offset 0xF4 */
200         unsigned int mmc2clkctrl;       /* offset 0xF8 */
201         unsigned int resv9[8];
202         unsigned int l4hsclkstctrl;     /* offset 0x11C */
203         unsigned int l4hsclkctrl;       /* offset 0x120 */
204         unsigned int resv10[8];
205         unsigned int cpswclkstctrl;     /* offset 0x144 */
206         unsigned int lcdcclkstctrl;     /* offset 0x148 */
207 };
208
209 /* Encapsulating Display pll registers */
210 struct cm_dpll {
211         unsigned int resv1;
212         unsigned int clktimer7clk;      /* offset 0x04 */
213         unsigned int clktimer2clk;      /* offset 0x08 */
214         unsigned int clktimer3clk;      /* offset 0x0C */
215         unsigned int clktimer4clk;      /* offset 0x10 */
216         unsigned int resv2;
217         unsigned int clktimer5clk;      /* offset 0x18 */
218         unsigned int clktimer6clk;      /* offset 0x1C */
219         unsigned int resv3[2];
220         unsigned int clktimer1clk;      /* offset 0x28 */
221         unsigned int resv4[2];
222         unsigned int clklcdcpixelclk;   /* offset 0x34 */
223 };
224 #else
225 /* Encapsulating core pll registers */
226 struct cm_wkuppll {
227         unsigned int resv0[136];
228         unsigned int wkl4wkclkctrl;     /* offset 0x220 */
229         unsigned int resv1[55];
230         unsigned int wkclkstctrl;       /* offset 0x300 */
231         unsigned int resv2[15];
232         unsigned int wkup_i2c0ctrl;     /* offset 0x340 */
233         unsigned int resv3;
234         unsigned int wkup_uart0ctrl;    /* offset 0x348 */
235         unsigned int resv4[5];
236         unsigned int wkctrlclkctrl;     /* offset 0x360 */
237         unsigned int resv5;
238         unsigned int wkgpio0clkctrl;    /* offset 0x368 */
239
240         unsigned int resv6[109];
241         unsigned int clkmoddpllcore;    /* offset 0x520 */
242         unsigned int idlestdpllcore;    /* offset 0x524 */
243         unsigned int resv61;
244         unsigned int clkseldpllcore;    /* offset 0x52C */
245         unsigned int resv7[2];
246         unsigned int divm4dpllcore;     /* offset 0x538 */
247         unsigned int divm5dpllcore;     /* offset 0x53C */
248         unsigned int divm6dpllcore;     /* offset 0x540 */
249
250         unsigned int resv8[7];
251         unsigned int clkmoddpllmpu;     /* offset 0x560 */
252         unsigned int idlestdpllmpu;     /* offset 0x564 */
253         unsigned int resv9;
254         unsigned int clkseldpllmpu;     /* offset 0x56c */
255         unsigned int divm2dpllmpu;      /* offset 0x570 */
256
257         unsigned int resv10[11];
258         unsigned int clkmoddpllddr;     /* offset 0x5A0 */
259         unsigned int idlestdpllddr;     /* offset 0x5A4 */
260         unsigned int resv11;
261         unsigned int clkseldpllddr;     /* offset 0x5AC */
262         unsigned int divm2dpllddr;      /* offset 0x5B0 */
263
264         unsigned int resv12[11];
265         unsigned int clkmoddpllper;     /* offset 0x5E0 */
266         unsigned int idlestdpllper;     /* offset 0x5E4 */
267         unsigned int resv13;
268         unsigned int clkseldpllper;     /* offset 0x5EC */
269         unsigned int divm2dpllper;      /* offset 0x5F0 */
270         unsigned int resv14[8];
271         unsigned int clkdcoldodpllper;  /* offset 0x614 */
272
273         unsigned int resv15[2];
274         unsigned int clkmoddplldisp;    /* offset 0x620 */
275         unsigned int resv16[2];
276         unsigned int clkseldplldisp;    /* offset 0x62C */
277         unsigned int divm2dplldisp;     /* offset 0x630 */
278 };
279
280 /*
281  * Encapsulating peripheral functional clocks
282  * pll registers
283  */
284 struct cm_perpll {
285         unsigned int l3clkstctrl;       /* offset 0x00 */
286         unsigned int resv0[7];
287         unsigned int l3clkctrl;         /* Offset 0x20 */
288         unsigned int resv1[7];
289         unsigned int l3instrclkctrl;    /* offset 0x40 */
290         unsigned int resv2[3];
291         unsigned int ocmcramclkctrl;    /* offset 0x50 */
292         unsigned int resv3[9];
293         unsigned int tpccclkctrl;       /* offset 0x78 */
294         unsigned int resv4;
295         unsigned int tptc0clkctrl;      /* offset 0x80 */
296
297         unsigned int resv5[7];
298         unsigned int l4hsclkctrl;       /* offset 0x0A0 */
299         unsigned int resv6;
300         unsigned int l4fwclkctrl;       /* offset 0x0A8 */
301         unsigned int resv7[85];
302         unsigned int l3sclkstctrl;      /* offset 0x200 */
303         unsigned int resv8[7];
304         unsigned int gpmcclkctrl;       /* offset 0x220 */
305         unsigned int resv9[5];
306         unsigned int mcasp0clkctrl;     /* offset 0x238 */
307         unsigned int resv10;
308         unsigned int mcasp1clkctrl;     /* offset 0x240 */
309         unsigned int resv11;
310         unsigned int mmc2clkctrl;       /* offset 0x248 */
311         unsigned int resv12[3];
312         unsigned int qspiclkctrl;       /* offset 0x258 */
313         unsigned int resv121;
314         unsigned int usb0clkctrl;       /* offset 0x260 */
315         unsigned int resv13[103];
316         unsigned int l4lsclkstctrl;     /* offset 0x400 */
317         unsigned int resv14[7];
318         unsigned int l4lsclkctrl;       /* offset 0x420 */
319         unsigned int resv15;
320         unsigned int dcan0clkctrl;      /* offset 0x428 */
321         unsigned int resv16;
322         unsigned int dcan1clkctrl;      /* offset 0x430 */
323         unsigned int resv17[13];
324         unsigned int elmclkctrl;        /* offset 0x468 */
325
326         unsigned int resv18[3];
327         unsigned int gpio1clkctrl;      /* offset 0x478 */
328         unsigned int resv19;
329         unsigned int gpio2clkctrl;      /* offset 0x480 */
330         unsigned int resv20;
331         unsigned int gpio3clkctrl;      /* offset 0x488 */
332         unsigned int resv41;
333         unsigned int gpio4clkctrl;      /* offset 0x490 */
334         unsigned int resv42;
335         unsigned int gpio5clkctrl;      /* offset 0x498 */
336         unsigned int resv21[3];
337
338         unsigned int i2c1clkctrl;       /* offset 0x4A8 */
339         unsigned int resv22;
340         unsigned int i2c2clkctrl;       /* offset 0x4B0 */
341         unsigned int resv23[3];
342         unsigned int mmc0clkctrl;       /* offset 0x4C0 */
343         unsigned int resv24;
344         unsigned int mmc1clkctrl;       /* offset 0x4C8 */
345
346         unsigned int resv25[13];
347         unsigned int spi0clkctrl;       /* offset 0x500 */
348         unsigned int resv26;
349         unsigned int spi1clkctrl;       /* offset 0x508 */
350         unsigned int resv27[9];
351         unsigned int timer2clkctrl;     /* offset 0x530 */
352         unsigned int resv28;
353         unsigned int timer3clkctrl;     /* offset 0x538 */
354         unsigned int resv29;
355         unsigned int timer4clkctrl;     /* offset 0x540 */
356         unsigned int resv30[5];
357         unsigned int timer7clkctrl;     /* offset 0x558 */
358
359         unsigned int resv31[9];
360         unsigned int uart1clkctrl;      /* offset 0x580 */
361         unsigned int resv32;
362         unsigned int uart2clkctrl;      /* offset 0x588 */
363         unsigned int resv33;
364         unsigned int uart3clkctrl;      /* offset 0x590 */
365         unsigned int resv34;
366         unsigned int uart4clkctrl;      /* offset 0x598 */
367         unsigned int resv35;
368         unsigned int uart5clkctrl;      /* offset 0x5A0 */
369         unsigned int resv36[87];
370
371         unsigned int emifclkstctrl;     /* offset 0x700 */
372         unsigned int resv361[7];
373         unsigned int emifclkctrl;       /* offset 0x720 */
374         unsigned int resv37[3];
375         unsigned int emiffwclkctrl;     /* offset 0x730 */
376         unsigned int resv371;
377         unsigned int otfaemifclkctrl;   /* offset 0x738 */
378         unsigned int resv38[57];
379         unsigned int lcdclkctrl;        /* offset 0x820 */
380         unsigned int resv39[183];
381         unsigned int cpswclkstctrl;     /* offset 0xB00 */
382         unsigned int resv40[7];
383         unsigned int cpgmac0clkctrl;    /* offset 0xB20 */
384 };
385
386 struct cm_device_inst {
387         unsigned int cm_clkout1_ctrl;
388         unsigned int cm_dll_ctrl;
389 };
390
391 struct cm_dpll {
392         unsigned int resv1;
393         unsigned int clktimer2clk;      /* offset 0x04 */
394 };
395 #endif /* CONFIG_AM43XX */
396
397 /* Control Module RTC registers */
398 struct cm_rtc {
399         unsigned int rtcclkctrl;        /* offset 0x0 */
400         unsigned int clkstctrl;         /* offset 0x4 */
401 };
402
403 /* Watchdog timer registers */
404 struct wd_timer {
405         unsigned int resv1[4];
406         unsigned int wdtwdsc;   /* offset 0x010 */
407         unsigned int wdtwdst;   /* offset 0x014 */
408         unsigned int wdtwisr;   /* offset 0x018 */
409         unsigned int wdtwier;   /* offset 0x01C */
410         unsigned int wdtwwer;   /* offset 0x020 */
411         unsigned int wdtwclr;   /* offset 0x024 */
412         unsigned int wdtwcrr;   /* offset 0x028 */
413         unsigned int wdtwldr;   /* offset 0x02C */
414         unsigned int wdtwtgr;   /* offset 0x030 */
415         unsigned int wdtwwps;   /* offset 0x034 */
416         unsigned int resv2[3];
417         unsigned int wdtwdly;   /* offset 0x044 */
418         unsigned int wdtwspr;   /* offset 0x048 */
419         unsigned int resv3[1];
420         unsigned int wdtwqeoi;  /* offset 0x050 */
421         unsigned int wdtwqstar; /* offset 0x054 */
422         unsigned int wdtwqsta;  /* offset 0x058 */
423         unsigned int wdtwqens;  /* offset 0x05C */
424         unsigned int wdtwqenc;  /* offset 0x060 */
425         unsigned int resv4[39];
426         unsigned int wdt_unfr;  /* offset 0x100 */
427 };
428
429 /* Timer 32 bit registers */
430 struct gptimer {
431         unsigned int tidr;              /* offset 0x00 */
432         unsigned char res1[12];
433         unsigned int tiocp_cfg;         /* offset 0x10 */
434         unsigned char res2[12];
435         unsigned int tier;              /* offset 0x20 */
436         unsigned int tistatr;           /* offset 0x24 */
437         unsigned int tistat;            /* offset 0x28 */
438         unsigned int tisr;              /* offset 0x2c */
439         unsigned int tcicr;             /* offset 0x30 */
440         unsigned int twer;              /* offset 0x34 */
441         unsigned int tclr;              /* offset 0x38 */
442         unsigned int tcrr;              /* offset 0x3c */
443         unsigned int tldr;              /* offset 0x40 */
444         unsigned int ttgr;              /* offset 0x44 */
445         unsigned int twpc;              /* offset 0x48 */
446         unsigned int tmar;              /* offset 0x4c */
447         unsigned int tcar1;             /* offset 0x50 */
448         unsigned int tsicr;             /* offset 0x54 */
449         unsigned int tcar2;             /* offset 0x58 */
450 };
451
452 /* UART Registers */
453 struct uart_sys {
454         unsigned int resv1[21];
455         unsigned int uartsyscfg;        /* offset 0x54 */
456         unsigned int uartsyssts;        /* offset 0x58 */
457 };
458
459 /* VTP Registers */
460 struct vtp_reg {
461         unsigned int vtp0ctrlreg;
462 };
463
464 /* Control Status Register */
465 struct ctrl_stat {
466         unsigned int resv1[16];
467         unsigned int statusreg;         /* ofset 0x40 */
468         unsigned int resv2[51];
469         unsigned int emif_sdram_config; /* offset 0x0110 */
470         unsigned int resv3[319];
471         unsigned int dev_attr;
472 };
473
474 /* AM33XX GPIO registers */
475 #define OMAP_GPIO_REVISION              0x0000
476 #define OMAP_GPIO_SYSCONFIG             0x0010
477 #define OMAP_GPIO_SYSSTATUS             0x0114
478 #define OMAP_GPIO_IRQSTATUS1            0x002c
479 #define OMAP_GPIO_IRQSTATUS2            0x0030
480 #define OMAP_GPIO_CTRL                  0x0130
481 #define OMAP_GPIO_OE                    0x0134
482 #define OMAP_GPIO_DATAIN                0x0138
483 #define OMAP_GPIO_DATAOUT               0x013c
484 #define OMAP_GPIO_LEVELDETECT0          0x0140
485 #define OMAP_GPIO_LEVELDETECT1          0x0144
486 #define OMAP_GPIO_RISINGDETECT          0x0148
487 #define OMAP_GPIO_FALLINGDETECT         0x014c
488 #define OMAP_GPIO_DEBOUNCE_EN           0x0150
489 #define OMAP_GPIO_DEBOUNCE_VAL          0x0154
490 #define OMAP_GPIO_CLEARDATAOUT          0x0190
491 #define OMAP_GPIO_SETDATAOUT            0x0194
492
493 /* Control Device Register */
494
495  /* Control Device Register */
496 #define MREQPRIO_0_SAB_INIT1_MASK       0xFFFFFF8F
497 #define MREQPRIO_0_SAB_INIT0_MASK       0xFFFFFFF8
498 #define MREQPRIO_1_DSS_MASK             0xFFFFFF8F
499
500 struct ctrl_dev {
501         unsigned int deviceid;          /* offset 0x00 */
502         unsigned int resv1[7];
503         unsigned int usb_ctrl0;         /* offset 0x20 */
504         unsigned int resv2;
505         unsigned int usb_ctrl1;         /* offset 0x28 */
506         unsigned int resv3;
507         unsigned int macid0l;           /* offset 0x30 */
508         unsigned int macid0h;           /* offset 0x34 */
509         unsigned int macid1l;           /* offset 0x38 */
510         unsigned int macid1h;           /* offset 0x3c */
511         unsigned int resv4[4];
512         unsigned int miisel;            /* offset 0x50 */
513         unsigned int resv5[7];
514         unsigned int mreqprio_0;        /* offset 0x70 */
515         unsigned int mreqprio_1;        /* offset 0x74 */
516         unsigned int resv6[97];
517         unsigned int efuse_sma;         /* offset 0x1FC */
518 };
519
520 /* Bandwidth Limiter Portion of the L3Fast Configuration Register */
521 #define BW_LIMITER_BW_FRAC_MASK         0xFFFFFFE0
522 #define BW_LIMITER_BW_INT_MASK          0xFFFFFFF0
523 #define BW_LIMITER_BW_WATERMARK_MASK    0xFFFFF800
524
525 struct l3f_cfg_bwlimiter {
526         u32 padding0[2];
527         u32 modena_init0_bw_fractional;
528         u32 modena_init0_bw_integer;
529         u32 modena_init0_watermark_0;
530 };
531
532 /* gmii_sel register defines */
533 #define GMII1_SEL_MII           0x0
534 #define GMII1_SEL_RMII          0x1
535 #define GMII1_SEL_RGMII         0x2
536 #define GMII2_SEL_MII           0x0
537 #define GMII2_SEL_RMII          0x4
538 #define GMII2_SEL_RGMII         0x8
539 #define RGMII1_IDMODE           BIT(4)
540 #define RGMII2_IDMODE           BIT(5)
541 #define RMII1_IO_CLK_EN         BIT(6)
542 #define RMII2_IO_CLK_EN         BIT(7)
543
544 #define MII_MODE_ENABLE         (GMII1_SEL_MII | GMII2_SEL_MII)
545 #define RMII_MODE_ENABLE        (GMII1_SEL_RMII | GMII2_SEL_RMII)
546 #define RGMII_MODE_ENABLE       (GMII1_SEL_RGMII | GMII2_SEL_RGMII)
547 #define RGMII_INT_DELAY         (RGMII1_IDMODE | RGMII2_IDMODE)
548 #define RMII_CHIPCKL_ENABLE     (RMII1_IO_CLK_EN | RMII2_IO_CLK_EN)
549
550 /* PWMSS */
551 struct pwmss_regs {
552         unsigned int idver;
553         unsigned int sysconfig;
554         unsigned int clkconfig;
555         unsigned int clkstatus;
556 };
557 #define ECAP_CLK_EN             BIT(0)
558 #define ECAP_CLK_STOP_REQ       BIT(1)
559
560 struct pwmss_ecap_regs {
561         unsigned int tsctr;
562         unsigned int ctrphs;
563         unsigned int cap1;
564         unsigned int cap2;
565         unsigned int cap3;
566         unsigned int cap4;
567         unsigned int resv1[4];
568         unsigned short ecctl1;
569         unsigned short ecctl2;
570 };
571
572 /* Capture Control register 2 */
573 #define ECTRL2_SYNCOSEL_MASK    (0x03 << 6)
574 #define ECTRL2_MDSL_ECAP        BIT(9)
575 #define ECTRL2_CTRSTP_FREERUN   BIT(4)
576 #define ECTRL2_PLSL_LOW         BIT(10)
577 #define ECTRL2_SYNC_EN          BIT(5)
578
579 #define clk_get_rate(c,p)                                       \
580         __clk_get_rate(readl(&(c)->clkseldpll##p),              \
581                 readl(&(c)->divm2dpll##p))
582
583 unsigned long __clk_get_rate(u32 m_n, u32 div_m2);
584
585 unsigned long mpu_clk_rate(void);
586
587 #endif /* __ASSEMBLY__ */
588 #endif /* __KERNEL_STRICT_NAMES */
589
590 /* Ethernet MAC ID from EFuse */
591 #define MAC_ID0_LO      (CTRL_BASE + 0x630)
592 #define MAC_ID0_HI      (CTRL_BASE + 0x634)
593 #define MAC_ID1_LO      (CTRL_BASE + 0x638)
594 #define MAC_ID1_HI      (CTRL_BASE + 0x63c)
595 #define MAC_MII_SEL     (CTRL_BASE + 0x650)
596
597 #endif /* _AM33XX_CPU_H */