aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-stmp378x/include/mach/regs-timrot.h
diff options
context:
space:
mode:
authordmitry pervushin <dpervushin@embeddedalley.com>2009-05-31 08:31:14 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-05-31 08:55:49 -0400
commite0421bbe6479816ea16c6553b8f376c592e36a85 (patch)
tree2bb916f05f8d52272f3c8097ca94039c60bb9d1f /arch/arm/mach-stmp378x/include/mach/regs-timrot.h
parentb4380b8e5888e5ef5872e43b610c9dac4bf253ac (diff)
[ARM] 5530/1: Freescale STMP: get rid of HW_zzz macros [1/3]
Replace HW_zzz register access macros by regular __raw_readl/__raw_writel calls Signed-off-by: dmitry pervushin <dpervushin@embeddedalley.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-stmp378x/include/mach/regs-timrot.h')
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-timrot.h240
1 files changed, 46 insertions, 194 deletions
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-timrot.h b/arch/arm/mach-stmp378x/include/mach/regs-timrot.h
index bb6355acdfd1..b5527957c67f 100644
--- a/arch/arm/mach-stmp378x/include/mach/regs-timrot.h
+++ b/arch/arm/mach-stmp378x/include/mach/regs-timrot.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * STMP TIMROT Register Definitions 2 * stmp378x: TIMROT register definitions
3 * 3 *
4 * Copyright (c) 2008 Freescale Semiconductor 4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved. 5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
@@ -18,199 +18,51 @@
18 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21#ifndef _MACH_REGS_TIMROT
22#define _MACH_REGS_TIMROT
21 23
22#ifndef __ARCH_ARM___TIMROT_H 24#define REGS_TIMROT_BASE (STMP3XXX_REGS_BASE + 0x68000)
23#define __ARCH_ARM___TIMROT_H 1 25#define REGS_TIMROT_PHYS 0x80068000
26#define REGS_TIMROT_SIZE 0x2000
24 27
25#include <mach/stmp3xxx_regs.h> 28#define HW_TIMROT_ROTCTRL 0x0
29#define BM_TIMROT_ROTCTRL_SELECT_A 0x00000007
30#define BP_TIMROT_ROTCTRL_SELECT_A 0
31#define BM_TIMROT_ROTCTRL_SELECT_B 0x00000070
32#define BP_TIMROT_ROTCTRL_SELECT_B 4
33#define BM_TIMROT_ROTCTRL_POLARITY_A 0x00000100
34#define BM_TIMROT_ROTCTRL_POLARITY_B 0x00000200
35#define BM_TIMROT_ROTCTRL_OVERSAMPLE 0x00000C00
36#define BP_TIMROT_ROTCTRL_OVERSAMPLE 10
37#define BM_TIMROT_ROTCTRL_RELATIVE 0x00001000
38#define BM_TIMROT_ROTCTRL_DIVIDER 0x003F0000
39#define BP_TIMROT_ROTCTRL_DIVIDER 16
40#define BM_TIMROT_ROTCTRL_ROTARY_PRESENT 0x20000000
41#define BM_TIMROT_ROTCTRL_CLKGATE 0x40000000
42#define BM_TIMROT_ROTCTRL_SFTRST 0x80000000
26 43
27#define REGS_TIMROT_BASE (REGS_BASE + 0x68000) 44#define HW_TIMROT_ROTCOUNT 0x10
28#define REGS_TIMROT_BASE_PHYS (0x80068000) 45#define BM_TIMROT_ROTCOUNT_UPDOWN 0x0000FFFF
29#define REGS_TIMROT_SIZE 0x00002000 46#define BP_TIMROT_ROTCOUNT_UPDOWN 0
30HW_REGISTER(HW_TIMROT_ROTCTRL, REGS_TIMROT_BASE, 0x00000000) 47
31#define HW_TIMROT_ROTCTRL_ADDR (REGS_TIMROT_BASE + 0x00000000) 48#define HW_TIMROT_TIMCTRL0 (0x20 + 0 * 0x20)
32#define BM_TIMROT_ROTCTRL_SFTRST 0x80000000 49#define HW_TIMROT_TIMCTRL1 (0x20 + 1 * 0x20)
33#define BM_TIMROT_ROTCTRL_CLKGATE 0x40000000 50#define HW_TIMROT_TIMCTRL2 (0x20 + 2 * 0x20)
34#define BM_TIMROT_ROTCTRL_ROTARY_PRESENT 0x20000000 51
35#define BM_TIMROT_ROTCTRL_TIM3_PRESENT 0x10000000 52#define HW_TIMROT_TIMCTRLn 0x20
36#define BM_TIMROT_ROTCTRL_TIM2_PRESENT 0x08000000 53#define BM_TIMROT_TIMCTRLn_SELECT 0x0000000F
37#define BM_TIMROT_ROTCTRL_TIM1_PRESENT 0x04000000 54#define BP_TIMROT_TIMCTRLn_SELECT 0
38#define BM_TIMROT_ROTCTRL_TIM0_PRESENT 0x02000000 55#define BM_TIMROT_TIMCTRLn_PRESCALE 0x00000030
39#define BP_TIMROT_ROTCTRL_STATE 22 56#define BP_TIMROT_TIMCTRLn_PRESCALE 4
40#define BM_TIMROT_ROTCTRL_STATE 0x01C00000 57#define BM_TIMROT_TIMCTRLn_RELOAD 0x00000040
41#define BF_TIMROT_ROTCTRL_STATE(v) \ 58#define BM_TIMROT_TIMCTRLn_UPDATE 0x00000080
42 (((v) << 22) & BM_TIMROT_ROTCTRL_STATE) 59#define BM_TIMROT_TIMCTRLn_IRQ_EN 0x00004000
43#define BP_TIMROT_ROTCTRL_DIVIDER 16 60#define BM_TIMROT_TIMCTRLn_IRQ 0x00008000
44#define BM_TIMROT_ROTCTRL_DIVIDER 0x003F0000 61
45#define BF_TIMROT_ROTCTRL_DIVIDER(v) \ 62#define HW_TIMROT_TIMCOUNT0 (0x30 + 0 * 0x20)
46 (((v) << 16) & BM_TIMROT_ROTCTRL_DIVIDER) 63#define HW_TIMROT_TIMCOUNT1 (0x30 + 1 * 0x20)
47#define BM_TIMROT_ROTCTRL_RELATIVE 0x00001000 64#define HW_TIMROT_TIMCOUNT2 (0x30 + 2 * 0x20)
48#define BP_TIMROT_ROTCTRL_OVERSAMPLE 10 65
49#define BM_TIMROT_ROTCTRL_OVERSAMPLE 0x00000C00 66#define HW_TIMROT_TIMCOUNTn 0x30
50#define BF_TIMROT_ROTCTRL_OVERSAMPLE(v) \ 67
51 (((v) << 10) & BM_TIMROT_ROTCTRL_OVERSAMPLE) 68#endif
52#define BV_TIMROT_ROTCTRL_OVERSAMPLE__8X 0x0
53#define BV_TIMROT_ROTCTRL_OVERSAMPLE__4X 0x1
54#define BV_TIMROT_ROTCTRL_OVERSAMPLE__2X 0x2
55#define BV_TIMROT_ROTCTRL_OVERSAMPLE__1X 0x3
56#define BM_TIMROT_ROTCTRL_POLARITY_B 0x00000200
57#define BM_TIMROT_ROTCTRL_POLARITY_A 0x00000100
58#define BP_TIMROT_ROTCTRL_SELECT_B 4
59#define BM_TIMROT_ROTCTRL_SELECT_B 0x00000070
60#define BF_TIMROT_ROTCTRL_SELECT_B(v) \
61 (((v) << 4) & BM_TIMROT_ROTCTRL_SELECT_B)
62#define BV_TIMROT_ROTCTRL_SELECT_B__NEVER_TICK 0x0
63#define BV_TIMROT_ROTCTRL_SELECT_B__PWM0 0x1
64#define BV_TIMROT_ROTCTRL_SELECT_B__PWM1 0x2
65#define BV_TIMROT_ROTCTRL_SELECT_B__PWM2 0x3
66#define BV_TIMROT_ROTCTRL_SELECT_B__PWM3 0x4
67#define BV_TIMROT_ROTCTRL_SELECT_B__PWM4 0x5
68#define BV_TIMROT_ROTCTRL_SELECT_B__ROTARYA 0x6
69#define BV_TIMROT_ROTCTRL_SELECT_B__ROTARYB 0x7
70#define BP_TIMROT_ROTCTRL_SELECT_A 0
71#define BM_TIMROT_ROTCTRL_SELECT_A 0x00000007
72#define BF_TIMROT_ROTCTRL_SELECT_A(v) \
73 (((v) << 0) & BM_TIMROT_ROTCTRL_SELECT_A)
74#define BV_TIMROT_ROTCTRL_SELECT_A__NEVER_TICK 0x0
75#define BV_TIMROT_ROTCTRL_SELECT_A__PWM0 0x1
76#define BV_TIMROT_ROTCTRL_SELECT_A__PWM1 0x2
77#define BV_TIMROT_ROTCTRL_SELECT_A__PWM2 0x3
78#define BV_TIMROT_ROTCTRL_SELECT_A__PWM3 0x4
79#define BV_TIMROT_ROTCTRL_SELECT_A__PWM4 0x5
80#define BV_TIMROT_ROTCTRL_SELECT_A__ROTARYA 0x6
81#define BV_TIMROT_ROTCTRL_SELECT_A__ROTARYB 0x7
82HW_REGISTER_0(HW_TIMROT_ROTCOUNT, REGS_TIMROT_BASE, 0x00000010)
83#define HW_TIMROT_ROTCOUNT_ADDR (REGS_TIMROT_BASE + 0x00000010)
84#define BP_TIMROT_ROTCOUNT_UPDOWN 0
85#define BM_TIMROT_ROTCOUNT_UPDOWN 0x0000FFFF
86#define BF_TIMROT_ROTCOUNT_UPDOWN(v) \
87 (((v) << 0) & BM_TIMROT_ROTCOUNT_UPDOWN)
88/*
89 * multi-register-define name HW_TIMROT_TIMCTRLn
90 * base 0x00000020
91 * count 3
92 * offset 0x20
93 */
94HW_REGISTER_INDEXED(HW_TIMROT_TIMCTRLn, REGS_TIMROT_BASE, 0x00000020, 0x20)
95#define BM_TIMROT_TIMCTRLn_IRQ 0x00008000
96#define BM_TIMROT_TIMCTRLn_IRQ_EN 0x00004000
97#define BM_TIMROT_TIMCTRLn_POLARITY 0x00000100
98#define BM_TIMROT_TIMCTRLn_UPDATE 0x00000080
99#define BM_TIMROT_TIMCTRLn_RELOAD 0x00000040
100#define BP_TIMROT_TIMCTRLn_PRESCALE 4
101#define BM_TIMROT_TIMCTRLn_PRESCALE 0x00000030
102#define BF_TIMROT_TIMCTRLn_PRESCALE(v) \
103 (((v) << 4) & BM_TIMROT_TIMCTRLn_PRESCALE)
104#define BV_TIMROT_TIMCTRLn_PRESCALE__DIV_BY_1 0x0
105#define BV_TIMROT_TIMCTRLn_PRESCALE__DIV_BY_2 0x1
106#define BV_TIMROT_TIMCTRLn_PRESCALE__DIV_BY_4 0x2
107#define BV_TIMROT_TIMCTRLn_PRESCALE__DIV_BY_8 0x3
108#define BP_TIMROT_TIMCTRLn_SELECT 0
109#define BM_TIMROT_TIMCTRLn_SELECT 0x0000000F
110#define BF_TIMROT_TIMCTRLn_SELECT(v) \
111 (((v) << 0) & BM_TIMROT_TIMCTRLn_SELECT)
112#define BV_TIMROT_TIMCTRLn_SELECT__NEVER_TICK 0x0
113#define BV_TIMROT_TIMCTRLn_SELECT__PWM0 0x1
114#define BV_TIMROT_TIMCTRLn_SELECT__PWM1 0x2
115#define BV_TIMROT_TIMCTRLn_SELECT__PWM2 0x3
116#define BV_TIMROT_TIMCTRLn_SELECT__PWM3 0x4
117#define BV_TIMROT_TIMCTRLn_SELECT__PWM4 0x5
118#define BV_TIMROT_TIMCTRLn_SELECT__ROTARYA 0x6
119#define BV_TIMROT_TIMCTRLn_SELECT__ROTARYB 0x7
120#define BV_TIMROT_TIMCTRLn_SELECT__32KHZ_XTAL 0x8
121#define BV_TIMROT_TIMCTRLn_SELECT__8KHZ_XTAL 0x9
122#define BV_TIMROT_TIMCTRLn_SELECT__4KHZ_XTAL 0xA
123#define BV_TIMROT_TIMCTRLn_SELECT__1KHZ_XTAL 0xB
124#define BV_TIMROT_TIMCTRLn_SELECT__TICK_ALWAYS 0xC
125/*
126 * multi-register-define name HW_TIMROT_TIMCOUNTn
127 * base 0x00000030
128 * count 3
129 * offset 0x20
130 */
131HW_REGISTER_0_INDEXED(HW_TIMROT_TIMCOUNTn, REGS_TIMROT_BASE, 0x00000030,
132 0x20)
133#define BP_TIMROT_TIMCOUNTn_RUNNING_COUNT 16
134#define BM_TIMROT_TIMCOUNTn_RUNNING_COUNT 0xFFFF0000
135#define BF_TIMROT_TIMCOUNTn_RUNNING_COUNT(v) \
136 (((v) << 16) & BM_TIMROT_TIMCOUNTn_RUNNING_COUNT)
137#define BP_TIMROT_TIMCOUNTn_FIXED_COUNT 0
138#define BM_TIMROT_TIMCOUNTn_FIXED_COUNT 0x0000FFFF
139#define BF_TIMROT_TIMCOUNTn_FIXED_COUNT(v) \
140 (((v) << 0) & BM_TIMROT_TIMCOUNTn_FIXED_COUNT)
141HW_REGISTER(HW_TIMROT_TIMCTRL3, REGS_TIMROT_BASE, 0x00000080)
142#define HW_TIMROT_TIMCTRL3_ADDR (REGS_TIMROT_BASE + 0x00000080)
143#define BP_TIMROT_TIMCTRL3_TEST_SIGNAL 16
144#define BM_TIMROT_TIMCTRL3_TEST_SIGNAL 0x000F0000
145#define BF_TIMROT_TIMCTRL3_TEST_SIGNAL(v) \
146 (((v) << 16) & BM_TIMROT_TIMCTRL3_TEST_SIGNAL)
147#define BV_TIMROT_TIMCTRL3_TEST_SIGNAL__NEVER_TICK 0x0
148#define BV_TIMROT_TIMCTRL3_TEST_SIGNAL__PWM0 0x1
149#define BV_TIMROT_TIMCTRL3_TEST_SIGNAL__PWM1 0x2
150#define BV_TIMROT_TIMCTRL3_TEST_SIGNAL__PWM2 0x3
151#define BV_TIMROT_TIMCTRL3_TEST_SIGNAL__PWM3 0x4
152#define BV_TIMROT_TIMCTRL3_TEST_SIGNAL__PWM4 0x5
153#define BV_TIMROT_TIMCTRL3_TEST_SIGNAL__ROTARYA 0x6
154#define BV_TIMROT_TIMCTRL3_TEST_SIGNAL__ROTARYB 0x7
155#define BV_TIMROT_TIMCTRL3_TEST_SIGNAL__32KHZ_XTAL 0x8
156#define BV_TIMROT_TIMCTRL3_TEST_SIGNAL__8KHZ_XTAL 0x9
157#define BV_TIMROT_TIMCTRL3_TEST_SIGNAL__4KHZ_XTAL 0xA
158#define BV_TIMROT_TIMCTRL3_TEST_SIGNAL__1KHZ_XTAL 0xB
159#define BV_TIMROT_TIMCTRL3_TEST_SIGNAL__TICK_ALWAYS 0xC
160#define BM_TIMROT_TIMCTRL3_IRQ 0x00008000
161#define BM_TIMROT_TIMCTRL3_IRQ_EN 0x00004000
162#define BM_TIMROT_TIMCTRL3_DUTY_VALID 0x00000400
163#define BM_TIMROT_TIMCTRL3_DUTY_CYCLE 0x00000200
164#define BM_TIMROT_TIMCTRL3_POLARITY 0x00000100
165#define BM_TIMROT_TIMCTRL3_UPDATE 0x00000080
166#define BM_TIMROT_TIMCTRL3_RELOAD 0x00000040
167#define BP_TIMROT_TIMCTRL3_PRESCALE 4
168#define BM_TIMROT_TIMCTRL3_PRESCALE 0x00000030
169#define BF_TIMROT_TIMCTRL3_PRESCALE(v) \
170 (((v) << 4) & BM_TIMROT_TIMCTRL3_PRESCALE)
171#define BV_TIMROT_TIMCTRL3_PRESCALE__DIV_BY_1 0x0
172#define BV_TIMROT_TIMCTRL3_PRESCALE__DIV_BY_2 0x1
173#define BV_TIMROT_TIMCTRL3_PRESCALE__DIV_BY_4 0x2
174#define BV_TIMROT_TIMCTRL3_PRESCALE__DIV_BY_8 0x3
175#define BP_TIMROT_TIMCTRL3_SELECT 0
176#define BM_TIMROT_TIMCTRL3_SELECT 0x0000000F
177#define BF_TIMROT_TIMCTRL3_SELECT(v) \
178 (((v) << 0) & BM_TIMROT_TIMCTRL3_SELECT)
179#define BV_TIMROT_TIMCTRL3_SELECT__NEVER_TICK 0x0
180#define BV_TIMROT_TIMCTRL3_SELECT__PWM0 0x1
181#define BV_TIMROT_TIMCTRL3_SELECT__PWM1 0x2
182#define BV_TIMROT_TIMCTRL3_SELECT__PWM2 0x3
183#define BV_TIMROT_TIMCTRL3_SELECT__PWM3 0x4
184#define BV_TIMROT_TIMCTRL3_SELECT__PWM4 0x5
185#define BV_TIMROT_TIMCTRL3_SELECT__ROTARYA 0x6
186#define BV_TIMROT_TIMCTRL3_SELECT__ROTARYB 0x7
187#define BV_TIMROT_TIMCTRL3_SELECT__32KHZ_XTAL 0x8
188#define BV_TIMROT_TIMCTRL3_SELECT__8KHZ_XTAL 0x9
189#define BV_TIMROT_TIMCTRL3_SELECT__4KHZ_XTAL 0xA
190#define BV_TIMROT_TIMCTRL3_SELECT__1KHZ_XTAL 0xB
191#define BV_TIMROT_TIMCTRL3_SELECT__TICK_ALWAYS 0xC
192HW_REGISTER_0(HW_TIMROT_TIMCOUNT3, REGS_TIMROT_BASE, 0x00000090)
193#define HW_TIMROT_TIMCOUNT3_ADDR (REGS_TIMROT_BASE + 0x00000090)
194#define BP_TIMROT_TIMCOUNT3_LOW_RUNNING_COUNT 16
195#define BM_TIMROT_TIMCOUNT3_LOW_RUNNING_COUNT 0xFFFF0000
196#define BF_TIMROT_TIMCOUNT3_LOW_RUNNING_COUNT(v) \
197 (((v) << 16) & BM_TIMROT_TIMCOUNT3_LOW_RUNNING_COUNT)
198#define BP_TIMROT_TIMCOUNT3_HIGH_FIXED_COUNT 0
199#define BM_TIMROT_TIMCOUNT3_HIGH_FIXED_COUNT 0x0000FFFF
200#define BF_TIMROT_TIMCOUNT3_HIGH_FIXED_COUNT(v) \
201 (((v) << 0) & BM_TIMROT_TIMCOUNT3_HIGH_FIXED_COUNT)
202HW_REGISTER_0(HW_TIMROT_VERSION, REGS_TIMROT_BASE, 0x000000a0)
203#define HW_TIMROT_VERSION_ADDR (REGS_TIMROT_BASE + 0x000000a0)
204#define BP_TIMROT_VERSION_MAJOR 24
205#define BM_TIMROT_VERSION_MAJOR 0xFF000000
206#define BF_TIMROT_VERSION_MAJOR(v) \
207 (((v) << 24) & BM_TIMROT_VERSION_MAJOR)
208#define BP_TIMROT_VERSION_MINOR 16
209#define BM_TIMROT_VERSION_MINOR 0x00FF0000
210#define BF_TIMROT_VERSION_MINOR(v) \
211 (((v) << 16) & BM_TIMROT_VERSION_MINOR)
212#define BP_TIMROT_VERSION_STEP 0
213#define BM_TIMROT_VERSION_STEP 0x0000FFFF
214#define BF_TIMROT_VERSION_STEP(v) \
215 (((v) << 0) & BM_TIMROT_VERSION_STEP)
216#endif /* __ARCH_ARM___TIMROT_H */