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 */
38 #if CONFIG_CPU==S5L8700
39 .word 0x43554644 /* DFUC */
41 .word 0xdeadbeef /* to keep the same PC offsets */
45 .word undef_instr_handler
46 .word software_int_handler
47 .word prefetch_abort_handler
48 .word data_abort_handler
49 .word reserved_handler
58 msr cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ/FIQ */
60 #if (CONFIG_CPU==AS3525 || CONFIG_CPU==AS3525v2) && !defined(BOOTLOADER)
63 #define CACHE_ALL 0x0C
64 #define UNCACHED_ADDR(a) (a + 0x10000000)
66 /* Setup MMU : has to be done before accessing IRAM ! */
70 mov r0, #0 @ physical address
71 mov r1, #0 @ virtual address
72 mov r2, #0x1000 @ size (all memory)
76 mov r0, #0 @ physical address
77 ldr r1, =IRAM_ORIG @ virtual address
78 mov r2, #1 @ size : 1MB
82 mov r0, #0 @ physical address
83 ldr r1, =UNCACHED_ADDR(IRAM_ORIG) @ virtual address
84 mov r2, #1 @ size : 1MB
88 mov r0, #0x30000000 @ physical address
89 mov r1, #DRAM_ORIG @ virtual address
90 mov r2, #MEMORYSIZE @ size
94 mov r0, #0x30000000 @ physical address
95 mov r1, #UNCACHED_ADDR(DRAM_ORIG) @ virtual address
96 mov r2, #MEMORYSIZE @ size
100 /* map 1st mbyte of DRAM at 0x0 to have exception vectors available */
102 mov r0, #0x30000000 @ physical address
103 mov r1, #0 @ virtual address
120 /* must be done before bss is zeroed */
132 #ifdef HAVE_INIT_ATTR
133 /* copy init data to codec buffer */
134 /* must be done before bss is zeroed */
145 mcr p15, 0, r2, c7, c5, 0 @ Invalidate ICache
148 /* Initialise bss section to zero */
157 /* Set up some stack and munge it with 0xdeadbeef */
166 /* Set up stack for IRQ mode */
170 /* Set up stack for FIQ mode */
174 /* Let abort and undefined modes use IRQ stack */
180 /* Switch back to supervisor mode */
185 /* All illegal exceptions call into UIE with exception address as first
186 * parameter. This is calculated differently depending on which exception
187 * we're in. Second parameter is exception number, used for a string lookup
194 /* We run supervisor mode most of the time, and should never see a software
195 * exception being thrown. Perhaps make it illegal and call UIE? */
196 software_int_handler:
200 prefetch_abort_handler:
210 /* 256 words of IRQ stack */
214 /* 256 words of FIQ stack */