1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
22 .section .init.text,"ax",%progbits
27 /* PortalPlayer bootloader and startup code based on startup.s from the iPodLinux
30 * Copyright (c) 2003, Daniel Palffy (dpalffy (at) rainstorm.org)
31 * Copyright (c) 2005, Bernard Leach <leachbj@bouncycastle.org>
34 #if CONFIG_CPU == PP5002
35 .equ PROC_ID, 0xc4000000
36 .equ CPU_CTRL, 0xcf004054
37 .equ CPU_STATUS, 0xcf004050
38 .equ COP_CTRL, 0xcf004058
39 .equ COP_STATUS, 0xcf004050
40 .equ IIS_CONFIG, 0xc0002500
43 .equ CPUSLEEPING, 0x8000
44 .equ COPSLEEPING, 0x4000
45 .equ CACHE_CTRL, 0xcf004024
46 .equ CACHE_ENAB, 0x2 /* Actually the CACHE_INIT flag */
48 .equ PROC_ID, 0x60000000
49 .equ CPU_CTRL, 0x60007000
50 .equ CPU_STATUS, 0x60007000
51 .equ COP_CTRL, 0x60007004
52 .equ COP_STATUS, 0x60007004
53 .equ IIS_CONFIG, 0x70002800
54 .equ SLEEP, 0x80000000
56 .equ CPUSLEEPING, 0x80000000
57 .equ COPSLEEPING, 0x80000000
58 .equ CACHE_CTRL, 0x6000c000
62 msr cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ */
63 #ifndef E200R_INSTALLER
64 /* 1 - Copy the bootloader to IRAM */
65 /* get the high part of our execute address */
66 bic r0, pc, #0xff /* r4 = pc & 0xffffff00 */
68 /* Copy bootloader to safe area - 0x40000000 (IRAM) */
78 /* For builds on targets with mi4 firmware, scramble writes data to
79 0xe0-0xeb, so jump past that. pad_skip must then exist at an
86 #endif /* IPOD_ARCH */
89 /* 2 - Jump both CPU and COP there */
90 ldr pc, =start_loc /* jump to the relocated start_loc: */
91 #endif /* E200R_INSTALLER */
94 /* Find out which processor we are */
101 /* put us (co-processor) to sleep */
108 /* Invalidate cache */
116 /* Wait for COP to be sleeping */
123 /* Initialise bss section to zero */
132 /* Set up some stack and munge it with 0xdeadbeef */
141 /* execute the loader - this will load an image to 0x10000000 */
144 /* store actual startup location returned by main() */
152 /* Wake up the coprocessor before executing the firmware */
158 /* Magic for loading the c200 OF */
172 .align 8 /* starts at 0x100 */
175 /* here comes the boot table, don't move its offset - preceding
176 code+data must stay <= 256 bytes */
196 #elif CONFIG_CPU == PP5002
197 ldrne r0, =0xf0004000
198 ldreq r0, =0xf000c000
205 #endif /* CPU type */