timer.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  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.
  8. */
  9. #ifndef _SUNXI_TIMER_H_
  10. #define _SUNXI_TIMER_H_
  11. #ifndef __ASSEMBLY__
  12. #include <linux/types.h>
  13. #include <asm/arch/watchdog.h>
  14. /* General purpose timer */
  15. struct sunxi_timer {
  16. u32 ctl;
  17. u32 inter;
  18. u32 val;
  19. u8 res[4];
  20. };
  21. /* Audio video sync*/
  22. struct sunxi_avs {
  23. u32 ctl; /* 0x80 */
  24. u32 cnt0; /* 0x84 */
  25. u32 cnt1; /* 0x88 */
  26. u32 div; /* 0x8c */
  27. };
  28. /* 64 bit counter */
  29. struct sunxi_64cnt {
  30. u32 ctl; /* 0xa0 */
  31. u32 lo; /* 0xa4 */
  32. u32 hi; /* 0xa8 */
  33. };
  34. /* Rtc */
  35. struct sunxi_rtc {
  36. u32 ctl; /* 0x100 */
  37. u32 yymmdd; /* 0x104 */
  38. u32 hhmmss; /* 0x108 */
  39. };
  40. /* Alarm */
  41. struct sunxi_alarm {
  42. u32 ddhhmmss; /* 0x10c */
  43. u32 hhmmss; /* 0x110 */
  44. u32 en; /* 0x114 */
  45. u32 irqen; /* 0x118 */
  46. u32 irqsta; /* 0x11c */
  47. };
  48. /* Timer general purpose register */
  49. struct sunxi_tgp {
  50. u32 tgpd;
  51. };
  52. struct sunxi_timer_reg {
  53. u32 tirqen; /* 0x00 */
  54. u32 tirqsta; /* 0x04 */
  55. u8 res1[8];
  56. struct sunxi_timer timer[6]; /* We have 6 timers */
  57. u8 res2[16];
  58. struct sunxi_avs avs;
  59. #if defined(CONFIG_SUNXI_GEN_SUN4I) || defined(CONFIG_MACH_SUN8I_R40)
  60. struct sunxi_wdog wdog; /* 0x90 */
  61. /* XXX the following is not accurate for sun5i/sun7i */
  62. struct sunxi_64cnt cnt64; /* 0xa0 */
  63. u8 res4[0x58];
  64. struct sunxi_rtc rtc;
  65. struct sunxi_alarm alarm;
  66. struct sunxi_tgp tgp[4];
  67. u8 res5[8];
  68. u32 cpu_cfg;
  69. #elif defined(CONFIG_SUNXI_GEN_SUN6I)
  70. u8 res3[16];
  71. struct sunxi_wdog wdog[5]; /* We have 5 watchdogs */
  72. #endif
  73. };
  74. #endif /* __ASSEMBLY__ */
  75. #endif