Ian Campbell | 49aeca3 | 2014-05-05 11:52:23 +0100 | [diff] [blame] | 1 | /* |
| 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 | |
Ian Campbell | 49aeca3 | 2014-05-05 11:52:23 +0100 | [diff] [blame] | 14 | #ifndef __ASSEMBLY__ |
| 15 | |
| 16 | #include <linux/types.h> |
Chen-Yu Tsai | 0d15276 | 2014-10-04 20:37:26 +0800 | [diff] [blame] | 17 | #include <asm/arch/watchdog.h> |
Ian Campbell | 49aeca3 | 2014-05-05 11:52:23 +0100 | [diff] [blame] | 18 | |
| 19 | /* General purpose timer */ |
| 20 | struct sunxi_timer { |
| 21 | u32 ctl; |
| 22 | u32 inter; |
| 23 | u32 val; |
| 24 | u8 res[4]; |
| 25 | }; |
| 26 | |
| 27 | /* Audio video sync*/ |
| 28 | struct sunxi_avs { |
| 29 | u32 ctl; /* 0x80 */ |
| 30 | u32 cnt0; /* 0x84 */ |
| 31 | u32 cnt1; /* 0x88 */ |
| 32 | u32 div; /* 0x8c */ |
| 33 | }; |
| 34 | |
| 35 | /* 64 bit counter */ |
| 36 | struct sunxi_64cnt { |
| 37 | u32 ctl; /* 0xa0 */ |
| 38 | u32 lo; /* 0xa4 */ |
| 39 | u32 hi; /* 0xa8 */ |
| 40 | }; |
| 41 | |
Ian Campbell | 49aeca3 | 2014-05-05 11:52:23 +0100 | [diff] [blame] | 42 | /* Rtc */ |
| 43 | struct sunxi_rtc { |
| 44 | u32 ctl; /* 0x100 */ |
| 45 | u32 yymmdd; /* 0x104 */ |
| 46 | u32 hhmmss; /* 0x108 */ |
| 47 | }; |
| 48 | |
| 49 | /* Alarm */ |
| 50 | struct sunxi_alarm { |
| 51 | u32 ddhhmmss; /* 0x10c */ |
| 52 | u32 hhmmss; /* 0x110 */ |
| 53 | u32 en; /* 0x114 */ |
| 54 | u32 irqen; /* 0x118 */ |
| 55 | u32 irqsta; /* 0x11c */ |
| 56 | }; |
| 57 | |
| 58 | /* Timer general purpose register */ |
| 59 | struct sunxi_tgp { |
| 60 | u32 tgpd; |
| 61 | }; |
| 62 | |
| 63 | struct sunxi_timer_reg { |
| 64 | u32 tirqen; /* 0x00 */ |
| 65 | u32 tirqsta; /* 0x04 */ |
| 66 | u8 res1[8]; |
| 67 | struct sunxi_timer timer[6]; /* We have 6 timers */ |
| 68 | u8 res2[16]; |
| 69 | struct sunxi_avs avs; |
Chen-Yu Tsai | b717bd8 | 2014-10-04 20:37:27 +0800 | [diff] [blame^] | 70 | #if defined(CONFIG_SUN4I) || defined(CONFIG_SUN5I) || defined(CONFIG_SUN7I) |
Chen-Yu Tsai | 0d15276 | 2014-10-04 20:37:26 +0800 | [diff] [blame] | 71 | struct sunxi_wdog wdog; /* 0x90 */ |
Chen-Yu Tsai | b717bd8 | 2014-10-04 20:37:27 +0800 | [diff] [blame^] | 72 | /* XXX the following is not accurate for sun5i/sun7i */ |
Chen-Yu Tsai | 0d15276 | 2014-10-04 20:37:26 +0800 | [diff] [blame] | 73 | struct sunxi_64cnt cnt64; /* 0xa0 */ |
Ian Campbell | 49aeca3 | 2014-05-05 11:52:23 +0100 | [diff] [blame] | 74 | u8 res4[0x58]; |
| 75 | struct sunxi_rtc rtc; |
| 76 | struct sunxi_alarm alarm; |
| 77 | struct sunxi_tgp tgp[4]; |
| 78 | u8 res5[8]; |
| 79 | u32 cpu_cfg; |
Chen-Yu Tsai | b717bd8 | 2014-10-04 20:37:27 +0800 | [diff] [blame^] | 80 | #else /* CONFIG_SUN6I || CONFIG_SUN8I || ... */ |
| 81 | u8 res3[16]; |
| 82 | struct sunxi_wdog wdog[5]; /* We have 5 watchdogs */ |
| 83 | #endif |
Ian Campbell | 49aeca3 | 2014-05-05 11:52:23 +0100 | [diff] [blame] | 84 | }; |
| 85 | |
| 86 | #endif /* __ASSEMBLY__ */ |
| 87 | |
| 88 | #endif |