diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 19:28:41 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 19:28:41 -0800 |
commit | 076ef94d61f349f7cf0fe776e60456d8f232cca5 (patch) | |
tree | 6a7dfaaef61ff7ee33bb2036cd14b08583e70223 /nandwrite/init.S | |
parent | 84fe89dad95fa18a8950d130a2537db834333bb7 (diff) | |
download | legacy-076ef94d61f349f7cf0fe776e60456d8f232cca5.tar.gz |
auto import from //depot/cupcake/@135843android-sdk-tools_r2android-sdk-1.6_r2android-sdk-1.6_r1android-sdk-1.6-docs_r1android-sdk-1.5_r3android-sdk-1.5_r1android-sdk-1.5-preandroid-1.6_r2android-1.6_r1.5android-1.6_r1.4android-1.6_r1.3android-1.6_r1.2android-1.6_r1.1android-1.6_r1android-1.5r4android-1.5r3android-1.5r2android-1.5donut-release2donut-releasedonutcupcake-releasecupcake
Diffstat (limited to 'nandwrite/init.S')
-rw-r--r-- | nandwrite/init.S | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/nandwrite/init.S b/nandwrite/init.S new file mode 100644 index 0000000..c542503 --- /dev/null +++ b/nandwrite/init.S @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <boot/arm.h> + +v_reset: + b start +v_undefined: + b . +v_swi: + b . +v_prefetch_abt: + b . +v_data_abt: + b . +v_reserved: + b . +v_irq: + b . +v_fiq: + b . + +start: + /* save registers for main() */ + mov r7, r0 + mov r8, r1 + mov r9, r2 + mov r10, r3 + + /* init stacks */ + ldr r0, =BOOTLOADER_STACK + msr cpsr_c, #(PSR_I | PSR_F | PSR_SVC) + mov sp, r0 + + /* zero the BSS */ + ldr r1, =BOOTLOADER_BSS + ldr r2, =BOOTLOADER_END + mov r0, #0 +1: str r0, [r1], #4 + cmp r1, r2 + ble 1b + + bl periph_2gb_open + + /* restore registers for main() */ + mov r0, r7 + mov r1, r8 + mov r2, r9 + mov r3, r10 + + ldr r4, =_main + blx r4 + b . |