aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-blackfin/gptimers.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-blackfin/gptimers.h')
-rw-r--r--include/asm-blackfin/gptimers.h150
1 files changed, 65 insertions, 85 deletions
diff --git a/include/asm-blackfin/gptimers.h b/include/asm-blackfin/gptimers.h
index 4f318f1fd2d9..0520d2aac8f3 100644
--- a/include/asm-blackfin/gptimers.h
+++ b/include/asm-blackfin/gptimers.h
@@ -22,6 +22,18 @@
22# define TIMER0_GROUP_REG TIMER_ENABLE 22# define TIMER0_GROUP_REG TIMER_ENABLE
23#endif 23#endif
24/* 24/*
25 * BF54x: 11 timers (BF542: 8 timers):
26 */
27#if defined(BF548_FAMILY)
28# ifdef CONFIG_BF542
29# define MAX_BLACKFIN_GPTIMERS 8
30# else
31# define MAX_BLACKFIN_GPTIMERS 11
32# define TIMER8_GROUP_REG TIMER_ENABLE1
33# endif
34# define TIMER0_GROUP_REG TIMER_ENABLE0
35#endif
36/*
25 * BF561: 12 timers: 37 * BF561: 12 timers:
26 */ 38 */
27#if defined(CONFIG_BF561) 39#if defined(CONFIG_BF561)
@@ -44,40 +56,28 @@
44#define TIMER0bit 0x0001 /* 0001b */ 56#define TIMER0bit 0x0001 /* 0001b */
45#define TIMER1bit 0x0002 /* 0010b */ 57#define TIMER1bit 0x0002 /* 0010b */
46#define TIMER2bit 0x0004 /* 0100b */ 58#define TIMER2bit 0x0004 /* 0100b */
47 59#define TIMER3bit 0x0008
48#if (MAX_BLACKFIN_GPTIMERS > 3) 60#define TIMER4bit 0x0010
49# define TIMER3bit 0x0008 61#define TIMER5bit 0x0020
50# define TIMER4bit 0x0010 62#define TIMER6bit 0x0040
51# define TIMER5bit 0x0020 63#define TIMER7bit 0x0080
52# define TIMER6bit 0x0040 64#define TIMER8bit 0x0100
53# define TIMER7bit 0x0080 65#define TIMER9bit 0x0200
54#endif 66#define TIMER10bit 0x0400
55 67#define TIMER11bit 0x0800
56#if (MAX_BLACKFIN_GPTIMERS > 8)
57# define TIMER8bit 0x0100
58# define TIMER9bit 0x0200
59# define TIMER10bit 0x0400
60# define TIMER11bit 0x0800
61#endif
62 68
63#define TIMER0_id 0 69#define TIMER0_id 0
64#define TIMER1_id 1 70#define TIMER1_id 1
65#define TIMER2_id 2 71#define TIMER2_id 2
66 72#define TIMER3_id 3
67#if (MAX_BLACKFIN_GPTIMERS > 3) 73#define TIMER4_id 4
68# define TIMER3_id 3 74#define TIMER5_id 5
69# define TIMER4_id 4 75#define TIMER6_id 6
70# define TIMER5_id 5 76#define TIMER7_id 7
71# define TIMER6_id 6 77#define TIMER8_id 8
72# define TIMER7_id 7 78#define TIMER9_id 9
73#endif 79#define TIMER10_id 10
74 80#define TIMER11_id 11
75#if (MAX_BLACKFIN_GPTIMERS > 8)
76# define TIMER8_id 8
77# define TIMER9_id 9
78# define TIMER10_id 10
79# define TIMER11_id 11
80#endif
81 81
82/* associated timers for ppi framesync: */ 82/* associated timers for ppi framesync: */
83 83
@@ -124,45 +124,31 @@
124/* 124/*
125 * Timer Status Register Bits 125 * Timer Status Register Bits
126 */ 126 */
127#define TIMER_STATUS_TIMIL0 0x0001 127#define TIMER_STATUS_TIMIL0 0x0001
128#define TIMER_STATUS_TIMIL1 0x0002 128#define TIMER_STATUS_TIMIL1 0x0002
129#define TIMER_STATUS_TIMIL2 0x0004 129#define TIMER_STATUS_TIMIL2 0x0004
130#if (MAX_BLACKFIN_GPTIMERS > 3) 130#define TIMER_STATUS_TIMIL3 0x00000008
131# define TIMER_STATUS_TIMIL3 0x00000008 131#define TIMER_STATUS_TIMIL4 0x00010000
132# define TIMER_STATUS_TIMIL4 0x00010000 132#define TIMER_STATUS_TIMIL5 0x00020000
133# define TIMER_STATUS_TIMIL5 0x00020000 133#define TIMER_STATUS_TIMIL6 0x00040000
134# define TIMER_STATUS_TIMIL6 0x00040000 134#define TIMER_STATUS_TIMIL7 0x00080000
135# define TIMER_STATUS_TIMIL7 0x00080000 135#define TIMER_STATUS_TIMIL8 0x0001
136# if (MAX_BLACKFIN_GPTIMERS > 8) 136#define TIMER_STATUS_TIMIL9 0x0002
137# define TIMER_STATUS_TIMIL8 0x0001 137#define TIMER_STATUS_TIMIL10 0x0004
138# define TIMER_STATUS_TIMIL9 0x0002 138#define TIMER_STATUS_TIMIL11 0x0008
139# define TIMER_STATUS_TIMIL10 0x0004 139
140# define TIMER_STATUS_TIMIL11 0x0008 140#define TIMER_STATUS_TOVF0 0x0010 /* timer 0 overflow error */
141# endif 141#define TIMER_STATUS_TOVF1 0x0020
142# define TIMER_STATUS_INTR 0x000F000F 142#define TIMER_STATUS_TOVF2 0x0040
143#else 143#define TIMER_STATUS_TOVF3 0x00000080
144# define TIMER_STATUS_INTR 0x0007 /* any timer interrupt */ 144#define TIMER_STATUS_TOVF4 0x00100000
145#endif 145#define TIMER_STATUS_TOVF5 0x00200000
146 146#define TIMER_STATUS_TOVF6 0x00400000
147#define TIMER_STATUS_TOVF0 0x0010 /* timer 0 overflow error */ 147#define TIMER_STATUS_TOVF7 0x00800000
148#define TIMER_STATUS_TOVF1 0x0020 148#define TIMER_STATUS_TOVF8 0x0010
149#define TIMER_STATUS_TOVF2 0x0040 149#define TIMER_STATUS_TOVF9 0x0020
150#if (MAX_BLACKFIN_GPTIMERS > 3) 150#define TIMER_STATUS_TOVF10 0x0040
151# define TIMER_STATUS_TOVF3 0x00000080 151#define TIMER_STATUS_TOVF11 0x0080
152# define TIMER_STATUS_TOVF4 0x00100000
153# define TIMER_STATUS_TOVF5 0x00200000
154# define TIMER_STATUS_TOVF6 0x00400000
155# define TIMER_STATUS_TOVF7 0x00800000
156# if (MAX_BLACKFIN_GPTIMERS > 8)
157# define TIMER_STATUS_TOVF8 0x0010
158# define TIMER_STATUS_TOVF9 0x0020
159# define TIMER_STATUS_TOVF10 0x0040
160# define TIMER_STATUS_TOVF11 0x0080
161# endif
162# define TIMER_STATUS_OFLOW 0x00F000F0
163#else
164# define TIMER_STATUS_OFLOW 0x0070 /* any timer overflow */
165#endif
166 152
167/* 153/*
168 * Timer Slave Enable Status : write 1 to clear 154 * Timer Slave Enable Status : write 1 to clear
@@ -170,22 +156,16 @@
170#define TIMER_STATUS_TRUN0 0x1000 156#define TIMER_STATUS_TRUN0 0x1000
171#define TIMER_STATUS_TRUN1 0x2000 157#define TIMER_STATUS_TRUN1 0x2000
172#define TIMER_STATUS_TRUN2 0x4000 158#define TIMER_STATUS_TRUN2 0x4000
173#if (MAX_BLACKFIN_GPTIMERS > 3) 159#define TIMER_STATUS_TRUN3 0x00008000
174# define TIMER_STATUS_TRUN3 0x00008000 160#define TIMER_STATUS_TRUN4 0x10000000
175# define TIMER_STATUS_TRUN4 0x10000000 161#define TIMER_STATUS_TRUN5 0x20000000
176# define TIMER_STATUS_TRUN5 0x20000000 162#define TIMER_STATUS_TRUN6 0x40000000
177# define TIMER_STATUS_TRUN6 0x40000000 163#define TIMER_STATUS_TRUN7 0x80000000
178# define TIMER_STATUS_TRUN7 0x80000000 164#define TIMER_STATUS_TRUN 0xF000F000
179# define TIMER_STATUS_TRUN 0xF000F000 165#define TIMER_STATUS_TRUN8 0x1000
180# if (MAX_BLACKFIN_GPTIMERS > 8) 166#define TIMER_STATUS_TRUN9 0x2000
181# define TIMER_STATUS_TRUN8 0x1000 167#define TIMER_STATUS_TRUN10 0x4000
182# define TIMER_STATUS_TRUN9 0x2000 168#define TIMER_STATUS_TRUN11 0x8000
183# define TIMER_STATUS_TRUN10 0x4000
184# define TIMER_STATUS_TRUN11 0x8000
185# endif
186#else
187# define TIMER_STATUS_TRUN 0x7000
188#endif
189 169
190/* The actual gptimer API */ 170/* The actual gptimer API */
191 171