head.S 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
  3. * Copyright (C) 2007-2009 PetaLogix
  4. * Copyright (C) 2006 Atmark Techno, Inc.
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/linkage.h>
  11. #include <asm/thread_info.h>
  12. #include <asm/page.h>
  13. .text
  14. ENTRY(_start)
  15. mfs r1, rmsr
  16. andi r1, r1, ~2
  17. mts rmsr, r1
  18. /* save fdt to kernel location */
  19. /* r7 stores pointer to fdt blob */
  20. beqi r7, no_fdt_arg
  21. or r11, r0, r0 /* incremment */
  22. ori r4, r0, TOPHYS(_fdt_start) /* save bram context */
  23. ori r3, r0, (0x4000 - 4)
  24. _copy_fdt:
  25. lw r12, r7, r11 /* r12 = r7 + r11 */
  26. sw r12, r4, r11 /* addr[r4 + r11] = r12 */
  27. addik r11, r11, 4 /* increment counting */
  28. bgtid r3, _copy_fdt /* loop for all entries */
  29. addik r3, r3, -4 /* descrement loop */
  30. no_fdt_arg:
  31. /* Initialize small data anchors */
  32. la r13, r0, _KERNEL_SDA_BASE_
  33. la r2, r0, _KERNEL_SDA2_BASE_
  34. /* Initialize stack pointer */
  35. la r1, r0, init_thread_union + THREAD_SIZE - 4
  36. /* Initialize r31 with current task address */
  37. la r31, r0, init_task
  38. /*
  39. * Call platform dependent initialize function.
  40. * Please see $(ARCH)/mach-$(SUBARCH)/setup.c for
  41. * the function.
  42. */
  43. la r8, r0, machine_early_init
  44. brald r15, r8
  45. nop
  46. la r15, r0, machine_halt
  47. braid start_kernel
  48. nop