scb.h
1// THIS HEADER FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
2
8#ifndef _HARDWARE_STRUCTS_SCB_H
9#define _HARDWARE_STRUCTS_SCB_H
10
12#include "hardware/regs/m33.h"
13
14// Reference to datasheet: https://datasheets.raspberrypi.com/rp2350/rp2350-datasheet.pdf#tab-registerlist_m33
15//
16// The _REG_ macro is intended to help make the register navigable in your IDE (for example, using the "Go to Definition" feature)
17// _REG_(x) will link to the corresponding register in hardware/regs/m33.h.
18//
19// Bit-field descriptions are of the form:
20// BITMASK [BITRANGE] FIELDNAME (RESETVALUE) DESCRIPTION
21
22#if defined(__riscv) && PICO_FORBID_ARM_HEADERS_ON_RISCV
23#error "Arm header included in a RISC-V build with PICO_FORBID_ARM_HEADERS_ON_RISCV=1"
24#endif
25
26typedef struct {
27 _REG_(M33_CPUID_OFFSET) // M33_CPUID
28 // Provides identification information for the PE, including an implementer code for the device and...
29 // 0xff000000 [31:24] IMPLEMENTER (0x41) This field must hold an implementer code that has been...
30 // 0x00f00000 [23:20] VARIANT (0x1) IMPLEMENTATION DEFINED variant number
31 // 0x000f0000 [19:16] ARCHITECTURE (0xf) Defines the Architecture implemented by the PE
32 // 0x0000fff0 [15:4] PARTNO (0xd21) IMPLEMENTATION DEFINED primary part number for the device
33 // 0x0000000f [3:0] REVISION (0x0) IMPLEMENTATION DEFINED revision number for the device
34 io_ro_32 cpuid;
35
36 _REG_(M33_ICSR_OFFSET) // M33_ICSR
37 // Controls and provides status information for NMI, PendSV, SysTick and interrupts
38 // 0x80000000 [31] PENDNMISET (0) Indicates whether the NMI exception is pending
39 // 0x40000000 [30] PENDNMICLR (0) Allows the NMI exception pend state to be cleared
40 // 0x10000000 [28] PENDSVSET (0) Indicates whether the PendSV `FTSSS exception is pending
41 // 0x08000000 [27] PENDSVCLR (0) Allows the PendSV exception pend state to be cleared `FTSSS
42 // 0x04000000 [26] PENDSTSET (0) Indicates whether the SysTick `FTSSS exception is pending
43 // 0x02000000 [25] PENDSTCLR (0) Allows the SysTick exception pend state to be cleared `FTSSS
44 // 0x01000000 [24] STTNS (0) Controls whether in a single SysTick implementation, the...
45 // 0x00800000 [23] ISRPREEMPT (0) Indicates whether a pending exception will be serviced...
46 // 0x00400000 [22] ISRPENDING (0) Indicates whether an external interrupt, generated by...
47 // 0x001ff000 [20:12] VECTPENDING (0x000) The exception number of the highest priority pending and...
48 // 0x00000800 [11] RETTOBASE (0) In Handler mode, indicates whether there is more than...
49 // 0x000001ff [8:0] VECTACTIVE (0x000) The exception number of the current executing exception
50 io_rw_32 icsr;
51
52 _REG_(M33_VTOR_OFFSET) // M33_VTOR
53 // Vector Table Offset Register
54 // 0xffffff80 [31:7] TBLOFF (0x0000000) Vector table base offset field
55 io_rw_32 vtor;
56
57 _REG_(M33_AIRCR_OFFSET) // M33_AIRCR
58 // Application Interrupt and Reset Control Register
59 // 0xffff0000 [31:16] VECTKEY (0x0000) Register key: +
60 // 0x00008000 [15] ENDIANESS (0) Data endianness implemented: +
61 // 0x00004000 [14] PRIS (0) Prioritize Secure exceptions
62 // 0x00002000 [13] BFHFNMINS (0) BusFault, HardFault, and NMI Non-secure enable
63 // 0x00000700 [10:8] PRIGROUP (0x0) Interrupt priority grouping field
64 // 0x00000008 [3] SYSRESETREQS (0) System reset request, Secure state only
65 // 0x00000004 [2] SYSRESETREQ (0) Writing 1 to this bit causes the SYSRESETREQ signal to...
66 // 0x00000002 [1] VECTCLRACTIVE (0) Clears all active state information for fixed and...
67 io_rw_32 aircr;
68
69 _REG_(M33_SCR_OFFSET) // M33_SCR
70 // System Control Register
71 // 0x00000010 [4] SEVONPEND (0) Send Event on Pending bit: +
72 // 0x00000008 [3] SLEEPDEEPS (0) 0 SLEEPDEEP is available to both security states +
73 // 0x00000004 [2] SLEEPDEEP (0) Controls whether the processor uses sleep or deep sleep...
74 // 0x00000002 [1] SLEEPONEXIT (0) Indicates sleep-on-exit when returning from Handler mode...
75 io_rw_32 scr;
76
77 _REG_(M33_CCR_OFFSET) // M33_CCR
78 // Sets or returns configuration and control data
79 // 0x00040000 [18] BP (0) Enables program flow prediction `FTSSS
80 // 0x00020000 [17] IC (0) This is a global enable bit for instruction caches in...
81 // 0x00010000 [16] DC (0) Enables data caching of all data accesses to Normal memory `FTSSS
82 // 0x00000400 [10] STKOFHFNMIGN (0) Controls the effect of a stack limit violation while...
83 // 0x00000200 [9] RES1 (1) Reserved, RES1
84 // 0x00000100 [8] BFHFNMIGN (0) Determines the effect of precise BusFaults on handlers...
85 // 0x00000010 [4] DIV_0_TRP (0) Controls the generation of a DIVBYZERO UsageFault when...
86 // 0x00000008 [3] UNALIGN_TRP (0) Controls the trapping of unaligned word or halfword accesses
87 // 0x00000002 [1] USERSETMPEND (0) Determines whether unprivileged accesses are permitted...
88 // 0x00000001 [0] RES1_1 (1) Reserved, RES1
89 io_rw_32 ccr;
90
91 // (Description copied from array index 0 register M33_SHPR1 applies similarly to other array indexes)
92 _REG_(M33_SHPR1_OFFSET) // M33_SHPR1
93 // Sets or returns priority for system handlers 4 - 7
94 // 0xe0000000 [31:29] PRI_7_3 (0x0) Priority of system handler 7, SecureFault
95 // 0x00e00000 [23:21] PRI_6_3 (0x0) Priority of system handler 6, SecureFault
96 // 0x0000e000 [15:13] PRI_5_3 (0x0) Priority of system handler 5, SecureFault
97 // 0x000000e0 [7:5] PRI_4_3 (0x0) Priority of system handler 4, SecureFault
98 io_rw_32 shpr[3];
99
100 _REG_(M33_SHCSR_OFFSET) // M33_SHCSR
101 // Provides access to the active and pending status of system exceptions
102 // 0x00200000 [21] HARDFAULTPENDED (0) `IAAMO the pending state of the HardFault exception `CTTSSS
103 // 0x00100000 [20] SECUREFAULTPENDED (0) `IAAMO the pending state of the SecureFault exception
104 // 0x00080000 [19] SECUREFAULTENA (0) `DW the SecureFault exception is enabled
105 // 0x00040000 [18] USGFAULTENA (0) `DW the UsageFault exception is enabled `FTSSS
106 // 0x00020000 [17] BUSFAULTENA (0) `DW the BusFault exception is enabled
107 // 0x00010000 [16] MEMFAULTENA (0) `DW the MemManage exception is enabled `FTSSS
108 // 0x00008000 [15] SVCALLPENDED (0) `IAAMO the pending state of the SVCall exception `FTSSS
109 // 0x00004000 [14] BUSFAULTPENDED (0) `IAAMO the pending state of the BusFault exception
110 // 0x00002000 [13] MEMFAULTPENDED (0) `IAAMO the pending state of the MemManage exception `FTSSS
111 // 0x00001000 [12] USGFAULTPENDED (0) The UsageFault exception is banked between Security...
112 // 0x00000800 [11] SYSTICKACT (0) `IAAMO the active state of the SysTick exception `FTSSS
113 // 0x00000400 [10] PENDSVACT (0) `IAAMO the active state of the PendSV exception `FTSSS
114 // 0x00000100 [8] MONITORACT (0) `IAAMO the active state of the DebugMonitor exception
115 // 0x00000080 [7] SVCALLACT (0) `IAAMO the active state of the SVCall exception `FTSSS
116 // 0x00000020 [5] NMIACT (0) `IAAMO the active state of the NMI exception
117 // 0x00000010 [4] SECUREFAULTACT (0) `IAAMO the active state of the SecureFault exception
118 // 0x00000008 [3] USGFAULTACT (0) `IAAMO the active state of the UsageFault exception `FTSSS
119 // 0x00000004 [2] HARDFAULTACT (0) Indicates and allows limited modification of the active...
120 // 0x00000002 [1] BUSFAULTACT (0) `IAAMO the active state of the BusFault exception
121 // 0x00000001 [0] MEMFAULTACT (0) `IAAMO the active state of the MemManage exception `FTSSS
122 io_rw_32 shcsr;
123
124 _REG_(M33_CFSR_OFFSET) // M33_CFSR
125 // Contains the three Configurable Fault Status Registers
126 // 0x02000000 [25] UFSR_DIVBYZERO (0) Sticky flag indicating whether an integer division by...
127 // 0x01000000 [24] UFSR_UNALIGNED (0) Sticky flag indicating whether an unaligned access error...
128 // 0x00100000 [20] UFSR_STKOF (0) Sticky flag indicating whether a stack overflow error...
129 // 0x00080000 [19] UFSR_NOCP (0) Sticky flag indicating whether a coprocessor disabled or...
130 // 0x00040000 [18] UFSR_INVPC (0) Sticky flag indicating whether an integrity check error...
131 // 0x00020000 [17] UFSR_INVSTATE (0) Sticky flag indicating whether an EPSR
132 // 0x00010000 [16] UFSR_UNDEFINSTR (0) Sticky flag indicating whether an undefined instruction...
133 // 0x00008000 [15] BFSR_BFARVALID (0) Indicates validity of the contents of the BFAR register
134 // 0x00002000 [13] BFSR_LSPERR (0) Records whether a BusFault occurred during FP lazy state...
135 // 0x00001000 [12] BFSR_STKERR (0) Records whether a derived BusFault occurred during...
136 // 0x00000800 [11] BFSR_UNSTKERR (0) Records whether a derived BusFault occurred during...
137 // 0x00000400 [10] BFSR_IMPRECISERR (0) Records whether an imprecise data access error has occurred
138 // 0x00000200 [9] BFSR_PRECISERR (0) Records whether a precise data access error has occurred
139 // 0x00000100 [8] BFSR_IBUSERR (0) Records whether a BusFault on an instruction prefetch...
140 // 0x000000ff [7:0] MMFSR (0x00) Provides information on MemManage exceptions
141 io_rw_32 cfsr;
142
143 _REG_(M33_HFSR_OFFSET) // M33_HFSR
144 // Shows the cause of any HardFaults
145 // 0x80000000 [31] DEBUGEVT (0) Indicates when a Debug event has occurred
146 // 0x40000000 [30] FORCED (0) Indicates that a fault with configurable priority has...
147 // 0x00000002 [1] VECTTBL (0) Indicates when a fault has occurred because of a vector...
148 io_rw_32 hfsr;
149
150 _REG_(M33_DFSR_OFFSET) // M33_DFSR
151 // Shows which debug event occurred
152 // 0x00000010 [4] EXTERNAL (0) Sticky flag indicating whether an External debug request...
153 // 0x00000008 [3] VCATCH (0) Sticky flag indicating whether a Vector catch debug...
154 // 0x00000004 [2] DWTTRAP (0) Sticky flag indicating whether a Watchpoint debug event...
155 // 0x00000002 [1] BKPT (0) Sticky flag indicating whether a Breakpoint debug event...
156 // 0x00000001 [0] HALTED (0) Sticky flag indicating that a Halt request debug event...
157 io_rw_32 dfsr;
158
159 _REG_(M33_MMFAR_OFFSET) // M33_MMFAR
160 // Shows the address of the memory location that caused an MPU fault
161 // 0xffffffff [31:0] ADDRESS (0x00000000) This register is updated with the address of a location...
162 io_rw_32 mmfar;
163
164 _REG_(M33_BFAR_OFFSET) // M33_BFAR
165 // Shows the address associated with a precise data access BusFault
166 // 0xffffffff [31:0] ADDRESS (0x00000000) This register is updated with the address of a location...
167 io_rw_32 bfar;
168
169 uint32_t _pad0;
170
171 // (Description copied from array index 0 register M33_ID_PFR0 applies similarly to other array indexes)
172 _REG_(M33_ID_PFR0_OFFSET) // M33_ID_PFR0
173 // Gives top-level information about the instruction set supported by the PE
174 // 0x000000f0 [7:4] STATE1 (0x3) T32 instruction set support
175 // 0x0000000f [3:0] STATE0 (0x0) A32 instruction set support
176 io_ro_32 id_pfr[2];
177
178 _REG_(M33_ID_DFR0_OFFSET) // M33_ID_DFR0
179 // Provides top level information about the debug system
180 // 0x00f00000 [23:20] MPROFDBG (0x2) Indicates the supported M-profile debug architecture
181 io_ro_32 id_dfr0;
182
183 _REG_(M33_ID_AFR0_OFFSET) // M33_ID_AFR0
184 // Provides information about the IMPLEMENTATION DEFINED features of the PE
185 // 0x0000f000 [15:12] IMPDEF3 (0x0) IMPLEMENTATION DEFINED meaning
186 // 0x00000f00 [11:8] IMPDEF2 (0x0) IMPLEMENTATION DEFINED meaning
187 // 0x000000f0 [7:4] IMPDEF1 (0x0) IMPLEMENTATION DEFINED meaning
188 // 0x0000000f [3:0] IMPDEF0 (0x0) IMPLEMENTATION DEFINED meaning
189 io_ro_32 id_afr0;
190
191 // (Description copied from array index 0 register M33_ID_MMFR0 applies similarly to other array indexes)
192 _REG_(M33_ID_MMFR0_OFFSET) // M33_ID_MMFR0
193 // Provides information about the implemented memory model and memory management support
194 // 0x00f00000 [23:20] AUXREG (0x1) Indicates support for Auxiliary Control Registers
195 // 0x000f0000 [19:16] TCM (0x0) Indicates support for tightly coupled memories (TCMs)
196 // 0x0000f000 [15:12] SHARELVL (0x1) Indicates the number of shareability levels implemented
197 // 0x00000f00 [11:8] OUTERSHR (0xf) Indicates the outermost shareability domain implemented
198 // 0x000000f0 [7:4] PMSA (0x4) Indicates support for the protected memory system...
199 io_ro_32 id_mmfr[4];
200
201 // (Description copied from array index 0 register M33_ID_ISAR0 applies similarly to other array indexes)
202 _REG_(M33_ID_ISAR0_OFFSET) // M33_ID_ISAR0
203 // Provides information about the instruction set implemented by the PE
204 // 0x0f000000 [27:24] DIVIDE (0x8) Indicates the supported Divide instructions
205 // 0x00f00000 [23:20] DEBUG (0x0) Indicates the implemented Debug instructions
206 // 0x000f0000 [19:16] COPROC (0x9) Indicates the supported Coprocessor instructions
207 // 0x0000f000 [15:12] CMPBRANCH (0x2) Indicates the supported combined Compare and Branch instructions
208 // 0x00000f00 [11:8] BITFIELD (0x3) Indicates the supported bit field instructions
209 // 0x000000f0 [7:4] BITCOUNT (0x0) Indicates the supported bit count instructions
210 io_ro_32 id_isar[6];
211
212 uint32_t _pad1;
213
214 _REG_(M33_CTR_OFFSET) // M33_CTR
215 // Provides information about the architecture of the caches
216 // 0x80000000 [31] RES1 (1) Reserved, RES1
217 // 0x0f000000 [27:24] CWG (0x0) Log2 of the number of words of the maximum size of...
218 // 0x00f00000 [23:20] ERG (0x0) Log2 of the number of words of the maximum size of the...
219 // 0x000f0000 [19:16] DMINLINE (0x0) Log2 of the number of words in the smallest cache line...
220 // 0x0000c000 [15:14] RES1_1 (0x3) Reserved, RES1
221 // 0x0000000f [3:0] IMINLINE (0x0) Log2 of the number of words in the smallest cache line...
222 io_ro_32 ctr;
223
224 uint32_t _pad2[2];
225
226 _REG_(M33_CPACR_OFFSET) // M33_CPACR
227 // Specifies the access privileges for coprocessors and the FP Extension
228 // 0x00c00000 [23:22] CP11 (0x0) The value in this field is ignored
229 // 0x00300000 [21:20] CP10 (0x0) Defines the access rights for the floating-point functionality
230 // 0x0000c000 [15:14] CP7 (0x0) Controls access privileges for coprocessor 7
231 // 0x00003000 [13:12] CP6 (0x0) Controls access privileges for coprocessor 6
232 // 0x00000c00 [11:10] CP5 (0x0) Controls access privileges for coprocessor 5
233 // 0x00000300 [9:8] CP4 (0x0) Controls access privileges for coprocessor 4
234 // 0x000000c0 [7:6] CP3 (0x0) Controls access privileges for coprocessor 3
235 // 0x00000030 [5:4] CP2 (0x0) Controls access privileges for coprocessor 2
236 // 0x0000000c [3:2] CP1 (0x0) Controls access privileges for coprocessor 1
237 // 0x00000003 [1:0] CP0 (0x0) Controls access privileges for coprocessor 0
238 io_rw_32 cpacr;
239
240 _REG_(M33_NSACR_OFFSET) // M33_NSACR
241 // Defines the Non-secure access permissions for both the FP Extension and coprocessors CP0 to CP7
242 // 0x00000800 [11] CP11 (0) Enables Non-secure access to the Floating-point Extension
243 // 0x00000400 [10] CP10 (0) Enables Non-secure access to the Floating-point Extension
244 // 0x00000080 [7] CP7 (0) Enables Non-secure access to coprocessor CP7
245 // 0x00000040 [6] CP6 (0) Enables Non-secure access to coprocessor CP6
246 // 0x00000020 [5] CP5 (0) Enables Non-secure access to coprocessor CP5
247 // 0x00000010 [4] CP4 (0) Enables Non-secure access to coprocessor CP4
248 // 0x00000008 [3] CP3 (0) Enables Non-secure access to coprocessor CP3
249 // 0x00000004 [2] CP2 (0) Enables Non-secure access to coprocessor CP2
250 // 0x00000002 [1] CP1 (0) Enables Non-secure access to coprocessor CP1
251 // 0x00000001 [0] CP0 (0) Enables Non-secure access to coprocessor CP0
252 io_rw_32 nsacr;
253
255
256#define scb_hw ((armv8m_scb_hw_t *)(PPB_BASE + M33_CPUID_OFFSET))
257#define scb_ns_hw ((armv8m_scb_hw_t *)(PPB_NONSEC_BASE + M33_CPUID_OFFSET))
258static_assert(sizeof (armv8m_scb_hw_t) == 0x0090, "");
259
260#endif // _HARDWARE_STRUCTS_SCB_H
261
Definition: scb.h:26