xref: /linux/arch/powerpc/include/asm/fsl_gtm.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*2874c5fdSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
2b8b572e1SStephen Rothwell /*
3b8b572e1SStephen Rothwell  * Freescale General-purpose Timers Module
4b8b572e1SStephen Rothwell  *
58a56e1eeSYang Li  * Copyright 2006 Freescale Semiconductor, Inc.
6b8b572e1SStephen Rothwell  *               Shlomi Gridish <gridish@freescale.com>
7b8b572e1SStephen Rothwell  *               Jerry Huang <Chang-Ming.Huang@freescale.com>
8b8b572e1SStephen Rothwell  * Copyright (c) MontaVista Software, Inc. 2008.
9b8b572e1SStephen Rothwell  *               Anton Vorontsov <avorontsov@ru.mvista.com>
10b8b572e1SStephen Rothwell  */
11b8b572e1SStephen Rothwell 
12b8b572e1SStephen Rothwell #ifndef __ASM_FSL_GTM_H
13b8b572e1SStephen Rothwell #define __ASM_FSL_GTM_H
14b8b572e1SStephen Rothwell 
15b8b572e1SStephen Rothwell #include <linux/types.h>
16b8b572e1SStephen Rothwell 
17b8b572e1SStephen Rothwell struct gtm;
18b8b572e1SStephen Rothwell 
19b8b572e1SStephen Rothwell struct gtm_timer {
20b8b572e1SStephen Rothwell 	unsigned int irq;
21b8b572e1SStephen Rothwell 
22b8b572e1SStephen Rothwell 	struct gtm *gtm;
23b8b572e1SStephen Rothwell 	bool requested;
24b8b572e1SStephen Rothwell 	u8 __iomem *gtcfr;
25b8b572e1SStephen Rothwell 	__be16 __iomem *gtmdr;
26b8b572e1SStephen Rothwell 	__be16 __iomem *gtpsr;
27b8b572e1SStephen Rothwell 	__be16 __iomem *gtcnr;
28b8b572e1SStephen Rothwell 	__be16 __iomem *gtrfr;
29b8b572e1SStephen Rothwell 	__be16 __iomem *gtevr;
30b8b572e1SStephen Rothwell };
31b8b572e1SStephen Rothwell 
32b8b572e1SStephen Rothwell extern struct gtm_timer *gtm_get_timer16(void);
33b8b572e1SStephen Rothwell extern struct gtm_timer *gtm_get_specific_timer16(struct gtm *gtm,
34b8b572e1SStephen Rothwell 						  unsigned int timer);
35b8b572e1SStephen Rothwell extern void gtm_put_timer16(struct gtm_timer *tmr);
36b8b572e1SStephen Rothwell extern int gtm_set_timer16(struct gtm_timer *tmr, unsigned long usec,
37b8b572e1SStephen Rothwell 			     bool reload);
38b8b572e1SStephen Rothwell extern int gtm_set_exact_timer16(struct gtm_timer *tmr, u16 usec,
39b8b572e1SStephen Rothwell 				 bool reload);
40b8b572e1SStephen Rothwell extern void gtm_stop_timer16(struct gtm_timer *tmr);
41b8b572e1SStephen Rothwell extern void gtm_ack_timer16(struct gtm_timer *tmr, u16 events);
42b8b572e1SStephen Rothwell 
43b8b572e1SStephen Rothwell #endif /* __ASM_FSL_GTM_H */
44