xref: /openbmc/linux/arch/mips/boot/compressed/head.S (revision 1b93b3c3e94be2605759735a89fc935ba5f58dcf)
1*1b93b3c3SWu Zhangjin/*
2*1b93b3c3SWu Zhangjin * This file is subject to the terms and conditions of the GNU General Public
3*1b93b3c3SWu Zhangjin * License.  See the file "COPYING" in the main directory of this archive
4*1b93b3c3SWu Zhangjin * for more details.
5*1b93b3c3SWu Zhangjin *
6*1b93b3c3SWu Zhangjin * Copyright (C) 1994, 1995 Waldorf Electronics
7*1b93b3c3SWu Zhangjin * Written by Ralf Baechle and Andreas Busse
8*1b93b3c3SWu Zhangjin * Copyright (C) 1995 - 1999 Ralf Baechle
9*1b93b3c3SWu Zhangjin * Copyright (C) 1996 Paul M. Antoine
10*1b93b3c3SWu Zhangjin * Modified for DECStation and hence R3000 support by Paul M. Antoine
11*1b93b3c3SWu Zhangjin * Further modifications by David S. Miller and Harald Koerfgen
12*1b93b3c3SWu Zhangjin * Copyright (C) 1999 Silicon Graphics, Inc.
13*1b93b3c3SWu Zhangjin */
14*1b93b3c3SWu Zhangjin
15*1b93b3c3SWu Zhangjin#include <asm/asm.h>
16*1b93b3c3SWu Zhangjin#include <asm/regdef.h>
17*1b93b3c3SWu Zhangjin
18*1b93b3c3SWu Zhangjin	.set noreorder
19*1b93b3c3SWu Zhangjin	.cprestore
20*1b93b3c3SWu Zhangjin	LEAF(start)
21*1b93b3c3SWu Zhangjinstart:
22*1b93b3c3SWu Zhangjin	/* Save boot rom start args */
23*1b93b3c3SWu Zhangjin	move	s0, a0
24*1b93b3c3SWu Zhangjin	move	s1, a1
25*1b93b3c3SWu Zhangjin	move	s2, a2
26*1b93b3c3SWu Zhangjin	move	s3, a3
27*1b93b3c3SWu Zhangjin
28*1b93b3c3SWu Zhangjin	/* Clear BSS */
29*1b93b3c3SWu Zhangjin	PTR_LA	a0, _edata
30*1b93b3c3SWu Zhangjin	PTR_LA	a2, _end
31*1b93b3c3SWu Zhangjin1:	sw	zero, 0(a0)
32*1b93b3c3SWu Zhangjin	bne	a2, a0, 1b
33*1b93b3c3SWu Zhangjin	 addiu	a0, a0, 4
34*1b93b3c3SWu Zhangjin
35*1b93b3c3SWu Zhangjin	PTR_LA	a0, (.heap)          /* heap address */
36*1b93b3c3SWu Zhangjin	PTR_LA  sp, (.stack + 8192)  /* stack address */
37*1b93b3c3SWu Zhangjin
38*1b93b3c3SWu Zhangjin	PTR_LA	ra, 2f
39*1b93b3c3SWu Zhangjin	PTR_LA	k0, decompress_kernel
40*1b93b3c3SWu Zhangjin	jr	k0
41*1b93b3c3SWu Zhangjin	 nop
42*1b93b3c3SWu Zhangjin2:
43*1b93b3c3SWu Zhangjin	move	a0, s0
44*1b93b3c3SWu Zhangjin	move	a1, s1
45*1b93b3c3SWu Zhangjin	move	a2, s2
46*1b93b3c3SWu Zhangjin	move	a3, s3
47*1b93b3c3SWu Zhangjin	PTR_LI	k0, KERNEL_ENTRY
48*1b93b3c3SWu Zhangjin	jr	k0
49*1b93b3c3SWu Zhangjin	 nop
50*1b93b3c3SWu Zhangjin3:
51*1b93b3c3SWu Zhangjin	b	3b
52*1b93b3c3SWu Zhangjin	 nop
53*1b93b3c3SWu Zhangjin	END(start)
54*1b93b3c3SWu Zhangjin
55*1b93b3c3SWu Zhangjin	.comm .heap,BOOT_HEAP_SIZE,4
56*1b93b3c3SWu Zhangjin	.comm .stack,4096*2,4
57