style
[RRG-proxmark3.git] / bootrom / flash-reset.s
blobf486eda15d77287c594a250a50e237e34b252762
1 @-----------------------------------------------------------------------------
2 @ Copyright (C) Jonathan Westhues, Mar 2006
3 @ Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
5 @ This program is free software: you can redistribute it and/or modify
6 @ it under the terms of the GNU General Public License as published by
7 @ the Free Software Foundation, either version 3 of the License, or
8 @ (at your option) any later version.
10 @ This program is distributed in the hope that it will be useful,
11 @ but WITHOUT ANY WARRANTY; without even the implied warranty of
12 @ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 @ GNU General Public License for more details.
15 @ See LICENSE.txt for the text of the license.
16 @-----------------------------------------------------------------------------
17 @ Reset vector for running from FLASH
18 @-----------------------------------------------------------------------------
20 .section .startup,"ax"
22 .arm
24 .global flashstart
25 flashstart:
26 b reset
27 b undefined_instruction
28 b software_interrupt
29 b prefetch_abort
30 b data_abort
31 b . @reserved
32 ldr pc, [pc,#-0xF20] @ IRQ - read the AIC
33 b fiq
35 reset:
36 ldr sp, =_stack_end @ initialize stack pointer to top of RAM
38 @ copy bootloader to RAM (in case the user re-flashes the bootloader)
39 ldr r0, =__bootphase2_src_start__
40 ldr r1, =__bootphase2_start__
41 ldr r2, =__bootphase2_end__
43 ldr r3, [r0], #4
44 str r3, [r1], #4
45 cmp r1, r2
46 blo 1b
48 ldr r3, =ram_start @ start address of RAM bootloader
49 bx r3 @ jump to it
51 .ltorg
53 undefined_instruction:
54 b .
55 software_interrupt:
56 b .
57 prefetch_abort:
58 b .
59 data_abort:
60 b .
61 fiq:
62 b .