1 // THIS HEADER FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT 2 3 /** 4 * Copyright (c) 2024 Raspberry Pi Ltd. 5 * 6 * SPDX-License-Identifier: BSD-3-Clause 7 */ 8 // ============================================================================= 9 // Register block : TIMER 10 // Version : 1 11 // Bus type : apb 12 // Description : Controls time and alarms 13 // 14 // time is a 64 bit value indicating the time since power-on 15 // 16 // timeh is the top 32 bits of time & timel is the bottom 32 17 // bits to change time write to timelw before timehw to read 18 // time read from timelr before timehr 19 // 20 // An alarm is set by setting alarm_enable and writing to the 21 // corresponding alarm register When an alarm is pending, the 22 // corresponding alarm_running signal will be high An alarm can 23 // be cancelled before it has finished by clearing the 24 // alarm_enable When an alarm fires, the corresponding 25 // alarm_irq is set and alarm_running is cleared To clear the 26 // interrupt write a 1 to the corresponding alarm_irq The timer 27 // can be locked to prevent writing 28 // ============================================================================= 29 #ifndef _HARDWARE_REGS_TIMER_H 30 #define _HARDWARE_REGS_TIMER_H 31 // ============================================================================= 32 // Register : TIMER_TIMEHW 33 // Description : Write to bits 63:32 of time always write timelw before timehw 34 #define TIMER_TIMEHW_OFFSET _u(0x00000000) 35 #define TIMER_TIMEHW_BITS _u(0xffffffff) 36 #define TIMER_TIMEHW_RESET _u(0x00000000) 37 #define TIMER_TIMEHW_MSB _u(31) 38 #define TIMER_TIMEHW_LSB _u(0) 39 #define TIMER_TIMEHW_ACCESS "WF" 40 // ============================================================================= 41 // Register : TIMER_TIMELW 42 // Description : Write to bits 31:0 of time writes do not get copied to time 43 // until timehw is written 44 #define TIMER_TIMELW_OFFSET _u(0x00000004) 45 #define TIMER_TIMELW_BITS _u(0xffffffff) 46 #define TIMER_TIMELW_RESET _u(0x00000000) 47 #define TIMER_TIMELW_MSB _u(31) 48 #define TIMER_TIMELW_LSB _u(0) 49 #define TIMER_TIMELW_ACCESS "WF" 50 // ============================================================================= 51 // Register : TIMER_TIMEHR 52 // Description : Read from bits 63:32 of time always read timelr before timehr 53 #define TIMER_TIMEHR_OFFSET _u(0x00000008) 54 #define TIMER_TIMEHR_BITS _u(0xffffffff) 55 #define TIMER_TIMEHR_RESET _u(0x00000000) 56 #define TIMER_TIMEHR_MSB _u(31) 57 #define TIMER_TIMEHR_LSB _u(0) 58 #define TIMER_TIMEHR_ACCESS "RO" 59 // ============================================================================= 60 // Register : TIMER_TIMELR 61 // Description : Read from bits 31:0 of time 62 #define TIMER_TIMELR_OFFSET _u(0x0000000c) 63 #define TIMER_TIMELR_BITS _u(0xffffffff) 64 #define TIMER_TIMELR_RESET _u(0x00000000) 65 #define TIMER_TIMELR_MSB _u(31) 66 #define TIMER_TIMELR_LSB _u(0) 67 #define TIMER_TIMELR_ACCESS "RO" 68 // ============================================================================= 69 // Register : TIMER_ALARM0 70 // Description : Arm alarm 0, and configure the time it will fire. Once armed, 71 // the alarm fires when TIMER_ALARM0 == TIMELR. The alarm will 72 // disarm itself once it fires, and can be disarmed early using 73 // the ARMED status register. 74 #define TIMER_ALARM0_OFFSET _u(0x00000010) 75 #define TIMER_ALARM0_BITS _u(0xffffffff) 76 #define TIMER_ALARM0_RESET _u(0x00000000) 77 #define TIMER_ALARM0_MSB _u(31) 78 #define TIMER_ALARM0_LSB _u(0) 79 #define TIMER_ALARM0_ACCESS "RW" 80 // ============================================================================= 81 // Register : TIMER_ALARM1 82 // Description : Arm alarm 1, and configure the time it will fire. Once armed, 83 // the alarm fires when TIMER_ALARM1 == TIMELR. The alarm will 84 // disarm itself once it fires, and can be disarmed early using 85 // the ARMED status register. 86 #define TIMER_ALARM1_OFFSET _u(0x00000014) 87 #define TIMER_ALARM1_BITS _u(0xffffffff) 88 #define TIMER_ALARM1_RESET _u(0x00000000) 89 #define TIMER_ALARM1_MSB _u(31) 90 #define TIMER_ALARM1_LSB _u(0) 91 #define TIMER_ALARM1_ACCESS "RW" 92 // ============================================================================= 93 // Register : TIMER_ALARM2 94 // Description : Arm alarm 2, and configure the time it will fire. Once armed, 95 // the alarm fires when TIMER_ALARM2 == TIMELR. The alarm will 96 // disarm itself once it fires, and can be disarmed early using 97 // the ARMED status register. 98 #define TIMER_ALARM2_OFFSET _u(0x00000018) 99 #define TIMER_ALARM2_BITS _u(0xffffffff) 100 #define TIMER_ALARM2_RESET _u(0x00000000) 101 #define TIMER_ALARM2_MSB _u(31) 102 #define TIMER_ALARM2_LSB _u(0) 103 #define TIMER_ALARM2_ACCESS "RW" 104 // ============================================================================= 105 // Register : TIMER_ALARM3 106 // Description : Arm alarm 3, and configure the time it will fire. Once armed, 107 // the alarm fires when TIMER_ALARM3 == TIMELR. The alarm will 108 // disarm itself once it fires, and can be disarmed early using 109 // the ARMED status register. 110 #define TIMER_ALARM3_OFFSET _u(0x0000001c) 111 #define TIMER_ALARM3_BITS _u(0xffffffff) 112 #define TIMER_ALARM3_RESET _u(0x00000000) 113 #define TIMER_ALARM3_MSB _u(31) 114 #define TIMER_ALARM3_LSB _u(0) 115 #define TIMER_ALARM3_ACCESS "RW" 116 // ============================================================================= 117 // Register : TIMER_ARMED 118 // Description : Indicates the armed/disarmed status of each alarm. A write to 119 // the corresponding ALARMx register arms the alarm. Alarms 120 // automatically disarm upon firing, but writing ones here will 121 // disarm immediately without waiting to fire. 122 #define TIMER_ARMED_OFFSET _u(0x00000020) 123 #define TIMER_ARMED_BITS _u(0x0000000f) 124 #define TIMER_ARMED_RESET _u(0x00000000) 125 #define TIMER_ARMED_MSB _u(3) 126 #define TIMER_ARMED_LSB _u(0) 127 #define TIMER_ARMED_ACCESS "WC" 128 // ============================================================================= 129 // Register : TIMER_TIMERAWH 130 // Description : Raw read from bits 63:32 of time (no side effects) 131 #define TIMER_TIMERAWH_OFFSET _u(0x00000024) 132 #define TIMER_TIMERAWH_BITS _u(0xffffffff) 133 #define TIMER_TIMERAWH_RESET _u(0x00000000) 134 #define TIMER_TIMERAWH_MSB _u(31) 135 #define TIMER_TIMERAWH_LSB _u(0) 136 #define TIMER_TIMERAWH_ACCESS "RO" 137 // ============================================================================= 138 // Register : TIMER_TIMERAWL 139 // Description : Raw read from bits 31:0 of time (no side effects) 140 #define TIMER_TIMERAWL_OFFSET _u(0x00000028) 141 #define TIMER_TIMERAWL_BITS _u(0xffffffff) 142 #define TIMER_TIMERAWL_RESET _u(0x00000000) 143 #define TIMER_TIMERAWL_MSB _u(31) 144 #define TIMER_TIMERAWL_LSB _u(0) 145 #define TIMER_TIMERAWL_ACCESS "RO" 146 // ============================================================================= 147 // Register : TIMER_DBGPAUSE 148 // Description : Set bits high to enable pause when the corresponding debug 149 // ports are active 150 #define TIMER_DBGPAUSE_OFFSET _u(0x0000002c) 151 #define TIMER_DBGPAUSE_BITS _u(0x00000006) 152 #define TIMER_DBGPAUSE_RESET _u(0x00000007) 153 // ----------------------------------------------------------------------------- 154 // Field : TIMER_DBGPAUSE_DBG1 155 // Description : Pause when processor 1 is in debug mode 156 #define TIMER_DBGPAUSE_DBG1_RESET _u(0x1) 157 #define TIMER_DBGPAUSE_DBG1_BITS _u(0x00000004) 158 #define TIMER_DBGPAUSE_DBG1_MSB _u(2) 159 #define TIMER_DBGPAUSE_DBG1_LSB _u(2) 160 #define TIMER_DBGPAUSE_DBG1_ACCESS "RW" 161 // ----------------------------------------------------------------------------- 162 // Field : TIMER_DBGPAUSE_DBG0 163 // Description : Pause when processor 0 is in debug mode 164 #define TIMER_DBGPAUSE_DBG0_RESET _u(0x1) 165 #define TIMER_DBGPAUSE_DBG0_BITS _u(0x00000002) 166 #define TIMER_DBGPAUSE_DBG0_MSB _u(1) 167 #define TIMER_DBGPAUSE_DBG0_LSB _u(1) 168 #define TIMER_DBGPAUSE_DBG0_ACCESS "RW" 169 // ============================================================================= 170 // Register : TIMER_PAUSE 171 // Description : Set high to pause the timer 172 #define TIMER_PAUSE_OFFSET _u(0x00000030) 173 #define TIMER_PAUSE_BITS _u(0x00000001) 174 #define TIMER_PAUSE_RESET _u(0x00000000) 175 #define TIMER_PAUSE_MSB _u(0) 176 #define TIMER_PAUSE_LSB _u(0) 177 #define TIMER_PAUSE_ACCESS "RW" 178 // ============================================================================= 179 // Register : TIMER_LOCKED 180 // Description : Set locked bit to disable write access to timer Once set, 181 // cannot be cleared (without a reset) 182 #define TIMER_LOCKED_OFFSET _u(0x00000034) 183 #define TIMER_LOCKED_BITS _u(0x00000001) 184 #define TIMER_LOCKED_RESET _u(0x00000000) 185 #define TIMER_LOCKED_MSB _u(0) 186 #define TIMER_LOCKED_LSB _u(0) 187 #define TIMER_LOCKED_ACCESS "RW" 188 // ============================================================================= 189 // Register : TIMER_SOURCE 190 // Description : Selects the source for the timer. Defaults to the normal tick 191 // configured in the ticks block (typically configured to 1 192 // microsecond). Writing to 1 will ignore the tick and count 193 // clk_sys cycles instead. 194 #define TIMER_SOURCE_OFFSET _u(0x00000038) 195 #define TIMER_SOURCE_BITS _u(0x00000001) 196 #define TIMER_SOURCE_RESET _u(0x00000000) 197 // ----------------------------------------------------------------------------- 198 // Field : TIMER_SOURCE_CLK_SYS 199 // 0x0 -> TICK 200 // 0x1 -> CLK_SYS 201 #define TIMER_SOURCE_CLK_SYS_RESET _u(0x0) 202 #define TIMER_SOURCE_CLK_SYS_BITS _u(0x00000001) 203 #define TIMER_SOURCE_CLK_SYS_MSB _u(0) 204 #define TIMER_SOURCE_CLK_SYS_LSB _u(0) 205 #define TIMER_SOURCE_CLK_SYS_ACCESS "RW" 206 #define TIMER_SOURCE_CLK_SYS_VALUE_TICK _u(0x0) 207 #define TIMER_SOURCE_CLK_SYS_VALUE_CLK_SYS _u(0x1) 208 // ============================================================================= 209 // Register : TIMER_INTR 210 // Description : Raw Interrupts 211 #define TIMER_INTR_OFFSET _u(0x0000003c) 212 #define TIMER_INTR_BITS _u(0x0000000f) 213 #define TIMER_INTR_RESET _u(0x00000000) 214 // ----------------------------------------------------------------------------- 215 // Field : TIMER_INTR_ALARM_3 216 #define TIMER_INTR_ALARM_3_RESET _u(0x0) 217 #define TIMER_INTR_ALARM_3_BITS _u(0x00000008) 218 #define TIMER_INTR_ALARM_3_MSB _u(3) 219 #define TIMER_INTR_ALARM_3_LSB _u(3) 220 #define TIMER_INTR_ALARM_3_ACCESS "WC" 221 // ----------------------------------------------------------------------------- 222 // Field : TIMER_INTR_ALARM_2 223 #define TIMER_INTR_ALARM_2_RESET _u(0x0) 224 #define TIMER_INTR_ALARM_2_BITS _u(0x00000004) 225 #define TIMER_INTR_ALARM_2_MSB _u(2) 226 #define TIMER_INTR_ALARM_2_LSB _u(2) 227 #define TIMER_INTR_ALARM_2_ACCESS "WC" 228 // ----------------------------------------------------------------------------- 229 // Field : TIMER_INTR_ALARM_1 230 #define TIMER_INTR_ALARM_1_RESET _u(0x0) 231 #define TIMER_INTR_ALARM_1_BITS _u(0x00000002) 232 #define TIMER_INTR_ALARM_1_MSB _u(1) 233 #define TIMER_INTR_ALARM_1_LSB _u(1) 234 #define TIMER_INTR_ALARM_1_ACCESS "WC" 235 // ----------------------------------------------------------------------------- 236 // Field : TIMER_INTR_ALARM_0 237 #define TIMER_INTR_ALARM_0_RESET _u(0x0) 238 #define TIMER_INTR_ALARM_0_BITS _u(0x00000001) 239 #define TIMER_INTR_ALARM_0_MSB _u(0) 240 #define TIMER_INTR_ALARM_0_LSB _u(0) 241 #define TIMER_INTR_ALARM_0_ACCESS "WC" 242 // ============================================================================= 243 // Register : TIMER_INTE 244 // Description : Interrupt Enable 245 #define TIMER_INTE_OFFSET _u(0x00000040) 246 #define TIMER_INTE_BITS _u(0x0000000f) 247 #define TIMER_INTE_RESET _u(0x00000000) 248 // ----------------------------------------------------------------------------- 249 // Field : TIMER_INTE_ALARM_3 250 #define TIMER_INTE_ALARM_3_RESET _u(0x0) 251 #define TIMER_INTE_ALARM_3_BITS _u(0x00000008) 252 #define TIMER_INTE_ALARM_3_MSB _u(3) 253 #define TIMER_INTE_ALARM_3_LSB _u(3) 254 #define TIMER_INTE_ALARM_3_ACCESS "RW" 255 // ----------------------------------------------------------------------------- 256 // Field : TIMER_INTE_ALARM_2 257 #define TIMER_INTE_ALARM_2_RESET _u(0x0) 258 #define TIMER_INTE_ALARM_2_BITS _u(0x00000004) 259 #define TIMER_INTE_ALARM_2_MSB _u(2) 260 #define TIMER_INTE_ALARM_2_LSB _u(2) 261 #define TIMER_INTE_ALARM_2_ACCESS "RW" 262 // ----------------------------------------------------------------------------- 263 // Field : TIMER_INTE_ALARM_1 264 #define TIMER_INTE_ALARM_1_RESET _u(0x0) 265 #define TIMER_INTE_ALARM_1_BITS _u(0x00000002) 266 #define TIMER_INTE_ALARM_1_MSB _u(1) 267 #define TIMER_INTE_ALARM_1_LSB _u(1) 268 #define TIMER_INTE_ALARM_1_ACCESS "RW" 269 // ----------------------------------------------------------------------------- 270 // Field : TIMER_INTE_ALARM_0 271 #define TIMER_INTE_ALARM_0_RESET _u(0x0) 272 #define TIMER_INTE_ALARM_0_BITS _u(0x00000001) 273 #define TIMER_INTE_ALARM_0_MSB _u(0) 274 #define TIMER_INTE_ALARM_0_LSB _u(0) 275 #define TIMER_INTE_ALARM_0_ACCESS "RW" 276 // ============================================================================= 277 // Register : TIMER_INTF 278 // Description : Interrupt Force 279 #define TIMER_INTF_OFFSET _u(0x00000044) 280 #define TIMER_INTF_BITS _u(0x0000000f) 281 #define TIMER_INTF_RESET _u(0x00000000) 282 // ----------------------------------------------------------------------------- 283 // Field : TIMER_INTF_ALARM_3 284 #define TIMER_INTF_ALARM_3_RESET _u(0x0) 285 #define TIMER_INTF_ALARM_3_BITS _u(0x00000008) 286 #define TIMER_INTF_ALARM_3_MSB _u(3) 287 #define TIMER_INTF_ALARM_3_LSB _u(3) 288 #define TIMER_INTF_ALARM_3_ACCESS "RW" 289 // ----------------------------------------------------------------------------- 290 // Field : TIMER_INTF_ALARM_2 291 #define TIMER_INTF_ALARM_2_RESET _u(0x0) 292 #define TIMER_INTF_ALARM_2_BITS _u(0x00000004) 293 #define TIMER_INTF_ALARM_2_MSB _u(2) 294 #define TIMER_INTF_ALARM_2_LSB _u(2) 295 #define TIMER_INTF_ALARM_2_ACCESS "RW" 296 // ----------------------------------------------------------------------------- 297 // Field : TIMER_INTF_ALARM_1 298 #define TIMER_INTF_ALARM_1_RESET _u(0x0) 299 #define TIMER_INTF_ALARM_1_BITS _u(0x00000002) 300 #define TIMER_INTF_ALARM_1_MSB _u(1) 301 #define TIMER_INTF_ALARM_1_LSB _u(1) 302 #define TIMER_INTF_ALARM_1_ACCESS "RW" 303 // ----------------------------------------------------------------------------- 304 // Field : TIMER_INTF_ALARM_0 305 #define TIMER_INTF_ALARM_0_RESET _u(0x0) 306 #define TIMER_INTF_ALARM_0_BITS _u(0x00000001) 307 #define TIMER_INTF_ALARM_0_MSB _u(0) 308 #define TIMER_INTF_ALARM_0_LSB _u(0) 309 #define TIMER_INTF_ALARM_0_ACCESS "RW" 310 // ============================================================================= 311 // Register : TIMER_INTS 312 // Description : Interrupt status after masking & forcing 313 #define TIMER_INTS_OFFSET _u(0x00000048) 314 #define TIMER_INTS_BITS _u(0x0000000f) 315 #define TIMER_INTS_RESET _u(0x00000000) 316 // ----------------------------------------------------------------------------- 317 // Field : TIMER_INTS_ALARM_3 318 #define TIMER_INTS_ALARM_3_RESET _u(0x0) 319 #define TIMER_INTS_ALARM_3_BITS _u(0x00000008) 320 #define TIMER_INTS_ALARM_3_MSB _u(3) 321 #define TIMER_INTS_ALARM_3_LSB _u(3) 322 #define TIMER_INTS_ALARM_3_ACCESS "RO" 323 // ----------------------------------------------------------------------------- 324 // Field : TIMER_INTS_ALARM_2 325 #define TIMER_INTS_ALARM_2_RESET _u(0x0) 326 #define TIMER_INTS_ALARM_2_BITS _u(0x00000004) 327 #define TIMER_INTS_ALARM_2_MSB _u(2) 328 #define TIMER_INTS_ALARM_2_LSB _u(2) 329 #define TIMER_INTS_ALARM_2_ACCESS "RO" 330 // ----------------------------------------------------------------------------- 331 // Field : TIMER_INTS_ALARM_1 332 #define TIMER_INTS_ALARM_1_RESET _u(0x0) 333 #define TIMER_INTS_ALARM_1_BITS _u(0x00000002) 334 #define TIMER_INTS_ALARM_1_MSB _u(1) 335 #define TIMER_INTS_ALARM_1_LSB _u(1) 336 #define TIMER_INTS_ALARM_1_ACCESS "RO" 337 // ----------------------------------------------------------------------------- 338 // Field : TIMER_INTS_ALARM_0 339 #define TIMER_INTS_ALARM_0_RESET _u(0x0) 340 #define TIMER_INTS_ALARM_0_BITS _u(0x00000001) 341 #define TIMER_INTS_ALARM_0_MSB _u(0) 342 #define TIMER_INTS_ALARM_0_LSB _u(0) 343 #define TIMER_INTS_ALARM_0_ACCESS "RO" 344 // ============================================================================= 345 #endif // _HARDWARE_REGS_TIMER_H 346 347