[BACK]Return to head.S CVS log [TXT][DIR] Up to [local] / prex-old / boot / avr32 / ngw100

Annotation of prex-old/boot/avr32/ngw100/head.S, Revision 1.1

1.1     ! nbrk        1: /*
        !             2:  * $Id$
        !             3:  */
        !             4: /*-
        !             5:  * Copyright (c) 2005, Kohsuke Ohtani
        !             6:  * All rights reserved.
        !             7:  *
        !             8:  * Redistribution and use in source and binary forms, with or without
        !             9:  * modification, are permitted provided that the following conditions
        !            10:  * are met:
        !            11:  * 1. Redistributions of source code must retain the above copyright
        !            12:  *    notice, this list of conditions and the following disclaimer.
        !            13:  * 2. Redistributions in binary form must reproduce the above copyright
        !            14:  *    notice, this list of conditions and the following disclaimer in the
        !            15:  *    documentation and/or other materials provided with the distribution.
        !            16:  * 3. Neither the name of the author nor the names of any co-contributors
        !            17:  *    may be used to endorse or promote products derived from this software
        !            18:  *    without specific prior written permission.
        !            19:  *
        !            20:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
        !            21:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        !            22:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
        !            23:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
        !            24:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        !            25:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
        !            26:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
        !            27:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
        !            28:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
        !            29:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
        !            30:  * SUCH DAMAGE.
        !            31:  */
        !            32:
        !            33: /*
        !            34:  * head.S - low level platform support
        !            35:  *
        !            36:  * This file contains the code from crt0.S which is released under
        !            37:  * public domain by Jeff Frohwein.
        !            38:  */
        !            39:
        !            40: /*-
        !            41:  * Memory ranges:
        !            42:  *
        !            43:  * 0x00000000 - 0x00800000 : Parallel FLASH (8MB)
        !            44:  * 0x10000000 - 0x11ffffff : SDRAM (32MB)
        !            45:  * 0x24000000 - 0x24007fff : On-chip SRAM (32KB)
        !            46:  *
        !            47:  * Note: on ATNGW100 U-Boot uses RAM @0x11fc0000 -> 0x12000000 (last 256K)
        !            48:  * to hold some variables during bootstrap.
        !            49:  * Note: we will pass struct boot_info to the kernel in 2K region right
        !            50:  * below U-Boot stuff.
        !            51:  * This means that BOOT_STACK should be at (0x11fc0000 - BOOT_INFO_SIZE).
        !            52:  */
        !            53:
        !            54: #include <conf/config.h>
        !            55: #include <platform.h>
        !            56:
        !            57: #define ENTRY(x) .global x; .align; x##:
        !            58:
        !            59:        .section ".text","ax"
        !            60: /*
        !            61:  * Kernel start point
        !            62:  */
        !            63: ENTRY(boot_entry)
        !            64:        bral    start_vector
        !            65:
        !            66: /* stack_end:  .word   BOOT_STACK+0xf00 */
        !            67: stack_end:     .word   BOOT_STACK
        !            68:
        !            69: start_vector:
        !            70:        /*
        !            71:         * Disable interrupts (just to be sure).
        !            72:         */
        !            73:        mfsr r0, 0      /* read SR */
        !            74:        mov r1, 1
        !            75:        or r0, r1       /* set GM bit */
        !            76:        mtsr 0, r0      /* write back SR */
        !            77:
        !            78:        /*
        !            79:         * Setup bootloader stack.
        !            80:         */
        !            81:        lddpc r1, stack_end
        !            82:        mov sp, r1
        !            83:
        !            84:        /* enter bootldr */
        !            85:        rcall loader_main
        !            86:
        !            87: /*
        !            88:  * Start kernel
        !            89:  */
        !            90: ENTRY(start_kernel)
        !            91:        icall   r0
        !            92:
        !            93:                .section .tail,"ax"
        !            94: dummy:
        !            95:        .byte   0xff
        !            96:
        !            97: .end

CVSweb