bootstrap.S 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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/processor.h>
  18. #include <asm/pgtable.h>
  19. #include <asm/page.h>
  20. #include <asm/cacheasm.h>
  21. #include <asm/initialize_mmu.h>
  22. #include <asm/vectors.h>
  23. #include <linux/linkage.h>
  24. .section .ResetVector.text, "ax"
  25. .global _ResetVector
  26. .global reset
  27. _ResetVector:
  28. _j _SetupMMU
  29. .begin no-absolute-literals
  30. .literal_position
  31. .align 4
  32. RomInitAddr:
  33. #if defined(CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX) && \
  34. XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
  35. .word CONFIG_KERNEL_LOAD_ADDRESS
  36. #else
  37. .word KERNELOFFSET
  38. #endif
  39. RomBootParam:
  40. .word _bootparam
  41. _bootparam:
  42. .short BP_TAG_FIRST
  43. .short 4
  44. .long BP_VERSION
  45. .short BP_TAG_LAST
  46. .short 0
  47. .long 0
  48. .align 4
  49. _SetupMMU:
  50. movi a0, 0
  51. wsr a0, windowbase
  52. rsync
  53. movi a0, 1
  54. wsr a0, windowstart
  55. rsync
  56. movi a0, 0x1F
  57. wsr a0, ps
  58. rsync
  59. #ifndef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
  60. initialize_mmu
  61. #endif
  62. .end no-absolute-literals
  63. rsil a0, XCHAL_DEBUGLEVEL-1
  64. rsync
  65. reset:
  66. l32r a0, RomInitAddr
  67. l32r a2, RomBootParam
  68. movi a3, 0
  69. movi a4, 0
  70. jx a0