Patchwork [v2,2/7] arch: toolchain: Introduce target CPU revision.

login
register
mail settings
Submitter Sonic Zhang
Date March 29, 2013, 9:50 a.m.
Message ID <1364550643-11793-2-git-send-email-sonic.adi@gmail.com>
Download mbox | patch
Permalink /patch/232340/
State Changes Requested
Headers show

Comments

Sonic Zhang - March 29, 2013, 9:50 a.m.
From: Sonic Zhang <sonic.zhang@analog.com>

v2-changes:
none

v1-changes:
- 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>
---
 arch/Config.in                           |    3 +++
 arch/Config.in.bfin                      |    5 +++++
 toolchain/toolchain-external/ext-tool.mk |    4 ++++
 3 files changed, 12 insertions(+), 0 deletions(-)
Thomas Petazzoni - April 7, 2013, 8:42 p.m.
Dear Sonic Zhang,

On Fri, 29 Mar 2013 17:50:38 +0800, Sonic Zhang wrote:

> +config BR2_GCC_TARGET_CPU_REVISION
> +	string "Target CPU revision"
> +	help
> +	  Specify target cpu revision which is passed to compiler as a parameter.

I think this line is slightly too long, it should be wrapped. And I
would like more details here in the help text. Maybe something like:

	Specify a target CPU revision, which will be appended to the
	value of the -mcpu option. For example, if the selected CPU is
	bf607, and then selected CPU revision is "r2", then gcc will
	receive the -mcpu=bf607-r2 option.

Other than this detail, looks good to me.

Thanks!

Thomas
Sonic Zhang - April 8, 2013, 6:30 a.m.
Hi Thomas,

On Mon, Apr 8, 2013 at 4:42 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Sonic Zhang,
>
> On Fri, 29 Mar 2013 17:50:38 +0800, Sonic Zhang wrote:
>
>> +config BR2_GCC_TARGET_CPU_REVISION
>> +     string "Target CPU revision"
>> +     help
>> +       Specify target cpu revision which is passed to compiler as a parameter.
>
> I think this line is slightly too long, it should be wrapped. And I
> would like more details here in the help text. Maybe something like:
>
>         Specify a target CPU revision, which will be appended to the
>         value of the -mcpu option. For example, if the selected CPU is
>         bf607, and then selected CPU revision is "r2", then gcc will
>         receive the -mcpu=bf607-r2 option.
>
OK.

Regards,

Sonic

Patch

diff --git a/arch/Config.in b/arch/Config.in
index 472b10c..c341848 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
+
 if BR2_arm || BR2_armeb
 source "arch/Config.in.arm"
 endif
diff --git a/arch/Config.in.bfin b/arch/Config.in.bfin
index ac96620..021f5fe 100644
--- a/arch/Config.in.bfin
+++ b/arch/Config.in.bfin
@@ -97,3 +97,8 @@  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 target cpu revision which is passed to compiler as a parameter.
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index b477bc0..407e1ad 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))