From 25f8151bdcdd62c6b879e3669a562c0d329eee4a Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Mon, 14 May 2007 19:12:37 +0900 Subject: sh: Get multiple boards in one image working again. This tidies up the build rules and permits multiple boards to be linked in to the same kernel. The earlier Kconfig work ensures that the CPU configuration is consistent across the boards, as this is the only thing that we can't do dynamically. Signed-off-by: Paul Mundt --- arch/sh/Makefile | 88 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 38 deletions(-) (limited to 'arch/sh/Makefile') diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 883b03b040c..c7323e7dce6 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -87,39 +87,39 @@ core-y += arch/sh/kernel/ arch/sh/mm/ core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ # Boards -machdir-$(CONFIG_SH_SOLUTION_ENGINE) := se/770x -machdir-$(CONFIG_SH_7722_SOLUTION_ENGINE) := se/7722 -machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) := se/7751 -machdir-$(CONFIG_SH_7780_SOLUTION_ENGINE) := se/7780 -machdir-$(CONFIG_SH_7300_SOLUTION_ENGINE) := se/7300 -machdir-$(CONFIG_SH_7343_SOLUTION_ENGINE) := se/7343 -machdir-$(CONFIG_SH_73180_SOLUTION_ENGINE) := se/73180 -machdir-$(CONFIG_SH_HP6XX) := hp6xx -machdir-$(CONFIG_SH_SATURN) := saturn -machdir-$(CONFIG_SH_DREAMCAST) := dreamcast -machdir-$(CONFIG_SH_MPC1211) := mpc1211 -machdir-$(CONFIG_SH_SH03) := sh03 -machdir-$(CONFIG_SH_SECUREEDGE5410) := snapgear -machdir-$(CONFIG_SH_HS7751RVOIP) := renesas/hs7751rvoip -machdir-$(CONFIG_SH_RTS7751R2D) := renesas/rts7751r2d -machdir-$(CONFIG_SH_7751_SYSTEMH) := renesas/systemh -machdir-$(CONFIG_SH_EDOSK7705) := renesas/edosk7705 -machdir-$(CONFIG_SH_HIGHLANDER) := renesas/r7780rp -machdir-$(CONFIG_SH_7710VOIPGW) := renesas/sh7710voipgw -machdir-$(CONFIG_SH_SH4202_MICRODEV) := superh/microdev -machdir-$(CONFIG_SH_LANDISK) := landisk -machdir-$(CONFIG_SH_TITAN) := titan -machdir-$(CONFIG_SH_SHMIN) := shmin -machdir-$(CONFIG_SH_7206_SOLUTION_ENGINE) := se/7206 -machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE) := se/7619 -machdir-$(CONFIG_SH_LBOX_RE2) := lboxre2 -machdir-$(CONFIG_SH_UNKNOWN) := unknown - -incdir-y := $(notdir $(machdir-y)) -incdir-$(CONFIG_SH_HP6XX) := hp6xx +machdir-$(CONFIG_SH_SOLUTION_ENGINE) += se/770x +machdir-$(CONFIG_SH_7722_SOLUTION_ENGINE) += se/7722 +machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) += se/7751 +machdir-$(CONFIG_SH_7780_SOLUTION_ENGINE) += se/7780 +machdir-$(CONFIG_SH_7300_SOLUTION_ENGINE) += se/7300 +machdir-$(CONFIG_SH_7343_SOLUTION_ENGINE) += se/7343 +machdir-$(CONFIG_SH_73180_SOLUTION_ENGINE) += se/73180 +machdir-$(CONFIG_SH_HP6XX) += hp6xx +machdir-$(CONFIG_SH_SATURN) += saturn +machdir-$(CONFIG_SH_DREAMCAST) += dreamcast +machdir-$(CONFIG_SH_MPC1211) += mpc1211 +machdir-$(CONFIG_SH_SH03) += sh03 +machdir-$(CONFIG_SH_SECUREEDGE5410) += snapgear +machdir-$(CONFIG_SH_HS7751RVOIP) += renesas/hs7751rvoip +machdir-$(CONFIG_SH_RTS7751R2D) += renesas/rts7751r2d +machdir-$(CONFIG_SH_7751_SYSTEMH) += renesas/systemh +machdir-$(CONFIG_SH_EDOSK7705) += renesas/edosk7705 +machdir-$(CONFIG_SH_HIGHLANDER) += renesas/r7780rp +machdir-$(CONFIG_SH_7710VOIPGW) += renesas/sh7710voipgw +machdir-$(CONFIG_SH_SH4202_MICRODEV) += superh/microdev +machdir-$(CONFIG_SH_LANDISK) += landisk +machdir-$(CONFIG_SH_TITAN) += titan +machdir-$(CONFIG_SH_SHMIN) += shmin +machdir-$(CONFIG_SH_7206_SOLUTION_ENGINE) += se/7206 +machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE) += se/7619 +machdir-$(CONFIG_SH_LBOX_RE2) += lboxre2 +machdir-$(CONFIG_SH_UNKNOWN) += unknown + +incdir-y := $(notdir $(machdir-y)) ifneq ($(machdir-y),) -core-y += arch/sh/boards/$(machdir-y)/ +core-y += $(addprefix arch/sh/boards/, \ + $(filter-out ., $(patsubst %,%/,$(machdir-y)))) endif # Companion chips @@ -157,19 +157,31 @@ include/asm-sh/.cpu: $(wildcard include/config/cpu/*.h) \ # Most boards have their own mach directories. For the ones that # don't, just reference the parent directory so the semantics are # kept roughly the same. +# +# When multiple boards are compiled in at the same time, preference +# for the mach link is given to whichever has a directory for its +# headers. However, this is only a workaround until platforms that +# can live in the same kernel image back away from relying on the +# mach link. include/asm-sh/.mach: $(wildcard include/config/sh/*.h) \ include/config/auto.conf FORCE - @echo -n ' SYMLINK include/asm-sh/mach -> ' $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi - $(Q)if [ -d $(incdir-prefix)$(incdir-y) ]; then \ - echo -e 'include/asm-sh/$(incdir-y)'; \ - ln -fsn $(incdir-prefix)$(incdir-y) \ + $(Q)rm -f include/asm-sh/mach + $(Q)for i in $(incdir-y); do \ + if [ -d $(incdir-prefix)$$i ]; then \ + echo -n ' SYMLINK include/asm-sh/mach -> '; \ + echo -e "include/asm-sh/$$i"; \ + ln -fsn $(incdir-prefix)$$i \ include/asm-sh/mach; \ else \ - echo -e 'include/asm-sh'; \ - ln -fsn $(incdir-prefix) include/asm-sh/mach; \ - fi + if [ ! -d include/asm-sh/mach ]; then \ + echo -n ' SYMLINK include/asm-sh/mach -> '; \ + echo -e 'include/asm-sh'; \ + ln -fsn $(incdir-prefix) include/asm-sh/mach; \ + fi; \ + fi; \ + done @touch $@ archprepare: include/asm-sh/.cpu include/asm-sh/.mach maketools -- cgit v1.2.3 From fd8f20e8e2f8f1d9201086bff444c8d35f0a6a45 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Tue, 15 May 2007 15:38:30 +0900 Subject: sh: Rip out special unknown machvec. This kills off the BareCPU board as a "special" machvec, rather, we leave this as a default for when no other vector is available, or when we want to use it in combination with other vectors for testing with generic ops. As sh_mv is copied out anyways (or overloaded when an alternate vector is explicitly selected), this doesn't consume any additional memory. The generic machvec can be forcibly selected with sh_mv=generic, or by not having any other boards enabled. Signed-off-by: Paul Mundt --- arch/sh/Makefile | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/sh/Makefile') diff --git a/arch/sh/Makefile b/arch/sh/Makefile index c7323e7dce6..ec2d82eda90 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -113,7 +113,6 @@ machdir-$(CONFIG_SH_SHMIN) += shmin machdir-$(CONFIG_SH_7206_SOLUTION_ENGINE) += se/7206 machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE) += se/7619 machdir-$(CONFIG_SH_LBOX_RE2) += lboxre2 -machdir-$(CONFIG_SH_UNKNOWN) += unknown incdir-y := $(notdir $(machdir-y)) -- cgit v1.2.3 From 6240d92f2f2fb74094b66b3510733fa0a1e2631a Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Fri, 1 Jun 2007 17:25:42 +0900 Subject: sh: Wrap CPU tuning through cc-option. Some compilers don't support the explicit CPU tuning, while binutils is still able to handle the special subtype-specific opcodes. Make the CFLAG optional, falling back on the compiler default if nothing better exists. Signed-off-by: Paul Mundt --- arch/sh/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'arch/sh/Makefile') diff --git a/arch/sh/Makefile b/arch/sh/Makefile index ec2d82eda90..aa76167ceb4 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -34,12 +34,14 @@ isa-y := $(isa-y)-nofpu endif endif -cflags-$(CONFIG_CPU_SH2) := -m2 -cflags-$(CONFIG_CPU_SH2A) := -m2a $(call cc-option,-m2a-nofpu,) -cflags-$(CONFIG_CPU_SH3) := -m3 -cflags-$(CONFIG_CPU_SH4) := -m4 \ +cflags-$(CONFIG_CPU_SH2) := $(call cc-option,-m2,) +cflags-$(CONFIG_CPU_SH2A) := $(call cc-option,-m2a,) \ + $(call cc-option,-m2a-nofpu,) +cflags-$(CONFIG_CPU_SH3) := $(call cc-option,-m3,) +cflags-$(CONFIG_CPU_SH4) := $(call cc-option,-m4,) \ $(call cc-option,-mno-implicit-fp,-m4-nofpu) -cflags-$(CONFIG_CPU_SH4A) := $(call cc-option,-m4a,) $(call cc-option,-m4a-nofpu,) +cflags-$(CONFIG_CPU_SH4A) := $(call cc-option,-m4a,) \ + $(call cc-option,-m4a-nofpu,) cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml -- cgit v1.2.3 From b9601c5e59dd25693345558a301e833741bf5874 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Fri, 8 Jun 2007 11:55:28 +0900 Subject: sh: Kill off dead SH7604 support. This was added during 2.5.x, but was never moved along. This can easily be resurrected if someone has one they wish to work with, but it's not worth keeping around in its current form. Signed-off-by: Paul Mundt --- arch/sh/Makefile | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/sh/Makefile') diff --git a/arch/sh/Makefile b/arch/sh/Makefile index aa76167ceb4..6e1e17467a4 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -97,7 +97,6 @@ machdir-$(CONFIG_SH_7300_SOLUTION_ENGINE) += se/7300 machdir-$(CONFIG_SH_7343_SOLUTION_ENGINE) += se/7343 machdir-$(CONFIG_SH_73180_SOLUTION_ENGINE) += se/73180 machdir-$(CONFIG_SH_HP6XX) += hp6xx -machdir-$(CONFIG_SH_SATURN) += saturn machdir-$(CONFIG_SH_DREAMCAST) += dreamcast machdir-$(CONFIG_SH_MPC1211) += mpc1211 machdir-$(CONFIG_SH_SH03) += sh03 -- cgit v1.2.3 From 880dec100761f4fbc5fa5d22e658a8718828f04e Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Fri, 6 Jul 2007 10:22:59 +0900 Subject: sh: Add cpu and mach links to CLEAN_FILES. These weren't being cleaned up, so add them to the CLEAN_FILES. Signed-off-by: Paul Mundt --- arch/sh/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'arch/sh/Makefile') diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 6e1e17467a4..211d9e01807 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -200,7 +200,9 @@ compressed: zImage archclean: $(Q)$(MAKE) $(clean)=$(boot) -CLEAN_FILES += include/asm-sh/machtypes.h +CLEAN_FILES += include/asm-sh/machtypes.h \ + include/asm-sh/cpu include/asm-sh/.cpu \ + include/asm-sh/mach include/asm-sh/.mach define archhelp @echo '* zImage - Compressed kernel image' -- cgit v1.2.3 From 5296307de63f1949d601b3515f8b1a0a859c5847 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Sat, 7 Jul 2007 07:25:56 +0900 Subject: sh: Drop -Wa,-dsp for DSP tuning. We already hand off the proper ISA variant with the dsp specifier appended, so we don't need to explicitly set -dsp. This causes some confusion with certain toolchains that are restricted to -dsp family opcodes artificially. Signed-off-by: Paul Mundt --- arch/sh/Makefile | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch/sh/Makefile') diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 211d9e01807..c7a8e1f0c6b 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -48,8 +48,6 @@ cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml cflags-y += $(call as-option,-Wa$(comma)-isa=$(isa-y),) -ffreestanding -cflags-$(CONFIG_SH_DSP) += -Wa,-dsp - cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g') -- cgit v1.2.3 From aab1b16a61d653173b1c5f158c51ec08dd6605b0 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Thu, 12 Jul 2007 09:48:54 +0900 Subject: sh: Don't let SH-4A clobber SH-4 CFLAGS. Older compilers don't support the -m4a{,nofpu} flags, which has the side-effect of allowing FP operations to be emitted. Switch this to incremental tuning, so we at least have -m4-nofpu as a fallback for the gcc3 toolchains. Without this, certain modules emit references to __udivsi3_i4 and __sdivsi3_i4. Reported-by: Andrew Morton Signed-off-by: Paul Mundt --- arch/sh/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/sh/Makefile') diff --git a/arch/sh/Makefile b/arch/sh/Makefile index c7a8e1f0c6b..77fecc62a05 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -35,12 +35,12 @@ endif endif cflags-$(CONFIG_CPU_SH2) := $(call cc-option,-m2,) -cflags-$(CONFIG_CPU_SH2A) := $(call cc-option,-m2a,) \ +cflags-$(CONFIG_CPU_SH2A) += $(call cc-option,-m2a,) \ $(call cc-option,-m2a-nofpu,) cflags-$(CONFIG_CPU_SH3) := $(call cc-option,-m3,) cflags-$(CONFIG_CPU_SH4) := $(call cc-option,-m4,) \ $(call cc-option,-mno-implicit-fp,-m4-nofpu) -cflags-$(CONFIG_CPU_SH4A) := $(call cc-option,-m4a,) \ +cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \ $(call cc-option,-m4a-nofpu,) cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb -- cgit v1.2.3