wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 1 | /* |
| 2 | * armboot - Startup Code for OMP2420/ARM1136 CPU-core |
| 3 | * |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 4 | * Copyright (c) 2004 Texas Instruments <r-woodruff2@ti.com> |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 5 | * |
Albert ARIBAUD | 60fbc8d | 2011-08-04 18:45:45 +0200 | [diff] [blame] | 6 | * Copyright (c) 2001 Marius Gröger <mag@sysgo.de> |
| 7 | * Copyright (c) 2002 Alex Züpke <azu@sysgo.de> |
Detlev Zundel | f1b3f2b | 2009-05-13 10:54:10 +0200 | [diff] [blame] | 8 | * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de> |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 9 | * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com> |
| 10 | * Copyright (c) 2003 Kshitij <kshitij@ti.com> |
| 11 | * |
Wolfgang Denk | bd8ec7e | 2013-10-07 13:07:26 +0200 | [diff] [blame^] | 12 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 13 | */ |
| 14 | |
Wolfgang Denk | 0191e47 | 2010-10-26 14:34:52 +0200 | [diff] [blame] | 15 | #include <asm-offsets.h> |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 16 | #include <config.h> |
| 17 | #include <version.h> |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 18 | .globl _start |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 19 | _start: b reset |
Aneesh V | 552a319 | 2011-07-13 05:11:07 +0000 | [diff] [blame] | 20 | #ifdef CONFIG_SPL_BUILD |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 21 | ldr pc, _hang |
| 22 | ldr pc, _hang |
| 23 | ldr pc, _hang |
| 24 | ldr pc, _hang |
| 25 | ldr pc, _hang |
| 26 | ldr pc, _hang |
| 27 | ldr pc, _hang |
| 28 | |
| 29 | _hang: |
| 30 | .word do_hang |
| 31 | .word 0x12345678 |
| 32 | .word 0x12345678 |
| 33 | .word 0x12345678 |
| 34 | .word 0x12345678 |
| 35 | .word 0x12345678 |
| 36 | .word 0x12345678 |
| 37 | .word 0x12345678 /* now 16*4=64 */ |
| 38 | #else |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 39 | ldr pc, _undefined_instruction |
| 40 | ldr pc, _software_interrupt |
| 41 | ldr pc, _prefetch_abort |
| 42 | ldr pc, _data_abort |
| 43 | ldr pc, _not_used |
| 44 | ldr pc, _irq |
| 45 | ldr pc, _fiq |
| 46 | |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 47 | _undefined_instruction: .word undefined_instruction |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 48 | _software_interrupt: .word software_interrupt |
| 49 | _prefetch_abort: .word prefetch_abort |
| 50 | _data_abort: .word data_abort |
| 51 | _not_used: .word not_used |
| 52 | _irq: .word irq |
| 53 | _fiq: .word fiq |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 54 | _pad: .word 0x12345678 /* now 16*4=64 */ |
Aneesh V | 552a319 | 2011-07-13 05:11:07 +0000 | [diff] [blame] | 55 | #endif /* CONFIG_SPL_BUILD */ |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 56 | .global _end_vect |
| 57 | _end_vect: |
| 58 | |
| 59 | .balignl 16,0xdeadbeef |
| 60 | /* |
| 61 | ************************************************************************* |
| 62 | * |
| 63 | * Startup Code (reset vector) |
| 64 | * |
| 65 | * do important init only if we don't start from memory! |
| 66 | * setup Memory and board specific bits prior to relocation. |
| 67 | * relocate armboot to ram |
| 68 | * setup stack |
| 69 | * |
| 70 | ************************************************************************* |
| 71 | */ |
| 72 | |
Heiko Schocher | 504f87c | 2010-09-17 13:10:40 +0200 | [diff] [blame] | 73 | .globl _TEXT_BASE |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 74 | _TEXT_BASE: |
Benoît Thébaudeau | a402da3 | 2013-04-11 09:35:42 +0000 | [diff] [blame] | 75 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE) |
| 76 | .word CONFIG_SPL_TEXT_BASE |
| 77 | #else |
Wolfgang Denk | 0708bc6 | 2010-10-07 21:51:12 +0200 | [diff] [blame] | 78 | .word CONFIG_SYS_TEXT_BASE |
Benoît Thébaudeau | a402da3 | 2013-04-11 09:35:42 +0000 | [diff] [blame] | 79 | #endif |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 80 | |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 81 | /* |
| 82 | * These are defined in the board-specific linker script. |
Heiko Schocher | 429ddf6 | 2010-10-13 07:57:14 +0200 | [diff] [blame] | 83 | * Subtracting _start from them lets the linker put their |
| 84 | * relative position in the executable instead of leaving |
| 85 | * them null. |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 86 | */ |
Heiko Schocher | 429ddf6 | 2010-10-13 07:57:14 +0200 | [diff] [blame] | 87 | .globl _bss_start_ofs |
| 88 | _bss_start_ofs: |
| 89 | .word __bss_start - _start |
Heiko Schocher | 504f87c | 2010-09-17 13:10:40 +0200 | [diff] [blame] | 90 | |
Heiko Schocher | 429ddf6 | 2010-10-13 07:57:14 +0200 | [diff] [blame] | 91 | .globl _bss_end_ofs |
| 92 | _bss_end_ofs: |
Simon Glass | ed70c8f | 2013-03-14 06:54:53 +0000 | [diff] [blame] | 93 | .word __bss_end - _start |
Heiko Schocher | 504f87c | 2010-09-17 13:10:40 +0200 | [diff] [blame] | 94 | |
Po-Yu Chuang | 1864b00 | 2011-03-01 23:02:04 +0000 | [diff] [blame] | 95 | .globl _end_ofs |
| 96 | _end_ofs: |
| 97 | .word _end - _start |
| 98 | |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 99 | #ifdef CONFIG_USE_IRQ |
| 100 | /* IRQ stack memory (calculated at run-time) */ |
| 101 | .globl IRQ_STACK_START |
| 102 | IRQ_STACK_START: |
| 103 | .word 0x0badc0de |
| 104 | |
| 105 | /* IRQ stack memory (calculated at run-time) */ |
| 106 | .globl FIQ_STACK_START |
| 107 | FIQ_STACK_START: |
| 108 | .word 0x0badc0de |
| 109 | #endif |
Heiko Schocher | 504f87c | 2010-09-17 13:10:40 +0200 | [diff] [blame] | 110 | |
Heiko Schocher | 504f87c | 2010-09-17 13:10:40 +0200 | [diff] [blame] | 111 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ |
| 112 | .globl IRQ_STACK_START_IN |
| 113 | IRQ_STACK_START_IN: |
| 114 | .word 0x0badc0de |
Heiko Schocher | 504f87c | 2010-09-17 13:10:40 +0200 | [diff] [blame] | 115 | |
Heiko Schocher | 504f87c | 2010-09-17 13:10:40 +0200 | [diff] [blame] | 116 | /* |
| 117 | * the actual reset code |
| 118 | */ |
| 119 | |
| 120 | reset: |
| 121 | /* |
| 122 | * set the cpu to SVC32 mode |
| 123 | */ |
| 124 | mrs r0,cpsr |
| 125 | bic r0,r0,#0x1f |
| 126 | orr r0,r0,#0xd3 |
| 127 | msr cpsr,r0 |
| 128 | |
Heiko Schocher | 504f87c | 2010-09-17 13:10:40 +0200 | [diff] [blame] | 129 | /* the mask ROM code should have PLL and others stable */ |
| 130 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
| 131 | bl cpu_init_crit |
| 132 | #endif |
| 133 | |
Albert ARIBAUD | facdae5 | 2013-01-08 10:18:02 +0000 | [diff] [blame] | 134 | bl _main |
Heiko Schocher | 504f87c | 2010-09-17 13:10:40 +0200 | [diff] [blame] | 135 | |
| 136 | /*------------------------------------------------------------------------------*/ |
| 137 | |
Albert ARIBAUD | facdae5 | 2013-01-08 10:18:02 +0000 | [diff] [blame] | 138 | .globl c_runtime_cpu_setup |
| 139 | c_runtime_cpu_setup: |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 140 | |
Albert ARIBAUD | facdae5 | 2013-01-08 10:18:02 +0000 | [diff] [blame] | 141 | bx lr |
Heiko Schocher | 429ddf6 | 2010-10-13 07:57:14 +0200 | [diff] [blame] | 142 | |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 143 | /* |
| 144 | ************************************************************************* |
| 145 | * |
| 146 | * CPU_init_critical registers |
| 147 | * |
| 148 | * setup important registers |
| 149 | * setup memory timing |
| 150 | * |
| 151 | ************************************************************************* |
| 152 | */ |
Magnus Lilja | 4133f65 | 2009-06-13 20:50:01 +0200 | [diff] [blame] | 153 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 154 | cpu_init_crit: |
| 155 | /* |
| 156 | * flush v4 I/D caches |
| 157 | */ |
| 158 | mov r0, #0 |
George G. Davis | 1596789 | 2010-05-11 10:15:36 -0400 | [diff] [blame] | 159 | mcr p15, 0, r0, c7, c7, 0 /* Invalidate I+D+BTB caches */ |
| 160 | mcr p15, 0, r0, c8, c7, 0 /* Invalidate Unified TLB */ |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 161 | |
| 162 | /* |
| 163 | * disable MMU stuff and caches |
| 164 | */ |
| 165 | mrc p15, 0, r0, c1, c0, 0 |
| 166 | bic r0, r0, #0x00002300 @ clear bits 13, 9:8 (--V- --RS) |
| 167 | bic r0, r0, #0x00000087 @ clear bits 7, 2:0 (B--- -CAM) |
| 168 | orr r0, r0, #0x00000002 @ set bit 2 (A) Align |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 169 | orr r0, r0, #0x00001000 @ set bit 12 (I) I-Cache |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 170 | mcr p15, 0, r0, c1, c0, 0 |
| 171 | |
| 172 | /* |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 173 | * Jump to board specific initialization... The Mask ROM will have already initialized |
| 174 | * basic memory. Go here to bump up clock rate and handle wake up conditions. |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 175 | */ |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 176 | mov ip, lr /* persevere link reg across call */ |
Wolfgang Denk | 7f88a5e | 2005-10-06 17:08:18 +0200 | [diff] [blame] | 177 | bl lowlevel_init /* go setup pll,mux,memory */ |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 178 | mov lr, ip /* restore link */ |
| 179 | mov pc, lr /* back to my caller */ |
Magnus Lilja | 4133f65 | 2009-06-13 20:50:01 +0200 | [diff] [blame] | 180 | #endif /* CONFIG_SKIP_LOWLEVEL_INIT */ |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 181 | |
Aneesh V | 552a319 | 2011-07-13 05:11:07 +0000 | [diff] [blame] | 182 | #ifndef CONFIG_SPL_BUILD |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 183 | /* |
| 184 | ************************************************************************* |
| 185 | * |
| 186 | * Interrupt handling |
| 187 | * |
| 188 | ************************************************************************* |
| 189 | */ |
| 190 | @ |
| 191 | @ IRQ stack frame. |
| 192 | @ |
| 193 | #define S_FRAME_SIZE 72 |
| 194 | |
| 195 | #define S_OLD_R0 68 |
| 196 | #define S_PSR 64 |
| 197 | #define S_PC 60 |
| 198 | #define S_LR 56 |
| 199 | #define S_SP 52 |
| 200 | |
| 201 | #define S_IP 48 |
| 202 | #define S_FP 44 |
| 203 | #define S_R10 40 |
| 204 | #define S_R9 36 |
| 205 | #define S_R8 32 |
| 206 | #define S_R7 28 |
| 207 | #define S_R6 24 |
| 208 | #define S_R5 20 |
| 209 | #define S_R4 16 |
| 210 | #define S_R3 12 |
| 211 | #define S_R2 8 |
| 212 | #define S_R1 4 |
| 213 | #define S_R0 0 |
| 214 | |
| 215 | #define MODE_SVC 0x13 |
| 216 | #define I_BIT 0x80 |
| 217 | |
| 218 | /* |
| 219 | * use bad_save_user_regs for abort/prefetch/undef/swi ... |
| 220 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling |
| 221 | */ |
| 222 | |
| 223 | .macro bad_save_user_regs |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 224 | sub sp, sp, #S_FRAME_SIZE @ carve out a frame on current user stack |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 225 | stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12 |
| 226 | |
Heiko Schocher | 504f87c | 2010-09-17 13:10:40 +0200 | [diff] [blame] | 227 | ldr r2, IRQ_STACK_START_IN @ set base 2 words into abort stack |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 228 | ldmia r2, {r2 - r3} @ get values for "aborted" pc and cpsr (into parm regs) |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 229 | add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack |
| 230 | |
| 231 | add r5, sp, #S_SP |
| 232 | mov r1, lr |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 233 | stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr |
| 234 | mov r0, sp @ save current stack into r0 (param register) |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 235 | .endm |
| 236 | |
| 237 | .macro irq_save_user_regs |
| 238 | sub sp, sp, #S_FRAME_SIZE |
| 239 | stmia sp, {r0 - r12} @ Calling r0-r12 |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 240 | add r8, sp, #S_PC @ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good. |
| 241 | stmdb r8, {sp, lr}^ @ Calling SP, LR |
| 242 | str lr, [r8, #0] @ Save calling PC |
| 243 | mrs r6, spsr |
| 244 | str r6, [r8, #4] @ Save CPSR |
| 245 | str r0, [r8, #8] @ Save OLD_R0 |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 246 | mov r0, sp |
| 247 | .endm |
| 248 | |
| 249 | .macro irq_restore_user_regs |
| 250 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr |
| 251 | mov r0, r0 |
| 252 | ldr lr, [sp, #S_PC] @ Get PC |
| 253 | add sp, sp, #S_FRAME_SIZE |
| 254 | subs pc, lr, #4 @ return & move spsr_svc into cpsr |
| 255 | .endm |
| 256 | |
| 257 | .macro get_bad_stack |
Heiko Schocher | 504f87c | 2010-09-17 13:10:40 +0200 | [diff] [blame] | 258 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack (enter in banked mode) |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 259 | |
| 260 | str lr, [r13] @ save caller lr in position 0 of saved stack |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 261 | mrs lr, spsr @ get the spsr |
| 262 | str lr, [r13, #4] @ save spsr in position 1 of saved stack |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 263 | |
| 264 | mov r13, #MODE_SVC @ prepare SVC-Mode |
| 265 | @ msr spsr_c, r13 |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 266 | msr spsr, r13 @ switch modes, make sure moves will execute |
| 267 | mov lr, pc @ capture return pc |
| 268 | movs pc, lr @ jump to next instruction & switch modes. |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 269 | .endm |
| 270 | |
| 271 | .macro get_bad_stack_swi |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 272 | sub r13, r13, #4 @ space on current stack for scratch reg. |
| 273 | str r0, [r13] @ save R0's value. |
Heiko Schocher | 504f87c | 2010-09-17 13:10:40 +0200 | [diff] [blame] | 274 | ldr r0, IRQ_STACK_START_IN @ get data regions start |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 275 | str lr, [r0] @ save caller lr in position 0 of saved stack |
Tetsuyuki Kobayashi | b023a95 | 2013-04-05 00:12:51 +0000 | [diff] [blame] | 276 | mrs lr, spsr @ get the spsr |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 277 | str lr, [r0, #4] @ save spsr in position 1 of saved stack |
Tetsuyuki Kobayashi | b023a95 | 2013-04-05 00:12:51 +0000 | [diff] [blame] | 278 | ldr lr, [r0] @ restore lr |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 279 | ldr r0, [r13] @ restore r0 |
| 280 | add r13, r13, #4 @ pop stack entry |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 281 | .endm |
| 282 | |
| 283 | .macro get_irq_stack @ setup IRQ stack |
| 284 | ldr sp, IRQ_STACK_START |
| 285 | .endm |
| 286 | |
| 287 | .macro get_fiq_stack @ setup FIQ stack |
| 288 | ldr sp, FIQ_STACK_START |
| 289 | .endm |
Aneesh V | 552a319 | 2011-07-13 05:11:07 +0000 | [diff] [blame] | 290 | #endif /* CONFIG_SPL_BUILD */ |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 291 | |
| 292 | /* |
| 293 | * exception handlers |
| 294 | */ |
Aneesh V | 552a319 | 2011-07-13 05:11:07 +0000 | [diff] [blame] | 295 | #ifdef CONFIG_SPL_BUILD |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 296 | .align 5 |
| 297 | do_hang: |
| 298 | ldr sp, _TEXT_BASE /* use 32 words about stack */ |
| 299 | bl hang /* hang and never return */ |
Aneesh V | 552a319 | 2011-07-13 05:11:07 +0000 | [diff] [blame] | 300 | #else /* !CONFIG_SPL_BUILD */ |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 301 | .align 5 |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 302 | undefined_instruction: |
| 303 | get_bad_stack |
| 304 | bad_save_user_regs |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 305 | bl do_undefined_instruction |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 306 | |
| 307 | .align 5 |
| 308 | software_interrupt: |
| 309 | get_bad_stack_swi |
| 310 | bad_save_user_regs |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 311 | bl do_software_interrupt |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 312 | |
| 313 | .align 5 |
| 314 | prefetch_abort: |
| 315 | get_bad_stack |
| 316 | bad_save_user_regs |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 317 | bl do_prefetch_abort |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 318 | |
| 319 | .align 5 |
| 320 | data_abort: |
| 321 | get_bad_stack |
| 322 | bad_save_user_regs |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 323 | bl do_data_abort |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 324 | |
| 325 | .align 5 |
| 326 | not_used: |
| 327 | get_bad_stack |
| 328 | bad_save_user_regs |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 329 | bl do_not_used |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 330 | |
| 331 | #ifdef CONFIG_USE_IRQ |
| 332 | |
| 333 | .align 5 |
| 334 | irq: |
| 335 | get_irq_stack |
| 336 | irq_save_user_regs |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 337 | bl do_irq |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 338 | irq_restore_user_regs |
| 339 | |
| 340 | .align 5 |
| 341 | fiq: |
| 342 | get_fiq_stack |
| 343 | /* someone ought to write a more effiction fiq_save_user_regs */ |
| 344 | irq_save_user_regs |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 345 | bl do_fiq |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 346 | irq_restore_user_regs |
| 347 | |
| 348 | #else |
| 349 | |
| 350 | .align 5 |
| 351 | irq: |
| 352 | get_bad_stack |
| 353 | bad_save_user_regs |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 354 | bl do_irq |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 355 | |
| 356 | .align 5 |
| 357 | fiq: |
| 358 | get_bad_stack |
| 359 | bad_save_user_regs |
wdenk | 2e405bf | 2005-01-10 00:01:04 +0000 | [diff] [blame] | 360 | bl do_fiq |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 361 | |
| 362 | #endif |
| 363 | .align 5 |
| 364 | .global arm1136_cache_flush |
| 365 | arm1136_cache_flush: |
Aneesh V | ecee9c8 | 2011-06-16 23:30:48 +0000 | [diff] [blame] | 366 | #if !defined(CONFIG_SYS_ICACHE_OFF) |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 367 | mcr p15, 0, r1, c7, c5, 0 @ invalidate I cache |
Heiko Schocher | 95965b9 | 2010-09-17 13:10:32 +0200 | [diff] [blame] | 368 | #endif |
Aneesh V | ecee9c8 | 2011-06-16 23:30:48 +0000 | [diff] [blame] | 369 | #if !defined(CONFIG_SYS_DCACHE_OFF) |
Heiko Schocher | 95965b9 | 2010-09-17 13:10:32 +0200 | [diff] [blame] | 370 | mcr p15, 0, r1, c7, c14, 0 @ invalidate D cache |
| 371 | #endif |
wdenk | f806271 | 2005-01-09 23:16:25 +0000 | [diff] [blame] | 372 | mov pc, lr @ back to caller |
Aneesh V | 552a319 | 2011-07-13 05:11:07 +0000 | [diff] [blame] | 373 | #endif /* CONFIG_SPL_BUILD */ |