aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm/arch-s3c2410/regs-timer.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-arm/arch-s3c2410/regs-timer.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-arm/arch-s3c2410/regs-timer.h')
-rw-r--r--include/asm-arm/arch-s3c2410/regs-timer.h113
1 files changed, 113 insertions, 0 deletions
diff --git a/include/asm-arm/arch-s3c2410/regs-timer.h b/include/asm-arm/arch-s3c2410/regs-timer.h
new file mode 100644
index 000000000000..169064e27520
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-timer.h
@@ -0,0 +1,113 @@
1/* linux/include/asm/arch-s3c2410/regs-timer.h
2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * S3C2410 Timer configuration
11 *
12 * Changelog:
13 * 05-06-2003 BJD Created file
14 * 26-06-2003 BJD Added more timer definitions to mux / control
15 * 12-03-2004 BJD Updated include protection
16 * 10-02-2005 BJD Added S3C2410_TCFG1_MUX4_SHIFT (Guillaume Gourat)
17 * 10-03-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
18*/
19
20
21#ifndef __ASM_ARCH_REGS_TIMER_H
22#define __ASM_ARCH_REGS_TIMER_H "$Id: timer.h,v 1.4 2003/05/06 19:30:50 ben Exp $"
23
24#define S3C2410_TIMERREG(x) (S3C24XX_VA_TIMER + (x))
25#define S3C2410_TIMERREG2(tmr,reg) S3C2410_TIMERREG((reg)+0x0c+((tmr)*0x0c))
26
27#define S3C2410_TCFG0 S3C2410_TIMERREG(0x00)
28#define S3C2410_TCFG1 S3C2410_TIMERREG(0x04)
29#define S3C2410_TCON S3C2410_TIMERREG(0x08)
30
31#define S3C2410_TCFG_PRESCALER0_MASK (255<<0)
32#define S3C2410_TCFG_PRESCALER1_MASK (255<<8)
33#define S3C2410_TCFG_PRESCALER1_SHIFT (8)
34#define S3C2410_TCFG_DEADZONE_MASK (255<<16)
35#define S3C2410_TCFG_DEADZONE_SHIFT (16)
36
37#define S3C2410_TCFG1_MUX4_DIV2 (0<<16)
38#define S3C2410_TCFG1_MUX4_DIV4 (1<<16)
39#define S3C2410_TCFG1_MUX4_DIV8 (2<<16)
40#define S3C2410_TCFG1_MUX4_DIV16 (3<<16)
41#define S3C2410_TCFG1_MUX4_TCLK1 (4<<16)
42#define S3C2410_TCFG1_MUX4_MASK (15<<16)
43#define S3C2410_TCFG1_MUX4_SHIFT (16)
44
45#define S3C2410_TCFG1_MUX3_DIV2 (0<<12)
46#define S3C2410_TCFG1_MUX3_DIV4 (1<<12)
47#define S3C2410_TCFG1_MUX3_DIV8 (2<<12)
48#define S3C2410_TCFG1_MUX3_DIV16 (3<<12)
49#define S3C2410_TCFG1_MUX3_TCLK1 (4<<12)
50#define S3C2410_TCFG1_MUX3_MASK (15<<12)
51
52
53#define S3C2410_TCFG1_MUX2_DIV2 (0<<8)
54#define S3C2410_TCFG1_MUX2_DIV4 (1<<8)
55#define S3C2410_TCFG1_MUX2_DIV8 (2<<8)
56#define S3C2410_TCFG1_MUX2_DIV16 (3<<8)
57#define S3C2410_TCFG1_MUX2_TCLK1 (4<<8)
58#define S3C2410_TCFG1_MUX2_MASK (15<<8)
59
60
61#define S3C2410_TCFG1_MUX1_DIV2 (0<<4)
62#define S3C2410_TCFG1_MUX1_DIV4 (1<<4)
63#define S3C2410_TCFG1_MUX1_DIV8 (2<<4)
64#define S3C2410_TCFG1_MUX1_DIV16 (3<<4)
65#define S3C2410_TCFG1_MUX1_TCLK0 (4<<4)
66#define S3C2410_TCFG1_MUX1_MASK (15<<4)
67
68#define S3C2410_TCFG1_MUX0_DIV2 (0<<0)
69#define S3C2410_TCFG1_MUX0_DIV4 (1<<0)
70#define S3C2410_TCFG1_MUX0_DIV8 (2<<0)
71#define S3C2410_TCFG1_MUX0_DIV16 (3<<0)
72#define S3C2410_TCFG1_MUX0_TCLK0 (4<<0)
73#define S3C2410_TCFG1_MUX0_MASK (15<<0)
74
75/* for each timer, we have an count buffer, an compare buffer and
76 * an observation buffer
77*/
78
79/* WARNING - timer 4 has no buffer reg, and it's observation is at +4 */
80
81#define S3C2410_TCNTB(tmr) S3C2410_TIMERREG2(tmr, 0x00)
82#define S3C2410_TCMPB(tmr) S3C2410_TIMERREG2(tmr, 0x04)
83#define S3C2410_TCNTO(tmr) S3C2410_TIMERREG2(tmr, (((tmr) == 4) ? 0x04 : 0x08))
84
85#define S3C2410_TCON_T4RELOAD (1<<22)
86#define S3C2410_TCON_T4MANUALUPD (1<<21)
87#define S3C2410_TCON_T4START (1<<20)
88
89#define S3C2410_TCON_T3RELOAD (1<<19)
90#define S3C2410_TCON_T3INVERT (1<<18)
91#define S3C2410_TCON_T3MANUALUPD (1<<17)
92#define S3C2410_TCON_T3START (1<<16)
93
94#define S3C2410_TCON_T2RELOAD (1<<15)
95#define S3C2410_TCON_T2INVERT (1<<14)
96#define S3C2410_TCON_T2MANUALUPD (1<<13)
97#define S3C2410_TCON_T2START (1<<12)
98
99#define S3C2410_TCON_T1RELOAD (1<<11)
100#define S3C2410_TCON_T1INVERT (1<<10)
101#define S3C2410_TCON_T1MANUALUPD (1<<9)
102#define S3C2410_TCON_T1START (1<<8)
103
104#define S3C2410_TCON_T0DEADZONE (1<<4)
105#define S3C2410_TCON_T0RELOAD (1<<3)
106#define S3C2410_TCON_T0INVERT (1<<2)
107#define S3C2410_TCON_T0MANUALUPD (1<<1)
108#define S3C2410_TCON_T0START (1<<0)
109
110#endif /* __ASM_ARCH_REGS_TIMER_H */
111
112
113