Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'xtensa-20170303' of git://github.com/jcmvbkbc/linux-xtensa

Pull Xtensa updates from Max Filippov:

- clean up bootable image build targets: provide separate 'Image',
'zImage' and 'uImage' make targets that only build corresponding
image type. Make 'all' build all images appropriate for a platform

- allow merging vectors code into .text section as a preparation step
for XIP support

- fix handling external FDT when the kernel is built without
BLK_DEV_INITRD support

* tag 'xtensa-20170303' of git://github.com/jcmvbkbc/linux-xtensa:
xtensa: allow merging vectors into .text section
xtensa: clean up bootable image build targets
xtensa: move parse_tag_fdt out of #ifdef CONFIG_BLK_DEV_INITRD

+71 -30
+3 -5
arch/xtensa/Makefile
··· 93 93 94 94 boot := arch/xtensa/boot 95 95 96 - all: zImage 97 - 98 - bzImage : zImage 99 - 100 - zImage: vmlinux 96 + all Image zImage uImage: vmlinux 101 97 $(Q)$(MAKE) $(build)=$(boot) $@ 102 98 103 99 %.dtb: ··· 103 107 $(Q)$(MAKE) $(build)=$(boot)/dts 104 108 105 109 define archhelp 110 + @echo '* Image - Kernel ELF image with reset vector' 106 111 @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)' 112 + @echo '* uImage - U-Boot wrapped image' 107 113 @echo ' dtbs - Build device tree blobs for enabled boards' 108 114 endef
+16 -7
arch/xtensa/boot/Makefile
··· 21 21 22 22 # Subdirs for the boot loader(s) 23 23 24 - bootdir-$(CONFIG_XTENSA_PLATFORM_ISS) += boot-elf 25 - bootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf boot-uboot 26 - bootdir-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += boot-redboot boot-elf boot-uboot 24 + boot-$(CONFIG_XTENSA_PLATFORM_ISS) += Image 25 + boot-$(CONFIG_XTENSA_PLATFORM_XT2000) += Image zImage uImage 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)) \ 31 - $(addprefix $(obj)/,$(host-progs)) 33 + boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y)) \ 34 + $(addprefix $(obj)/,$(host-progs)) 32 35 $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS) 33 36 34 37 OBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary ··· 44 41 45 42 boot-elf: vmlinux.bin 46 43 boot-redboot: vmlinux.bin.gz 47 - boot-uboot: vmlinux.bin.gz 44 + 45 + UIMAGE_LOADADDR = $(CONFIG_KERNEL_LOAD_ADDRESS) 46 + UIMAGE_COMPRESSION = gzip 47 + 48 + $(obj)/uImage: vmlinux.bin.gz FORCE 49 + $(call if_changed,uimage) 50 + $(Q)$(kecho) ' Kernel: $@ is ready'
+1 -1
arch/xtensa/boot/boot-elf/Makefile
··· 31 31 -o $@ $(obj)/Image.o 32 32 $(Q)$(kecho) ' Kernel: $@ is ready' 33 33 34 - zImage: $(obj)/../Image.elf 34 + all Image: $(obj)/../Image.elf
+1 -1
arch/xtensa/boot/boot-redboot/Makefile
··· 32 32 $(Q)$(OBJCOPY) -S -O binary $< $@ 33 33 $(Q)$(kecho) ' Kernel: $@ is ready' 34 34 35 - zImage: $(obj)/../zImage.redboot 35 + all zImage: $(obj)/../zImage.redboot
-14
arch/xtensa/boot/boot-uboot/Makefile
··· 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
+4
arch/xtensa/include/asm/vectors.h
··· 67 67 #endif /* CONFIG_MMU */ 68 68 69 69 #define RESET_VECTOR1_VADDR (XCHAL_RESET_VECTOR1_VADDR) 70 + #ifdef CONFIG_VECTORS_OFFSET 70 71 #define VECBASE_VADDR (KERNELOFFSET - CONFIG_VECTORS_OFFSET) 72 + #else 73 + #define VECBASE_VADDR _vecbase 74 + #endif 71 75 72 76 #if defined(XCHAL_HAVE_VECBASE) && XCHAL_HAVE_VECBASE 73 77
+5 -2
arch/xtensa/kernel/setup.c
··· 126 126 127 127 __tagtable(BP_TAG_INITRD, parse_tag_initrd); 128 128 129 + #endif /* CONFIG_BLK_DEV_INITRD */ 130 + 129 131 #ifdef CONFIG_OF 130 132 131 133 static int __init parse_tag_fdt(const bp_tag_t *tag) ··· 139 137 __tagtable(BP_TAG_FDT, parse_tag_fdt); 140 138 141 139 #endif /* CONFIG_OF */ 142 - 143 - #endif /* CONFIG_BLK_DEV_INITRD */ 144 140 145 141 static int __init parse_tag_cmdline(const bp_tag_t* tag) 146 142 { ··· 334 334 335 335 mem_reserve(__pa(&_stext), __pa(&_end)); 336 336 337 + #ifdef CONFIG_VECTORS_OFFSET 337 338 mem_reserve(__pa(&_WindowVectors_text_start), 338 339 __pa(&_WindowVectors_text_end)); 339 340 ··· 370 369 mem_reserve(__pa(&_Level6InterruptVector_text_start), 371 370 __pa(&_Level6InterruptVector_text_end)); 372 371 #endif 372 + 373 + #endif /* CONFIG_VECTORS_OFFSET */ 373 374 374 375 #ifdef CONFIG_SMP 375 376 mem_reserve(__pa(&_SecondaryResetVector_text_start),
+41
arch/xtensa/kernel/vmlinux.lds.S
··· 59 59 * garbage.) 60 60 */ 61 61 62 + #ifdef CONFIG_VECTORS_OFFSET 62 63 #define SECTION_VECTOR(sym, section, addr, max_prevsec_size, prevsec) \ 63 64 section addr : AT((MIN(LOADADDR(prevsec) + max_prevsec_size, \ 64 65 LOADADDR(prevsec) + SIZEOF(prevsec)) + 3) & ~ 3) \ ··· 69 68 *(section) \ 70 69 sym ## _end = ABSOLUTE(.); \ 71 70 } 71 + #else 72 + #define SECTION_VECTOR(section, addr) \ 73 + . = addr; \ 74 + *(section) 75 + #endif 72 76 73 77 /* 74 78 * Mapping of input sections to output sections when linking. ··· 91 85 { 92 86 /* The HEAD_TEXT section must be the first section! */ 93 87 HEAD_TEXT 88 + 89 + #ifndef CONFIG_VECTORS_OFFSET 90 + . = ALIGN(PAGE_SIZE); 91 + _vecbase = .; 92 + 93 + SECTION_VECTOR (.WindowVectors.text, WINDOW_VECTORS_VADDR) 94 + #if XCHAL_EXCM_LEVEL >= 2 95 + SECTION_VECTOR (.Level2InterruptVector.text, INTLEVEL2_VECTOR_VADDR) 96 + #endif 97 + #if XCHAL_EXCM_LEVEL >= 3 98 + SECTION_VECTOR (.Level3InterruptVector.text, INTLEVEL3_VECTOR_VADDR) 99 + #endif 100 + #if XCHAL_EXCM_LEVEL >= 4 101 + SECTION_VECTOR (.Level4InterruptVector.text, INTLEVEL4_VECTOR_VADDR) 102 + #endif 103 + #if XCHAL_EXCM_LEVEL >= 5 104 + SECTION_VECTOR (.Level5InterruptVector.text, INTLEVEL5_VECTOR_VADDR) 105 + #endif 106 + #if XCHAL_EXCM_LEVEL >= 6 107 + SECTION_VECTOR (.Level6InterruptVector.text, INTLEVEL6_VECTOR_VADDR) 108 + #endif 109 + SECTION_VECTOR (.DebugInterruptVector.literal, DEBUG_VECTOR_VADDR - 4) 110 + SECTION_VECTOR (.DebugInterruptVector.text, DEBUG_VECTOR_VADDR) 111 + SECTION_VECTOR (.KernelExceptionVector.literal, KERNEL_VECTOR_VADDR - 4) 112 + SECTION_VECTOR (.KernelExceptionVector.text, KERNEL_VECTOR_VADDR) 113 + SECTION_VECTOR (.UserExceptionVector.literal, USER_VECTOR_VADDR - 4) 114 + SECTION_VECTOR (.UserExceptionVector.text, USER_VECTOR_VADDR) 115 + SECTION_VECTOR (.DoubleExceptionVector.literal, DOUBLEEXC_VECTOR_VADDR - 48) 116 + SECTION_VECTOR (.DoubleExceptionVector.text, DOUBLEEXC_VECTOR_VADDR) 117 + #endif 118 + 94 119 TEXT_TEXT 95 120 VMLINUX_SYMBOL(__sched_text_start) = .; 96 121 *(.sched.literal .sched.text) ··· 169 132 . = ALIGN(16); 170 133 __boot_reloc_table_start = ABSOLUTE(.); 171 134 135 + #ifdef CONFIG_VECTORS_OFFSET 172 136 RELOCATE_ENTRY(_WindowVectors_text, 173 137 .WindowVectors.text); 174 138 #if XCHAL_EXCM_LEVEL >= 2 ··· 202 164 .DoubleExceptionVector.text); 203 165 RELOCATE_ENTRY(_DebugInterruptVector_text, 204 166 .DebugInterruptVector.text); 167 + #endif 205 168 #if defined(CONFIG_SMP) 206 169 RELOCATE_ENTRY(_SecondaryResetVector_text, 207 170 .SecondaryResetVector.text); ··· 225 186 . = ALIGN(4); 226 187 .dummy : { LONG(0) } 227 188 189 + #ifdef CONFIG_VECTORS_OFFSET 228 190 /* The vectors are relocated to the real position at startup time */ 229 191 230 192 SECTION_VECTOR (_WindowVectors_text, ··· 317 277 318 278 . = (LOADADDR( .DoubleExceptionVector.text ) + SIZEOF( .DoubleExceptionVector.text ) + 3) & ~ 3; 319 279 280 + #endif 320 281 #if defined(CONFIG_SMP) 321 282 322 283 SECTION_VECTOR (_SecondaryResetVector_text,