]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/asm-arm/arch-mx23/timrot.h
applied patches from Freescale and Ka-Ro
[karo-tx-uboot.git] / include / asm-arm / arch-mx23 / timrot.h
1 /*
2  * Copyright (C) 2008 Embedded Alley Solutions Inc.
3  *
4  * (C) Copyright 2009-2010 Freescale Semiconductor, Inc.
5  *
6  * Timers and rotary encoder register definitions
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22 #ifndef TIMROT_H
23 #define TIMROT_H
24
25 #include <asm/arch/mx23.h>
26
27 #define TIMROT_BASE     (MX23_REGS_BASE + 0x00068000)
28
29 /* Timer and rotary encoder register offsets */
30 #define ROTCTRL         0x0
31 #define ROTCOUNT        0x10
32 #define TIMCTRL0        0x20
33 #define TIMCOUNT0       0x30
34 #define TIMCTRL1        0x40
35 #define TIMCOUNT1       0x50
36 #define TIMCTRL2        0x60
37 #define TIMCOUNT2       0x70
38 #define TIMCTRL3        0x80
39 #define TIMCTRL3        0x90
40
41 /* TIMCTRL bits, bit fields and values */
42 #define TIMCTRL_SELECT          0
43 #define TIMCTRL_PRESCALE        4
44 #define TIMCTRL_RELOAD          (1 << 6)
45 #define TIMCTRL_UPDATE          (1 << 7)
46 #define TIMCTRL_POLARITY        (1 << 8)
47 #define TIMCTRL_IRQEN           (1 << 14)
48 #define TIMCTRL_IRQ             (1 << 15)
49
50 #define TIMCTRL_SELECT_PWM0     (0x1 << TIMCTRL_SELECT)
51 #define TIMCTRL_SELECT_PWM1     (0x2 << TIMCTRL_SELECT)
52 #define TIMCTRL_SELECT_PWM2     (0x3 << TIMCTRL_SELECT)
53 #define TIMCTRL_SELECT_PWM3     (0x4 << TIMCTRL_SELECT)
54 #define TIMCTRL_SELECT_PWM4     (0x5 << TIMCTRL_SELECT)
55 #define TIMCTRL_SELECT_ROTARYA  (0x6 << TIMCTRL_SELECT)
56 #define TIMCTRL_SELECT_ROTARYB  (0x7 << TIMCTRL_SELECT)
57 #define TIMCTRL_SELECT_32KHZ    (0x8 << TIMCTRL_SELECT)
58 #define TIMCTRL_SELECT_8KHZ     (0x9 << TIMCTRL_SELECT)
59 #define TIMCTRL_SELECT_4KHZ     (0xa << TIMCTRL_SELECT)
60 #define TIMCTRL_SELECT_1KHZ     (0xb << TIMCTRL_SELECT)
61 #define TIMCTRL_SELECT_ALWAYS   (0xc << TIMCTRL_SELECT)
62
63 #endif /* TIMROT_H */