bootstrap.S 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * arch/xtensa/boot/boot-elf/bootstrap.S
  3. *
  4. * Low-level exception handling
  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. * Copyright (C) 2004 - 2013 by Tensilica Inc.
  11. *
  12. * Chris Zankel <chris@zankel.net>
  13. * Marc Gauthier <marc@tensilica.com>
  14. * Piet Delaney <piet@tensilica.com>
  15. */
  16. #include <asm/bootparam.h>
  17. #include <asm/initialize_mmu.h>
  18. #include <asm/vectors.h>
  19. #include <linux/linkage.h>
  20. .section .ResetVector.text, "ax"
  21. .global _ResetVector
  22. .global reset
  23. _ResetVector:
  24. _j _SetupMMU
  25. .begin no-absolute-literals
  26. .literal_position
  27. #if defined(CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX) && \
  28. XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
  29. .literal RomInitAddr, CONFIG_KERNEL_LOAD_ADDRESS
  30. #else
  31. .literal RomInitAddr, KERNELOFFSET
  32. #endif
  33. #ifndef CONFIG_PARSE_BOOTPARAM
  34. .literal RomBootParam, 0
  35. #else
  36. .literal RomBootParam, _bootparam
  37. .align 4
  38. _bootparam:
  39. .short BP_TAG_FIRST
  40. .short 4
  41. .long BP_VERSION
  42. .short BP_TAG_LAST
  43. .short 0
  44. .long 0
  45. #endif
  46. .align 4
  47. _SetupMMU:
  48. movi a0, 0
  49. wsr a0, windowbase
  50. rsync
  51. movi a0, 1
  52. wsr a0, windowstart
  53. rsync
  54. movi a0, 0x1F
  55. wsr a0, ps
  56. rsync
  57. #ifndef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
  58. initialize_mmu
  59. #endif
  60. .end no-absolute-literals
  61. rsil a0, XCHAL_DEBUGLEVEL-1
  62. rsync
  63. reset:
  64. l32r a0, RomInitAddr
  65. l32r a2, RomBootParam
  66. movi a3, 0
  67. movi a4, 0
  68. jx a0