1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2008 by Marcoen Hirschberg
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
24 .section .init.text,"ax",%progbits
28 /* Exception vectors */
31 * reset vector *MUST* use relative-addressing only
32 * the MMU might not be enabled yet, and the PC might point to
33 * a memory region not present in the linked binary
38 b software_int_handler
39 b prefetch_abort_handler
50 msr cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ/FIQ */
52 #if CONFIG_CPU == AS3525 || CONFIG_CPU == AS3525v2
67 /* must be done before bss is zeroed */
79 /* copy init data to codec buffer */
80 /* must be done before bss is zeroed */
91 mcr p15, 0, r2, c7, c5, 0 @ Invalidate ICache
94 /* Initialise bss section to zero */
103 /* Set up some stack and munge it with 0xdeadbeef */
112 /* Set up stack for IRQ mode */
116 /* Set up stack for FIQ mode */
120 /* Let abort and undefined modes use IRQ stack */
126 /* Switch back to supervisor mode */
128 ldr ip, =main @ make sure we are using the virtual address
131 /* All illegal exceptions call into UIE with exception address as first
132 * parameter. This is calculated differently depending on which exception
133 * we're in. Second parameter is exception number, used for a string lookup
136 sub r0, lr, #4 @ r0 points to the faulty ARM instruction
139 tst r1, #(1<<5) @ T bit set ?
140 subne r0, lr, #2 @ if yes, r0 points to the faulty THUMB instruction
141 #endif /* USE_THUMB */
145 /* We run supervisor mode most of the time, and should never see a software
146 * exception being thrown. Perhaps make it illegal and call UIE? */
147 software_int_handler:
151 prefetch_abort_handler:
161 /* 256 words of IRQ stack */
165 /* 256 words of FIQ stack */