diff options
-rw-r--r-- | arch/xtensa/Makefile | 8 | ||||
-rw-r--r-- | arch/xtensa/boot/Makefile | 23 | ||||
-rw-r--r-- | arch/xtensa/boot/boot-elf/Makefile | 2 | ||||
-rw-r--r-- | arch/xtensa/boot/boot-redboot/Makefile | 2 | ||||
-rw-r--r-- | arch/xtensa/boot/boot-uboot/Makefile | 14 | ||||
-rw-r--r-- | arch/xtensa/include/asm/vectors.h | 4 | ||||
-rw-r--r-- | arch/xtensa/kernel/setup.c | 7 | ||||
-rw-r--r-- | arch/xtensa/kernel/vmlinux.lds.S | 41 |
8 files changed, 71 insertions, 30 deletions
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile index e54189427b31..7ee02fe4a63d 100644 --- a/arch/xtensa/Makefile +++ b/arch/xtensa/Makefile | |||
@@ -93,11 +93,7 @@ endif | |||
93 | 93 | ||
94 | boot := arch/xtensa/boot | 94 | boot := arch/xtensa/boot |
95 | 95 | ||
96 | all: zImage | 96 | all Image zImage uImage: vmlinux |
97 | |||
98 | bzImage : zImage | ||
99 | |||
100 | zImage: vmlinux | ||
101 | $(Q)$(MAKE) $(build)=$(boot) $@ | 97 | $(Q)$(MAKE) $(build)=$(boot) $@ |
102 | 98 | ||
103 | %.dtb: | 99 | %.dtb: |
@@ -107,6 +103,8 @@ dtbs: scripts | |||
107 | $(Q)$(MAKE) $(build)=$(boot)/dts | 103 | $(Q)$(MAKE) $(build)=$(boot)/dts |
108 | 104 | ||
109 | define archhelp | 105 | define archhelp |
106 | @echo '* Image - Kernel ELF image with reset vector' | ||
110 | @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)' | 107 | @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)' |
108 | @echo '* uImage - U-Boot wrapped image' | ||
111 | @echo ' dtbs - Build device tree blobs for enabled boards' | 109 | @echo ' dtbs - Build device tree blobs for enabled boards' |
112 | endef | 110 | endef |
diff --git a/arch/xtensa/boot/Makefile b/arch/xtensa/boot/Makefile index ca20a892021b..53e4178711e6 100644 --- a/arch/xtensa/boot/Makefile +++ b/arch/xtensa/boot/Makefile | |||
@@ -21,14 +21,17 @@ subdir-y := lib | |||
21 | 21 | ||
22 | # Subdirs for the boot loader(s) | 22 | # Subdirs for the boot loader(s) |
23 | 23 | ||
24 | bootdir-$(CONFIG_XTENSA_PLATFORM_ISS) += boot-elf | 24 | boot-$(CONFIG_XTENSA_PLATFORM_ISS) += Image |
25 | bootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf boot-uboot | 25 | boot-$(CONFIG_XTENSA_PLATFORM_XT2000) += Image zImage uImage |
26 | bootdir-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += boot-redboot boot-elf boot-uboot | 26 | boot-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += Image zImage uImage |
27 | 27 | ||
28 | zImage Image: $(bootdir-y) | 28 | all: $(boot-y) |
29 | Image: boot-elf | ||
30 | zImage: boot-redboot | ||
31 | uImage: $(obj)/uImage | ||
29 | 32 | ||
30 | $(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \ | 33 | boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y)) \ |
31 | $(addprefix $(obj)/,$(host-progs)) | 34 | $(addprefix $(obj)/,$(host-progs)) |
32 | $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS) | 35 | $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS) |
33 | 36 | ||
34 | OBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary | 37 | OBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary |
@@ -41,4 +44,10 @@ vmlinux.bin.gz: vmlinux.bin FORCE | |||
41 | 44 | ||
42 | boot-elf: vmlinux.bin | 45 | boot-elf: vmlinux.bin |
43 | boot-redboot: vmlinux.bin.gz | 46 | boot-redboot: vmlinux.bin.gz |
44 | boot-uboot: vmlinux.bin.gz | 47 | |
48 | UIMAGE_LOADADDR = $(CONFIG_KERNEL_LOAD_ADDRESS) | ||
49 | UIMAGE_COMPRESSION = gzip | ||
50 | |||
51 | $(obj)/uImage: vmlinux.bin.gz FORCE | ||
52 | $(call if_changed,uimage) | ||
53 | $(Q)$(kecho) ' Kernel: $@ is ready' | ||
diff --git a/arch/xtensa/boot/boot-elf/Makefile b/arch/xtensa/boot/boot-elf/Makefile index 89db089f5a12..521471981356 100644 --- a/arch/xtensa/boot/boot-elf/Makefile +++ b/arch/xtensa/boot/boot-elf/Makefile | |||
@@ -31,4 +31,4 @@ $(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds | |||
31 | -o $@ $(obj)/Image.o | 31 | -o $@ $(obj)/Image.o |
32 | $(Q)$(kecho) ' Kernel: $@ is ready' | 32 | $(Q)$(kecho) ' Kernel: $@ is ready' |
33 | 33 | ||
34 | zImage: $(obj)/../Image.elf | 34 | all Image: $(obj)/../Image.elf |
diff --git a/arch/xtensa/boot/boot-redboot/Makefile b/arch/xtensa/boot/boot-redboot/Makefile index 8be8b9436981..8632473ad319 100644 --- a/arch/xtensa/boot/boot-redboot/Makefile +++ b/arch/xtensa/boot/boot-redboot/Makefile | |||
@@ -32,4 +32,4 @@ $(obj)/../zImage.redboot: $(obj)/zImage.elf | |||
32 | $(Q)$(OBJCOPY) -S -O binary $< $@ | 32 | $(Q)$(OBJCOPY) -S -O binary $< $@ |
33 | $(Q)$(kecho) ' Kernel: $@ is ready' | 33 | $(Q)$(kecho) ' Kernel: $@ is ready' |
34 | 34 | ||
35 | zImage: $(obj)/../zImage.redboot | 35 | all zImage: $(obj)/../zImage.redboot |
diff --git a/arch/xtensa/boot/boot-uboot/Makefile b/arch/xtensa/boot/boot-uboot/Makefile deleted file mode 100644 index 0f4c417b4196..000000000000 --- a/arch/xtensa/boot/boot-uboot/Makefile +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | # | ||
2 | # This file is subject to the terms and conditions of the GNU General Public | ||
3 | # License. See the file "COPYING" in the main directory of this archive | ||
4 | # for more details. | ||
5 | # | ||
6 | |||
7 | UIMAGE_LOADADDR = $(CONFIG_KERNEL_LOAD_ADDRESS) | ||
8 | UIMAGE_COMPRESSION = gzip | ||
9 | |||
10 | $(obj)/../uImage: vmlinux.bin.gz FORCE | ||
11 | $(call if_changed,uimage) | ||
12 | $(Q)$(kecho) ' Kernel: $@ is ready' | ||
13 | |||
14 | zImage: $(obj)/../uImage | ||
diff --git a/arch/xtensa/include/asm/vectors.h b/arch/xtensa/include/asm/vectors.h index 77d41cc7a688..65d3da9db19b 100644 --- a/arch/xtensa/include/asm/vectors.h +++ b/arch/xtensa/include/asm/vectors.h | |||
@@ -67,7 +67,11 @@ static inline unsigned long xtensa_get_kio_paddr(void) | |||
67 | #endif /* CONFIG_MMU */ | 67 | #endif /* CONFIG_MMU */ |
68 | 68 | ||
69 | #define RESET_VECTOR1_VADDR (XCHAL_RESET_VECTOR1_VADDR) | 69 | #define RESET_VECTOR1_VADDR (XCHAL_RESET_VECTOR1_VADDR) |
70 | #ifdef CONFIG_VECTORS_OFFSET | ||
70 | #define VECBASE_VADDR (KERNELOFFSET - CONFIG_VECTORS_OFFSET) | 71 | #define VECBASE_VADDR (KERNELOFFSET - CONFIG_VECTORS_OFFSET) |
72 | #else | ||
73 | #define VECBASE_VADDR _vecbase | ||
74 | #endif | ||
71 | 75 | ||
72 | #if defined(XCHAL_HAVE_VECBASE) && XCHAL_HAVE_VECBASE | 76 | #if defined(XCHAL_HAVE_VECBASE) && XCHAL_HAVE_VECBASE |
73 | 77 | ||
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index 8fd4be610607..197e75b400b1 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c | |||
@@ -126,6 +126,8 @@ static int __init parse_tag_initrd(const bp_tag_t* tag) | |||
126 | 126 | ||
127 | __tagtable(BP_TAG_INITRD, parse_tag_initrd); | 127 | __tagtable(BP_TAG_INITRD, parse_tag_initrd); |
128 | 128 | ||
129 | #endif /* CONFIG_BLK_DEV_INITRD */ | ||
130 | |||
129 | #ifdef CONFIG_OF | 131 | #ifdef CONFIG_OF |
130 | 132 | ||
131 | static int __init parse_tag_fdt(const bp_tag_t *tag) | 133 | static int __init parse_tag_fdt(const bp_tag_t *tag) |
@@ -138,8 +140,6 @@ __tagtable(BP_TAG_FDT, parse_tag_fdt); | |||
138 | 140 | ||
139 | #endif /* CONFIG_OF */ | 141 | #endif /* CONFIG_OF */ |
140 | 142 | ||
141 | #endif /* CONFIG_BLK_DEV_INITRD */ | ||
142 | |||
143 | static int __init parse_tag_cmdline(const bp_tag_t* tag) | 143 | static int __init parse_tag_cmdline(const bp_tag_t* tag) |
144 | { | 144 | { |
145 | strlcpy(command_line, (char *)(tag->data), COMMAND_LINE_SIZE); | 145 | strlcpy(command_line, (char *)(tag->data), COMMAND_LINE_SIZE); |
@@ -334,6 +334,7 @@ void __init setup_arch(char **cmdline_p) | |||
334 | 334 | ||
335 | mem_reserve(__pa(&_stext), __pa(&_end)); | 335 | mem_reserve(__pa(&_stext), __pa(&_end)); |
336 | 336 | ||
337 | #ifdef CONFIG_VECTORS_OFFSET | ||
337 | mem_reserve(__pa(&_WindowVectors_text_start), | 338 | mem_reserve(__pa(&_WindowVectors_text_start), |
338 | __pa(&_WindowVectors_text_end)); | 339 | __pa(&_WindowVectors_text_end)); |
339 | 340 | ||
@@ -370,6 +371,8 @@ void __init setup_arch(char **cmdline_p) | |||
370 | __pa(&_Level6InterruptVector_text_end)); | 371 | __pa(&_Level6InterruptVector_text_end)); |
371 | #endif | 372 | #endif |
372 | 373 | ||
374 | #endif /* CONFIG_VECTORS_OFFSET */ | ||
375 | |||
373 | #ifdef CONFIG_SMP | 376 | #ifdef CONFIG_SMP |
374 | mem_reserve(__pa(&_SecondaryResetVector_text_start), | 377 | mem_reserve(__pa(&_SecondaryResetVector_text_start), |
375 | __pa(&_SecondaryResetVector_text_end)); | 378 | __pa(&_SecondaryResetVector_text_end)); |
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S index 31411fc82662..30d9fc21e076 100644 --- a/arch/xtensa/kernel/vmlinux.lds.S +++ b/arch/xtensa/kernel/vmlinux.lds.S | |||
@@ -59,6 +59,7 @@ jiffies = jiffies_64; | |||
59 | * garbage.) | 59 | * garbage.) |
60 | */ | 60 | */ |
61 | 61 | ||
62 | #ifdef CONFIG_VECTORS_OFFSET | ||
62 | #define SECTION_VECTOR(sym, section, addr, max_prevsec_size, prevsec) \ | 63 | #define SECTION_VECTOR(sym, section, addr, max_prevsec_size, prevsec) \ |
63 | section addr : AT((MIN(LOADADDR(prevsec) + max_prevsec_size, \ | 64 | section addr : AT((MIN(LOADADDR(prevsec) + max_prevsec_size, \ |
64 | LOADADDR(prevsec) + SIZEOF(prevsec)) + 3) & ~ 3) \ | 65 | LOADADDR(prevsec) + SIZEOF(prevsec)) + 3) & ~ 3) \ |
@@ -68,6 +69,11 @@ jiffies = jiffies_64; | |||
68 | *(section) \ | 69 | *(section) \ |
69 | sym ## _end = ABSOLUTE(.); \ | 70 | sym ## _end = ABSOLUTE(.); \ |
70 | } | 71 | } |
72 | #else | ||
73 | #define SECTION_VECTOR(section, addr) \ | ||
74 | . = addr; \ | ||
75 | *(section) | ||
76 | #endif | ||
71 | 77 | ||
72 | /* | 78 | /* |
73 | * Mapping of input sections to output sections when linking. | 79 | * Mapping of input sections to output sections when linking. |
@@ -85,6 +91,37 @@ SECTIONS | |||
85 | { | 91 | { |
86 | /* The HEAD_TEXT section must be the first section! */ | 92 | /* The HEAD_TEXT section must be the first section! */ |
87 | HEAD_TEXT | 93 | HEAD_TEXT |
94 | |||
95 | #ifndef CONFIG_VECTORS_OFFSET | ||
96 | . = ALIGN(PAGE_SIZE); | ||
97 | _vecbase = .; | ||
98 | |||
99 | SECTION_VECTOR (.WindowVectors.text, WINDOW_VECTORS_VADDR) | ||
100 | #if XCHAL_EXCM_LEVEL >= 2 | ||
101 | SECTION_VECTOR (.Level2InterruptVector.text, INTLEVEL2_VECTOR_VADDR) | ||
102 | #endif | ||
103 | #if XCHAL_EXCM_LEVEL >= 3 | ||
104 | SECTION_VECTOR (.Level3InterruptVector.text, INTLEVEL3_VECTOR_VADDR) | ||
105 | #endif | ||
106 | #if XCHAL_EXCM_LEVEL >= 4 | ||
107 | SECTION_VECTOR (.Level4InterruptVector.text, INTLEVEL4_VECTOR_VADDR) | ||
108 | #endif | ||
109 | #if XCHAL_EXCM_LEVEL >= 5 | ||
110 | SECTION_VECTOR (.Level5InterruptVector.text, INTLEVEL5_VECTOR_VADDR) | ||
111 | #endif | ||
112 | #if XCHAL_EXCM_LEVEL >= 6 | ||
113 | SECTION_VECTOR (.Level6InterruptVector.text, INTLEVEL6_VECTOR_VADDR) | ||
114 | #endif | ||
115 | SECTION_VECTOR (.DebugInterruptVector.literal, DEBUG_VECTOR_VADDR - 4) | ||
116 | SECTION_VECTOR (.DebugInterruptVector.text, DEBUG_VECTOR_VADDR) | ||
117 | SECTION_VECTOR (.KernelExceptionVector.literal, KERNEL_VECTOR_VADDR - 4) | ||
118 | SECTION_VECTOR (.KernelExceptionVector.text, KERNEL_VECTOR_VADDR) | ||
119 | SECTION_VECTOR (.UserExceptionVector.literal, USER_VECTOR_VADDR - 4) | ||
120 | SECTION_VECTOR (.UserExceptionVector.text, USER_VECTOR_VADDR) | ||
121 | SECTION_VECTOR (.DoubleExceptionVector.literal, DOUBLEEXC_VECTOR_VADDR - 48) | ||
122 | SECTION_VECTOR (.DoubleExceptionVector.text, DOUBLEEXC_VECTOR_VADDR) | ||
123 | #endif | ||
124 | |||
88 | TEXT_TEXT | 125 | TEXT_TEXT |
89 | VMLINUX_SYMBOL(__sched_text_start) = .; | 126 | VMLINUX_SYMBOL(__sched_text_start) = .; |
90 | *(.sched.literal .sched.text) | 127 | *(.sched.literal .sched.text) |
@@ -132,6 +169,7 @@ SECTIONS | |||
132 | . = ALIGN(16); | 169 | . = ALIGN(16); |
133 | __boot_reloc_table_start = ABSOLUTE(.); | 170 | __boot_reloc_table_start = ABSOLUTE(.); |
134 | 171 | ||
172 | #ifdef CONFIG_VECTORS_OFFSET | ||
135 | RELOCATE_ENTRY(_WindowVectors_text, | 173 | RELOCATE_ENTRY(_WindowVectors_text, |
136 | .WindowVectors.text); | 174 | .WindowVectors.text); |
137 | #if XCHAL_EXCM_LEVEL >= 2 | 175 | #if XCHAL_EXCM_LEVEL >= 2 |
@@ -164,6 +202,7 @@ SECTIONS | |||
164 | .DoubleExceptionVector.text); | 202 | .DoubleExceptionVector.text); |
165 | RELOCATE_ENTRY(_DebugInterruptVector_text, | 203 | RELOCATE_ENTRY(_DebugInterruptVector_text, |
166 | .DebugInterruptVector.text); | 204 | .DebugInterruptVector.text); |
205 | #endif | ||
167 | #if defined(CONFIG_SMP) | 206 | #if defined(CONFIG_SMP) |
168 | RELOCATE_ENTRY(_SecondaryResetVector_text, | 207 | RELOCATE_ENTRY(_SecondaryResetVector_text, |
169 | .SecondaryResetVector.text); | 208 | .SecondaryResetVector.text); |
@@ -186,6 +225,7 @@ SECTIONS | |||
186 | . = ALIGN(4); | 225 | . = ALIGN(4); |
187 | .dummy : { LONG(0) } | 226 | .dummy : { LONG(0) } |
188 | 227 | ||
228 | #ifdef CONFIG_VECTORS_OFFSET | ||
189 | /* The vectors are relocated to the real position at startup time */ | 229 | /* The vectors are relocated to the real position at startup time */ |
190 | 230 | ||
191 | SECTION_VECTOR (_WindowVectors_text, | 231 | SECTION_VECTOR (_WindowVectors_text, |
@@ -277,6 +317,7 @@ SECTIONS | |||
277 | 317 | ||
278 | . = (LOADADDR( .DoubleExceptionVector.text ) + SIZEOF( .DoubleExceptionVector.text ) + 3) & ~ 3; | 318 | . = (LOADADDR( .DoubleExceptionVector.text ) + SIZEOF( .DoubleExceptionVector.text ) + 3) & ~ 3; |
279 | 319 | ||
320 | #endif | ||
280 | #if defined(CONFIG_SMP) | 321 | #if defined(CONFIG_SMP) |
281 | 322 | ||
282 | SECTION_VECTOR (_SecondaryResetVector_text, | 323 | SECTION_VECTOR (_SecondaryResetVector_text, |