bootstrap.S 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 <linux/linkage.h>
  23. .section .ResetVector.text, "ax"
  24. .global _ResetVector
  25. .global reset
  26. _ResetVector:
  27. _j _SetupMMU
  28. .begin no-absolute-literals
  29. .literal_position
  30. .align 4
  31. RomInitAddr:
  32. #if defined(CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX) && \
  33. XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
  34. .word 0x00003000
  35. #else
  36. .word 0xd0003000
  37. #endif
  38. RomBootParam:
  39. .word _bootparam
  40. _bootparam:
  41. .short BP_TAG_FIRST
  42. .short 4
  43. .long BP_VERSION
  44. .short BP_TAG_LAST
  45. .short 0
  46. .long 0
  47. .align 4
  48. _SetupMMU:
  49. movi a0, 0
  50. wsr a0, windowbase
  51. rsync
  52. movi a0, 1
  53. wsr a0, windowstart
  54. rsync
  55. movi a0, 0x1F
  56. wsr a0, ps
  57. rsync
  58. Offset = _SetupMMU - _ResetVector
  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
  71. .align 4
  72. .section .ResetVector.remapped_text, "x"
  73. .global _RemappedResetVector
  74. /* Do org before literals */
  75. .org 0
  76. _RemappedResetVector:
  77. .begin no-absolute-literals
  78. .literal_position
  79. _j _RemappedSetupMMU
  80. /* Position Remapped code at the same location as the original code */
  81. . = _RemappedResetVector + Offset
  82. _RemappedSetupMMU:
  83. #ifndef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
  84. initialize_mmu
  85. #endif
  86. .end no-absolute-literals