build: define CPU only when arch/${ARCH}/cpu/${CPU} exists
PATCH 1/1 build: define CPU only when arch/${ARCH}/cpu/${CPU} exists
The directory arch/${ARCH}/cpu/${CPU} does not exist in avr32, blackfin, microblaze, nios2, openrisc, sandbox, x86.
These architectures have only one CPU type. Defining CPU should not be required for such architectures.
This commit allows cpu field (= the 3rd field of boards.cfg) to be kept blank.
---
I built all the boards and compared MD5SUM.
I confirmed that the same binaries are generated with/without this patch.
.../sandbox/include/asm/{arch-sandbox => }/sound.h | 0
boards.cfg | 104 ++++++++++-----------
config.mk | 5 +-
drivers/sound/sandbox.c | 2 +-
mkconfig | 11 ++-
5 files changed, 62 insertions(+), 60 deletions(-)
rename arch/sandbox/include/asm/{arch-sandbox => }/sound.h (100%)arch/sandbox/include/asm/sound.h renamed from arch/sandbox/include/asm/arch-sandbox/sound.h +0 -0
boards.cfg +52 -52
146 lines not on this page · raw message
config.mk +1 -4
@@ -24,10 +24,7 @@ OBJCOPYFLAGS := # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files. # Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains # CPU-specific code. -CPUDIR=arch/$(ARCH)/cpu/$(CPU) -ifneq ($(srctree)/$(CPUDIR),$(wildcard $(srctree)/$(CPUDIR))) -CPUDIR=arch/$(ARCH)/cpu -endif +CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),) sinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules sinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules
drivers/sound/sandbox.c +1 -1
@@ -5,7 +5,7 @@*/ #include <common.h> -#include <asm/arch/sound.h> +#include <asm/sound.h> #include <asm/sdl.h> int sound_play (uint32_t msec,uint32_t frequency)
mkconfig +8 -3
@@ -55,6 +55,11 @@ CONFIG_NAME="${7%_config}" arch="$2" cpu=`echo $3 | awk 'BEGIN {FS = ":"} ; {print $1}'` spl_cpu=`echo $3 | awk 'BEGIN {FS = ":"} ; {print $2}'` + +if [ "$cpu" = "-" ] ; then + cpu= +fi + if [ "$6" = "<none>" ] ; then board= elif [ "$6" = "-" ] ; then
@@ -114,10 +119,10 @@ fi rm -f asm/arch -if [ -z "${soc}" ] ; then - ln -s ${LNPREFIX}arch-${cpu} asm/arch -else +if [ "${soc}" ] ; then ln -s ${LNPREFIX}arch-${soc} asm/arch +elif [ "${cpu}" ] ; then + ln -s ${LNPREFIX}arch-${cpu} asm/arch fi if [ -z "$KBUILD_SRC" ] ; then
Signature · 1 line
1.9.1
PATCH 1/1 build: define CPU only when arch/${ARCH}/cpu/${CPU} exists
Hi Masahiro,
Quoted 9 lines · Masahiro Yamada
The directory
arch/${ARCH}/cpu/${CPU}does not exist in avr32, blackfin, microblaze, nios2, openrisc, sandbox, x86.These architectures have only one CPU type. Defining CPU should not be required for such architectures.
This commit allows cpu field (= the 3rd field of boards.cfg) to be kept blank.
Quoted 7 lines
Signed-off-by Masahiro Yamada <[email protected]>Cc Andreas Bie?mann <[email protected]>Cc Simon Glass <[email protected]>Cc Sonic Zhang <[email protected]>Cc Michal Simek <[email protected]>Cc Thomas Chou <[email protected]>Cc Stefan Kristiansson <[email protected]>
But see question below.
Quoted 17 lines
mkconfig +5
-0@@ -55,6 +55,11 @@ CONFIG_NAME="${7%_config}" arch="$2" cpu=`echo $3 | awk 'BEGIN {FS = ":"} ; {print $1}'` spl_cpu=`echo $3 | awk 'BEGIN {FS = ":"} ; {print $2}'` + +if [ "$cpu" = "-" ] ; then + cpu= +fi + if [ "$6" = "<none>" ] ; then board= elif [ "$6" = "-" ] ; then
mkconfig fi · line 122
Quoted 7 lines
mkconfig +1
-3@@ -114,10 +119,10 @@ fi rm -f asm/arch -if [ -z "${soc}" ] ; then - ln -s ${LNPREFIX}arch-${cpu} asm/arch -else +if [ "${soc}" ] ; then
Will this work OK in dash? (or non-bash)
Quoted 9 lines
mkconfig +2
-1ln -s ${LNPREFIX}arch-${soc} asm/arch +elif [ "${cpu}" ] ; then + ln -s ${LNPREFIX}arch-${cpu} asm/arch fi if [ -z "$KBUILD_SRC" ] ; then --1.9.1
Regards,
Simon
PATCH 1/1 build: define CPU only when arch/${ARCH}/cpu/${CPU} exists
Hi Simon,
Quoted 20 lines · On Mon, 7 Jul 2014 16:44:36 -0600 Simon Glass <[email protected]> wrote:
But see question below.
Quoted 18 lines
mkconfig +5
-0@@ -55,6 +55,11 @@ CONFIG_NAME="${7%_config}" arch="$2" cpu=`echo $3 | awk 'BEGIN {FS = ":"} ; {print $1}'` spl_cpu=`echo $3 | awk 'BEGIN {FS = ":"} ; {print $2}'` + +if [ "$cpu" = "-" ] ; then + cpu= +fi + if [ "$6" = "<none>" ] ; then board= elif [ "$6" = "-" ] ; then@@ -114,10 +119,10 @@ fi
Quoted 9 lines
mkconfig fi · line 122
Quoted 6 lines
mkconfig +1
-3rm -f asm/arch -if [ -z "${soc}" ] ; then - ln -s ${LNPREFIX}arch-${cpu} asm/arch -else +if [ "${soc}" ] ; thenWill this work OK in dash? (or non-bash)
Yes.
I am dash-user. :-)
This is working on dash too.
Best Regards
Masahiro Yamada
Quoted 9 lines · Masahiro Yamada
The directory
arch/${ARCH}/cpu/${CPU}does not exist in avr32, blackfin, microblaze, nios2, openrisc, sandbox, x86.These architectures have only one CPU type. Defining CPU should not be required for such architectures.
This commit allows cpu field (= the 3rd field of boards.cfg) to be kept blank.
Quoted 7 lines
Signed-off-by Masahiro Yamada <[email protected]>Cc Andreas Bie?mann <[email protected]>Cc Simon Glass <[email protected]>Cc Sonic Zhang <[email protected]>Cc Michal Simek <[email protected]>Cc Thomas Chou <[email protected]>Cc Stefan Kristiansson <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140707/d13a8f9e/attachment.pgp>