On Wed, Apr 14, 2010 at 12:18:11PM +0200, Wolfgang Denk wrote: > In message <1271238797-14117-1-git-send-email-rabin.vinc...@stericsson.com> > you wrote: > > +SOCDIR = $(CPUDIR)/$(SOC) > > +ifdef SUBCPU > > +SOCDIR = $(CPUDIR)/$(SUBCPU)/$(SOC) > > +endif > > Using an `ifdef' / `else' / `endif' would seem more logical to me.
Updated patch below. Rabin >From 2131e817d21162d0dd47b56cc068eb868b1ac7fc Mon Sep 17 00:00:00 2001 From: Rabin Vincent <rabin.vinc...@stericsson.com> Date: Tue, 13 Apr 2010 15:18:56 +0530 Subject: [PATCHv2 1/2] Allow SOC to be two-levels deep inside CPU On ARM, it has been suggested to place Cortex-A8 SoC directories in arch/arm/cpu/cortex/a8 and Cortex-A9 SoC directories in arch/arm/cpu/cortex/a9, with common code kept in arch/arm/cpu/cortex. To allow this, if the mkconfig argument for the CPU includes a slash, make mkconfig split the variable, at the slash, into a $CPU and a $SUBCPU. SOC directories will be expected to be present in $SOCDIR, which will either be $CPUDIR/$SOC or $CPUDIR/$SUBCPU/$SOC, depending on whether a SUBCPU is used. The top-level Makefile will continue to look for the CPU-specific config.mk and Makefile inside $CPUDIR. CPU-specific Makefiles can choose to include code from inside $SUBCPU as necessary. Acked-by: Michael Brandt <michael.bra...@stericsson.com> Signed-off-by: Rabin Vincent <rabin.vinc...@stericsson.com> --- v2: use ifdef/else/endif Makefile | 2 +- board/freescale/mx51evk/config.mk | 2 +- config.mk | 8 +++++++- doc/README.ARM-SoC | 8 +++++--- mkconfig | 3 ++- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 0381c81..ca0dffb 100644 --- a/Makefile +++ b/Makefile @@ -190,7 +190,7 @@ LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \ "board/$(VENDOR)/common/lib$(VENDOR).a"; fi) LIBS += $(CPUDIR)/lib$(CPU).a ifdef SOC -LIBS += $(CPUDIR)/$(SOC)/lib$(SOC).a +LIBS += $(SOCDIR)/lib$(SOC).a endif ifeq ($(CPU),ixp) LIBS += arch/arm/cpu/ixp/npe/libnpe.a diff --git a/board/freescale/mx51evk/config.mk b/board/freescale/mx51evk/config.mk index af70ec2..8305bfa 100644 --- a/board/freescale/mx51evk/config.mk +++ b/board/freescale/mx51evk/config.mk @@ -20,6 +20,6 @@ # MA 02111-1307 USA # -LDSCRIPT = $(CPUDIR)/$(SOC)/u-boot.lds +LDSCRIPT = $(SOCDIR)/u-boot.lds TEXT_BASE = 0x97800000 IMX_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/imximage.cfg diff --git a/config.mk b/config.mk index 73b5195..7070cf1 100644 --- a/config.mk +++ b/config.mk @@ -119,11 +119,17 @@ ifneq ($(SRCTREE)/$(CPUDIR),$(wildcard $(SRCTREE)/$(CPUDIR))) CPUDIR=arch/$(ARCH)/cpu endif +ifdef SUBCPU +SOCDIR = $(CPUDIR)/$(SUBCPU)/$(SOC) +else +SOCDIR = $(CPUDIR)/$(SOC) +endif + sinclude $(TOPDIR)/arch/$(ARCH)/config.mk # include architecture dependend rules sinclude $(TOPDIR)/$(CPUDIR)/config.mk # include CPU specific rules ifdef SOC -sinclude $(TOPDIR)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules +sinclude $(TOPDIR)/$(SOCDIR)/config.mk # include SoC specific rules endif ifdef VENDOR BOARDDIR = $(VENDOR)/$(BOARD) diff --git a/doc/README.ARM-SoC b/doc/README.ARM-SoC index d6bd624..57fc10d 100644 --- a/doc/README.ARM-SoC +++ b/doc/README.ARM-SoC @@ -10,12 +10,14 @@ resides in $(CPUDIR)/ and code that is specific to some SoC (i.e. vendor specific -peripherals around the core) is moved into +peripherals around the core) is moved into $(SOCDIR), which is +one of $(CPUDIR)/$(SOC)/ + $(CPUDIR)/$(SUBCPU)/$(SOC)/ -Thus a library/archive "$(CPUDIR)/$(SOC)/lib$(SOC).a" will be build -and linked. Examples will be +Thus a library/archive "$(SOCDIR)/lib$(SOC).a" will be build and linked. +Examples will be arch/arm/cpu/arm920t/imx/ arch/arm/cpu/arm920t/s3c24x0 diff --git a/mkconfig b/mkconfig index d3109e4..1e162d4 100755 --- a/mkconfig +++ b/mkconfig @@ -70,7 +70,8 @@ fi # Create include file for Make # echo "ARCH = $2" > config.mk -echo "CPU = $3" >> config.mk +echo "CPU =" `echo $3 | cut -f1 -d/` >> config.mk +echo "SUBCPU =" `echo $3 | cut -f2 -s -d/` >> config.mk echo "BOARD = $4" >> config.mk [ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk -- 1.7.0 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot