linux/arch/avr32/boot/u-boot/head.S
<<
>>
Prefs
   1/*
   2 * Startup code for use with the u-boot bootloader.
   3 *
   4 * Copyright (C) 2004-2006 Atmel Corporation
   5 *
   6 * This program is free software; you can redistribute it and/or modify
   7 * it under the terms of the GNU General Public License version 2 as
   8 * published by the Free Software Foundation.
   9 */
  10#include <asm/setup.h>
  11
  12        /*
  13         * The kernel is loaded where we want it to be and all caches
  14         * have just been flushed. We get two parameters from u-boot:
  15         *
  16         * r12 contains a magic number (ATAG_MAGIC)
  17         * r11 points to a tag table providing information about
  18         *     the system.
  19         */
  20        .section .init.text,"ax"
  21        .global _start
  22_start:
  23        /* Check if the boot loader actually provided a tag table */
  24        lddpc   r0, magic_number
  25        cp.w    r12, r0
  26        brne    no_tag_table
  27
  28        /* Initialize .bss */
  29        lddpc   r2, bss_start_addr
  30        lddpc   r3, end_addr
  31        mov     r0, 0
  32        mov     r1, 0
  331:      st.d    r2++, r0
  34        cp      r2, r3
  35        brlo    1b
  36
  37        /*
  38         * Save the tag table address for later use. This must be done
  39         * _after_ .bss has been initialized...
  40         */
  41        lddpc   r0, tag_table_addr
  42        st.w    r0[0], r11
  43
  44        /* Jump to loader-independent setup code */
  45        rjmp    kernel_entry
  46
  47        .align  2
  48magic_number:
  49        .long   ATAG_MAGIC
  50tag_table_addr:
  51        .long   bootloader_tags
  52bss_start_addr:
  53        .long   __bss_start
  54end_addr:
  55        .long   _end
  56
  57no_tag_table:
  58        sub     r12, pc, (. - 2f)
  59        bral    panic
  602:      .asciz  "Boot loader didn't provide correct magic number\n"
  61