summaryrefslogtreecommitdiffstats
path: root/arch/mips/boot/compressed/head.S
blob: 0ca599563ea18edc25420424545d393513ec8df7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 *  arch/mips/boot/compressed/head.S
 *
 *  Copyright (C) 1995 by Ralf Baechle
 *
 *  Head.S contains the MIPS exception handler and startup code.
 */

#include <asm/asm.h>

		.text
		.set	noreorder
/*
 * Compressed kernel entry
 */
		NESTED(kernel_entry, 16, sp)
		/*
		 * Set EXL in c0_status. The results in the lowest two
		 * gigabytes identity mapped.
		 */
		mfc0	t0,CP0_STATUS
		ori	t0,4
		mtc0	t0,CP0_STATUS

		/*
		 * Clear BSS first so that there are no surprises...
		 */
		la	t0,_edata
		la	t1,_end
		sw	zero,(t0)
1:		addiu	t0,4
		bnel	t0,t1,1b
		sw	zero,(t0)
		END(kernel_entry)

		/*
		 * Do the decompression, and jump to the new kernel..
		 */
		jal	C_LABEL(decompress_kernel)
		nop

		/*
		 * Flush caches
		 */
		jal	C_LABEL(cacheflush)

		/*
		 * Jump into the decompressed kernel
		 */
		la	t0,KSEG0
		jr	t0
		nop