aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJesper Nilsson <jesper.nilsson@axis.com>2008-10-22 17:57:53 -0400
committerJesper Nilsson <jesper.nilsson@axis.com>2008-10-31 18:37:57 -0400
commitc5ec6fb08d7806cf1a9e4fceed15f5d4a69f885e (patch)
treee3a1dca7bb4ea58907c067f592ce45391222ffc4 /arch
parent0365f707c99bf940a51c2a3ffc19f3ade2f700d4 (diff)
[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>
Diffstat (limited to 'arch')
-rw-r--r--arch/cris/Makefile61
-rw-r--r--arch/cris/arch-v10/vmlinux.lds.S118
-rw-r--r--arch/cris/arch-v32/boot/compressed/head.S16
-rw-r--r--arch/cris/arch-v32/kernel/head.S20
-rw-r--r--arch/cris/kernel/vmlinux.lds.S (renamed from arch/cris/arch-v32/vmlinux.lds.S)44
5 files changed, 81 insertions, 178 deletions
diff --git a/arch/cris/Makefile b/arch/cris/Makefile
index 241e35bc3b59..3662cfb7b61d 100644
--- a/arch/cris/Makefile
+++ b/arch/cris/Makefile
@@ -23,7 +23,8 @@ mach-$(CONFIG_ETRAXFS) := fs
23 23
24ifneq ($(arch-y),) 24ifneq ($(arch-y),)
25SARCH := arch-$(arch-y) 25SARCH := arch-$(arch-y)
26inc := -Iarch/cris/include/arch-$(arch-y) -Iarch/cris/include/arch-$(arch-y)/arch 26inc := -Iarch/cris/include/$(SARCH)
27inc += -Iarch/cris/include/$(SARCH)/arch
27else 28else
28SARCH := 29SARCH :=
29inc := 30inc :=
@@ -52,72 +53,48 @@ KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
52KBUILD_CFLAGS += -fno-omit-frame-pointer 53KBUILD_CFLAGS += -fno-omit-frame-pointer
53endif 54endif
54 55
55head-y := arch/$(ARCH)/$(SARCH)/kernel/head.o 56head-y := arch/cris/$(SARCH)/kernel/head.o
56 57
57LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a) 58LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a)
58 59
59core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ 60core-y += arch/cris/kernel/ arch/cris/mm/
60core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/ 61core-y += arch/cris/$(SARCH)/kernel/ arch/cris/$(SARCH)/mm/
61ifdef CONFIG_ETRAX_ARCH_V32 62ifdef CONFIG_ETRAX_ARCH_V32
62core-y += arch/$(ARCH)/$(SARCH)/$(MACH)/ 63core-y += arch/cris/$(SARCH)/$(MACH)/
63endif 64endif
64drivers-y += arch/$(ARCH)/$(SARCH)/drivers/ 65drivers-y += arch/cris/$(SARCH)/drivers/
65libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC) 66libs-y += arch/cris/$(SARCH)/lib/ $(LIBGCC)
66 67
67# cris source path 68# cris source path
68SRC_ARCH = $(srctree)/arch/$(ARCH) 69SRC_ARCH = $(srctree)/arch/cris
69# cris object files path 70# cris object files path
70OBJ_ARCH = $(objtree)/arch/$(ARCH) 71OBJ_ARCH = $(objtree)/arch/cris
71 72
72boot := arch/$(ARCH)/boot 73boot := arch/cris/$(SARCH)/boot
73MACHINE := arch/$(ARCH)/$(SARCH) 74MACHINE := arch/cris/$(SARCH)
74 75
75all: zImage 76all: zImage
76 77
77zImage Image: vmlinux 78zImage Image: vmlinux
78 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ 79 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
79 80
80archprepare: $(SRC_ARCH)/.links FORCE 81archprepare:
81
82# Create some links to make all tools happy
83$(SRC_ARCH)/.links:
84 @rm -rf $(SRC_ARCH)/drivers
85 @ln -sfn $(SARCH)/drivers $(SRC_ARCH)/drivers
86 @rm -rf $(SRC_ARCH)/boot
87 @ln -sfn $(SARCH)/boot $(SRC_ARCH)/boot
88 @rm -rf $(SRC_ARCH)/lib
89 @ln -sfn $(SARCH)/lib $(SRC_ARCH)/lib
90 @rm -f $(SRC_ARCH)/arch/mach
91 @rm -rf $(SRC_ARCH)/arch
92 @ln -sfn $(SARCH) $(SRC_ARCH)/arch
93ifdef CONFIG_ETRAX_ARCH_V32
94 @ln -sfn ../$(SARCH)/$(MACH) $(SRC_ARCH)/arch/mach
95endif
96 @rm -rf $(SRC_ARCH)/kernel/vmlinux.lds.S
97 @ln -sfn ../$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S
98 @touch $@
99 82
100archclean: 83archclean:
101 $(Q)if [ -e arch/$(ARCH)/boot ]; then \ 84 $(Q)if [ -e arch/cris/$(SARCH)/boot ]; then \
102 $(MAKE) $(clean)=arch/$(ARCH)/boot; \ 85 $(MAKE) $(clean)=arch/cris/$(SARCH)/boot; \
103 fi 86 fi
104 87
105CLEAN_FILES += \ 88CLEAN_FILES += \
106 $(MACHINE)/boot/zImage \ 89 $(MACHINE)/boot/zImage \
107 $(MACHINE)/boot/compressed/decompress.bin \ 90 $(MACHINE)/boot/compressed/decompress.bin \
108 $(MACHINE)/boot/compressed/piggy.gz \ 91 $(MACHINE)/boot/compressed/piggy.gz \
109 $(MACHINE)/boot/rescue/rescue.bin \ 92 $(MACHINE)/boot/rescue/rescue.bin
110 $(SRC_ARCH)/.links
111 93
112MRPROPER_FILES += \
113 $(SRC_ARCH)/drivers \
114 $(SRC_ARCH)/boot \
115 $(SRC_ARCH)/lib \
116 $(SRC_ARCH)/arch \
117 $(SRC_ARCH)/kernel/vmlinux.lds.S
118 94
95# MRPROPER_FILES +=
119 96
120define archhelp 97define archhelp
121 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' 98 echo '* zImage - Compressed kernel image (arch/cris/boot/zImage)'
122 echo '* Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' 99 echo '* Image - Uncompressed kernel image (arch/cris/boot/Image)'
123endef 100endef
diff --git a/arch/cris/arch-v10/vmlinux.lds.S b/arch/cris/arch-v10/vmlinux.lds.S
deleted file mode 100644
index 93c9f0ea286b..000000000000
--- a/arch/cris/arch-v10/vmlinux.lds.S
+++ /dev/null
@@ -1,118 +0,0 @@
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
14jiffies = jiffies_64;
15SECTIONS
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}
diff --git a/arch/cris/arch-v32/boot/compressed/head.S b/arch/cris/arch-v32/boot/compressed/head.S
index ea3012993b07..a4a65c5c669e 100644
--- a/arch/cris/arch-v32/boot/compressed/head.S
+++ b/arch/cris/arch-v32/boot/compressed/head.S
@@ -28,7 +28,13 @@ _start:
28 beq dram_init_finished 28 beq dram_init_finished
29 nop 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
33dram_init_finished: 39dram_init_finished:
34 40
@@ -130,4 +136,10 @@ _cmd_line_addr:
130_boot_source: 136_boot_source:
131 .dword 0 137 .dword 0
132 138
133#include "../../mach/hw_settings.S" 139#if defined CONFIG_ETRAXFS
140#include "../../mach-fs/hw_settings.S"
141#elif defined CONFIG_CRIS_MACH_ARTPEC3
142#include "../../mach-a3/hw_settings.S"
143#else
144#error Only ETRAXFS and ARTPEC-3 supported!
145#endif
diff --git a/arch/cris/arch-v32/kernel/head.S b/arch/cris/arch-v32/kernel/head.S
index f902d87fb5de..3db478eb5155 100644
--- a/arch/cris/arch-v32/kernel/head.S
+++ b/arch/cris/arch-v32/kernel/head.S
@@ -10,8 +10,9 @@
10 * The macros found in mmu_defs_asm.h uses the ## concatenation operator, so 10 * The macros found in mmu_defs_asm.h uses the ## concatenation operator, so
11 * -traditional must not be used when assembling this file. 11 * -traditional must not be used when assembling this file.
12 */ 12 */
13#include <hwregs/reg_rdwr.h> 13#include <linux/autoconf.h>
14#include <arch/memmap.h> 14#include <arch/memmap.h>
15#include <hwregs/reg_rdwr.h>
15#include <hwregs/intr_vect.h> 16#include <hwregs/intr_vect.h>
16#include <hwregs/asm/mmu_defs_asm.h> 17#include <hwregs/asm/mmu_defs_asm.h>
17#include <hwregs/asm/reg_map_asm.h> 18#include <hwregs/asm/reg_map_asm.h>
@@ -217,7 +218,14 @@ _inflash:
217 beq _dram_initialized 218 beq _dram_initialized
218 nop 219 nop
219 220
220#include "../mach/dram_init.S" 221#if defined CONFIG_ETRAXFS
222#include "../mach-fs/dram_init.S"
223#elif defined CONFIG_CRIS_MACH_ARTPEC3
224#include "../mach-a3/dram_init.S"
225#else
226#error Only ETRAXFS and ARTPEC-3 supported!
227#endif
228
221 229
222_dram_initialized: 230_dram_initialized:
223 ;; Copy the text and data section to DRAM. This depends on that the 231 ;; Copy the text and data section to DRAM. This depends on that the
@@ -472,4 +480,10 @@ swapper_pg_dir = 0xc0002000
472 480
473 .section ".init.data", "aw" 481 .section ".init.data", "aw"
474 482
475#include "../mach/hw_settings.S" 483#if defined CONFIG_ETRAXFS
484#include "../mach-fs/hw_settings.S"
485#elif defined CONFIG_CRIS_MACH_ARTPEC3
486#include "../mach-a3/hw_settings.S"
487#else
488#error Only ETRAXFS and ARTPEC-3 supported!
489#endif
diff --git a/arch/cris/arch-v32/vmlinux.lds.S b/arch/cris/kernel/vmlinux.lds.S
index d5f28e40717c..0d2adfc794d4 100644
--- a/arch/cris/arch-v32/vmlinux.lds.S
+++ b/arch/cris/kernel/vmlinux.lds.S
@@ -8,6 +8,7 @@
8 * the kernel has booted. 8 * the kernel has booted.
9 */ 9 */
10 10
11#include <linux/autoconf.h>
11#include <asm-generic/vmlinux.lds.h> 12#include <asm-generic/vmlinux.lds.h>
12#include <asm/page.h> 13#include <asm/page.h>
13 14
@@ -17,22 +18,26 @@
17#define __CONFIG_ETRAX_VMEM_SIZE 0 18#define __CONFIG_ETRAX_VMEM_SIZE 0
18#endif 19#endif
19 20
21
20jiffies = jiffies_64; 22jiffies = jiffies_64;
21SECTIONS 23SECTIONS
22{ 24{
23 . = DRAM_VIRTUAL_BASE; 25 . = DRAM_VIRTUAL_BASE;
24 dram_start = .; 26 dram_start = .;
27#ifdef CONFIG_ETRAX_ARCH_V10
28 ibr_start = .;
29#else
25 ebp_start = .; 30 ebp_start = .;
26
27 /* The boot section is only necessary until the VCS top */ 31 /* The boot section is only necessary until the VCS top */
28 /* level testbench includes both flash and DRAM. */ 32 /* level testbench includes both flash and DRAM. */
29 .boot : { *(.boot) } 33 .boot : { *(.boot) }
34#endif
30 35
31 /* See head.S and pages reserved at the start. */ 36 /* see head.S and pages reserved at the start */
32 . = DRAM_VIRTUAL_BASE + 0x4000; 37 . = DRAM_VIRTUAL_BASE + 0x4000;
33 38
34 _text = .; /* Text and read-only data. */ 39 _text = .; /* Text and read-only data. */
35 text_start = .; /* Lots of aliases. */ 40 text_start = .; /* Lots of aliases. */
36 _stext = .; 41 _stext = .;
37 __stext = .; 42 __stext = .;
38 .text : { 43 .text : {
@@ -43,10 +48,10 @@ SECTIONS
43 *(.text.__*) 48 *(.text.__*)
44 } 49 }
45 50
46 _etext = . ; /* End of text section. */ 51 _etext = . ; /* End of text section. */
47 __etext = .; 52 __etext = .;
48 53
49 . = ALIGN(4); /* Exception table. */ 54 . = ALIGN(4); /* Exception table. */
50 __start___ex_table = .; 55 __start___ex_table = .;
51 __ex_table : { *(__ex_table) } 56 __ex_table : { *(__ex_table) }
52 __stop___ex_table = .; 57 __stop___ex_table = .;
@@ -56,16 +61,16 @@ SECTIONS
56 . = ALIGN (4); 61 . = ALIGN (4);
57 ___data_start = . ; 62 ___data_start = . ;
58 __Sdata = . ; 63 __Sdata = . ;
59 .data : { /* Data */ 64 .data : { /* Data */
60 DATA_DATA 65 DATA_DATA
61 } 66 }
62 __edata = . ; /* End of data section. */ 67 __edata = . ; /* End of data section. */
63 _edata = . ; 68 _edata = . ;
64 69
65 . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned. */ 70 . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned. */
66 .data.init_task : { *(.data.init_task) } 71 .data.init_task : { *(.data.init_task) }
67 72
68 . = ALIGN(PAGE_SIZE); /* Init code and data. */ 73 . = ALIGN(PAGE_SIZE); /* Init code and data. */
69 __init_begin = .; 74 __init_begin = .;
70 .init.text : { 75 .init.text : {
71 _sinittext = .; 76 _sinittext = .;
@@ -77,9 +82,11 @@ SECTIONS
77 __setup_start = .; 82 __setup_start = .;
78 .init.setup : { *(.init.setup) } 83 .init.setup : { *(.init.setup) }
79 __setup_end = .; 84 __setup_end = .;
85#ifdef CONFIG_ETRAX_ARCH_V32
80 __start___param = .; 86 __start___param = .;
81 __param : { *(__param) } 87 __param : { *(__param) }
82 __stop___param = .; 88 __stop___param = .;
89#endif
83 .initcall.init : { 90 .initcall.init : {
84 __initcall_start = .; 91 __initcall_start = .;
85 INITCALLS 92 INITCALLS
@@ -93,7 +100,17 @@ SECTIONS
93 } 100 }
94 SECURITY_INIT 101 SECURITY_INIT
95 102
96 __vmlinux_end = .; /* Last address of the physical file. */ 103#ifdef CONFIG_ETRAX_ARCH_V10
104#ifdef CONFIG_BLK_DEV_INITRD
105 .init.ramfs : {
106 __initramfs_start = .;
107 *(.init.ramfs)
108 __initramfs_end = .;
109 }
110#endif
111#endif
112 __vmlinux_end = .; /* Last address of the physical file. */
113#ifdef CONFIG_ETRAX_ARCH_V32
97 PERCPU(PAGE_SIZE) 114 PERCPU(PAGE_SIZE)
98 115
99 .init.ramfs : { 116 .init.ramfs : {
@@ -101,18 +118,19 @@ SECTIONS
101 *(.init.ramfs) 118 *(.init.ramfs)
102 __initramfs_end = .; 119 __initramfs_end = .;
103 } 120 }
121#endif
104 122
105 /* 123 /*
106 * We fill to the next page, so we can discard all init 124 * We fill to the next page, so we can discard all init
107 * pages without needing to consider what payload might be 125 * pages without needing to consider what payload might be
108 * appended to the kernel image. 126 * appended to the kernel image.
109 */ 127 */
110 . = ALIGN (PAGE_SIZE); 128 . = ALIGN(PAGE_SIZE);
111 129
112 __init_end = .; 130 __init_end = .;
113 131
114 __data_end = . ; /* Move to _edata? */ 132 __data_end = . ; /* Move to _edata ? */
115 __bss_start = .; /* BSS. */ 133 __bss_start = .; /* BSS. */
116 .bss : { 134 .bss : {
117 *(COMMON) 135 *(COMMON)
118 *(.bss) 136 *(.bss)