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

[CRIS] Remove links from CRIS build

Remove the links to architecture and machine dependent directories
(boot, lib, drivers, arch, mach)

The links were created and used mostly from the arch/cris/Makefile,
so why not dispense with them altogether?
Changed $(ARCH) to "cris" in Makefile, it is easier to read this way.

The CRISv32 head.S common files for the kernel and compressed images
needed to be modified to use ifdefs instead of using the now removed
mach link. Since there are only two versions, this is not a huge loss
in readability.

The link to vmlinux.lds.S is also replaced with a merged version
which uses ifdefs to select the correct layout.
System.map before and after are identical.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>

+81 -178
+19 -42
arch/cris/Makefile
··· 23 23 24 24 ifneq ($(arch-y),) 25 25 SARCH := arch-$(arch-y) 26 - inc := -Iarch/cris/include/arch-$(arch-y) -Iarch/cris/include/arch-$(arch-y)/arch 26 + inc := -Iarch/cris/include/$(SARCH) 27 + inc += -Iarch/cris/include/$(SARCH)/arch 27 28 else 28 29 SARCH := 29 30 inc := ··· 53 52 KBUILD_CFLAGS += -fno-omit-frame-pointer 54 53 endif 55 54 56 - head-y := arch/$(ARCH)/$(SARCH)/kernel/head.o 55 + head-y := arch/cris/$(SARCH)/kernel/head.o 57 56 58 57 LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a) 59 58 60 - core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ 61 - core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/ 59 + core-y += arch/cris/kernel/ arch/cris/mm/ 60 + core-y += arch/cris/$(SARCH)/kernel/ arch/cris/$(SARCH)/mm/ 62 61 ifdef CONFIG_ETRAX_ARCH_V32 63 - core-y += arch/$(ARCH)/$(SARCH)/$(MACH)/ 62 + core-y += arch/cris/$(SARCH)/$(MACH)/ 64 63 endif 65 - drivers-y += arch/$(ARCH)/$(SARCH)/drivers/ 66 - libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC) 64 + drivers-y += arch/cris/$(SARCH)/drivers/ 65 + libs-y += arch/cris/$(SARCH)/lib/ $(LIBGCC) 67 66 68 67 # cris source path 69 - SRC_ARCH = $(srctree)/arch/$(ARCH) 68 + SRC_ARCH = $(srctree)/arch/cris 70 69 # cris object files path 71 - OBJ_ARCH = $(objtree)/arch/$(ARCH) 70 + OBJ_ARCH = $(objtree)/arch/cris 72 71 73 - boot := arch/$(ARCH)/boot 74 - MACHINE := arch/$(ARCH)/$(SARCH) 72 + boot := arch/cris/$(SARCH)/boot 73 + MACHINE := arch/cris/$(SARCH) 75 74 76 75 all: zImage 77 76 78 77 zImage Image: vmlinux 79 78 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ 80 79 81 - archprepare: $(SRC_ARCH)/.links FORCE 82 - 83 - # Create some links to make all tools happy 84 - $(SRC_ARCH)/.links: 85 - @rm -rf $(SRC_ARCH)/drivers 86 - @ln -sfn $(SARCH)/drivers $(SRC_ARCH)/drivers 87 - @rm -rf $(SRC_ARCH)/boot 88 - @ln -sfn $(SARCH)/boot $(SRC_ARCH)/boot 89 - @rm -rf $(SRC_ARCH)/lib 90 - @ln -sfn $(SARCH)/lib $(SRC_ARCH)/lib 91 - @rm -f $(SRC_ARCH)/arch/mach 92 - @rm -rf $(SRC_ARCH)/arch 93 - @ln -sfn $(SARCH) $(SRC_ARCH)/arch 94 - ifdef CONFIG_ETRAX_ARCH_V32 95 - @ln -sfn ../$(SARCH)/$(MACH) $(SRC_ARCH)/arch/mach 96 - endif 97 - @rm -rf $(SRC_ARCH)/kernel/vmlinux.lds.S 98 - @ln -sfn ../$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S 99 - @touch $@ 80 + archprepare: 100 81 101 82 archclean: 102 - $(Q)if [ -e arch/$(ARCH)/boot ]; then \ 103 - $(MAKE) $(clean)=arch/$(ARCH)/boot; \ 83 + $(Q)if [ -e arch/cris/$(SARCH)/boot ]; then \ 84 + $(MAKE) $(clean)=arch/cris/$(SARCH)/boot; \ 104 85 fi 105 86 106 87 CLEAN_FILES += \ 107 88 $(MACHINE)/boot/zImage \ 108 89 $(MACHINE)/boot/compressed/decompress.bin \ 109 90 $(MACHINE)/boot/compressed/piggy.gz \ 110 - $(MACHINE)/boot/rescue/rescue.bin \ 111 - $(SRC_ARCH)/.links 91 + $(MACHINE)/boot/rescue/rescue.bin 112 92 113 - MRPROPER_FILES += \ 114 - $(SRC_ARCH)/drivers \ 115 - $(SRC_ARCH)/boot \ 116 - $(SRC_ARCH)/lib \ 117 - $(SRC_ARCH)/arch \ 118 - $(SRC_ARCH)/kernel/vmlinux.lds.S 119 93 94 + # MRPROPER_FILES += 120 95 121 96 define archhelp 122 - echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' 123 - echo '* Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' 97 + echo '* zImage - Compressed kernel image (arch/cris/boot/zImage)' 98 + echo '* Image - Uncompressed kernel image (arch/cris/boot/Image)' 124 99 endef
-118
arch/cris/arch-v10/vmlinux.lds.S
··· 1 - /* ld script to make the Linux/CRIS kernel 2 - * Authors: Bjorn Wesen (bjornw@axis.com) 3 - * 4 - * It is VERY DANGEROUS to fiddle around with the symbols in this 5 - * script. It is for example quite vital that all generated sections 6 - * that are used are actually named here, otherwise the linker will 7 - * put them at the end, where the init stuff is which is FREED after 8 - * the kernel has booted. 9 - */ 10 - 11 - #include <asm-generic/vmlinux.lds.h> 12 - #include <asm/page.h> 13 - 14 - jiffies = jiffies_64; 15 - SECTIONS 16 - { 17 - . = DRAM_VIRTUAL_BASE; 18 - dram_start = .; 19 - ibr_start = .; 20 - . = . + 0x4000; /* see head.S and pages reserved at the start */ 21 - 22 - _text = .; /* Text and read-only data */ 23 - text_start = .; /* lots of aliases */ 24 - _stext = .; 25 - __stext = .; 26 - .text : { 27 - TEXT_TEXT 28 - SCHED_TEXT 29 - LOCK_TEXT 30 - *(.fixup) 31 - *(.text.__*) 32 - } 33 - 34 - _etext = . ; /* End of text section */ 35 - __etext = .; 36 - 37 - . = ALIGN(4); /* Exception table */ 38 - __start___ex_table = .; 39 - __ex_table : { *(__ex_table) } 40 - __stop___ex_table = .; 41 - 42 - RODATA 43 - 44 - . = ALIGN (4); 45 - ___data_start = . ; 46 - __Sdata = . ; 47 - .data : { /* Data */ 48 - DATA_DATA 49 - } 50 - __edata = . ; /* End of data section */ 51 - _edata = . ; 52 - 53 - . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned */ 54 - .data.init_task : { *(.data.init_task) } 55 - 56 - . = ALIGN(PAGE_SIZE); /* Init code and data */ 57 - __init_begin = .; 58 - .init.text : { 59 - _sinittext = .; 60 - INIT_TEXT 61 - _einittext = .; 62 - } 63 - .init.data : { INIT_DATA } 64 - . = ALIGN(16); 65 - __setup_start = .; 66 - .init.setup : { *(.init.setup) } 67 - __setup_end = .; 68 - .initcall.init : { 69 - __initcall_start = .; 70 - INITCALLS 71 - __initcall_end = .; 72 - } 73 - 74 - .con_initcall.init : { 75 - __con_initcall_start = .; 76 - *(.con_initcall.init) 77 - __con_initcall_end = .; 78 - } 79 - SECURITY_INIT 80 - 81 - #ifdef CONFIG_BLK_DEV_INITRD 82 - .init.ramfs : { 83 - __initramfs_start = .; 84 - *(.init.ramfs) 85 - __initramfs_end = .; 86 - } 87 - #endif 88 - __vmlinux_end = .; /* last address of the physical file */ 89 - 90 - /* 91 - * We fill to the next page, so we can discard all init 92 - * pages without needing to consider what payload might be 93 - * appended to the kernel image. 94 - */ 95 - . = ALIGN(PAGE_SIZE); 96 - 97 - __init_end = .; 98 - 99 - __data_end = . ; /* Move to _edata ? */ 100 - __bss_start = .; /* BSS */ 101 - .bss : { 102 - *(COMMON) 103 - *(.bss) 104 - } 105 - 106 - . = ALIGN (0x20); 107 - _end = .; 108 - __end = .; 109 - 110 - /* Sections to be discarded */ 111 - /DISCARD/ : { 112 - EXIT_TEXT 113 - EXIT_DATA 114 - *(.exitcall.exit) 115 - } 116 - 117 - dram_end = dram_start + CONFIG_ETRAX_DRAM_SIZE*1024*1024; 118 - }
+14 -2
arch/cris/arch-v32/boot/compressed/head.S
··· 28 28 beq dram_init_finished 29 29 nop 30 30 31 - #include "../../mach/dram_init.S" 31 + #if defined CONFIG_ETRAXFS 32 + #include "../../mach-fs/dram_init.S" 33 + #elif defined CONFIG_CRIS_MACH_ARTPEC3 34 + #include "../../mach-a3/dram_init.S" 35 + #else 36 + #error Only ETRAXFS and ARTPEC-3 supported! 37 + #endif 32 38 33 39 dram_init_finished: 34 40 ··· 136 130 _boot_source: 137 131 .dword 0 138 132 139 - #include "../../mach/hw_settings.S" 133 + #if defined CONFIG_ETRAXFS 134 + #include "../../mach-fs/hw_settings.S" 135 + #elif defined CONFIG_CRIS_MACH_ARTPEC3 136 + #include "../../mach-a3/hw_settings.S" 137 + #else 138 + #error Only ETRAXFS and ARTPEC-3 supported! 139 + #endif
+17 -3
arch/cris/arch-v32/kernel/head.S
··· 10 10 * The macros found in mmu_defs_asm.h uses the ## concatenation operator, so 11 11 * -traditional must not be used when assembling this file. 12 12 */ 13 - #include <hwregs/reg_rdwr.h> 13 + #include <linux/autoconf.h> 14 14 #include <arch/memmap.h> 15 + #include <hwregs/reg_rdwr.h> 15 16 #include <hwregs/intr_vect.h> 16 17 #include <hwregs/asm/mmu_defs_asm.h> 17 18 #include <hwregs/asm/reg_map_asm.h> ··· 218 217 beq _dram_initialized 219 218 nop 220 219 221 - #include "../mach/dram_init.S" 220 + #if defined CONFIG_ETRAXFS 221 + #include "../mach-fs/dram_init.S" 222 + #elif defined CONFIG_CRIS_MACH_ARTPEC3 223 + #include "../mach-a3/dram_init.S" 224 + #else 225 + #error Only ETRAXFS and ARTPEC-3 supported! 226 + #endif 227 + 222 228 223 229 _dram_initialized: 224 230 ;; Copy the text and data section to DRAM. This depends on that the ··· 480 472 481 473 .section ".init.data", "aw" 482 474 483 - #include "../mach/hw_settings.S" 475 + #if defined CONFIG_ETRAXFS 476 + #include "../mach-fs/hw_settings.S" 477 + #elif defined CONFIG_CRIS_MACH_ARTPEC3 478 + #include "../mach-a3/hw_settings.S" 479 + #else 480 + #error Only ETRAXFS and ARTPEC-3 supported! 481 + #endif
+31 -13
arch/cris/arch-v32/vmlinux.lds.S arch/cris/kernel/vmlinux.lds.S
··· 8 8 * the kernel has booted. 9 9 */ 10 10 11 + #include <linux/autoconf.h> 11 12 #include <asm-generic/vmlinux.lds.h> 12 13 #include <asm/page.h> 13 14 ··· 18 17 #define __CONFIG_ETRAX_VMEM_SIZE 0 19 18 #endif 20 19 20 + 21 21 jiffies = jiffies_64; 22 22 SECTIONS 23 23 { 24 24 . = DRAM_VIRTUAL_BASE; 25 25 dram_start = .; 26 + #ifdef CONFIG_ETRAX_ARCH_V10 27 + ibr_start = .; 28 + #else 26 29 ebp_start = .; 27 - 28 30 /* The boot section is only necessary until the VCS top */ 29 31 /* level testbench includes both flash and DRAM. */ 30 32 .boot : { *(.boot) } 33 + #endif 31 34 32 - /* See head.S and pages reserved at the start. */ 35 + /* see head.S and pages reserved at the start */ 33 36 . = DRAM_VIRTUAL_BASE + 0x4000; 34 37 35 - _text = .; /* Text and read-only data. */ 36 - text_start = .; /* Lots of aliases. */ 38 + _text = .; /* Text and read-only data. */ 39 + text_start = .; /* Lots of aliases. */ 37 40 _stext = .; 38 41 __stext = .; 39 42 .text : { ··· 48 43 *(.text.__*) 49 44 } 50 45 51 - _etext = . ; /* End of text section. */ 46 + _etext = . ; /* End of text section. */ 52 47 __etext = .; 53 48 54 - . = ALIGN(4); /* Exception table. */ 49 + . = ALIGN(4); /* Exception table. */ 55 50 __start___ex_table = .; 56 51 __ex_table : { *(__ex_table) } 57 52 __stop___ex_table = .; ··· 61 56 . = ALIGN (4); 62 57 ___data_start = . ; 63 58 __Sdata = . ; 64 - .data : { /* Data */ 59 + .data : { /* Data */ 65 60 DATA_DATA 66 61 } 67 - __edata = . ; /* End of data section. */ 62 + __edata = . ; /* End of data section. */ 68 63 _edata = . ; 69 64 70 65 . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned. */ 71 66 .data.init_task : { *(.data.init_task) } 72 67 73 - . = ALIGN(PAGE_SIZE); /* Init code and data. */ 68 + . = ALIGN(PAGE_SIZE); /* Init code and data. */ 74 69 __init_begin = .; 75 70 .init.text : { 76 71 _sinittext = .; ··· 82 77 __setup_start = .; 83 78 .init.setup : { *(.init.setup) } 84 79 __setup_end = .; 80 + #ifdef CONFIG_ETRAX_ARCH_V32 85 81 __start___param = .; 86 82 __param : { *(__param) } 87 83 __stop___param = .; 84 + #endif 88 85 .initcall.init : { 89 86 __initcall_start = .; 90 87 INITCALLS ··· 100 93 } 101 94 SECURITY_INIT 102 95 103 - __vmlinux_end = .; /* Last address of the physical file. */ 96 + #ifdef CONFIG_ETRAX_ARCH_V10 97 + #ifdef CONFIG_BLK_DEV_INITRD 98 + .init.ramfs : { 99 + __initramfs_start = .; 100 + *(.init.ramfs) 101 + __initramfs_end = .; 102 + } 103 + #endif 104 + #endif 105 + __vmlinux_end = .; /* Last address of the physical file. */ 106 + #ifdef CONFIG_ETRAX_ARCH_V32 104 107 PERCPU(PAGE_SIZE) 105 108 106 109 .init.ramfs : { ··· 118 101 *(.init.ramfs) 119 102 __initramfs_end = .; 120 103 } 104 + #endif 121 105 122 106 /* 123 107 * We fill to the next page, so we can discard all init 124 108 * pages without needing to consider what payload might be 125 109 * appended to the kernel image. 126 110 */ 127 - . = ALIGN (PAGE_SIZE); 111 + . = ALIGN(PAGE_SIZE); 128 112 129 113 __init_end = .; 130 114 131 - __data_end = . ; /* Move to _edata? */ 132 - __bss_start = .; /* BSS. */ 115 + __data_end = . ; /* Move to _edata ? */ 116 + __bss_start = .; /* BSS. */ 133 117 .bss : { 134 118 *(COMMON) 135 119 *(.bss)