aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios-contrib/ext/mcux-sdk/devices/MKE15Z7/gcc/startup_MKE15Z7.S
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/devices/MKE15Z7/gcc/startup_MKE15Z7.S')
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/MKE15Z7/gcc/startup_MKE15Z7.S380
1 files changed, 380 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/MKE15Z7/gcc/startup_MKE15Z7.S b/lib/chibios-contrib/ext/mcux-sdk/devices/MKE15Z7/gcc/startup_MKE15Z7.S
new file mode 100644
index 000000000..dac42f863
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/devices/MKE15Z7/gcc/startup_MKE15Z7.S
@@ -0,0 +1,380 @@
1/* ------------------------------------------------------------------------- */
2/* @file: startup_MKE15Z7.s */
3/* @purpose: CMSIS Cortex-M0P Core Device Startup File */
4/* MKE15Z7 */
5/* @version: 6.0 */
6/* @date: 2016-9-20 */
7/* @build: b190918 */
8/* ------------------------------------------------------------------------- */
9/* */
10/* Copyright 1997-2016 Freescale Semiconductor, Inc. */
11/* Copyright 2016-2019 NXP */
12/* All rights reserved. */
13/* */
14/* SPDX-License-Identifier: BSD-3-Clause */
15/*****************************************************************************/
16/* Version: GCC for ARM Embedded Processors */
17/*****************************************************************************/
18 .syntax unified
19 .arch armv6-m
20
21 .section .isr_vector, "a"
22 .align 2
23 .globl __isr_vector
24__isr_vector:
25 .long __StackTop /* Top of Stack */
26 .long Reset_Handler /* Reset Handler */
27 .long NMI_Handler /* NMI Handler*/
28 .long HardFault_Handler /* Hard Fault Handler*/
29 .long 0 /* Reserved*/
30 .long 0 /* Reserved*/
31 .long 0 /* Reserved*/
32 .long 0 /* Reserved*/
33 .long 0 /* Reserved*/
34 .long 0 /* Reserved*/
35 .long 0 /* Reserved*/
36 .long SVC_Handler /* SVCall Handler*/
37 .long 0 /* Reserved*/
38 .long 0 /* Reserved*/
39 .long PendSV_Handler /* PendSV Handler*/
40 .long SysTick_Handler /* SysTick Handler*/
41
42 /* External Interrupts*/
43 .long DMA0_04_IRQHandler /* DMA channel 0 or 4 transfer complete*/
44 .long DMA0_15_IRQHandler /* DMA channel 1 or 5 transfer complete*/
45 .long DMA0_26_IRQHandler /* DMA channel 2 or 6 transfer complete*/
46 .long DMA0_37_IRQHandler /* DMA channel 3 or 7 transfer complete*/
47 .long DMA_Error_IRQHandler /* DMA error interrupt channels 0-7*/
48 .long FTFE_IRQHandler /* Single interrupt vector for all sources*/
49 .long LVD_LVW_IRQHandler /* Low-voltage detect, low-voltage warning*/
50 .long PORTAE_IRQHandler /* Pin detect (Port A, E)*/
51 .long LPI2C0_IRQHandler /* Inter-integrated circuit 0 interrupt*/
52 .long LPI2C1_IRQHandler /* Inter-integrated circuit 1 interrupt*/
53 .long LPSPI0_IRQHandler /* Serial peripheral Interface 0 interrupt*/
54 .long LPSPI1_IRQHandler /* Serial peripheral Interface 1 interrupt*/
55 .long LPUART0_IRQHandler /* Single interrupt vector for all sources*/
56 .long LPUART1_IRQHandler /* Single interrupt vector for all sources*/
57 .long LPUART2_IRQHandler /* Single interrupt vector for all sources*/
58 .long ADC0_IRQHandler /* ADC0 conversion complete interrupt*/
59 .long CMP0_IRQHandler /* CMP0 interrupt*/
60 .long FTM0_IRQHandler /* FTM0 single interrupt vector for all sources*/
61 .long FTM1_IRQHandler /* FTM1 single interrupt vector for all sources*/
62 .long FTM2_IRQHandler /* FTM2 single interrupt vector for all sources*/
63 .long RTC_IRQHandler /* Single interrupt vector for all sources*/
64 .long CMP1_IRQHandler /* CMP1 interrupt*/
65 .long LPIT0_IRQHandler /* LPIT interrupt*/
66 .long FLEXIO_IRQHandler /* FLEXIO interrupt*/
67 .long TSI_IRQHandler /* TSI interrupt*/
68 .long PDB0_IRQHandler /* Programmable delay block interrupt*/
69 .long PORTBCD_IRQHandler /* Pin detect (Port B, C, D)*/
70 .long SCG_IRQHandler /* System clock generator interrupt*/
71 .long WDOG_EWM_IRQHandler /* Single interrupt vector for WDOG and EWM*/
72 .long PWT_LPTMR0_IRQHandler /* Single interrupt vector for PWT and LPTMR0*/
73 .long ADC1_IRQHandler /* ADC1 conversion complete interrupt*/
74 .long RCM_IRQHandler /* RCM interrupt*/
75
76 .size __isr_vector, . - __isr_vector
77
78/* Flash Configuration */
79 .section .FlashConfig, "a"
80 .long 0xFFFFFFFF
81 .long 0xFFFFFFFF
82 .long 0xFFFFFFFF
83 .long 0xFFFF7DFE
84
85 .text
86 .thumb
87
88/* Reset Handler */
89
90 .thumb_func
91 .align 2
92 .globl Reset_Handler
93 .weak Reset_Handler
94 .type Reset_Handler, %function
95Reset_Handler:
96 cpsid i /* Mask interrupts */
97 .equ VTOR, 0xE000ED08
98 ldr r0, =VTOR
99 ldr r1, =__isr_vector
100 str r1, [r0]
101 ldr r2, [r1]
102 msr msp, r2
103#ifndef __NO_SYSTEM_INIT
104 ldr r0,=SystemInit
105 blx r0
106#endif
107/* Loop to copy data from read only memory to RAM. The ranges
108 * of copy from/to are specified by following symbols evaluated in
109 * linker script.
110 * __etext: End of code section, i.e., begin of data sections to copy from.
111 * __data_start__/__data_end__: RAM address range that data should be
112 * copied to. Both must be aligned to 4 bytes boundary. */
113
114 ldr r1, =__etext
115 ldr r2, =__data_start__
116 ldr r3, =__data_end__
117
118 subs r3, r2
119 ble .LC0
120
121.LC1:
122 subs r3, 4
123 ldr r0, [r1,r3]
124 str r0, [r2,r3]
125 bgt .LC1
126.LC0:
127
128#ifdef __STARTUP_CLEAR_BSS
129/* This part of work usually is done in C library startup code. Otherwise,
130 * define this macro to enable it in this startup.
131 *
132 * Loop to zero out BSS section, which uses following symbols
133 * in linker script:
134 * __bss_start__: start of BSS section. Must align to 4
135 * __bss_end__: end of BSS section. Must align to 4
136 */
137 ldr r1, =__bss_start__
138 ldr r2, =__bss_end__
139
140 subs r2, r1
141 ble .LC3
142
143 movs r0, 0
144.LC2:
145 subs r2, 4
146 str r0, [r1, r2]
147 bge .LC2
148.LC3:
149#endif
150 cpsie i /* Unmask interrupts */
151#ifndef __START
152#define __START _start
153#endif
154#ifndef __ATOLLIC__
155 ldr r0,=__START
156 blx r0
157#else
158 ldr r0,=__libc_init_array
159 blx r0
160 ldr r0,=main
161 bx r0
162#endif
163 .pool
164 .size Reset_Handler, . - Reset_Handler
165
166 .align 1
167 .thumb_func
168 .weak DefaultISR
169 .type DefaultISR, %function
170DefaultISR:
171 ldr r0, =DefaultISR
172 bx r0
173 .size DefaultISR, . - DefaultISR
174
175 .align 1
176 .thumb_func
177 .weak NMI_Handler
178 .type NMI_Handler, %function
179NMI_Handler:
180 ldr r0,=NMI_Handler
181 bx r0
182 .size NMI_Handler, . - NMI_Handler
183
184 .align 1
185 .thumb_func
186 .weak HardFault_Handler
187 .type HardFault_Handler, %function
188HardFault_Handler:
189 ldr r0,=HardFault_Handler
190 bx r0
191 .size HardFault_Handler, . - HardFault_Handler
192
193 .align 1
194 .thumb_func
195 .weak SVC_Handler
196 .type SVC_Handler, %function
197SVC_Handler:
198 ldr r0,=SVC_Handler
199 bx r0
200 .size SVC_Handler, . - SVC_Handler
201
202 .align 1
203 .thumb_func
204 .weak PendSV_Handler
205 .type PendSV_Handler, %function
206PendSV_Handler:
207 ldr r0,=PendSV_Handler
208 bx r0
209 .size PendSV_Handler, . - PendSV_Handler
210
211 .align 1
212 .thumb_func
213 .weak SysTick_Handler
214 .type SysTick_Handler, %function
215SysTick_Handler:
216 ldr r0,=SysTick_Handler
217 bx r0
218 .size SysTick_Handler, . - SysTick_Handler
219
220 .align 1
221 .thumb_func
222 .weak DMA0_04_IRQHandler
223 .type DMA0_04_IRQHandler, %function
224DMA0_04_IRQHandler:
225 ldr r0,=DMA0_04_DriverIRQHandler
226 bx r0
227 .size DMA0_04_IRQHandler, . - DMA0_04_IRQHandler
228
229 .align 1
230 .thumb_func
231 .weak DMA0_15_IRQHandler
232 .type DMA0_15_IRQHandler, %function
233DMA0_15_IRQHandler:
234 ldr r0,=DMA0_15_DriverIRQHandler
235 bx r0
236 .size DMA0_15_IRQHandler, . - DMA0_15_IRQHandler
237
238 .align 1
239 .thumb_func
240 .weak DMA0_26_IRQHandler
241 .type DMA0_26_IRQHandler, %function
242DMA0_26_IRQHandler:
243 ldr r0,=DMA0_26_DriverIRQHandler
244 bx r0
245 .size DMA0_26_IRQHandler, . - DMA0_26_IRQHandler
246
247 .align 1
248 .thumb_func
249 .weak DMA0_37_IRQHandler
250 .type DMA0_37_IRQHandler, %function
251DMA0_37_IRQHandler:
252 ldr r0,=DMA0_37_DriverIRQHandler
253 bx r0
254 .size DMA0_37_IRQHandler, . - DMA0_37_IRQHandler
255
256 .align 1
257 .thumb_func
258 .weak DMA_Error_IRQHandler
259 .type DMA_Error_IRQHandler, %function
260DMA_Error_IRQHandler:
261 ldr r0,=DMA_Error_DriverIRQHandler
262 bx r0
263 .size DMA_Error_IRQHandler, . - DMA_Error_IRQHandler
264
265 .align 1
266 .thumb_func
267 .weak LPI2C0_IRQHandler
268 .type LPI2C0_IRQHandler, %function
269LPI2C0_IRQHandler:
270 ldr r0,=LPI2C0_DriverIRQHandler
271 bx r0
272 .size LPI2C0_IRQHandler, . - LPI2C0_IRQHandler
273
274 .align 1
275 .thumb_func
276 .weak LPI2C1_IRQHandler
277 .type LPI2C1_IRQHandler, %function
278LPI2C1_IRQHandler:
279 ldr r0,=LPI2C1_DriverIRQHandler
280 bx r0
281 .size LPI2C1_IRQHandler, . - LPI2C1_IRQHandler
282
283 .align 1
284 .thumb_func
285 .weak LPSPI0_IRQHandler
286 .type LPSPI0_IRQHandler, %function
287LPSPI0_IRQHandler:
288 ldr r0,=LPSPI0_DriverIRQHandler
289 bx r0
290 .size LPSPI0_IRQHandler, . - LPSPI0_IRQHandler
291
292 .align 1
293 .thumb_func
294 .weak LPSPI1_IRQHandler
295 .type LPSPI1_IRQHandler, %function
296LPSPI1_IRQHandler:
297 ldr r0,=LPSPI1_DriverIRQHandler
298 bx r0
299 .size LPSPI1_IRQHandler, . - LPSPI1_IRQHandler
300
301 .align 1
302 .thumb_func
303 .weak LPUART0_IRQHandler
304 .type LPUART0_IRQHandler, %function
305LPUART0_IRQHandler:
306 ldr r0,=LPUART0_DriverIRQHandler
307 bx r0
308 .size LPUART0_IRQHandler, . - LPUART0_IRQHandler
309
310 .align 1
311 .thumb_func
312 .weak LPUART1_IRQHandler
313 .type LPUART1_IRQHandler, %function
314LPUART1_IRQHandler:
315 ldr r0,=LPUART1_DriverIRQHandler
316 bx r0
317 .size LPUART1_IRQHandler, . - LPUART1_IRQHandler
318
319 .align 1
320 .thumb_func
321 .weak LPUART2_IRQHandler
322 .type LPUART2_IRQHandler, %function
323LPUART2_IRQHandler:
324 ldr r0,=LPUART2_DriverIRQHandler
325 bx r0
326 .size LPUART2_IRQHandler, . - LPUART2_IRQHandler
327
328 .align 1
329 .thumb_func
330 .weak FLEXIO_IRQHandler
331 .type FLEXIO_IRQHandler, %function
332FLEXIO_IRQHandler:
333 ldr r0,=FLEXIO_DriverIRQHandler
334 bx r0
335 .size FLEXIO_IRQHandler, . - FLEXIO_IRQHandler
336
337
338/* Macro to define default handlers. Default handler
339 * will be weak symbol and just dead loops. They can be
340 * overwritten by other handlers */
341 .macro def_irq_handler handler_name
342 .weak \handler_name
343 .set \handler_name, DefaultISR
344 .endm
345
346/* Exception Handlers */
347 def_irq_handler DMA0_04_DriverIRQHandler
348 def_irq_handler DMA0_15_DriverIRQHandler
349 def_irq_handler DMA0_26_DriverIRQHandler
350 def_irq_handler DMA0_37_DriverIRQHandler
351 def_irq_handler DMA_Error_DriverIRQHandler
352 def_irq_handler FTFE_IRQHandler
353 def_irq_handler LVD_LVW_IRQHandler
354 def_irq_handler PORTAE_IRQHandler
355 def_irq_handler LPI2C0_DriverIRQHandler
356 def_irq_handler LPI2C1_DriverIRQHandler
357 def_irq_handler LPSPI0_DriverIRQHandler
358 def_irq_handler LPSPI1_DriverIRQHandler
359 def_irq_handler LPUART0_DriverIRQHandler
360 def_irq_handler LPUART1_DriverIRQHandler
361 def_irq_handler LPUART2_DriverIRQHandler
362 def_irq_handler ADC0_IRQHandler
363 def_irq_handler CMP0_IRQHandler
364 def_irq_handler FTM0_IRQHandler
365 def_irq_handler FTM1_IRQHandler
366 def_irq_handler FTM2_IRQHandler
367 def_irq_handler RTC_IRQHandler
368 def_irq_handler CMP1_IRQHandler
369 def_irq_handler LPIT0_IRQHandler
370 def_irq_handler FLEXIO_DriverIRQHandler
371 def_irq_handler TSI_IRQHandler
372 def_irq_handler PDB0_IRQHandler
373 def_irq_handler PORTBCD_IRQHandler
374 def_irq_handler SCG_IRQHandler
375 def_irq_handler WDOG_EWM_IRQHandler
376 def_irq_handler PWT_LPTMR0_IRQHandler
377 def_irq_handler ADC1_IRQHandler
378 def_irq_handler RCM_IRQHandler
379
380 .end