blob: 6f138d04b806495d2af17d641b02efa9a71bab08 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Ian Campbell49aeca32014-05-05 11:52:23 +01002/*
3 * (C) Copyright 2007-2011
4 * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
5 * Tom Cubie <tangliang@allwinnertech.com>
6 *
7 * Configuration settings for the Allwinner A10-evb board.
Ian Campbell49aeca32014-05-05 11:52:23 +01008 */
9
10#ifndef _SUNXI_TIMER_H_
11#define _SUNXI_TIMER_H_
12
Ian Campbell49aeca32014-05-05 11:52:23 +010013#ifndef __ASSEMBLY__
14
15#include <linux/types.h>
Chen-Yu Tsai0d152762014-10-04 20:37:26 +080016#include <asm/arch/watchdog.h>
Ian Campbell49aeca32014-05-05 11:52:23 +010017
18/* General purpose timer */
19struct sunxi_timer {
20 u32 ctl;
21 u32 inter;
22 u32 val;
23 u8 res[4];
24};
25
26/* Audio video sync*/
27struct sunxi_avs {
28 u32 ctl; /* 0x80 */
29 u32 cnt0; /* 0x84 */
30 u32 cnt1; /* 0x88 */
31 u32 div; /* 0x8c */
32};
33
34/* 64 bit counter */
35struct sunxi_64cnt {
36 u32 ctl; /* 0xa0 */
37 u32 lo; /* 0xa4 */
38 u32 hi; /* 0xa8 */
39};
40
Ian Campbell49aeca32014-05-05 11:52:23 +010041/* Rtc */
42struct sunxi_rtc {
43 u32 ctl; /* 0x100 */
44 u32 yymmdd; /* 0x104 */
45 u32 hhmmss; /* 0x108 */
46};
47
48/* Alarm */
49struct sunxi_alarm {
50 u32 ddhhmmss; /* 0x10c */
51 u32 hhmmss; /* 0x110 */
52 u32 en; /* 0x114 */
53 u32 irqen; /* 0x118 */
54 u32 irqsta; /* 0x11c */
55};
56
57/* Timer general purpose register */
58struct sunxi_tgp {
59 u32 tgpd;
60};
61
62struct sunxi_timer_reg {
63 u32 tirqen; /* 0x00 */
64 u32 tirqsta; /* 0x04 */
65 u8 res1[8];
66 struct sunxi_timer timer[6]; /* We have 6 timers */
67 u8 res2[16];
68 struct sunxi_avs avs;
Chen-Yu Tsai84f3bb42016-11-30 16:27:14 +080069#if defined(CONFIG_SUNXI_GEN_SUN4I) || defined(CONFIG_MACH_SUN8I_R40)
Chen-Yu Tsai0d152762014-10-04 20:37:26 +080070 struct sunxi_wdog wdog; /* 0x90 */
Chen-Yu Tsaib717bd82014-10-04 20:37:27 +080071 /* XXX the following is not accurate for sun5i/sun7i */
Chen-Yu Tsai0d152762014-10-04 20:37:26 +080072 struct sunxi_64cnt cnt64; /* 0xa0 */
Ian Campbell49aeca32014-05-05 11:52:23 +010073 u8 res4[0x58];
74 struct sunxi_rtc rtc;
75 struct sunxi_alarm alarm;
76 struct sunxi_tgp tgp[4];
77 u8 res5[8];
78 u32 cpu_cfg;
Icenowy Zheng5a76cdd2018-07-21 16:20:27 +080079#elif defined(CONFIG_SUNXI_GEN_SUN6I) || defined(CONFIG_MACH_SUN50I_H6)
Chen-Yu Tsaib717bd82014-10-04 20:37:27 +080080 u8 res3[16];
81 struct sunxi_wdog wdog[5]; /* We have 5 watchdogs */
82#endif
Ian Campbell49aeca32014-05-05 11:52:23 +010083};
84
85#endif /* __ASSEMBLY__ */
86
87#endif