head.S 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. ! Copyright 2005,2006,2007,2009 Imagination Technologies
  2. #include <linux/init.h>
  3. #include <asm/metag_mem.h>
  4. #include <generated/asm-offsets.h>
  5. #undef __exit
  6. __HEAD
  7. ! Setup the stack and get going into _metag_start_kernel
  8. .global __start
  9. .type __start,function
  10. __start:
  11. ! D1Ar1 contains pTBI (ISTAT)
  12. ! D0Ar2 contains pTBI
  13. ! D1Ar3 contains __pTBISegs
  14. ! D0Ar4 contains kernel arglist pointer
  15. MOVT D0Re0,#HI(___pTBIs)
  16. ADD D0Re0,D0Re0,#LO(___pTBIs)
  17. SETL [D0Re0],D0Ar2,D1Ar1
  18. MOVT D0Re0,#HI(___pTBISegs)
  19. ADD D0Re0,D0Re0,#LO(___pTBISegs)
  20. SETD [D0Re0],D1Ar3
  21. MOV A0FrP,#0
  22. MOV D0Re0,#0
  23. MOV D1Re0,#0
  24. MOV D1Ar3,#0
  25. MOV D1Ar1,D0Ar4 !Store kernel boot params
  26. MOV D1Ar5,#0
  27. MOV D0Ar6,#0
  28. #ifdef CONFIG_METAG_DSP
  29. MOV D0.8,#0
  30. #endif
  31. MOVT A0StP,#HI(_init_thread_union)
  32. ADD A0StP,A0StP,#LO(_init_thread_union)
  33. ADD A0StP,A0StP,#THREAD_INFO_SIZE
  34. MOVT D1RtP,#HI(_metag_start_kernel)
  35. CALL D1RtP,#LO(_metag_start_kernel)
  36. .size __start,.-__start
  37. !! Needed by TBX
  38. .global __exit
  39. .type __exit,function
  40. __exit:
  41. XOR TXENABLE,D0Re0,D0Re0
  42. .size __exit,.-__exit
  43. #ifdef CONFIG_SMP
  44. .global _secondary_startup
  45. .type _secondary_startup,function
  46. _secondary_startup:
  47. #if CONFIG_PAGE_OFFSET < LINGLOBAL_BASE
  48. ! In case GCOn has just been turned on we need to fence any writes that
  49. ! the boot thread might have performed prior to coherency taking effect.
  50. MOVT D0Re0,#HI(LINSYSEVENT_WR_ATOMIC_UNLOCK)
  51. MOV D1Re0,#0
  52. SETD [D0Re0], D1Re0
  53. #endif
  54. MOVT A0StP,#HI(_secondary_data_stack)
  55. ADD A0StP,A0StP,#LO(_secondary_data_stack)
  56. GETD A0StP,[A0StP]
  57. ADD A0StP,A0StP,#THREAD_INFO_SIZE
  58. B _secondary_start_kernel
  59. .size _secondary_startup,.-_secondary_startup
  60. #endif