xref: /openbmc/linux/arch/powerpc/include/asm/fsl_gtm.h (revision 8a56e1ee)
1b8b572e1SStephen Rothwell /*
2b8b572e1SStephen Rothwell  * Freescale General-purpose Timers Module
3b8b572e1SStephen Rothwell  *
48a56e1eeSYang Li  * Copyright 2006 Freescale Semiconductor, Inc.
5b8b572e1SStephen Rothwell  *               Shlomi Gridish <gridish@freescale.com>
6b8b572e1SStephen Rothwell  *               Jerry Huang <Chang-Ming.Huang@freescale.com>
7b8b572e1SStephen Rothwell  * Copyright (c) MontaVista Software, Inc. 2008.
8b8b572e1SStephen Rothwell  *               Anton Vorontsov <avorontsov@ru.mvista.com>
9b8b572e1SStephen Rothwell  *
10b8b572e1SStephen Rothwell  * This program is free software; you can redistribute  it and/or modify it
11b8b572e1SStephen Rothwell  * under  the terms of  the GNU General  Public License as published by the
12b8b572e1SStephen Rothwell  * Free Software Foundation;  either version 2 of the  License, or (at your
13b8b572e1SStephen Rothwell  * option) any later version.
14b8b572e1SStephen Rothwell  */
15b8b572e1SStephen Rothwell 
16b8b572e1SStephen Rothwell #ifndef __ASM_FSL_GTM_H
17b8b572e1SStephen Rothwell #define __ASM_FSL_GTM_H
18b8b572e1SStephen Rothwell 
19b8b572e1SStephen Rothwell #include <linux/types.h>
20b8b572e1SStephen Rothwell 
21b8b572e1SStephen Rothwell struct gtm;
22b8b572e1SStephen Rothwell 
23b8b572e1SStephen Rothwell struct gtm_timer {
24b8b572e1SStephen Rothwell 	unsigned int irq;
25b8b572e1SStephen Rothwell 
26b8b572e1SStephen Rothwell 	struct gtm *gtm;
27b8b572e1SStephen Rothwell 	bool requested;
28b8b572e1SStephen Rothwell 	u8 __iomem *gtcfr;
29b8b572e1SStephen Rothwell 	__be16 __iomem *gtmdr;
30b8b572e1SStephen Rothwell 	__be16 __iomem *gtpsr;
31b8b572e1SStephen Rothwell 	__be16 __iomem *gtcnr;
32b8b572e1SStephen Rothwell 	__be16 __iomem *gtrfr;
33b8b572e1SStephen Rothwell 	__be16 __iomem *gtevr;
34b8b572e1SStephen Rothwell };
35b8b572e1SStephen Rothwell 
36b8b572e1SStephen Rothwell extern struct gtm_timer *gtm_get_timer16(void);
37b8b572e1SStephen Rothwell extern struct gtm_timer *gtm_get_specific_timer16(struct gtm *gtm,
38b8b572e1SStephen Rothwell 						  unsigned int timer);
39b8b572e1SStephen Rothwell extern void gtm_put_timer16(struct gtm_timer *tmr);
40b8b572e1SStephen Rothwell extern int gtm_set_timer16(struct gtm_timer *tmr, unsigned long usec,
41b8b572e1SStephen Rothwell 			     bool reload);
42b8b572e1SStephen Rothwell extern int gtm_set_exact_timer16(struct gtm_timer *tmr, u16 usec,
43b8b572e1SStephen Rothwell 				 bool reload);
44b8b572e1SStephen Rothwell extern void gtm_stop_timer16(struct gtm_timer *tmr);
45b8b572e1SStephen Rothwell extern void gtm_ack_timer16(struct gtm_timer *tmr, u16 events);
46b8b572e1SStephen Rothwell 
47b8b572e1SStephen Rothwell #endif /* __ASM_FSL_GTM_H */
48