Skip to content

Commit c5ec6fb

Browse files
committed
[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>
1 parent 0365f70 commit c5ec6fb

5 files changed

Lines changed: 81 additions & 178 deletions

File tree

‎arch/cris/Makefile‎

Lines changed: 19 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ mach-$(CONFIG_ETRAXFS) := fs
2323

2424
ifneq ($(arch-y),)
2525
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
2728
else
2829
SARCH :=
2930
inc :=
@@ -52,72 +53,48 @@ KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
5253
KBUILD_CFLAGS += -fno-omit-frame-pointer
5354
endif
5455

55-
head-y := arch/$(ARCH)/$(SARCH)/kernel/head.o
56+
head-y := arch/cris/$(SARCH)/kernel/head.o
5657

5758
LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a)
5859

59-
core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
60-
core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/
60+
core-y += arch/cris/kernel/ arch/cris/mm/
61+
core-y += arch/cris/$(SARCH)/kernel/ arch/cris/$(SARCH)/mm/
6162
ifdef CONFIG_ETRAX_ARCH_V32
62-
core-y += arch/$(ARCH)/$(SARCH)/$(MACH)/
63+
core-y += arch/cris/$(SARCH)/$(MACH)/
6364
endif
64-
drivers-y += arch/$(ARCH)/$(SARCH)/drivers/
65-
libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC)
65+
drivers-y += arch/cris/$(SARCH)/drivers/
66+
libs-y += arch/cris/$(SARCH)/lib/ $(LIBGCC)
6667

6768
# cris source path
68-
SRC_ARCH = $(srctree)/arch/$(ARCH)
69+
SRC_ARCH = $(srctree)/arch/cris
6970
# cris object files path
70-
OBJ_ARCH = $(objtree)/arch/$(ARCH)
71+
OBJ_ARCH = $(objtree)/arch/cris
7172

72-
boot := arch/$(ARCH)/boot
73-
MACHINE := arch/$(ARCH)/$(SARCH)
73+
boot := arch/cris/$(SARCH)/boot
74+
MACHINE := arch/cris/$(SARCH)
7475

7576
all: zImage
7677

7778
zImage Image: vmlinux
7879
$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
7980

80-
archprepare: $(SRC_ARCH)/.links FORCE
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
93-
ifdef CONFIG_ETRAX_ARCH_V32
94-
@ln -sfn ../$(SARCH)/$(MACH) $(SRC_ARCH)/arch/mach
95-
endif
96-
@rm -rf $(SRC_ARCH)/kernel/vmlinux.lds.S
97-
@ln -sfn ../$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S
98-
@touch $@
81+
archprepare:
9982

10083
archclean:
101-
$(Q)if [ -e arch/$(ARCH)/boot ]; then \
102-
$(MAKE) $(clean)=arch/$(ARCH)/boot; \
84+
$(Q)if [ -e arch/cris/$(SARCH)/boot ]; then \
85+
$(MAKE) $(clean)=arch/cris/$(SARCH)/boot; \
10386
fi
10487

10588
CLEAN_FILES += \
10689
$(MACHINE)/boot/zImage \
10790
$(MACHINE)/boot/compressed/decompress.bin \
10891
$(MACHINE)/boot/compressed/piggy.gz \
109-
$(MACHINE)/boot/rescue/rescue.bin \
110-
$(SRC_ARCH)/.links
92+
$(MACHINE)/boot/rescue/rescue.bin
11193

112-
MRPROPER_FILES += \
113-
$(SRC_ARCH)/drivers \
114-
$(SRC_ARCH)/boot \
115-
$(SRC_ARCH)/lib \
116-
$(SRC_ARCH)/arch \
117-
$(SRC_ARCH)/kernel/vmlinux.lds.S
11894

95+
# MRPROPER_FILES +=
11996

12097
define archhelp
121-
echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
122-
echo '* Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
98+
echo '* zImage - Compressed kernel image (arch/cris/boot/zImage)'
99+
echo '* Image - Uncompressed kernel image (arch/cris/boot/Image)'
123100
endef

‎arch/cris/arch-v10/vmlinux.lds.S‎

Lines changed: 0 additions & 118 deletions
This file was deleted.

‎arch/cris/arch-v32/boot/compressed/head.S‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ _start:
2828
beq dram_init_finished
2929
nop
3030

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
3238

3339
dram_init_finished:
3440

@@ -130,4 +136,10 @@ _cmd_line_addr:
130136
_boot_source:
131137
.dword 0
132138

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

‎arch/cris/arch-v32/kernel/head.S‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
* The macros found in mmu_defs_asm.h uses the ## concatenation operator, so
1111
* -traditional must not be used when assembling this file.
1212
*/
13-
#include <hwregs/reg_rdwr.h>
13+
#include <linux/autoconf.h>
1414
#include <arch/memmap.h>
15+
#include <hwregs/reg_rdwr.h>
1516
#include <hwregs/intr_vect.h>
1617
#include <hwregs/asm/mmu_defs_asm.h>
1718
#include <hwregs/asm/reg_map_asm.h>
@@ -217,7 +218,14 @@ _inflash:
217218
beq _dram_initialized
218219
nop
219220

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+
221229

222230
_dram_initialized:
223231
;; Copy the text and data section to DRAM. This depends on that the
@@ -472,4 +480,10 @@ swapper_pg_dir = 0xc0002000
472480

473481
.section ".init.data", "aw"
474482

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

0 commit comments

Comments
 (0)