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 : ROSC 10 // Version : 1 11 // Bus type : apb 12 // ============================================================================= 13 #ifndef _HARDWARE_REGS_ROSC_H 14 #define _HARDWARE_REGS_ROSC_H 15 // ============================================================================= 16 // Register : ROSC_CTRL 17 // Description : Ring Oscillator control 18 #define ROSC_CTRL_OFFSET _u(0x00000000) 19 #define ROSC_CTRL_BITS _u(0x00ffffff) 20 #define ROSC_CTRL_RESET _u(0x00000aa0) 21 // ----------------------------------------------------------------------------- 22 // Field : ROSC_CTRL_ENABLE 23 // Description : On power-up this field is initialised to ENABLE 24 // The system clock must be switched to another source before 25 // setting this field to DISABLE otherwise the chip will lock up 26 // The 12-bit code is intended to give some protection against 27 // accidental writes. An invalid setting will enable the 28 // oscillator. 29 // 0xd1e -> DISABLE 30 // 0xfab -> ENABLE 31 #define ROSC_CTRL_ENABLE_RESET "-" 32 #define ROSC_CTRL_ENABLE_BITS _u(0x00fff000) 33 #define ROSC_CTRL_ENABLE_MSB _u(23) 34 #define ROSC_CTRL_ENABLE_LSB _u(12) 35 #define ROSC_CTRL_ENABLE_ACCESS "RW" 36 #define ROSC_CTRL_ENABLE_VALUE_DISABLE _u(0xd1e) 37 #define ROSC_CTRL_ENABLE_VALUE_ENABLE _u(0xfab) 38 // ----------------------------------------------------------------------------- 39 // Field : ROSC_CTRL_FREQ_RANGE 40 // Description : Controls the number of delay stages in the ROSC ring 41 // LOW uses stages 0 to 7 42 // MEDIUM uses stages 2 to 7 43 // HIGH uses stages 4 to 7 44 // TOOHIGH uses stages 6 to 7 and should not be used because its 45 // frequency exceeds design specifications 46 // The clock output will not glitch when changing the range up one 47 // step at a time 48 // The clock output will glitch when changing the range down 49 // Note: the values here are gray coded which is why HIGH comes 50 // before TOOHIGH 51 // 0xfa4 -> LOW 52 // 0xfa5 -> MEDIUM 53 // 0xfa7 -> HIGH 54 // 0xfa6 -> TOOHIGH 55 #define ROSC_CTRL_FREQ_RANGE_RESET _u(0xaa0) 56 #define ROSC_CTRL_FREQ_RANGE_BITS _u(0x00000fff) 57 #define ROSC_CTRL_FREQ_RANGE_MSB _u(11) 58 #define ROSC_CTRL_FREQ_RANGE_LSB _u(0) 59 #define ROSC_CTRL_FREQ_RANGE_ACCESS "RW" 60 #define ROSC_CTRL_FREQ_RANGE_VALUE_LOW _u(0xfa4) 61 #define ROSC_CTRL_FREQ_RANGE_VALUE_MEDIUM _u(0xfa5) 62 #define ROSC_CTRL_FREQ_RANGE_VALUE_HIGH _u(0xfa7) 63 #define ROSC_CTRL_FREQ_RANGE_VALUE_TOOHIGH _u(0xfa6) 64 // ============================================================================= 65 // Register : ROSC_FREQA 66 // Description : The FREQA & FREQB registers control the frequency by 67 // controlling the drive strength of each stage 68 // The drive strength has 4 levels determined by the number of 69 // bits set 70 // Increasing the number of bits set increases the drive strength 71 // and increases the oscillation frequency 72 // 0 bits set is the default drive strength 73 // 1 bit set doubles the drive strength 74 // 2 bits set triples drive strength 75 // 3 bits set quadruples drive strength 76 #define ROSC_FREQA_OFFSET _u(0x00000004) 77 #define ROSC_FREQA_BITS _u(0xffff7777) 78 #define ROSC_FREQA_RESET _u(0x00000000) 79 // ----------------------------------------------------------------------------- 80 // Field : ROSC_FREQA_PASSWD 81 // Description : Set to 0x9696 to apply the settings 82 // Any other value in this field will set all drive strengths to 0 83 // 0x9696 -> PASS 84 #define ROSC_FREQA_PASSWD_RESET _u(0x0000) 85 #define ROSC_FREQA_PASSWD_BITS _u(0xffff0000) 86 #define ROSC_FREQA_PASSWD_MSB _u(31) 87 #define ROSC_FREQA_PASSWD_LSB _u(16) 88 #define ROSC_FREQA_PASSWD_ACCESS "RW" 89 #define ROSC_FREQA_PASSWD_VALUE_PASS _u(0x9696) 90 // ----------------------------------------------------------------------------- 91 // Field : ROSC_FREQA_DS3 92 // Description : Stage 3 drive strength 93 #define ROSC_FREQA_DS3_RESET _u(0x0) 94 #define ROSC_FREQA_DS3_BITS _u(0x00007000) 95 #define ROSC_FREQA_DS3_MSB _u(14) 96 #define ROSC_FREQA_DS3_LSB _u(12) 97 #define ROSC_FREQA_DS3_ACCESS "RW" 98 // ----------------------------------------------------------------------------- 99 // Field : ROSC_FREQA_DS2 100 // Description : Stage 2 drive strength 101 #define ROSC_FREQA_DS2_RESET _u(0x0) 102 #define ROSC_FREQA_DS2_BITS _u(0x00000700) 103 #define ROSC_FREQA_DS2_MSB _u(10) 104 #define ROSC_FREQA_DS2_LSB _u(8) 105 #define ROSC_FREQA_DS2_ACCESS "RW" 106 // ----------------------------------------------------------------------------- 107 // Field : ROSC_FREQA_DS1 108 // Description : Stage 1 drive strength 109 #define ROSC_FREQA_DS1_RESET _u(0x0) 110 #define ROSC_FREQA_DS1_BITS _u(0x00000070) 111 #define ROSC_FREQA_DS1_MSB _u(6) 112 #define ROSC_FREQA_DS1_LSB _u(4) 113 #define ROSC_FREQA_DS1_ACCESS "RW" 114 // ----------------------------------------------------------------------------- 115 // Field : ROSC_FREQA_DS0 116 // Description : Stage 0 drive strength 117 #define ROSC_FREQA_DS0_RESET _u(0x0) 118 #define ROSC_FREQA_DS0_BITS _u(0x00000007) 119 #define ROSC_FREQA_DS0_MSB _u(2) 120 #define ROSC_FREQA_DS0_LSB _u(0) 121 #define ROSC_FREQA_DS0_ACCESS "RW" 122 // ============================================================================= 123 // Register : ROSC_FREQB 124 // Description : For a detailed description see freqa register 125 #define ROSC_FREQB_OFFSET _u(0x00000008) 126 #define ROSC_FREQB_BITS _u(0xffff7777) 127 #define ROSC_FREQB_RESET _u(0x00000000) 128 // ----------------------------------------------------------------------------- 129 // Field : ROSC_FREQB_PASSWD 130 // Description : Set to 0x9696 to apply the settings 131 // Any other value in this field will set all drive strengths to 0 132 // 0x9696 -> PASS 133 #define ROSC_FREQB_PASSWD_RESET _u(0x0000) 134 #define ROSC_FREQB_PASSWD_BITS _u(0xffff0000) 135 #define ROSC_FREQB_PASSWD_MSB _u(31) 136 #define ROSC_FREQB_PASSWD_LSB _u(16) 137 #define ROSC_FREQB_PASSWD_ACCESS "RW" 138 #define ROSC_FREQB_PASSWD_VALUE_PASS _u(0x9696) 139 // ----------------------------------------------------------------------------- 140 // Field : ROSC_FREQB_DS7 141 // Description : Stage 7 drive strength 142 #define ROSC_FREQB_DS7_RESET _u(0x0) 143 #define ROSC_FREQB_DS7_BITS _u(0x00007000) 144 #define ROSC_FREQB_DS7_MSB _u(14) 145 #define ROSC_FREQB_DS7_LSB _u(12) 146 #define ROSC_FREQB_DS7_ACCESS "RW" 147 // ----------------------------------------------------------------------------- 148 // Field : ROSC_FREQB_DS6 149 // Description : Stage 6 drive strength 150 #define ROSC_FREQB_DS6_RESET _u(0x0) 151 #define ROSC_FREQB_DS6_BITS _u(0x00000700) 152 #define ROSC_FREQB_DS6_MSB _u(10) 153 #define ROSC_FREQB_DS6_LSB _u(8) 154 #define ROSC_FREQB_DS6_ACCESS "RW" 155 // ----------------------------------------------------------------------------- 156 // Field : ROSC_FREQB_DS5 157 // Description : Stage 5 drive strength 158 #define ROSC_FREQB_DS5_RESET _u(0x0) 159 #define ROSC_FREQB_DS5_BITS _u(0x00000070) 160 #define ROSC_FREQB_DS5_MSB _u(6) 161 #define ROSC_FREQB_DS5_LSB _u(4) 162 #define ROSC_FREQB_DS5_ACCESS "RW" 163 // ----------------------------------------------------------------------------- 164 // Field : ROSC_FREQB_DS4 165 // Description : Stage 4 drive strength 166 #define ROSC_FREQB_DS4_RESET _u(0x0) 167 #define ROSC_FREQB_DS4_BITS _u(0x00000007) 168 #define ROSC_FREQB_DS4_MSB _u(2) 169 #define ROSC_FREQB_DS4_LSB _u(0) 170 #define ROSC_FREQB_DS4_ACCESS "RW" 171 // ============================================================================= 172 // Register : ROSC_DORMANT 173 // Description : Ring Oscillator pause control 174 // This is used to save power by pausing the ROSC 175 // On power-up this field is initialised to WAKE 176 // An invalid write will also select WAKE 177 // Warning: setup the irq before selecting dormant mode 178 // 0x636f6d61 -> dormant 179 // 0x77616b65 -> WAKE 180 #define ROSC_DORMANT_OFFSET _u(0x0000000c) 181 #define ROSC_DORMANT_BITS _u(0xffffffff) 182 #define ROSC_DORMANT_RESET "-" 183 #define ROSC_DORMANT_MSB _u(31) 184 #define ROSC_DORMANT_LSB _u(0) 185 #define ROSC_DORMANT_ACCESS "RW" 186 #define ROSC_DORMANT_VALUE_DORMANT _u(0x636f6d61) 187 #define ROSC_DORMANT_VALUE_WAKE _u(0x77616b65) 188 // ============================================================================= 189 // Register : ROSC_DIV 190 // Description : Controls the output divider 191 // set to 0xaa0 + div where 192 // div = 0 divides by 32 193 // div = 1-31 divides by div 194 // any other value sets div=31 195 // this register resets to div=16 196 // 0xaa0 -> PASS 197 #define ROSC_DIV_OFFSET _u(0x00000010) 198 #define ROSC_DIV_BITS _u(0x00000fff) 199 #define ROSC_DIV_RESET "-" 200 #define ROSC_DIV_MSB _u(11) 201 #define ROSC_DIV_LSB _u(0) 202 #define ROSC_DIV_ACCESS "RW" 203 #define ROSC_DIV_VALUE_PASS _u(0xaa0) 204 // ============================================================================= 205 // Register : ROSC_PHASE 206 // Description : Controls the phase shifted output 207 #define ROSC_PHASE_OFFSET _u(0x00000014) 208 #define ROSC_PHASE_BITS _u(0x00000fff) 209 #define ROSC_PHASE_RESET _u(0x00000008) 210 // ----------------------------------------------------------------------------- 211 // Field : ROSC_PHASE_PASSWD 212 // Description : set to 0xaa 213 // any other value enables the output with shift=0 214 #define ROSC_PHASE_PASSWD_RESET _u(0x00) 215 #define ROSC_PHASE_PASSWD_BITS _u(0x00000ff0) 216 #define ROSC_PHASE_PASSWD_MSB _u(11) 217 #define ROSC_PHASE_PASSWD_LSB _u(4) 218 #define ROSC_PHASE_PASSWD_ACCESS "RW" 219 // ----------------------------------------------------------------------------- 220 // Field : ROSC_PHASE_ENABLE 221 // Description : enable the phase-shifted output 222 // this can be changed on-the-fly 223 #define ROSC_PHASE_ENABLE_RESET _u(0x1) 224 #define ROSC_PHASE_ENABLE_BITS _u(0x00000008) 225 #define ROSC_PHASE_ENABLE_MSB _u(3) 226 #define ROSC_PHASE_ENABLE_LSB _u(3) 227 #define ROSC_PHASE_ENABLE_ACCESS "RW" 228 // ----------------------------------------------------------------------------- 229 // Field : ROSC_PHASE_FLIP 230 // Description : invert the phase-shifted output 231 // this is ignored when div=1 232 #define ROSC_PHASE_FLIP_RESET _u(0x0) 233 #define ROSC_PHASE_FLIP_BITS _u(0x00000004) 234 #define ROSC_PHASE_FLIP_MSB _u(2) 235 #define ROSC_PHASE_FLIP_LSB _u(2) 236 #define ROSC_PHASE_FLIP_ACCESS "RW" 237 // ----------------------------------------------------------------------------- 238 // Field : ROSC_PHASE_SHIFT 239 // Description : phase shift the phase-shifted output by SHIFT input clocks 240 // this can be changed on-the-fly 241 // must be set to 0 before setting div=1 242 #define ROSC_PHASE_SHIFT_RESET _u(0x0) 243 #define ROSC_PHASE_SHIFT_BITS _u(0x00000003) 244 #define ROSC_PHASE_SHIFT_MSB _u(1) 245 #define ROSC_PHASE_SHIFT_LSB _u(0) 246 #define ROSC_PHASE_SHIFT_ACCESS "RW" 247 // ============================================================================= 248 // Register : ROSC_STATUS 249 // Description : Ring Oscillator Status 250 #define ROSC_STATUS_OFFSET _u(0x00000018) 251 #define ROSC_STATUS_BITS _u(0x81011000) 252 #define ROSC_STATUS_RESET _u(0x00000000) 253 // ----------------------------------------------------------------------------- 254 // Field : ROSC_STATUS_STABLE 255 // Description : Oscillator is running and stable 256 #define ROSC_STATUS_STABLE_RESET _u(0x0) 257 #define ROSC_STATUS_STABLE_BITS _u(0x80000000) 258 #define ROSC_STATUS_STABLE_MSB _u(31) 259 #define ROSC_STATUS_STABLE_LSB _u(31) 260 #define ROSC_STATUS_STABLE_ACCESS "RO" 261 // ----------------------------------------------------------------------------- 262 // Field : ROSC_STATUS_BADWRITE 263 // Description : An invalid value has been written to CTRL_ENABLE or 264 // CTRL_FREQ_RANGE or FREQA or FREQB or DIV or PHASE or DORMANT 265 #define ROSC_STATUS_BADWRITE_RESET _u(0x0) 266 #define ROSC_STATUS_BADWRITE_BITS _u(0x01000000) 267 #define ROSC_STATUS_BADWRITE_MSB _u(24) 268 #define ROSC_STATUS_BADWRITE_LSB _u(24) 269 #define ROSC_STATUS_BADWRITE_ACCESS "WC" 270 // ----------------------------------------------------------------------------- 271 // Field : ROSC_STATUS_DIV_RUNNING 272 // Description : post-divider is running 273 // this resets to 0 but transitions to 1 during chip startup 274 #define ROSC_STATUS_DIV_RUNNING_RESET "-" 275 #define ROSC_STATUS_DIV_RUNNING_BITS _u(0x00010000) 276 #define ROSC_STATUS_DIV_RUNNING_MSB _u(16) 277 #define ROSC_STATUS_DIV_RUNNING_LSB _u(16) 278 #define ROSC_STATUS_DIV_RUNNING_ACCESS "RO" 279 // ----------------------------------------------------------------------------- 280 // Field : ROSC_STATUS_ENABLED 281 // Description : Oscillator is enabled but not necessarily running and stable 282 // this resets to 0 but transitions to 1 during chip startup 283 #define ROSC_STATUS_ENABLED_RESET "-" 284 #define ROSC_STATUS_ENABLED_BITS _u(0x00001000) 285 #define ROSC_STATUS_ENABLED_MSB _u(12) 286 #define ROSC_STATUS_ENABLED_LSB _u(12) 287 #define ROSC_STATUS_ENABLED_ACCESS "RO" 288 // ============================================================================= 289 // Register : ROSC_RANDOMBIT 290 // Description : This just reads the state of the oscillator output so 291 // randomness is compromised if the ring oscillator is stopped or 292 // run at a harmonic of the bus frequency 293 #define ROSC_RANDOMBIT_OFFSET _u(0x0000001c) 294 #define ROSC_RANDOMBIT_BITS _u(0x00000001) 295 #define ROSC_RANDOMBIT_RESET _u(0x00000001) 296 #define ROSC_RANDOMBIT_MSB _u(0) 297 #define ROSC_RANDOMBIT_LSB _u(0) 298 #define ROSC_RANDOMBIT_ACCESS "RO" 299 // ============================================================================= 300 // Register : ROSC_COUNT 301 // Description : A down counter running at the ROSC frequency which counts to 302 // zero and stops. 303 // To start the counter write a non-zero value. 304 // Can be used for short software pauses when setting up time 305 // sensitive hardware. 306 #define ROSC_COUNT_OFFSET _u(0x00000020) 307 #define ROSC_COUNT_BITS _u(0x000000ff) 308 #define ROSC_COUNT_RESET _u(0x00000000) 309 #define ROSC_COUNT_MSB _u(7) 310 #define ROSC_COUNT_LSB _u(0) 311 #define ROSC_COUNT_ACCESS "RW" 312 // ============================================================================= 313 #endif // _HARDWARE_REGS_ROSC_H 314 315