blob: 58e14fd0f713033aeaa2e2b0976b40444a8e1399 [file] [log] [blame]
Ian Campbell49aeca32014-05-05 11:52:23 +01001/*
2 * (C) Copyright 2007-2011
3 * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
4 * Tom Cubie <tangliang@allwinnertech.com>
5 *
6 * Configuration settings for the Allwinner A10-evb board.
7 *
8 * SPDX-License-Identifier: GPL-2.0+
9 */
10
11#ifndef _SUNXI_TIMER_H_
12#define _SUNXI_TIMER_H_
13
Hans de Goede1374e892014-06-09 11:36:56 +020014#define WDT_CTRL_RESTART (0x1 << 0)
15#define WDT_CTRL_KEY (0x0a57 << 1)
16#define WDT_MODE_EN (0x1 << 0)
17#define WDT_MODE_RESET_EN (0x1 << 1)
18
Ian Campbell49aeca32014-05-05 11:52:23 +010019#ifndef __ASSEMBLY__
20
21#include <linux/types.h>
22
23/* General purpose timer */
24struct sunxi_timer {
25 u32 ctl;
26 u32 inter;
27 u32 val;
28 u8 res[4];
29};
30
31/* Audio video sync*/
32struct sunxi_avs {
33 u32 ctl; /* 0x80 */
34 u32 cnt0; /* 0x84 */
35 u32 cnt1; /* 0x88 */
36 u32 div; /* 0x8c */
37};
38
39/* 64 bit counter */
40struct sunxi_64cnt {
41 u32 ctl; /* 0xa0 */
42 u32 lo; /* 0xa4 */
43 u32 hi; /* 0xa8 */
44};
45
46/* Watchdog */
47struct sunxi_wdog {
48 u32 ctl; /* 0x90 */
49 u32 mode; /* 0x94 */
50};
51
52/* Rtc */
53struct sunxi_rtc {
54 u32 ctl; /* 0x100 */
55 u32 yymmdd; /* 0x104 */
56 u32 hhmmss; /* 0x108 */
57};
58
59/* Alarm */
60struct sunxi_alarm {
61 u32 ddhhmmss; /* 0x10c */
62 u32 hhmmss; /* 0x110 */
63 u32 en; /* 0x114 */
64 u32 irqen; /* 0x118 */
65 u32 irqsta; /* 0x11c */
66};
67
68/* Timer general purpose register */
69struct sunxi_tgp {
70 u32 tgpd;
71};
72
73struct sunxi_timer_reg {
74 u32 tirqen; /* 0x00 */
75 u32 tirqsta; /* 0x04 */
76 u8 res1[8];
77 struct sunxi_timer timer[6]; /* We have 6 timers */
78 u8 res2[16];
79 struct sunxi_avs avs;
80 struct sunxi_wdog wdog;
81 u8 res3[8];
82 struct sunxi_64cnt cnt64;
83 u8 res4[0x58];
84 struct sunxi_rtc rtc;
85 struct sunxi_alarm alarm;
86 struct sunxi_tgp tgp[4];
87 u8 res5[8];
88 u32 cpu_cfg;
89};
90
91#endif /* __ASSEMBLY__ */
92
93#endif