blob: 0d8140201d28f890e31688eb9fc63aeafa7928c3 [file] [log] [blame]
Michal Simek76316a32007-03-11 13:42:58 +01001/*
2 * (C) Copyright 2007 Michal Simek
3 *
4 * Michal SIMEK <monstr@monstr.cz>
5 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
Michal Simek76316a32007-03-11 13:42:58 +01007 */
8
9#define TIMER_ENABLE_ALL 0x400 /* ENALL */
10#define TIMER_PWM 0x200 /* PWMA0 */
11#define TIMER_INTERRUPT 0x100 /* T0INT */
12#define TIMER_ENABLE 0x080 /* ENT0 */
13#define TIMER_ENABLE_INTR 0x040 /* ENIT0 */
14#define TIMER_RESET 0x020 /* LOAD0 */
15#define TIMER_RELOAD 0x010 /* ARHT0 */
16#define TIMER_EXT_CAPTURE 0x008 /* CAPT0 */
17#define TIMER_EXT_COMPARE 0x004 /* GENT0 */
18#define TIMER_DOWN_COUNT 0x002 /* UDT0 */
19#define TIMER_CAPTURE_MODE 0x001 /* MDT0 */
20
21typedef volatile struct microblaze_timer_t {
22 int control; /* control/statuc register TCSR */
23 int loadreg; /* load register TLR */
24 int counter; /* timer/counter register */
25} microblaze_timer_t;
Michal Simekbcbb0462012-06-29 13:46:54 +020026
27int timer_init(void);