1 /*
2  * 1. load vmlinuz
3  *
4  * CONFIG_MEMORY_START  	+-----------------------+
5  *				|        vmlinuz	|
6  *				+-----------------------+
7  * 2. decompressed
8  *
9  * CONFIG_MEMORY_START  	+-----------------------+
10  *				|        vmlinuz	|
11  *				+-----------------------+
12  *				|			|
13  * BOOT_RELOC_ADDR		+-----------------------+
14  *				|		 	|
15  * KERNEL_DECOMPRESS_ADDR 	+-----------------------+
16  *				|  	vmlinux		|
17  *				+-----------------------+
18  *
19  * 3. relocate copy & jump code
20  *
21  * CONFIG_MEMORY_START  	+-----------------------+
22  *				|        vmlinuz	|
23  *				+-----------------------+
24  *				|			|
25  * BOOT_RELOC_ADDR		+-----------------------+
26  *				|    boot(copy&jump)	|
27  * KERNEL_DECOMPRESS_ADDR 	+-----------------------+
28  *				|  	vmlinux		|
29  *				+-----------------------+
30  *
31  * 4. relocate decompressed kernel
32  *
33  * CONFIG_MEMORY_START  	+-----------------------+
34  *				|        vmlinux	|
35  *				+-----------------------+
36  *				|			|
37  * BOOT_RELOC_ADDR		+-----------------------+
38  *				|     boot(copy&jump) 	|
39  * KERNEL_DECOMPRESS_ADDR 	+-----------------------+
40  *				|  			|
41  *				+-----------------------+
42  *
43  */
44 #ifdef __ASSEMBLY__
45 #define __val(x)	x
46 #else
47 #define __val(x)	(x)
48 #endif
49 
50 #define DECOMPRESS_OFFSET_BASE	__val(0x00900000)
51 #define BOOT_RELOC_SIZE		__val(0x00001000)
52 
53 #define KERNEL_EXEC_ADDR	__val(CONFIG_MEMORY_START)
54 #define KERNEL_DECOMPRESS_ADDR	__val(CONFIG_MEMORY_START + \
55 				      DECOMPRESS_OFFSET_BASE + BOOT_RELOC_SIZE)
56 #define KERNEL_ENTRY		__val(CONFIG_MEMORY_START + 0x1000)
57 
58 #define BOOT_EXEC_ADDR		__val(CONFIG_MEMORY_START)
59 #define BOOT_RELOC_ADDR		__val(CONFIG_MEMORY_START + DECOMPRESS_OFFSET_BASE)
60