Jacky Bai | 4d93d1d | 2020-07-02 14:39:58 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2021-2024 NXP |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef MU_H |
| 8 | #define MU_H |
| 9 | |
| 10 | #include <stdint.h> |
| 11 | |
| 12 | typedef volatile unsigned int vuint32_t; |
| 13 | |
| 14 | /****************************************************************************/ |
| 15 | /* MODULE: Message Unit */ |
| 16 | /****************************************************************************/ |
| 17 | /* VER Register */ |
| 18 | typedef union { |
| 19 | vuint32_t R; |
| 20 | struct { |
| 21 | vuint32_t FEATURE : 16; |
| 22 | vuint32_t MINOR : 8; |
| 23 | vuint32_t MAJOR : 8; |
| 24 | } B; |
| 25 | } MU_VER_t; |
| 26 | |
| 27 | /* PAR Register */ |
| 28 | typedef union { |
| 29 | vuint32_t R; |
| 30 | struct { |
| 31 | vuint32_t TR_NUM : 8; |
| 32 | vuint32_t RR_NUM : 8; |
| 33 | vuint32_t GIR_NUM : 8; |
| 34 | vuint32_t FLAG_WIDTH : 8; |
| 35 | } B; |
| 36 | } MU_PAR_t; |
| 37 | |
| 38 | /* CR Register */ |
| 39 | typedef union { |
| 40 | vuint32_t R; |
| 41 | struct { |
| 42 | vuint32_t MUR : 1; |
| 43 | vuint32_t MURIE : 1; |
| 44 | vuint32_t rsrv_1 : 30; |
| 45 | } B; |
| 46 | } MU_CR_t; |
| 47 | |
| 48 | /* SR Register */ |
| 49 | typedef union { |
| 50 | vuint32_t R; |
| 51 | struct { |
| 52 | vuint32_t MURS : 1; |
| 53 | vuint32_t MURIP : 1; |
| 54 | vuint32_t EP : 1; |
| 55 | vuint32_t FUP : 1; |
| 56 | vuint32_t GIRP : 1; |
| 57 | vuint32_t TEP : 1; |
| 58 | vuint32_t RFP : 1; |
| 59 | vuint32_t CEP : 1; |
| 60 | vuint32_t rsrv_1 : 24; |
| 61 | |
| 62 | } B; |
| 63 | } MU_SR_t; |
| 64 | |
| 65 | /* CCR0 Register */ |
| 66 | typedef union { |
| 67 | vuint32_t R; |
| 68 | struct { |
| 69 | vuint32_t NMI : 1; |
| 70 | vuint32_t HR : 1; |
| 71 | vuint32_t HRM : 1; |
| 72 | vuint32_t CLKE : 1; |
| 73 | vuint32_t RSTH : 1; |
| 74 | vuint32_t BOOT : 2; |
| 75 | vuint32_t rsrv_1 : 25; |
| 76 | |
| 77 | } B; |
| 78 | } MU_CCR0_t; |
| 79 | |
| 80 | /* CIER0 Register */ |
| 81 | typedef union { |
| 82 | vuint32_t R; |
| 83 | struct { |
| 84 | vuint32_t rsrv_1 : 1; |
| 85 | vuint32_t HRIE : 1; |
| 86 | vuint32_t RUNIE : 1; |
| 87 | vuint32_t RAIE : 1; |
| 88 | vuint32_t HALTIE : 1; |
| 89 | vuint32_t WAITIE : 1; |
| 90 | vuint32_t STOPIE : 1; |
| 91 | vuint32_t PDIE : 1; |
| 92 | vuint32_t rsrv_2 : 24; |
| 93 | } B; |
| 94 | } MU_CIER0_t; |
| 95 | |
| 96 | /* CSSR0 Register */ |
| 97 | typedef union { |
| 98 | vuint32_t R; |
| 99 | struct { |
| 100 | vuint32_t NMIC : 1; |
| 101 | vuint32_t HRIP : 1; |
| 102 | vuint32_t RUN : 1; |
| 103 | vuint32_t RAIP : 1; |
| 104 | vuint32_t HALT : 1; |
| 105 | vuint32_t WAIT : 1; |
| 106 | vuint32_t STOP : 1; |
| 107 | vuint32_t PD : 1; |
| 108 | vuint32_t rsrv_1 : 24; |
| 109 | } B; |
| 110 | } MU_CSSR0_t; |
| 111 | |
| 112 | /* CSR0 Register */ |
| 113 | typedef union { |
| 114 | vuint32_t R; |
| 115 | struct { |
| 116 | vuint32_t rsrv_1 : 1; |
| 117 | vuint32_t HRIP : 1; |
| 118 | vuint32_t RUN : 1; |
| 119 | vuint32_t RAIP : 1; |
| 120 | vuint32_t HALT : 1; |
| 121 | vuint32_t WAIT : 1; |
| 122 | vuint32_t STOP : 1; |
| 123 | vuint32_t PD : 1; |
| 124 | vuint32_t rsrv_2 : 24; |
| 125 | } B; |
| 126 | } MU_CSR0_t; |
| 127 | |
| 128 | /* FCR Register */ |
| 129 | typedef union { |
| 130 | vuint32_t R; |
| 131 | struct { |
| 132 | vuint32_t F0 : 1; |
| 133 | vuint32_t F1 : 1; |
| 134 | vuint32_t F2 : 1; |
| 135 | vuint32_t rsrv_1 : 29; |
| 136 | } B; |
| 137 | } MU_FCR_t; |
| 138 | |
| 139 | /* FSR Register */ |
| 140 | typedef union { |
| 141 | vuint32_t R; |
| 142 | struct { |
| 143 | vuint32_t F0 : 1; |
| 144 | vuint32_t F1 : 1; |
| 145 | vuint32_t F2 : 1; |
| 146 | vuint32_t rsrv_1 : 29; |
| 147 | } B; |
| 148 | } MU_FSR_t; |
| 149 | |
| 150 | /* GIER Register */ |
| 151 | typedef union { |
| 152 | vuint32_t R; |
| 153 | struct { |
| 154 | vuint32_t GIE0 : 1; |
| 155 | vuint32_t GIE1 : 1; |
| 156 | vuint32_t rsrv_1 : 30; |
| 157 | } B; |
| 158 | } MU_GIER_t; |
| 159 | |
| 160 | /* GCR Register */ |
| 161 | typedef union { |
| 162 | vuint32_t R; |
| 163 | struct { |
| 164 | vuint32_t GIR0 : 1; |
| 165 | vuint32_t GIR1 : 1; |
| 166 | vuint32_t rsrv_1 : 30; |
| 167 | } B; |
| 168 | } MU_GCR_t; |
| 169 | |
| 170 | /* GSR Register */ |
| 171 | typedef union { |
| 172 | vuint32_t R; |
| 173 | struct { |
| 174 | vuint32_t GIP0 : 1; |
| 175 | vuint32_t GIP1 : 1; |
| 176 | vuint32_t rsrv_1 : 30; |
| 177 | } B; |
| 178 | } MU_GSR_t; |
| 179 | |
| 180 | /* TCR Register */ |
| 181 | typedef union{ |
| 182 | vuint32_t R; |
| 183 | struct { |
| 184 | vuint32_t TIE0 : 1; |
| 185 | vuint32_t TIE1 : 1; |
| 186 | vuint32_t rsrv_1 : 30; |
| 187 | } B; |
| 188 | } MU_TCR_t; |
| 189 | |
| 190 | /* TSR Register */ |
| 191 | typedef union { |
| 192 | vuint32_t R; |
| 193 | struct { |
| 194 | vuint32_t TE0 : 1; |
| 195 | vuint32_t TE1 : 1; |
| 196 | vuint32_t rsrv_1 : 30; |
| 197 | } B; |
| 198 | } MU_TSR_t; |
| 199 | |
| 200 | /* RCR Register */ |
| 201 | typedef union { |
| 202 | vuint32_t R; |
| 203 | struct { |
| 204 | vuint32_t RIE0 : 1; |
| 205 | vuint32_t RIE1 : 1; |
| 206 | vuint32_t rsrv_1 : 30; |
| 207 | } B; |
| 208 | } MU_RCR_t; |
| 209 | |
| 210 | /* RSR Register */ |
| 211 | typedef union { |
| 212 | vuint32_t R; |
| 213 | struct { |
| 214 | vuint32_t RF0 : 1; |
| 215 | vuint32_t RF1 : 1; |
| 216 | vuint32_t rsrv_1 : 30; |
| 217 | } B; |
| 218 | } MU_RSR_t; |
| 219 | |
| 220 | /* TR0 Register */ |
| 221 | typedef union { |
| 222 | vuint32_t R; |
| 223 | struct { |
| 224 | vuint32_t TR_DATA : 32; |
| 225 | } B; |
| 226 | } MU_TR0_t; |
| 227 | |
| 228 | /* TR1 Register */ |
| 229 | typedef union { |
| 230 | vuint32_t R; |
| 231 | struct { |
| 232 | vuint32_t TR_DATA : 32; |
| 233 | } B; |
| 234 | } MU_TR1_t; |
| 235 | |
| 236 | /* RR0 Register */ |
| 237 | typedef union { |
| 238 | vuint32_t R; |
| 239 | struct { |
| 240 | vuint32_t RR_DATA : 32; |
| 241 | } B; |
| 242 | } MU_RR0_t; |
| 243 | |
| 244 | /* RR1 Register */ |
| 245 | typedef union { |
| 246 | vuint32_t R; |
| 247 | struct { |
| 248 | vuint32_t RR_DATA : 32; |
| 249 | } B; |
| 250 | } MU_RR1_t; |
| 251 | |
| 252 | struct MU_t { |
| 253 | MU_VER_t VER; |
| 254 | MU_PAR_t PAR; |
| 255 | MU_CR_t CR; |
| 256 | MU_SR_t SR; |
| 257 | MU_CCR0_t CCR0; |
| 258 | MU_CIER0_t CIER0; |
| 259 | MU_CSSR0_t CSSR0; |
| 260 | MU_CSR0_t CSR0; |
| 261 | uint8_t MU_reserved0[224]; |
| 262 | MU_FCR_t FCR; |
| 263 | MU_FSR_t FSR; |
| 264 | uint8_t MU_reserved1[8]; |
| 265 | MU_GIER_t GIER; |
| 266 | MU_GCR_t GCR; |
| 267 | MU_GSR_t GSR; |
| 268 | uint8_t MU_reserved2[4]; |
| 269 | MU_TCR_t TCR; |
| 270 | MU_TSR_t TSR; |
| 271 | MU_RCR_t RCR; |
| 272 | MU_RSR_t RSR; |
| 273 | uint8_t MU_reserved3[208]; |
| 274 | MU_TR0_t TR[2]; |
| 275 | uint8_t MU_reserved4[120]; |
| 276 | MU_RR0_t RR[2]; |
| 277 | }; |
| 278 | |
| 279 | #endif /* MU_H */ |