summaryrefslogtreecommitdiffstats
path: root/utils/rk27utils/rk27load/stage2/crt0.S
diff options
context:
space:
mode:
Diffstat (limited to 'utils/rk27utils/rk27load/stage2/crt0.S')
-rw-r--r--utils/rk27utils/rk27load/stage2/crt0.S93
1 files changed, 47 insertions, 46 deletions
diff --git a/utils/rk27utils/rk27load/stage2/crt0.S b/utils/rk27utils/rk27load/stage2/crt0.S
index c85477546d..d931123f95 100644
--- a/utils/rk27utils/rk27load/stage2/crt0.S
+++ b/utils/rk27utils/rk27load/stage2/crt0.S
@@ -1,55 +1,56 @@
-//
-// startup code
-//
-//
+/*
+ * startup code
+ *
+ */
-#define PSR_MODE 0x0000001f
-#define PSR_USR_MODE 0x00000010
-#define PSR_IRQ_MODE 0x00000012
-#define PSR_SVC_MODE 0x00000013
+#define PSR_MODE 0x0000001f
+#define PSR_USR_MODE 0x00000010
+#define PSR_IRQ_MODE 0x00000012
+#define PSR_SVC_MODE 0x00000013
-#define PSR_INT_MASK 0x000000c0
-#define PSR_FIQ_DIS 0x00000040
-#define PSR_IRQ_DIS 0x00000080
+#define PSR_INT_MASK 0x000000c0
+#define PSR_FIQ_DIS 0x00000040
+#define PSR_IRQ_DIS 0x00000080
.section .init.text,"ax",%progbits
.global start
.extern _interrupt_disable
-// -----------------------------------------------------
-// startup code (setup stacks, branch to main)
-// -----------------------------------------------------
+/* -----------------------------------------------------
+ * startup code (setup stacks, branch to main)
+ * -----------------------------------------------------
+ */
start:
- // setup IRQ stack
- mov r0, #(PSR_IRQ_MODE|PSR_FIQ_DIS|PSR_IRQ_DIS)
- msr cpsr, r0
- ldr sp,=irqstackend
-
- // setup SVC stack
- mov r0, #(PSR_SVC_MODE|PSR_FIQ_DIS|PSR_IRQ_DIS)
- msr cpsr, r0
- ldr sp,=stackend
-
- // disbale interrupts
- mrs r0, cpsr
- orr r0, r0, #0xc0
- msr cpsr_c, r0
-
- // remap
- mov r0, #0x18000000
- add r0, r0, #0x1C000
- ldr r1,=0xdeadbeef
- str r1, [r0, #4]
-
- // relocate itself
- ldr r0,=_relocstart
- ldr r1,=_relocend
- ldr r2,=0x0
+ /* setup IRQ stack */
+ mov r0,#(PSR_IRQ_MODE|PSR_FIQ_DIS|PSR_IRQ_DIS)
+ msr cpsr,r0
+ ldr sp,=irqstackend
+
+ /* setup SVC stack */
+ mov r0,#(PSR_SVC_MODE|PSR_FIQ_DIS|PSR_IRQ_DIS)
+ msr cpsr,r0
+ ldr sp,=stackend
+
+ /* disbale interrupts */
+ mrs r0,cpsr
+ orr r0,r0,#0xc0
+ msr cpsr_c, r0
+
+ /* remap */
+ mov r0,#0x18000000
+ add r0,r0,#0x1C000
+ ldr r1,=0xdeadbeef
+ str r1,[r0,#4]
+
+ /* relocate itself */
+ ldr r0,=_relocstart
+ ldr r1,=_relocend
+ ldr r2,=0x0
1:
- cmp r1,r0
- ldrhi r3,[r0],#4
- strhi r3,[r2],#4
- bhi 1b
-
- // continue running in SVC (supervisor mode)
- ldr pc,=0x0
+ cmp r1,r0
+ ldrhi r3,[r0],#4
+ strhi r3,[r2],#4
+ bhi 1b
+
+ /* continue running in SVC (supervisor mode) */
+ ldr pc,=0x0