]> git.karo-electronics.de Git - karo-tx-uboot.git/commitdiff
Create CPUDIR variable
authorPeter Tyser <ptyser@xes-inc.com>
Tue, 13 Apr 2010 03:28:02 +0000 (22:28 -0500)
committerWolfgang Denk <wd@denx.de>
Tue, 13 Apr 2010 07:12:59 +0000 (09:12 +0200)
The CPUDIR variable points to the location of a target's CPU directory.
Currently, it is set to cpu/$CPU.  However, using $CPUDIR will allow for
more flexibility in the future.  It lays the groundwork for reorganizing
U-Boot's directory structure to support a layout such as:

  arch/$ARCH/cpu/$CPU/* (architecture with multiple CPU types)
  arch/$ARCH/cpu/*      (architecture with one CPU type)

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
14 files changed:
Makefile
board/freescale/mpc8536ds/config.mk
board/freescale/mpc8569mds/config.mk
board/freescale/mx51evk/config.mk
board/freescale/p1_p2_rdb/config.mk
config.mk
doc/README.ARM-SoC
lib_arm/config.mk
lib_blackfin/config.mk
lib_sh/config.mk
nand_spl/board/freescale/mpc8536ds/Makefile
nand_spl/board/freescale/mpc8569mds/Makefile
nand_spl/board/freescale/p1_p2_rdb/Makefile
onenand_ipl/board/apollon/Makefile

index 5d314c62a388256f8a7f23f3bd375389c025ed42..8e3eb9938d63176baaa41ae2ba835484e3f1fc68 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -169,16 +169,16 @@ include $(TOPDIR)/config.mk
 #########################################################################
 # U-Boot objects....order is important (i.e. start must be first)
 
 #########################################################################
 # U-Boot objects....order is important (i.e. start must be first)
 
-OBJS  = cpu/$(CPU)/start.o
+OBJS  = $(CPUDIR)/start.o
 ifeq ($(CPU),i386)
 ifeq ($(CPU),i386)
-OBJS += cpu/$(CPU)/start16.o
-OBJS += cpu/$(CPU)/resetvec.o
+OBJS += $(CPUDIR)/start16.o
+OBJS += $(CPUDIR)/resetvec.o
 endif
 ifeq ($(CPU),ppc4xx)
 endif
 ifeq ($(CPU),ppc4xx)
-OBJS += cpu/$(CPU)/resetvec.o
+OBJS += $(CPUDIR)/resetvec.o
 endif
 ifeq ($(CPU),mpc85xx)
 endif
 ifeq ($(CPU),mpc85xx)
-OBJS += cpu/$(CPU)/resetvec.o
+OBJS += $(CPUDIR)/resetvec.o
 endif
 
 OBJS := $(addprefix $(obj),$(OBJS))
 endif
 
 OBJS := $(addprefix $(obj),$(OBJS))
@@ -188,9 +188,9 @@ LIBS += lib_generic/lzma/liblzma.a
 LIBS += lib_generic/lzo/liblzo.a
 LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
        "board/$(VENDOR)/common/lib$(VENDOR).a"; fi)
 LIBS += lib_generic/lzo/liblzo.a
 LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
        "board/$(VENDOR)/common/lib$(VENDOR).a"; fi)
-LIBS += cpu/$(CPU)/lib$(CPU).a
+LIBS += $(CPUDIR)/lib$(CPU).a
 ifdef SOC
 ifdef SOC
-LIBS += cpu/$(CPU)/$(SOC)/lib$(SOC).a
+LIBS += $(CPUDIR)/$(SOC)/lib$(SOC).a
 endif
 ifeq ($(CPU),ixp)
 LIBS += cpu/ixp/npe/libnpe.a
 endif
 ifeq ($(CPU),ixp)
 LIBS += cpu/ixp/npe/libnpe.a
@@ -354,7 +354,7 @@ ifeq ($(CONFIG_KALLSYMS),y)
 endif
 
 $(OBJS):       depend
 endif
 
 $(OBJS):       depend
-               $(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@))
+               $(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir $@))
 
 $(LIBS):       depend $(SUBDIRS)
                $(MAKE) -C $(dir $(subst $(obj),,$@))
 
 $(LIBS):       depend $(SUBDIRS)
                $(MAKE) -C $(dir $(subst $(obj),,$@))
@@ -404,7 +404,7 @@ env:
 # Explicitly make _depend in subdirs containing multiple targets to prevent
 # parallel sub-makes creating .depend files simultaneously.
 depend dep:    $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
 # Explicitly make _depend in subdirs containing multiple targets to prevent
 # parallel sub-makes creating .depend files simultaneously.
 depend dep:    $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
-               for dir in $(SUBDIRS) cpu/$(CPU) $(dir $(LDSCRIPT)) ; do \
+               for dir in $(SUBDIRS) $(CPUDIR) $(dir $(LDSCRIPT)) ; do \
                        $(MAKE) -C $$dir _depend ; done
 
 TAG_SUBDIRS = $(SUBDIRS)
                        $(MAKE) -C $$dir _depend ; done
 
 TAG_SUBDIRS = $(SUBDIRS)
index e38af731bed519855f53c59119454c68de0056f0..3f5447a4369715c9a3edc6ceab53b93aada98408 100644 (file)
@@ -26,7 +26,7 @@
 ifndef NAND_SPL
 ifeq ($(CONFIG_MK_NAND), y)
 TEXT_BASE = $(CONFIG_RAMBOOT_TEXT_BASE)
 ifndef NAND_SPL
 ifeq ($(CONFIG_MK_NAND), y)
 TEXT_BASE = $(CONFIG_RAMBOOT_TEXT_BASE)
-LDSCRIPT := $(TOPDIR)/cpu/$(CPU)/u-boot-nand.lds
+LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
 endif
 endif
 
 endif
 endif
 
index 7de0f7cf7d6cb2382114debb911ff18f6afadc20..86f138c19ca292258aae0bc19bac7f41af9b6c28 100644 (file)
@@ -26,7 +26,7 @@
 ifndef NAND_SPL
 ifeq ($(CONFIG_MK_NAND), y)
 TEXT_BASE = $(CONFIG_RAMBOOT_TEXT_BASE)
 ifndef NAND_SPL
 ifeq ($(CONFIG_MK_NAND), y)
 TEXT_BASE = $(CONFIG_RAMBOOT_TEXT_BASE)
-LDSCRIPT := $(TOPDIR)/cpu/$(CPU)/u-boot-nand.lds
+LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
 endif
 endif
 
 endif
 endif
 
index c8279ec8cbd9d9bacefcc4388fef0741c28eff59..af70ec250f63eabc8e745649e4d3d3d66cef20f8 100644 (file)
@@ -20,6 +20,6 @@
 # MA 02111-1307 USA
 #
 
 # MA 02111-1307 USA
 #
 
-LDSCRIPT = cpu/$(CPU)/$(SOC)/u-boot.lds
+LDSCRIPT = $(CPUDIR)/$(SOC)/u-boot.lds
 TEXT_BASE = 0x97800000
 IMX_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/imximage.cfg
 TEXT_BASE = 0x97800000
 IMX_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/imximage.cfg
index 0f7a0487e07f82c6117cd778b839a20496579e30..1f9f7b68a266a2dd850ffe1e7bf218823a86807f 100644 (file)
@@ -27,7 +27,7 @@
 ifndef NAND_SPL
 ifeq ($(CONFIG_MK_NAND), y)
 TEXT_BASE = $(CONFIG_RAMBOOT_TEXT_BASE)
 ifndef NAND_SPL
 ifeq ($(CONFIG_MK_NAND), y)
 TEXT_BASE = $(CONFIG_RAMBOOT_TEXT_BASE)
-LDSCRIPT := $(TOPDIR)/cpu/$(CPU)/u-boot-nand.lds
+LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
 endif
 endif
 
 endif
 endif
 
index cb1c4af977203cca95aa39aa58a1864648f023dc..c82cb63d247ab22a59a4ef9b172e862f142e255b 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -110,14 +110,15 @@ RANLIB    = $(CROSS_COMPILE)RANLIB
 # Load generated board configuration
 sinclude $(OBJTREE)/include/autoconf.mk
 
 # Load generated board configuration
 sinclude $(OBJTREE)/include/autoconf.mk
 
-ifdef  ARCH
+# Some architecture config.mk files need to know what CPUDIR is set to,
+# so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
+CPUDIR=cpu/$(CPU)
+
 sinclude $(TOPDIR)/lib_$(ARCH)/config.mk       # include architecture dependend rules
 sinclude $(TOPDIR)/lib_$(ARCH)/config.mk       # include architecture dependend rules
-endif
-ifdef  CPU
-sinclude $(TOPDIR)/cpu/$(CPU)/config.mk                # include  CPU  specific rules
-endif
+sinclude $(TOPDIR)/$(CPUDIR)/config.mk         # include  CPU  specific rules
+
 ifdef  SOC
 ifdef  SOC
-sinclude $(TOPDIR)/cpu/$(CPU)/$(SOC)/config.mk # include  SoC  specific rules
+sinclude $(TOPDIR)/$(CPUDIR)/$(SOC)/config.mk  # include  SoC  specific rules
 endif
 ifdef  VENDOR
 BOARDDIR = $(VENDOR)/$(BOARD)
 endif
 ifdef  VENDOR
 BOARDDIR = $(VENDOR)/$(BOARD)
index 0f2677f88bf463d981d4d7aa040e4e849a920fc6..15f065dfbc7e3889804a20ff4432ea92e6a99c31 100644 (file)
@@ -7,14 +7,14 @@ I introduced the concept of Soc (system on a chip) into the ./cpu
 directory. That means that code that is cpu (i.e. core) specific
 resides in
 
 directory. That means that code that is cpu (i.e. core) specific
 resides in
 
-       cpu/$(CPU)/
+       $(CPUDIR)/
 
 and code that is specific to some SoC (i.e. vendor specific
 peripherals around the core) is moved into
 
 
 and code that is specific to some SoC (i.e. vendor specific
 peripherals around the core) is moved into
 
-       cpu/$(CPU)/$(SOC)/
+       $(CPUDIR)/$(SOC)/
 
 
-Thus a library/archive "cpu/$(CPU)/$(SOC)/lib$(SOC).a" will be build
+Thus a library/archive "$(CPUDIR)/$(SOC)/lib$(SOC).a" will be build
 and linked. Examples will be
 
        cpu/arm920t/imx/
 and linked. Examples will be
 
        cpu/arm920t/imx/
index 3c078df3c127c2fe680cfc9fa0fc3011d79df3d8..8dd4dccf368c0d75b6a9ce8f763f6e9afc8e6c65 100644 (file)
@@ -63,4 +63,4 @@ ifeq (,$(findstring lib_arm/eabi_compat.o,$(PLATFORM_LIBS)))
 PLATFORM_LIBS += $(OBJTREE)/lib_arm/eabi_compat.o
 endif
 endif
 PLATFORM_LIBS += $(OBJTREE)/lib_arm/eabi_compat.o
 endif
 endif
-LDSCRIPT := $(SRCTREE)/cpu/$(CPU)/u-boot.lds
+LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds
index 1b5cbbaf2952bdcb58e589cb0f96151cb30d11e1..3ecade9aa438a2be88a9de827d5e881e4a88f492 100644 (file)
@@ -56,7 +56,7 @@ LDR_FLAGS-$(CONFIG_BFIN_BOOTROM_USES_EVT1) += -J
 
 LDR_FLAGS += --bmode $(subst BFIN_BOOT_,,$(CONFIG_BFIN_BOOT_MODE))
 LDR_FLAGS += --use-vmas
 
 LDR_FLAGS += --bmode $(subst BFIN_BOOT_,,$(CONFIG_BFIN_BOOT_MODE))
 LDR_FLAGS += --use-vmas
-LDR_FLAGS += --initcode $(obj)cpu/$(CPU)/initcode.o
+LDR_FLAGS += --initcode $(obj)$(CPUDIR)/initcode.o
 ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_UART)
 LDR_FLAGS-$(CONFIG_ENV_IS_EMBEDDED_IN_LDR) += \
        --punchit $$(($(CONFIG_ENV_OFFSET))):$$(($(CONFIG_ENV_SIZE))):$(obj)env-ldr.o
 ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_UART)
 LDR_FLAGS-$(CONFIG_ENV_IS_EMBEDDED_IN_LDR) += \
        --punchit $$(($(CONFIG_ENV_OFFSET))):$$(($(CONFIG_ENV_SIZE))):$(obj)env-ldr.o
index fa5369fd0843db5d6c6737f04bf60a91e1edf87d..797bf4c2269d8a2e5baa8f756f808953bf0e0db9 100644 (file)
@@ -31,4 +31,4 @@ endif
 PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
 PLATFORM_LDFLAGS += -e $(TEXT_BASE) --defsym reloc_dst=$(TEXT_BASE)
 
 PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
 PLATFORM_LDFLAGS += -e $(TEXT_BASE) --defsym reloc_dst=$(TEXT_BASE)
 
-LDSCRIPT := $(SRCTREE)/cpu/$(CPU)/u-boot.lds
+LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds
index 7ed9d619dc8aafce02c54413749f594184a4f44f..be0caaa7b3d2255e0b4a25ed7e5b88b61511e950 100644 (file)
@@ -29,7 +29,7 @@ PAD_TO := 0xfff01000
 
 include $(TOPDIR)/config.mk
 
 
 include $(TOPDIR)/config.mk
 
-LDSCRIPT= $(TOPDIR)/cpu/$(CPU)/u-boot-nand_spl.lds
+LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
 LDFLAGS        = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
 AFLAGS += -DCONFIG_NAND_SPL
 CFLAGS += -DCONFIG_NAND_SPL
 LDFLAGS        = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
 AFLAGS += -DCONFIG_NAND_SPL
 CFLAGS += -DCONFIG_NAND_SPL
@@ -93,7 +93,7 @@ $(obj)ns16550.c:
 
 $(obj)resetvec.S:
        @rm -f $(obj)resetvec.S
 
 $(obj)resetvec.S:
        @rm -f $(obj)resetvec.S
-       ln -s $(SRCTREE)/cpu/$(CPU)/resetvec.S $(obj)resetvec.S
+       ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $(obj)resetvec.S
 
 $(obj)fixed_ivor.S:
        @rm -f $(obj)fixed_ivor.S
 
 $(obj)fixed_ivor.S:
        @rm -f $(obj)fixed_ivor.S
index 7ed9d619dc8aafce02c54413749f594184a4f44f..be0caaa7b3d2255e0b4a25ed7e5b88b61511e950 100644 (file)
@@ -29,7 +29,7 @@ PAD_TO := 0xfff01000
 
 include $(TOPDIR)/config.mk
 
 
 include $(TOPDIR)/config.mk
 
-LDSCRIPT= $(TOPDIR)/cpu/$(CPU)/u-boot-nand_spl.lds
+LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
 LDFLAGS        = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
 AFLAGS += -DCONFIG_NAND_SPL
 CFLAGS += -DCONFIG_NAND_SPL
 LDFLAGS        = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
 AFLAGS += -DCONFIG_NAND_SPL
 CFLAGS += -DCONFIG_NAND_SPL
@@ -93,7 +93,7 @@ $(obj)ns16550.c:
 
 $(obj)resetvec.S:
        @rm -f $(obj)resetvec.S
 
 $(obj)resetvec.S:
        @rm -f $(obj)resetvec.S
-       ln -s $(SRCTREE)/cpu/$(CPU)/resetvec.S $(obj)resetvec.S
+       ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $(obj)resetvec.S
 
 $(obj)fixed_ivor.S:
        @rm -f $(obj)fixed_ivor.S
 
 $(obj)fixed_ivor.S:
        @rm -f $(obj)fixed_ivor.S
index 7ed9d619dc8aafce02c54413749f594184a4f44f..be0caaa7b3d2255e0b4a25ed7e5b88b61511e950 100644 (file)
@@ -29,7 +29,7 @@ PAD_TO := 0xfff01000
 
 include $(TOPDIR)/config.mk
 
 
 include $(TOPDIR)/config.mk
 
-LDSCRIPT= $(TOPDIR)/cpu/$(CPU)/u-boot-nand_spl.lds
+LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
 LDFLAGS        = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
 AFLAGS += -DCONFIG_NAND_SPL
 CFLAGS += -DCONFIG_NAND_SPL
 LDFLAGS        = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
 AFLAGS += -DCONFIG_NAND_SPL
 CFLAGS += -DCONFIG_NAND_SPL
@@ -93,7 +93,7 @@ $(obj)ns16550.c:
 
 $(obj)resetvec.S:
        @rm -f $(obj)resetvec.S
 
 $(obj)resetvec.S:
        @rm -f $(obj)resetvec.S
-       ln -s $(SRCTREE)/cpu/$(CPU)/resetvec.S $(obj)resetvec.S
+       ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $(obj)resetvec.S
 
 $(obj)fixed_ivor.S:
        @rm -f $(obj)fixed_ivor.S
 
 $(obj)fixed_ivor.S:
        @rm -f $(obj)fixed_ivor.S
index 193efffb56507a3e822c59ca646bc4887346ff76..6f1df01135ed6f3b4fd278cf2a1a3c9739f10abc 100644 (file)
@@ -46,7 +46,7 @@ $(onenandobj)u-boot.lds:      $(LDSCRIPT)
 # from cpu directory
 $(obj)start.S:
        @rm -f $@
 # from cpu directory
 $(obj)start.S:
        @rm -f $@
-       ln -s $(SRCTREE)/cpu/$(CPU)/start.S $@
+       ln -s $(SRCTREE)/$(CPUDIR)/start.S $@
 
 # from onenand_ipl directory
 $(obj)onenand_ipl.h:
 
 # from onenand_ipl directory
 $(obj)onenand_ipl.h: