Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 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 | */ |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 16 | |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 17 | #include <asm/bootparam.h> |
Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 18 | #include <asm/processor.h> |
| 19 | #include <asm/pgtable.h> |
| 20 | #include <asm/page.h> |
| 21 | #include <asm/cacheasm.h> |
| 22 | #include <asm/initialize_mmu.h> |
Max Filippov | ccd0ef3 | 2014-10-02 22:03:27 +0400 | [diff] [blame] | 23 | #include <asm/vectors.h> |
Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 24 | #include <linux/linkage.h> |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 25 | |
Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 26 | .section .ResetVector.text, "ax" |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 27 | .global _ResetVector |
Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 28 | .global reset |
| 29 | |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 30 | _ResetVector: |
Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 31 | _j _SetupMMU |
| 32 | |
| 33 | .begin no-absolute-literals |
| 34 | .literal_position |
| 35 | |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 36 | .align 4 |
| 37 | RomInitAddr: |
Max Filippov | a9f2fc6 | 2016-04-13 05:20:02 +0300 | [diff] [blame^] | 38 | #if defined(CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX) && \ |
| 39 | XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY |
| 40 | .word CONFIG_KERNEL_LOAD_ADDRESS |
| 41 | #else |
| 42 | .word KERNELOFFSET |
| 43 | #endif |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 44 | RomBootParam: |
| 45 | .word _bootparam |
Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 46 | _bootparam: |
| 47 | .short BP_TAG_FIRST |
| 48 | .short 4 |
| 49 | .long BP_VERSION |
| 50 | .short BP_TAG_LAST |
| 51 | .short 0 |
| 52 | .long 0 |
| 53 | |
| 54 | .align 4 |
| 55 | _SetupMMU: |
| 56 | movi a0, 0 |
| 57 | wsr a0, windowbase |
| 58 | rsync |
| 59 | movi a0, 1 |
| 60 | wsr a0, windowstart |
| 61 | rsync |
| 62 | movi a0, 0x1F |
| 63 | wsr a0, ps |
| 64 | rsync |
| 65 | |
Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 66 | #ifndef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX |
| 67 | initialize_mmu |
| 68 | #endif |
| 69 | |
| 70 | .end no-absolute-literals |
| 71 | |
| 72 | rsil a0, XCHAL_DEBUGLEVEL-1 |
| 73 | rsync |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 74 | reset: |
| 75 | l32r a0, RomInitAddr |
| 76 | l32r a2, RomBootParam |
| 77 | movi a3, 0 |
| 78 | movi a4, 0 |
| 79 | jx a0 |