18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * arch/xtensa/boot/boot-elf/bootstrap.S
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Low-level exception handling
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
78c2ecf20Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
88c2ecf20Sopenharmony_ci * for more details.
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci * Copyright (C) 2004 - 2013 by Tensilica Inc.
118c2ecf20Sopenharmony_ci *
128c2ecf20Sopenharmony_ci * Chris Zankel <chris@zankel.net>
138c2ecf20Sopenharmony_ci * Marc Gauthier <marc@tensilica.com>
148c2ecf20Sopenharmony_ci * Piet Delaney <piet@tensilica.com>
158c2ecf20Sopenharmony_ci */
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#include <asm/bootparam.h>
188c2ecf20Sopenharmony_ci#include <asm/initialize_mmu.h>
198c2ecf20Sopenharmony_ci#include <asm/vectors.h>
208c2ecf20Sopenharmony_ci#include <linux/linkage.h>
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci	.section	.ResetVector.text, "ax"
238c2ecf20Sopenharmony_ci	.global         _ResetVector
248c2ecf20Sopenharmony_ci	.global         reset
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci_ResetVector:
278c2ecf20Sopenharmony_ci	_j _SetupMMU
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci	.begin  no-absolute-literals
308c2ecf20Sopenharmony_ci	.literal_position
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#ifdef CONFIG_PARSE_BOOTPARAM
338c2ecf20Sopenharmony_ci	.align 4
348c2ecf20Sopenharmony_ci_bootparam:
358c2ecf20Sopenharmony_ci	.short	BP_TAG_FIRST
368c2ecf20Sopenharmony_ci	.short	4
378c2ecf20Sopenharmony_ci	.long	BP_VERSION
388c2ecf20Sopenharmony_ci	.short	BP_TAG_LAST
398c2ecf20Sopenharmony_ci	.short	0
408c2ecf20Sopenharmony_ci	.long	0
418c2ecf20Sopenharmony_ci#endif
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci	.align  4
448c2ecf20Sopenharmony_ci_SetupMMU:
458c2ecf20Sopenharmony_ci	movi	a0, 0
468c2ecf20Sopenharmony_ci	wsr	a0, windowbase
478c2ecf20Sopenharmony_ci	rsync
488c2ecf20Sopenharmony_ci	movi	a0, 1
498c2ecf20Sopenharmony_ci	wsr	a0, windowstart
508c2ecf20Sopenharmony_ci	rsync
518c2ecf20Sopenharmony_ci	movi	a0, 0x1F
528c2ecf20Sopenharmony_ci	wsr	a0, ps
538c2ecf20Sopenharmony_ci	rsync
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci#ifndef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
568c2ecf20Sopenharmony_ci	initialize_mmu
578c2ecf20Sopenharmony_ci#endif
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci	rsil    a0, XCHAL_DEBUGLEVEL-1
608c2ecf20Sopenharmony_ci	rsync
618c2ecf20Sopenharmony_cireset:
628c2ecf20Sopenharmony_ci#if defined(CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX) && \
638c2ecf20Sopenharmony_ci	XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
648c2ecf20Sopenharmony_ci	movi	a0, CONFIG_KERNEL_LOAD_ADDRESS
658c2ecf20Sopenharmony_ci#else
668c2ecf20Sopenharmony_ci	movi	a0, KERNELOFFSET
678c2ecf20Sopenharmony_ci#endif
688c2ecf20Sopenharmony_ci#ifdef CONFIG_PARSE_BOOTPARAM
698c2ecf20Sopenharmony_ci	movi	a2, _bootparam
708c2ecf20Sopenharmony_ci#else
718c2ecf20Sopenharmony_ci	movi	a2, 0
728c2ecf20Sopenharmony_ci#endif
738c2ecf20Sopenharmony_ci	movi	a3, 0
748c2ecf20Sopenharmony_ci	movi	a4, 0
758c2ecf20Sopenharmony_ci	jx      a0
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci	.end    no-absolute-literals
78