head.S 914 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. /* Start the show */
  29. lddpc pc, kernel_start_addr
  30. .align 2
  31. init_sr:
  32. .long 0x007f0000 /* Supervisor mode, everything masked */
  33. stack_addr:
  34. .long init_thread_union
  35. kernel_start_addr:
  36. .long start_kernel