regsspba.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  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_SPBA_REGISTERS_H__
  22. #define __HW_SPBA_REGISTERS_H__
  23. #include "regs.h"
  24. /*
  25. * i.MX6UL SPBA
  26. *
  27. * Temperature Monitor
  28. *
  29. * Registers defined in this header file:
  30. * - HW_SPBA_PRRn - Peripheral Rights Register
  31. *
  32. * - hw_spba_t - Struct containing all module registers.
  33. */
  34. //! @name Module base addresses
  35. //@{
  36. #ifndef REGS_SPBA_BASE
  37. #define HW_SPBA_INSTANCE_COUNT (1) //!< Number of instances of the SPBA module.
  38. #define REGS_SPBA_BASE (0x0203c000) //!< Base address for SPBA.
  39. #endif
  40. //@}
  41. //-------------------------------------------------------------------------------------------
  42. // HW_SPBA_PRRn - Peripheral Rights Register
  43. //-------------------------------------------------------------------------------------------
  44. #ifndef __LANGUAGE_ASM__
  45. /*!
  46. * @brief HW_SPBA_PRRn - Peripheral Rights Register (RW)
  47. *
  48. * Reset value: 0x00000007
  49. *
  50. * This register controls master ownership and access for a peripheral.
  51. */
  52. typedef union _hw_spba_prrn
  53. {
  54. reg32_t U;
  55. struct _hw_spba_prrn_bitfields
  56. {
  57. unsigned RARA : 1; //!< [0] Resource Access Right.
  58. unsigned RARB : 1; //!< [1] Resource Access Right.
  59. unsigned RARC : 1; //!< [2] Resource Access Right.
  60. unsigned RESERVED0 : 13; //!< [15:3] Reserved
  61. unsigned ROI : 2; //!< [17:16] Resource Owner ID.
  62. unsigned RESERVED1 : 12; //!< [29:18] Reserved
  63. unsigned RMO : 2; //!< [31:30] Requesting Master Owner.
  64. } B;
  65. } hw_spba_prrn_t;
  66. #endif
  67. /*!
  68. * @name Constants and macros for entire SPBA_PRRn register
  69. */
  70. //@{
  71. //! @brief Number of instances of the SPBA_PRRn register.
  72. #define HW_SPBA_PRRn_COUNT (32)
  73. #define HW_SPBA_PRRn_ADDR(n) (REGS_SPBA_BASE + 0x0 + (0x4 * (n)))
  74. #ifndef __LANGUAGE_ASM__
  75. #define HW_SPBA_PRRn(n) (*(volatile hw_spba_prrn_t *) HW_SPBA_PRRn_ADDR(n))
  76. #define HW_SPBA_PRRn_RD(n) (HW_SPBA_PRRn(n).U)
  77. #define HW_SPBA_PRRn_WR(n, v) (HW_SPBA_PRRn(n).U = (v))
  78. #define HW_SPBA_PRRn_SET(n, v) (HW_SPBA_PRRn_WR(n, HW_SPBA_PRRn_RD(n) | (v)))
  79. #define HW_SPBA_PRRn_CLR(n, v) (HW_SPBA_PRRn_WR(n, HW_SPBA_PRRn_RD(n) & ~(v)))
  80. #define HW_SPBA_PRRn_TOG(n, v) (HW_SPBA_PRRn_WR(n, HW_SPBA_PRRn_RD(n) ^ (v)))
  81. #endif
  82. //@}
  83. /*
  84. * constants & macros for individual SPBA_PRRn bitfields
  85. */
  86. /*! @name Register SPBA_PRRn, field RARA[0] (RW)
  87. *
  88. * Resource Access Right. Control and Status bit for master A. This field indicates whether master A
  89. * can access the peripheral. From 0 up to 3 masters can have permission to access a resource (all
  90. * the master can be granted on a peripheral, but only one access at a time will be granted by
  91. * SPBA).
  92. *
  93. * Values:
  94. * - PROHIBITED = 0 - Access to peripheral is not allowed.
  95. * - ALLOWED = 1 - Access to peripheral is granted.
  96. */
  97. //@{
  98. #define BP_SPBA_PRRn_RARA (0) //!< Bit position for SPBA_PRRn_RARA.
  99. #define BM_SPBA_PRRn_RARA (0x00000001) //!< Bit mask for SPBA_PRRn_RARA.
  100. //! @brief Get value of SPBA_PRRn_RARA from a register value.
  101. #define BG_SPBA_PRRn_RARA(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_SPBA_PRRn_RARA) >> BP_SPBA_PRRn_RARA)
  102. //! @brief Format value for bitfield SPBA_PRRn_RARA.
  103. #define BF_SPBA_PRRn_RARA(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_SPBA_PRRn_RARA) & BM_SPBA_PRRn_RARA)
  104. #ifndef __LANGUAGE_ASM__
  105. //! @brief Set the RARA field to a new value.
  106. #define BW_SPBA_PRRn_RARA(n, v) (HW_SPBA_PRRn_WR(n, (HW_SPBA_PRRn_RD(n) & ~BM_SPBA_PRRn_RARA) | BF_SPBA_PRRn_RARA(v)))
  107. #endif
  108. //! @brief Macro to simplify usage of value macros.
  109. #define BF_SPBA_PRRn_RARA_V(v) BF_SPBA_PRRn_RARA(BV_SPBA_PRRn_RARA__##v)
  110. #define BV_SPBA_PRRn_RARA__PROHIBITED (0x0) //!< Access to peripheral is not allowed.
  111. #define BV_SPBA_PRRn_RARA__ALLOWED (0x1) //!< Access to peripheral is granted.
  112. //@}
  113. /*! @name Register SPBA_PRRn, field RARB[1] (RW)
  114. *
  115. * Resource Access Right. Control and Status bit for master B. This field indicates whether master B
  116. * can access the peripheral. From 0 up to 3 masters can have permission to access a resource (all
  117. * the master can be granted on a peripheral, but only one access at a time will be granted by
  118. * SPBA).
  119. *
  120. * Values:
  121. * - PROHIBITED = 0 - Access to peripheral is not allowed.
  122. * - ALLOWED = 1 - Access to peripheral is granted.
  123. */
  124. //@{
  125. #define BP_SPBA_PRRn_RARB (1) //!< Bit position for SPBA_PRRn_RARB.
  126. #define BM_SPBA_PRRn_RARB (0x00000002) //!< Bit mask for SPBA_PRRn_RARB.
  127. //! @brief Get value of SPBA_PRRn_RARB from a register value.
  128. #define BG_SPBA_PRRn_RARB(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_SPBA_PRRn_RARB) >> BP_SPBA_PRRn_RARB)
  129. //! @brief Format value for bitfield SPBA_PRRn_RARB.
  130. #define BF_SPBA_PRRn_RARB(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_SPBA_PRRn_RARB) & BM_SPBA_PRRn_RARB)
  131. #ifndef __LANGUAGE_ASM__
  132. //! @brief Set the RARB field to a new value.
  133. #define BW_SPBA_PRRn_RARB(n, v) (HW_SPBA_PRRn_WR(n, (HW_SPBA_PRRn_RD(n) & ~BM_SPBA_PRRn_RARB) | BF_SPBA_PRRn_RARB(v)))
  134. #endif
  135. //! @brief Macro to simplify usage of value macros.
  136. #define BF_SPBA_PRRn_RARB_V(v) BF_SPBA_PRRn_RARB(BV_SPBA_PRRn_RARB__##v)
  137. #define BV_SPBA_PRRn_RARB__PROHIBITED (0x0) //!< Access to peripheral is not allowed.
  138. #define BV_SPBA_PRRn_RARB__ALLOWED (0x1) //!< Access to peripheral is granted.
  139. //@}
  140. /*! @name Register SPBA_PRRn, field RARC[2] (RW)
  141. *
  142. * Resource Access Right. Control and Status bit for master C. This field indicates whether master C
  143. * can access the peripheral. From 0 up to 3 masters can have permission to access a resource (all
  144. * the master can be granted on a peripheral, but only one access at a time will be granted by
  145. * SPBA).
  146. *
  147. * Values:
  148. * - PROHIBITED = 0 - Access to peripheral is not allowed.
  149. * - ALLOWED = 1 - Access to peripheral is granted.
  150. */
  151. //@{
  152. #define BP_SPBA_PRRn_RARC (2) //!< Bit position for SPBA_PRRn_RARC.
  153. #define BM_SPBA_PRRn_RARC (0x00000004) //!< Bit mask for SPBA_PRRn_RARC.
  154. //! @brief Get value of SPBA_PRRn_RARC from a register value.
  155. #define BG_SPBA_PRRn_RARC(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_SPBA_PRRn_RARC) >> BP_SPBA_PRRn_RARC)
  156. //! @brief Format value for bitfield SPBA_PRRn_RARC.
  157. #define BF_SPBA_PRRn_RARC(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_SPBA_PRRn_RARC) & BM_SPBA_PRRn_RARC)
  158. #ifndef __LANGUAGE_ASM__
  159. //! @brief Set the RARC field to a new value.
  160. #define BW_SPBA_PRRn_RARC(n, v) (HW_SPBA_PRRn_WR(n, (HW_SPBA_PRRn_RD(n) & ~BM_SPBA_PRRn_RARC) | BF_SPBA_PRRn_RARC(v)))
  161. #endif
  162. //! @brief Macro to simplify usage of value macros.
  163. #define BF_SPBA_PRRn_RARC_V(v) BF_SPBA_PRRn_RARC(BV_SPBA_PRRn_RARC__##v)
  164. #define BV_SPBA_PRRn_RARC__PROHIBITED (0x0) //!< Access to peripheral is not allowed.
  165. #define BV_SPBA_PRRn_RARC__ALLOWED (0x1) //!< Access to peripheral is granted.
  166. //@}
  167. /*! @name Register SPBA_PRRn, field ROI[17:16] (RO)
  168. *
  169. * Resource Owner ID. This field indicates which master (one at a time) can access to the PRR for
  170. * rights modification. This is a read-only register. After reset, ROI bits are cleared ("00" -> un-
  171. * owned resource). A master performing a write access to the an un-owned PRR will get its ID
  172. * automatically written into ROI, while modifying RARx bits. It can then read back the RMO, RAR,
  173. * ROI bits to make sure RMO returns the right value, ROI bits contain its ID and RARx bits are
  174. * correctly asserted. Then no other master (whom ID is different from the one stored in ROI) will
  175. * be able to modify RAR fields. Owner master of a peripheral can assert its dead_owner signal, or
  176. * write 1'b0 in the RARx to release the ownership (ROI[1:0] reset to 2'b0).
  177. *
  178. * Values:
  179. * - UNOWNED = 00 - Unowned resource.
  180. * - MASTER_A = 01 - The resource is owned by master A port.
  181. * - MASTER_B = 10 - The resource is owned by master B port.
  182. * - MASTER_C = 11 - The resource is owned by master C port.
  183. */
  184. //@{
  185. #define BP_SPBA_PRRn_ROI (16) //!< Bit position for SPBA_PRRn_ROI.
  186. #define BM_SPBA_PRRn_ROI (0x00030000) //!< Bit mask for SPBA_PRRn_ROI.
  187. //! @brief Get value of SPBA_PRRn_ROI from a register value.
  188. #define BG_SPBA_PRRn_ROI(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_SPBA_PRRn_ROI) >> BP_SPBA_PRRn_ROI)
  189. //! @brief Macro to simplify usage of value macros.
  190. #define BF_SPBA_PRRn_ROI_V(v) BF_SPBA_PRRn_ROI(BV_SPBA_PRRn_ROI__##v)
  191. #define BV_SPBA_PRRn_ROI__UNOWNED (0x0) //!< Unowned resource.
  192. #define BV_SPBA_PRRn_ROI__MASTER_A (0x1) //!< The resource is owned by master A port.
  193. #define BV_SPBA_PRRn_ROI__MASTER_B (0x2) //!< The resource is owned by master B port.
  194. #define BV_SPBA_PRRn_ROI__MASTER_C (0x3) //!< The resource is owned by master C port.
  195. //@}
  196. /*! @name Register SPBA_PRRn, field RMO[31:30] (RO)
  197. *
  198. * Requesting Master Owner. This 2-bit register field indicates if the corresponding resource is
  199. * owned by the requesting master or not. This register is reset to 2'b0 if ROI = 2'b0.
  200. *
  201. * Values:
  202. * - UNOWNED = 00 - The resource is unowned.
  203. * - 01 - Reserved.
  204. * - ANOTHER_MASTER = 10 - The resource is owned by another master.
  205. * - REQUESTING_MASTER = 11 - The resource is owned by the requesting master.
  206. */
  207. //@{
  208. #define BP_SPBA_PRRn_RMO (30) //!< Bit position for SPBA_PRRn_RMO.
  209. #define BM_SPBA_PRRn_RMO (0xc0000000) //!< Bit mask for SPBA_PRRn_RMO.
  210. //! @brief Get value of SPBA_PRRn_RMO from a register value.
  211. #define BG_SPBA_PRRn_RMO(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_SPBA_PRRn_RMO) >> BP_SPBA_PRRn_RMO)
  212. //! @brief Macro to simplify usage of value macros.
  213. #define BF_SPBA_PRRn_RMO_V(v) BF_SPBA_PRRn_RMO(BV_SPBA_PRRn_RMO__##v)
  214. #define BV_SPBA_PRRn_RMO__UNOWNED (0x0) //!< The resource is unowned.
  215. #define BV_SPBA_PRRn_RMO__ANOTHER_MASTER (0x2) //!< The resource is owned by another master.
  216. #define BV_SPBA_PRRn_RMO__REQUESTING_MASTER (0x3) //!< The resource is owned by the requesting master.
  217. //@}
  218. //-------------------------------------------------------------------------------------------
  219. // hw_spba_t - module struct
  220. //-------------------------------------------------------------------------------------------
  221. /*!
  222. * @brief All SPBA module registers.
  223. */
  224. #ifndef __LANGUAGE_ASM__
  225. #pragma pack(1)
  226. typedef struct _hw_spba
  227. {
  228. volatile hw_spba_prrn_t PRRn[32]; //!< Peripheral Rights Register
  229. } hw_spba_t;
  230. #pragma pack()
  231. //! @brief Macro to access all SPBA registers.
  232. //! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
  233. //! use the '&' operator, like <code>&HW_SPBA</code>.
  234. #define HW_SPBA (*(hw_spba_t *) REGS_SPBA_BASE)
  235. #endif
  236. #endif // __HW_SPBA_REGISTERS_H__
  237. // v18/121106/1.2.2
  238. // EOF