xref: /openbmc/linux/arch/mips/boot/compressed/head.S (revision d0034a7a4ac7fae708146ac0059b9c47a1543f0d)
11b93b3c3SWu Zhangjin/*
21b93b3c3SWu Zhangjin * This file is subject to the terms and conditions of the GNU General Public
31b93b3c3SWu Zhangjin * License.  See the file "COPYING" in the main directory of this archive
41b93b3c3SWu Zhangjin * for more details.
51b93b3c3SWu Zhangjin *
61b93b3c3SWu Zhangjin * Copyright (C) 1994, 1995 Waldorf Electronics
71b93b3c3SWu Zhangjin * Written by Ralf Baechle and Andreas Busse
81b93b3c3SWu Zhangjin * Copyright (C) 1995 - 1999 Ralf Baechle
91b93b3c3SWu Zhangjin * Copyright (C) 1996 Paul M. Antoine
101b93b3c3SWu Zhangjin * Modified for DECStation and hence R3000 support by Paul M. Antoine
111b93b3c3SWu Zhangjin * Further modifications by David S. Miller and Harald Koerfgen
121b93b3c3SWu Zhangjin * Copyright (C) 1999 Silicon Graphics, Inc.
131b93b3c3SWu Zhangjin */
141b93b3c3SWu Zhangjin
151b93b3c3SWu Zhangjin#include <asm/asm.h>
161b93b3c3SWu Zhangjin#include <asm/regdef.h>
171b93b3c3SWu Zhangjin
181b93b3c3SWu Zhangjin	LEAF(start)
191b93b3c3SWu Zhangjin	/* Save boot rom start args */
201b93b3c3SWu Zhangjin	move	s0, a0
211b93b3c3SWu Zhangjin	move	s1, a1
221b93b3c3SWu Zhangjin	move	s2, a2
231b93b3c3SWu Zhangjin	move	s3, a3
241b93b3c3SWu Zhangjin
251b93b3c3SWu Zhangjin	/* Clear BSS */
261b93b3c3SWu Zhangjin	PTR_LA	a0, _edata
271b93b3c3SWu Zhangjin	PTR_LA	a2, _end
281b93b3c3SWu Zhangjin1:	sw	zero, 0(a0)
291b93b3c3SWu Zhangjin	addiu	a0, a0, 4
30*fdd85e04SJinyang He	bne	a2, a0, 1b
311b93b3c3SWu Zhangjin
321b93b3c3SWu Zhangjin	PTR_LA	a0, (.heap)	     /* heap address */
331b93b3c3SWu Zhangjin	PTR_LA	sp, (.stack + 8192)  /* stack address */
341b93b3c3SWu Zhangjin
352ee1503eSJiaxun Yang	PTR_LA	t9, decompress_kernel
362ee1503eSJiaxun Yang	jalr	t9
372ee1503eSJiaxun Yang
381b93b3c3SWu Zhangjin2:
391b93b3c3SWu Zhangjin	move	a0, s0
401b93b3c3SWu Zhangjin	move	a1, s1
411b93b3c3SWu Zhangjin	move	a2, s2
421b93b3c3SWu Zhangjin	move	a3, s3
432ee1503eSJiaxun Yang	PTR_LI	t9, KERNEL_ENTRY
442ee1503eSJiaxun Yang	jalr	t9
452ee1503eSJiaxun Yang
461b93b3c3SWu Zhangjin3:
471b93b3c3SWu Zhangjin	b	3b
482ee1503eSJiaxun Yang
491b93b3c3SWu Zhangjin	END(start)
501b93b3c3SWu Zhangjin
511b93b3c3SWu Zhangjin	.comm .heap,BOOT_HEAP_SIZE,4
521b93b3c3SWu Zhangjin	.comm .stack,4096*2,4
53