bootstrap.S 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. .word LOAD_MEMORY_ADDRESS
  34. RomBootParam:
  35. .word _bootparam
  36. _bootparam:
  37. .short BP_TAG_FIRST
  38. .short 4
  39. .long BP_VERSION
  40. .short BP_TAG_LAST
  41. .short 0
  42. .long 0
  43. .align 4
  44. _SetupMMU:
  45. movi a0, 0
  46. wsr a0, windowbase
  47. rsync
  48. movi a0, 1
  49. wsr a0, windowstart
  50. rsync
  51. movi a0, 0x1F
  52. wsr a0, ps
  53. rsync
  54. Offset = _SetupMMU - _ResetVector
  55. #ifndef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
  56. initialize_mmu
  57. #endif
  58. .end no-absolute-literals
  59. rsil a0, XCHAL_DEBUGLEVEL-1
  60. rsync
  61. reset:
  62. l32r a0, RomInitAddr
  63. l32r a2, RomBootParam
  64. movi a3, 0
  65. movi a4, 0
  66. jx a0
  67. #ifdef CONFIG_MMU
  68. .align 4
  69. .section .ResetVector.remapped_text, "x"
  70. .global _RemappedResetVector
  71. /* Do org before literals */
  72. .org 0
  73. _RemappedResetVector:
  74. .begin no-absolute-literals
  75. .literal_position
  76. _j _RemappedSetupMMU
  77. /* Position Remapped code at the same location as the original code */
  78. . = _RemappedResetVector + Offset
  79. _RemappedSetupMMU:
  80. #ifndef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
  81. initialize_mmu
  82. #endif
  83. .end no-absolute-literals
  84. #endif