head.S 999 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Non-board-specific low-level startup code
  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 <linux/linkage.h>
  11. #include <asm/page.h>
  12. #include <asm/thread_info.h>
  13. #include <asm/sysreg.h>
  14. .section .init.text,"ax"
  15. .global kernel_entry
  16. kernel_entry:
  17. /* Initialize status register */
  18. lddpc r0, init_sr
  19. mtsr SYSREG_SR, r0
  20. /* Set initial stack pointer */
  21. lddpc sp, stack_addr
  22. sub sp, -THREAD_SIZE
  23. #ifdef CONFIG_FRAME_POINTER
  24. /* Mark last stack frame */
  25. mov lr, 0
  26. mov r7, 0
  27. #endif
  28. /* Set up the PIO, SDRAM controller, early printk, etc. */
  29. rcall board_early_init
  30. /* Start the show */
  31. lddpc pc, kernel_start_addr
  32. .align 2
  33. init_sr:
  34. .long 0x007f0000 /* Supervisor mode, everything masked */
  35. stack_addr:
  36. .long init_thread_union
  37. kernel_start_addr:
  38. .long start_kernel