aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMeihui Fan <mhfan@hhcn.com>2008-04-22 20:53:15 -0400
committerBryan Wu <cooloney@kernel.org>2008-04-22 20:53:15 -0400
commit6eceb0d4da10df9301e27bcec7a9b927e5047251 (patch)
tree16d5d592266f48b4e5abf0a30a833f98eca2331d
parenta8a46a269e05190d18e4e36f51477d59bd0b29f6 (diff)
[Blackfin] arch: add support for the rest of the gptimers on the BF54x
Signed-off-by: Meihui Fan <mhfan@hhcn.com> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
-rw-r--r--arch/blackfin/kernel/gptimers.c24
-rw-r--r--include/asm-blackfin/gptimers.h150
2 files changed, 81 insertions, 93 deletions
diff --git a/arch/blackfin/kernel/gptimers.c b/arch/blackfin/kernel/gptimers.c
index 1904d8b53328..e698554895a7 100644
--- a/arch/blackfin/kernel/gptimers.c
+++ b/arch/blackfin/kernel/gptimers.c
@@ -52,12 +52,14 @@ static volatile GPTIMER_timer_regs *const timer_regs[MAX_BLACKFIN_GPTIMERS] =
52 (GPTIMER_timer_regs *)TIMER5_CONFIG, 52 (GPTIMER_timer_regs *)TIMER5_CONFIG,
53 (GPTIMER_timer_regs *)TIMER6_CONFIG, 53 (GPTIMER_timer_regs *)TIMER6_CONFIG,
54 (GPTIMER_timer_regs *)TIMER7_CONFIG, 54 (GPTIMER_timer_regs *)TIMER7_CONFIG,
55#endif 55# if (MAX_BLACKFIN_GPTIMERS > 8)
56#if (MAX_BLACKFIN_GPTIMERS > 8)
57 (GPTIMER_timer_regs *)TIMER8_CONFIG, 56 (GPTIMER_timer_regs *)TIMER8_CONFIG,
58 (GPTIMER_timer_regs *)TIMER9_CONFIG, 57 (GPTIMER_timer_regs *)TIMER9_CONFIG,
59 (GPTIMER_timer_regs *)TIMER10_CONFIG, 58 (GPTIMER_timer_regs *)TIMER10_CONFIG,
59# if (MAX_BLACKFIN_GPTIMERS > 11)
60 (GPTIMER_timer_regs *)TIMER11_CONFIG, 60 (GPTIMER_timer_regs *)TIMER11_CONFIG,
61# endif
62# endif
61#endif 63#endif
62}; 64};
63 65
@@ -80,12 +82,14 @@ static uint32_t const trun_mask[MAX_BLACKFIN_GPTIMERS] =
80 TIMER_STATUS_TRUN5, 82 TIMER_STATUS_TRUN5,
81 TIMER_STATUS_TRUN6, 83 TIMER_STATUS_TRUN6,
82 TIMER_STATUS_TRUN7, 84 TIMER_STATUS_TRUN7,
83#endif 85# if (MAX_BLACKFIN_GPTIMERS > 8)
84#if (MAX_BLACKFIN_GPTIMERS > 8)
85 TIMER_STATUS_TRUN8, 86 TIMER_STATUS_TRUN8,
86 TIMER_STATUS_TRUN9, 87 TIMER_STATUS_TRUN9,
87 TIMER_STATUS_TRUN10, 88 TIMER_STATUS_TRUN10,
89# if (MAX_BLACKFIN_GPTIMERS > 11)
88 TIMER_STATUS_TRUN11, 90 TIMER_STATUS_TRUN11,
91# endif
92# endif
89#endif 93#endif
90}; 94};
91 95
@@ -100,12 +104,14 @@ static uint32_t const tovf_mask[MAX_BLACKFIN_GPTIMERS] =
100 TIMER_STATUS_TOVF5, 104 TIMER_STATUS_TOVF5,
101 TIMER_STATUS_TOVF6, 105 TIMER_STATUS_TOVF6,
102 TIMER_STATUS_TOVF7, 106 TIMER_STATUS_TOVF7,
103#endif 107# if (MAX_BLACKFIN_GPTIMERS > 8)
104#if (MAX_BLACKFIN_GPTIMERS > 8)
105 TIMER_STATUS_TOVF8, 108 TIMER_STATUS_TOVF8,
106 TIMER_STATUS_TOVF9, 109 TIMER_STATUS_TOVF9,
107 TIMER_STATUS_TOVF10, 110 TIMER_STATUS_TOVF10,
111# if (MAX_BLACKFIN_GPTIMERS > 11)
108 TIMER_STATUS_TOVF11, 112 TIMER_STATUS_TOVF11,
113# endif
114# endif
109#endif 115#endif
110}; 116};
111 117
@@ -120,12 +126,14 @@ static uint32_t const timil_mask[MAX_BLACKFIN_GPTIMERS] =
120 TIMER_STATUS_TIMIL5, 126 TIMER_STATUS_TIMIL5,
121 TIMER_STATUS_TIMIL6, 127 TIMER_STATUS_TIMIL6,
122 TIMER_STATUS_TIMIL7, 128 TIMER_STATUS_TIMIL7,
123#endif 129# if (MAX_BLACKFIN_GPTIMERS > 8)
124#if (MAX_BLACKFIN_GPTIMERS > 8)
125 TIMER_STATUS_TIMIL8, 130 TIMER_STATUS_TIMIL8,
126 TIMER_STATUS_TIMIL9, 131 TIMER_STATUS_TIMIL9,
127 TIMER_STATUS_TIMIL10, 132 TIMER_STATUS_TIMIL10,
133# if (MAX_BLACKFIN_GPTIMERS > 11)
128 TIMER_STATUS_TIMIL11, 134 TIMER_STATUS_TIMIL11,
135# endif
136# endif
129#endif 137#endif
130}; 138};
131 139
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