pmic_timer.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _PMIC_TIMER_H_
  13. #define _PMIC_TIMER_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define REG_PMIC_TIMER_BASE (0x51108000)
  17. typedef volatile struct
  18. {
  19. uint32_t timer_version; // 0x00000000
  20. uint32_t timer_load_lo; // 0x00000004
  21. uint32_t timer_load_hi; // 0x00000008
  22. uint32_t timer_ctl; // 0x0000000c
  23. uint32_t timer_int; // 0x00000010
  24. uint32_t timer_value_shdw_lo; // 0x00000014
  25. uint32_t timer_value_shdw_hi; // 0x00000018
  26. } HWP_PMIC_TIMER_T;
  27. #define hwp_pmicTimer ((HWP_PMIC_TIMER_T *)REG_ACCESS_ADDRESS(REG_PMIC_TIMER_BASE))
  28. // timer_version
  29. typedef union {
  30. uint32_t v;
  31. struct
  32. {
  33. uint32_t ip_patch_version : 4; // [3:0], read only
  34. uint32_t ip_version : 12; // [15:4], read only
  35. uint32_t __31_16 : 16; // [31:16]
  36. } b;
  37. } REG_PMIC_TIMER_TIMER_VERSION_T;
  38. // timer_load_lo
  39. typedef union {
  40. uint32_t v;
  41. struct
  42. {
  43. uint32_t timer_load_lo : 16; // [15:0]
  44. uint32_t __31_16 : 16; // [31:16]
  45. } b;
  46. } REG_PMIC_TIMER_TIMER_LOAD_LO_T;
  47. // timer_load_hi
  48. typedef union {
  49. uint32_t v;
  50. struct
  51. {
  52. uint32_t timer_load_hi : 16; // [15:0]
  53. uint32_t __31_16 : 16; // [31:16]
  54. } b;
  55. } REG_PMIC_TIMER_TIMER_LOAD_HI_T;
  56. // timer_ctl
  57. typedef union {
  58. uint32_t v;
  59. struct
  60. {
  61. uint32_t timer_mode : 1; // [0]
  62. uint32_t timer_run : 1; // [1]
  63. uint32_t __31_2 : 30; // [31:2]
  64. } b;
  65. } REG_PMIC_TIMER_TIMER_CTL_T;
  66. // timer_int
  67. typedef union {
  68. uint32_t v;
  69. struct
  70. {
  71. uint32_t timer_int_en : 1; // [0]
  72. uint32_t timer_int_raw_sts : 1; // [1], read only
  73. uint32_t timer_int_mask_sts : 1; // [2], read only
  74. uint32_t timer_int_clr : 1; // [3], write clear
  75. uint32_t __31_4 : 28; // [31:4]
  76. } b;
  77. } REG_PMIC_TIMER_TIMER_INT_T;
  78. // timer_value_shdw_lo
  79. typedef union {
  80. uint32_t v;
  81. struct
  82. {
  83. uint32_t timer_value_shdw_lo : 16; // [15:0], read only
  84. uint32_t __31_16 : 16; // [31:16]
  85. } b;
  86. } REG_PMIC_TIMER_TIMER_VALUE_SHDW_LO_T;
  87. // timer_value_shdw_hi
  88. typedef union {
  89. uint32_t v;
  90. struct
  91. {
  92. uint32_t timer_value_shdw_hi : 16; // [15:0], read only
  93. uint32_t __31_16 : 16; // [31:16]
  94. } b;
  95. } REG_PMIC_TIMER_TIMER_VALUE_SHDW_HI_T;
  96. // timer_version
  97. #define PMIC_TIMER_IP_PATCH_VERSION(n) (((n)&0xf) << 0)
  98. #define PMIC_TIMER_IP_VERSION(n) (((n)&0xfff) << 4)
  99. // timer_load_lo
  100. #define PMIC_TIMER_TIMER_LOAD_LO(n) (((n)&0xffff) << 0)
  101. // timer_load_hi
  102. #define PMIC_TIMER_TIMER_LOAD_HI(n) (((n)&0xffff) << 0)
  103. // timer_ctl
  104. #define PMIC_TIMER_TIMER_MODE (1 << 0)
  105. #define PMIC_TIMER_TIMER_RUN (1 << 1)
  106. // timer_int
  107. #define PMIC_TIMER_TIMER_INT_EN (1 << 0)
  108. #define PMIC_TIMER_TIMER_INT_RAW_STS (1 << 1)
  109. #define PMIC_TIMER_TIMER_INT_MASK_STS (1 << 2)
  110. #define PMIC_TIMER_TIMER_INT_CLR (1 << 3)
  111. // timer_value_shdw_lo
  112. #define PMIC_TIMER_TIMER_VALUE_SHDW_LO(n) (((n)&0xffff) << 0)
  113. // timer_value_shdw_hi
  114. #define PMIC_TIMER_TIMER_VALUE_SHDW_HI(n) (((n)&0xffff) << 0)
  115. #endif // _PMIC_TIMER_H_