aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86')
-rw-r--r--include/asm-x86/geode.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/include/asm-x86/geode.h b/include/asm-x86/geode.h
index 6da4bbbea3dc..d94898831bac 100644
--- a/include/asm-x86/geode.h
+++ b/include/asm-x86/geode.h
@@ -156,4 +156,54 @@ static inline int is_geode(void)
156 return (is_geode_gx() || is_geode_lx()); 156 return (is_geode_gx() || is_geode_lx());
157} 157}
158 158
159/* MFGPTs */
160
161#define MFGPT_MAX_TIMERS 8
162#define MFGPT_TIMER_ANY -1
163
164#define MFGPT_DOMAIN_WORKING 1
165#define MFGPT_DOMAIN_STANDBY 2
166#define MFGPT_DOMAIN_ANY (MFGPT_DOMAIN_WORKING | MFGPT_DOMAIN_STANDBY)
167
168#define MFGPT_CMP1 0
169#define MFGPT_CMP2 1
170
171#define MFGPT_EVENT_IRQ 0
172#define MFGPT_EVENT_NMI 1
173#define MFGPT_EVENT_RESET 3
174
175#define MFGPT_REG_CMP1 0
176#define MFGPT_REG_CMP2 2
177#define MFGPT_REG_COUNTER 4
178#define MFGPT_REG_SETUP 6
179
180#define MFGPT_SETUP_CNTEN (1 << 15)
181#define MFGPT_SETUP_CMP2 (1 << 14)
182#define MFGPT_SETUP_CMP1 (1 << 13)
183#define MFGPT_SETUP_SETUP (1 << 12)
184#define MFGPT_SETUP_STOPEN (1 << 11)
185#define MFGPT_SETUP_EXTEN (1 << 10)
186#define MFGPT_SETUP_REVEN (1 << 5)
187#define MFGPT_SETUP_CLKSEL (1 << 4)
188
189static inline void geode_mfgpt_write(int timer, u16 reg, u16 value)
190{
191 u32 base = geode_get_dev_base(GEODE_DEV_MFGPT);
192 outw(value, base + reg + (timer * 8));
193}
194
195static inline u16 geode_mfgpt_read(int timer, u16 reg)
196{
197 u32 base = geode_get_dev_base(GEODE_DEV_MFGPT);
198 return inw(base + reg + (timer * 8));
199}
200
201extern int __init geode_mfgpt_detect(void);
202extern int geode_mfgpt_toggle_event(int timer, int cmp, int event, int enable);
203extern int geode_mfgpt_set_irq(int timer, int cmp, int irq, int enable);
204extern int geode_mfgpt_alloc_timer(int timer, int domain, struct module *owner);
205
206#define geode_mfgpt_setup_irq(t, c, i) geode_mfgpt_set_irq((t), (c), (i), 1)
207#define geode_mfgpt_release_irq(t, c, i) geode_mfgpt_set_irq((t), (c), (i), 0)
208
159#endif 209#endif