Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Ian Campbell | 49aeca3 | 2014-05-05 11:52:23 +0100 | [diff] [blame] | 2 | /* |
| 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 Campbell | 49aeca3 | 2014-05-05 11:52:23 +0100 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #ifndef _SUNXI_TIMER_H_ |
| 11 | #define _SUNXI_TIMER_H_ |
| 12 | |
Ian Campbell | 49aeca3 | 2014-05-05 11:52:23 +0100 | [diff] [blame] | 13 | #ifndef __ASSEMBLY__ |
| 14 | |
| 15 | #include <linux/types.h> |
Chen-Yu Tsai | 0d15276 | 2014-10-04 20:37:26 +0800 | [diff] [blame] | 16 | #include <asm/arch/watchdog.h> |
Ian Campbell | 49aeca3 | 2014-05-05 11:52:23 +0100 | [diff] [blame] | 17 | |
| 18 | /* General purpose timer */ |
| 19 | struct sunxi_timer { |
| 20 | u32 ctl; |
| 21 | u32 inter; |
| 22 | u32 val; |
| 23 | u8 res[4]; |
| 24 | }; |
| 25 | |
| 26 | /* Audio video sync*/ |
| 27 | struct sunxi_avs { |
| 28 | u32 ctl; /* 0x80 */ |
| 29 | u32 cnt0; /* 0x84 */ |
| 30 | u32 cnt1; /* 0x88 */ |
| 31 | u32 div; /* 0x8c */ |
| 32 | }; |
| 33 | |
| 34 | /* 64 bit counter */ |
| 35 | struct sunxi_64cnt { |
| 36 | u32 ctl; /* 0xa0 */ |
| 37 | u32 lo; /* 0xa4 */ |
| 38 | u32 hi; /* 0xa8 */ |
| 39 | }; |
| 40 | |
Ian Campbell | 49aeca3 | 2014-05-05 11:52:23 +0100 | [diff] [blame] | 41 | /* Rtc */ |
| 42 | struct sunxi_rtc { |
| 43 | u32 ctl; /* 0x100 */ |
| 44 | u32 yymmdd; /* 0x104 */ |
| 45 | u32 hhmmss; /* 0x108 */ |
| 46 | }; |
| 47 | |
| 48 | /* Alarm */ |
| 49 | struct 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 */ |
| 58 | struct sunxi_tgp { |
| 59 | u32 tgpd; |
| 60 | }; |
| 61 | |
| 62 | struct 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 Tsai | 84f3bb4 | 2016-11-30 16:27:14 +0800 | [diff] [blame] | 69 | #if defined(CONFIG_SUNXI_GEN_SUN4I) || defined(CONFIG_MACH_SUN8I_R40) |
Chen-Yu Tsai | 0d15276 | 2014-10-04 20:37:26 +0800 | [diff] [blame] | 70 | struct sunxi_wdog wdog; /* 0x90 */ |
Chen-Yu Tsai | b717bd8 | 2014-10-04 20:37:27 +0800 | [diff] [blame] | 71 | /* XXX the following is not accurate for sun5i/sun7i */ |
Chen-Yu Tsai | 0d15276 | 2014-10-04 20:37:26 +0800 | [diff] [blame] | 72 | struct sunxi_64cnt cnt64; /* 0xa0 */ |
Ian Campbell | 49aeca3 | 2014-05-05 11:52:23 +0100 | [diff] [blame] | 73 | 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 Zheng | 5a76cdd | 2018-07-21 16:20:27 +0800 | [diff] [blame] | 79 | #elif defined(CONFIG_SUNXI_GEN_SUN6I) || defined(CONFIG_MACH_SUN50I_H6) |
Chen-Yu Tsai | b717bd8 | 2014-10-04 20:37:27 +0800 | [diff] [blame] | 80 | u8 res3[16]; |
| 81 | struct sunxi_wdog wdog[5]; /* We have 5 watchdogs */ |
| 82 | #endif |
Ian Campbell | 49aeca3 | 2014-05-05 11:52:23 +0100 | [diff] [blame] | 83 | }; |
| 84 | |
| 85 | #endif /* __ASSEMBLY__ */ |
| 86 | |
| 87 | #endif |