Patchwork [v5,3/7] arch: toolchain: Introduce target CPU revision.

login
register
mail settings
Submitter Sonic Zhang
Date April 12, 2013, 10:18 a.m.
Message ID <1365761909-15305-3-git-send-email-sonic.adi@gmail.com>
Download mbox | patch
Permalink /patch/236019/
State Changes Requested
Headers show

Comments

Sonic Zhang - April 12, 2013, 10:18 a.m.
From: Sonic Zhang <sonic.zhang@analog.com>

Adds the possibility to have a free-form CPU revision string and append it
to the target CPU. Only Blackfin actually uses this option.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>

---

v3-changes:
- Detail the help text and fix the line length.
---
 arch/Config.in                           |    3 +++
 arch/Config.in.bfin                      |    8 ++++++++
 toolchain/toolchain-external/ext-tool.mk |    4 ++++
 3 files changed, 15 insertions(+), 0 deletions(-)
Thomas Petazzoni - April 16, 2013, 9:20 p.m.
Dear Sonic Zhang,

On Fri, 12 Apr 2013 18:18:25 +0800, Sonic Zhang wrote:
> From: Sonic Zhang <sonic.zhang@analog.com>

> diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
> index 92183a4..27fd296 100644
> --- a/toolchain/toolchain-external/ext-tool.mk
> +++ b/toolchain/toolchain-external/ext-tool.mk
> @@ -134,7 +134,11 @@ TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += \
>  endif
>  
>  CC_TARGET_TUNE_:=$(call qstrip,$(BR2_GCC_TARGET_TUNE))
> +ifeq ($(BR2_GCC_TARGET_CPU_REVISION),)

I think this test should have a $(call qstrip) to be effective.

>  CC_TARGET_CPU_:=$(call qstrip,$(BR2_GCC_TARGET_CPU))
> +else
> +CC_TARGET_CPU_:=$(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISION))
> +endif
>  CC_TARGET_ARCH_:=$(call qstrip,$(BR2_GCC_TARGET_ARCH))
>  CC_TARGET_ABI_:=$(call qstrip,$(BR2_GCC_TARGET_ABI))

It should also be changed in toolchain/gcc/gcc-uclibc-4.x.mk in a
similar way. Code is currently:

ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),)
GCC_WITH_CPU:=--with-cpu=$(BR2_GCC_TARGET_CPU)
endif

It should be:

ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),)
ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU_REVISION)),)
GCC_WITH_CPU:=--with-cpu=$(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISION))
else
GCC_WITH_CPU:=--with-cpu=$(call qstrip,$(BR2_GCC_TARGET_CPU))
endif
endif

Once this is one, I think the patch is OK.

Thomas

Patch

diff --git a/arch/Config.in b/arch/Config.in
index 2a14c29..047abc1 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -174,6 +174,9 @@  config BR2_GCC_TARGET_ABI
 config BR2_GCC_TARGET_CPU
 	string
 
+config BR2_GCC_TARGET_CPU_REVISION
+	string
+
 # Set up target binary format
 choice
 	prompt "Target Binary Format"
diff --git a/arch/Config.in.bfin b/arch/Config.in.bfin
index ac96620..f755c8d 100644
--- a/arch/Config.in.bfin
+++ b/arch/Config.in.bfin
@@ -97,3 +97,11 @@  config BR2_GCC_TARGET_CPU
 	default bf548		if BR2_bf548
 	default bf549		if BR2_bf549
 	default bf561		if BR2_bf561
+
+config BR2_GCC_TARGET_CPU_REVISION
+	string "Target CPU revision"
+	help
+	  Specify a target CPU revision, which will be appended to the
+	  value of the -mcpu option. For example, if the selected CPU is
+	  bf609, and then selected CPU revision is "0.0", then gcc will
+	  receive the -mcpu=bf609-0.0 option.
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 92183a4..27fd296 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -134,7 +134,11 @@  TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += \
 endif
 
 CC_TARGET_TUNE_:=$(call qstrip,$(BR2_GCC_TARGET_TUNE))
+ifeq ($(BR2_GCC_TARGET_CPU_REVISION),)
 CC_TARGET_CPU_:=$(call qstrip,$(BR2_GCC_TARGET_CPU))
+else
+CC_TARGET_CPU_:=$(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISION))
+endif
 CC_TARGET_ARCH_:=$(call qstrip,$(BR2_GCC_TARGET_ARCH))
 CC_TARGET_ABI_:=$(call qstrip,$(BR2_GCC_TARGET_ABI))