head.S 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1994, 1995 Waldorf Electronics
  7. * Written by Ralf Baechle and Andreas Busse
  8. * Copyright (C) 1995 - 1999 Ralf Baechle
  9. * Copyright (C) 1996 Paul M. Antoine
  10. * Modified for DECStation and hence R3000 support by Paul M. Antoine
  11. * Further modifications by David S. Miller and Harald Koerfgen
  12. * Copyright (C) 1999 Silicon Graphics, Inc.
  13. */
  14. #include <asm/asm.h>
  15. #include <asm/regdef.h>
  16. .set noreorder
  17. .cprestore
  18. LEAF(start)
  19. start:
  20. /* Save boot rom start args */
  21. move s0, a0
  22. move s1, a1
  23. move s2, a2
  24. move s3, a3
  25. #ifdef CONFIG_MIPS_ZBOOT_APPENDED_DTB
  26. PTR_LA t0, __appended_dtb
  27. #ifdef CONFIG_CPU_BIG_ENDIAN
  28. li t1, 0xd00dfeed
  29. #else
  30. li t1, 0xedfe0dd0
  31. #endif
  32. lw t2, (t0)
  33. bne t1, t2, not_found
  34. nop
  35. move s1, t0
  36. PTR_LI s0, -2
  37. not_found:
  38. #endif
  39. /* Clear BSS */
  40. PTR_LA a0, _edata
  41. PTR_LA a2, _end
  42. 1: sw zero, 0(a0)
  43. bne a2, a0, 1b
  44. addiu a0, a0, 4
  45. PTR_LA a0, (.heap) /* heap address */
  46. PTR_LA sp, (.stack + 8192) /* stack address */
  47. PTR_LA ra, 2f
  48. PTR_LA k0, decompress_kernel
  49. jr k0
  50. nop
  51. 2:
  52. move a0, s0
  53. move a1, s1
  54. move a2, s2
  55. move a3, s3
  56. PTR_LI k0, KERNEL_ENTRY
  57. jr k0
  58. nop
  59. 3:
  60. b 3b
  61. nop
  62. END(start)
  63. .comm .heap,BOOT_HEAP_SIZE,4
  64. .comm .stack,4096*2,4