regsarmglobaltimer.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * Copyright (c) 2012, Freescale Semiconductor, Inc.
  3. * All rights reserved.
  4. *
  5. * THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESS OR IMPLIED
  6. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  7. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
  8. * SHALL FREESCALE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  9. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
  10. * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  11. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  12. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  13. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  14. * OF SUCH DAMAGE.
  15. */
  16. /*
  17. * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
  18. *
  19. * This file was generated automatically and any changes may be lost.
  20. */
  21. #ifndef __HW_ARMGLOBALTIMER_REGISTERS_H__
  22. #define __HW_ARMGLOBALTIMER_REGISTERS_H__
  23. #include "regs.h"
  24. /*
  25. * i.MX6UL ARMGLOBALTIMER
  26. *
  27. * ARM Cortex-A9 Global Timer
  28. *
  29. * Registers defined in this header file:
  30. * - HW_ARMGLOBALTIMER_COUNTERn - Global Timer Counter Registers
  31. * - HW_ARMGLOBALTIMER_CONTROL - Global Timer Control Register
  32. * - HW_ARMGLOBALTIMER_IRQSTATUS - Global Timer Interrupt Status Register
  33. * - HW_ARMGLOBALTIMER_COMPARATORn - Global Timer Comparator Value Registers
  34. * - HW_ARMGLOBALTIMER_AUTOINCREMENT - Global Timer Auto-increment Register
  35. *
  36. * - hw_armglobaltimer_t - Struct containing all module registers.
  37. */
  38. //! @name Module base addresses
  39. //@{
  40. #ifndef REGS_ARMGLOBALTIMER_BASE
  41. #define HW_ARMGLOBALTIMER_INSTANCE_COUNT (1) //!< Number of instances of the ARMGLOBALTIMER module.
  42. #define REGS_ARMGLOBALTIMER_BASE (0x021DC000) //!< Base address for ARMGLOBALTIMER.
  43. #endif
  44. //@}
  45. //-------------------------------------------------------------------------------------------
  46. // HW_ARMGLOBALTIMER_CONTROL - Global Timer Control Register
  47. //-------------------------------------------------------------------------------------------
  48. #ifndef __LANGUAGE_ASM__
  49. /*!
  50. * @brief HW_ARMGLOBALTIMER_CONTROL - Global Timer Control Register (RW)
  51. *
  52. * Reset value: 0x00000000
  53. *
  54. * Configuration and control of the Global Timer.
  55. */
  56. typedef union _hw_armglobaltimer_control
  57. {
  58. reg32_t U;
  59. struct _hw_armglobaltimer_control_bitfields
  60. {
  61. unsigned TIMER_ENABLE : 1; //!< [0] Timer enable.
  62. unsigned DBG_ENABLE : 1; //!< [1] This bit is banked per Cortex-A9 processor.
  63. unsigned RESERVED0 : 6; //!< [2] This bit is banked per Cortex-A9 processor.
  64. unsigned FCR0 : 1; //!< [3] This bit is banked per Cortex-A9 processor.
  65. unsigned FCR1 : 1; //!< [7:4] Reserved
  66. unsigned RESERVED1 : 22; //!< [31:16] Reserved.
  67. } B;
  68. } hw_armglobaltimer_control_t;
  69. #endif
  70. /*!
  71. * @name Constants and macros for entire ARMGLOBALTIMER_CONTROL register
  72. */
  73. //@{
  74. #define HW_ARMGLOBALTIMER_CONTROL_ADDR (REGS_ARMGLOBALTIMER_BASE + 0x000)
  75. #ifndef __LANGUAGE_ASM__
  76. #define HW_ARMGLOBALTIMER_CONTROL (*(volatile hw_armglobaltimer_control_t *) HW_ARMGLOBALTIMER_CONTROL_ADDR)
  77. #define HW_ARMGLOBALTIMER_CONTROL_RD() (HW_ARMGLOBALTIMER_CONTROL.U)
  78. #define HW_ARMGLOBALTIMER_CONTROL_WR(v) (HW_ARMGLOBALTIMER_CONTROL.U = (v))
  79. #define HW_ARMGLOBALTIMER_CONTROL_SET(v) (HW_ARMGLOBALTIMER_CONTROL_WR(HW_ARMGLOBALTIMER_CONTROL_RD() | (v)))
  80. #define HW_ARMGLOBALTIMER_CONTROL_CLR(v) (HW_ARMGLOBALTIMER_CONTROL_WR(HW_ARMGLOBALTIMER_CONTROL_RD() & ~(v)))
  81. #define HW_ARMGLOBALTIMER_CONTROL_TOG(v) (HW_ARMGLOBALTIMER_CONTROL_WR(HW_ARMGLOBALTIMER_CONTROL_RD() ^ (v)))
  82. #endif
  83. //@}
  84. #define HW_ARMGLOBALTIMER_COUNTER_LO_ADDR (REGS_ARMGLOBALTIMER_BASE + 0x008)
  85. #ifndef __LANGUAGE_ASM__
  86. #define HW_ARMGLOBALTIMER_COUNTER_LO (*(volatile unsigned *) HW_ARMGLOBALTIMER_COUNTER_LO_ADDR)
  87. #define HW_ARMGLOBALTIMER_COUNTER_LO_RD() (HW_ARMGLOBALTIMER_COUNTER_LO)
  88. #define HW_ARMGLOBALTIMER_COUNTER_LO_WR(v) (HW_ARMGLOBALTIMER_COUNTER_LO = (v))
  89. #endif
  90. #define HW_ARMGLOBALTIMER_COUNTER_HI_ADDR (REGS_ARMGLOBALTIMER_BASE + 0x00C)
  91. #ifndef __LANGUAGE_ASM__
  92. #define HW_ARMGLOBALTIMER_COUNTER_HI (*(volatile unsigned *) HW_ARMGLOBALTIMER_COUNTER_HI_ADDR)
  93. #define HW_ARMGLOBALTIMER_COUNTER_HI_RD() (HW_ARMGLOBALTIMER_COUNTER_HI)
  94. #define HW_ARMGLOBALTIMER_COUNTER_HI_WR(v) (HW_ARMGLOBALTIMER_COUNTER_HI = (v))
  95. #endif
  96. #endif // __HW_ARMGLOBALTIMER_REGISTERS_H__