提交 03b7004d 编写于 作者: P Peter Tyser 提交者: Wolfgang Denk

Create CPUDIR variable

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: NPeter Tyser <ptyser@xes-inc.com>
上级 fd4e49c1
...@@ -169,16 +169,16 @@ include $(TOPDIR)/config.mk ...@@ -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 += $(CPUDIR)/start16.o
OBJS += cpu/$(CPU)/resetvec.o OBJS += $(CPUDIR)/resetvec.o
endif endif
ifeq ($(CPU),ppc4xx) ifeq ($(CPU),ppc4xx)
OBJS += cpu/$(CPU)/resetvec.o OBJS += $(CPUDIR)/resetvec.o
endif endif
ifeq ($(CPU),mpc85xx) ifeq ($(CPU),mpc85xx)
OBJS += cpu/$(CPU)/resetvec.o OBJS += $(CPUDIR)/resetvec.o
endif endif
OBJS := $(addprefix $(obj),$(OBJS)) OBJS := $(addprefix $(obj),$(OBJS))
...@@ -188,9 +188,9 @@ LIBS += lib_generic/lzma/liblzma.a ...@@ -188,9 +188,9 @@ LIBS += lib_generic/lzma/liblzma.a
LIBS += lib_generic/lzo/liblzo.a LIBS += lib_generic/lzo/liblzo.a
LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \ LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
"board/$(VENDOR)/common/lib$(VENDOR).a"; fi) "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 endif
ifeq ($(CPU),ixp) ifeq ($(CPU),ixp)
LIBS += cpu/ixp/npe/libnpe.a LIBS += cpu/ixp/npe/libnpe.a
...@@ -354,7 +354,7 @@ ifeq ($(CONFIG_KALLSYMS),y) ...@@ -354,7 +354,7 @@ ifeq ($(CONFIG_KALLSYMS),y)
endif endif
$(OBJS): depend $(OBJS): depend
$(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@)) $(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir $@))
$(LIBS): depend $(SUBDIRS) $(LIBS): depend $(SUBDIRS)
$(MAKE) -C $(dir $(subst $(obj),,$@)) $(MAKE) -C $(dir $(subst $(obj),,$@))
...@@ -404,7 +404,7 @@ env: ...@@ -404,7 +404,7 @@ env:
# Explicitly make _depend in subdirs containing multiple targets to prevent # Explicitly make _depend in subdirs containing multiple targets to prevent
# parallel sub-makes creating .depend files simultaneously. # parallel sub-makes creating .depend files simultaneously.
depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk 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 $(MAKE) -C $$dir _depend ; done
TAG_SUBDIRS = $(SUBDIRS) TAG_SUBDIRS = $(SUBDIRS)
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
ifndef NAND_SPL ifndef NAND_SPL
ifeq ($(CONFIG_MK_NAND), y) ifeq ($(CONFIG_MK_NAND), y)
TEXT_BASE = $(CONFIG_RAMBOOT_TEXT_BASE) 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
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
ifndef NAND_SPL ifndef NAND_SPL
ifeq ($(CONFIG_MK_NAND), y) ifeq ($(CONFIG_MK_NAND), y)
TEXT_BASE = $(CONFIG_RAMBOOT_TEXT_BASE) 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
......
...@@ -20,6 +20,6 @@ ...@@ -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 TEXT_BASE = 0x97800000
IMX_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/imximage.cfg IMX_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/imximage.cfg
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
ifndef NAND_SPL ifndef NAND_SPL
ifeq ($(CONFIG_MK_NAND), y) ifeq ($(CONFIG_MK_NAND), y)
TEXT_BASE = $(CONFIG_RAMBOOT_TEXT_BASE) 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
......
...@@ -110,14 +110,15 @@ RANLIB = $(CROSS_COMPILE)RANLIB ...@@ -110,14 +110,15 @@ RANLIB = $(CROSS_COMPILE)RANLIB
# Load generated board configuration # Load generated board configuration
sinclude $(OBJTREE)/include/autoconf.mk 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 sinclude $(TOPDIR)/$(CPUDIR)/config.mk # include CPU specific rules
ifdef CPU
sinclude $(TOPDIR)/cpu/$(CPU)/config.mk # include CPU specific rules
endif
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 endif
ifdef VENDOR ifdef VENDOR
BOARDDIR = $(VENDOR)/$(BOARD) BOARDDIR = $(VENDOR)/$(BOARD)
......
...@@ -7,14 +7,14 @@ I introduced the concept of Soc (system on a chip) into the ./cpu ...@@ -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 directory. That means that code that is cpu (i.e. core) specific
resides in resides in
cpu/$(CPU)/ $(CPUDIR)/
and code that is specific to some SoC (i.e. vendor specific 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
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 and linked. Examples will be
cpu/arm920t/imx/ cpu/arm920t/imx/
......
...@@ -63,4 +63,4 @@ ifeq (,$(findstring lib_arm/eabi_compat.o,$(PLATFORM_LIBS))) ...@@ -63,4 +63,4 @@ ifeq (,$(findstring lib_arm/eabi_compat.o,$(PLATFORM_LIBS)))
PLATFORM_LIBS += $(OBJTREE)/lib_arm/eabi_compat.o PLATFORM_LIBS += $(OBJTREE)/lib_arm/eabi_compat.o
endif endif
endif endif
LDSCRIPT := $(SRCTREE)/cpu/$(CPU)/u-boot.lds LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds
...@@ -56,7 +56,7 @@ LDR_FLAGS-$(CONFIG_BFIN_BOOTROM_USES_EVT1) += -J ...@@ -56,7 +56,7 @@ LDR_FLAGS-$(CONFIG_BFIN_BOOTROM_USES_EVT1) += -J
LDR_FLAGS += --bmode $(subst BFIN_BOOT_,,$(CONFIG_BFIN_BOOT_MODE)) LDR_FLAGS += --bmode $(subst BFIN_BOOT_,,$(CONFIG_BFIN_BOOT_MODE))
LDR_FLAGS += --use-vmas 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) ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_UART)
LDR_FLAGS-$(CONFIG_ENV_IS_EMBEDDED_IN_LDR) += \ LDR_FLAGS-$(CONFIG_ENV_IS_EMBEDDED_IN_LDR) += \
--punchit $$(($(CONFIG_ENV_OFFSET))):$$(($(CONFIG_ENV_SIZE))):$(obj)env-ldr.o --punchit $$(($(CONFIG_ENV_OFFSET))):$$(($(CONFIG_ENV_SIZE))):$(obj)env-ldr.o
......
...@@ -31,4 +31,4 @@ endif ...@@ -31,4 +31,4 @@ endif
PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__ PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
PLATFORM_LDFLAGS += -e $(TEXT_BASE) --defsym reloc_dst=$(TEXT_BASE) PLATFORM_LDFLAGS += -e $(TEXT_BASE) --defsym reloc_dst=$(TEXT_BASE)
LDSCRIPT := $(SRCTREE)/cpu/$(CPU)/u-boot.lds LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds
...@@ -29,7 +29,7 @@ PAD_TO := 0xfff01000 ...@@ -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) LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
AFLAGS += -DCONFIG_NAND_SPL AFLAGS += -DCONFIG_NAND_SPL
CFLAGS += -DCONFIG_NAND_SPL CFLAGS += -DCONFIG_NAND_SPL
...@@ -93,7 +93,7 @@ $(obj)ns16550.c: ...@@ -93,7 +93,7 @@ $(obj)ns16550.c:
$(obj)resetvec.S: $(obj)resetvec.S:
@rm -f $(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: $(obj)fixed_ivor.S:
@rm -f $(obj)fixed_ivor.S @rm -f $(obj)fixed_ivor.S
......
...@@ -29,7 +29,7 @@ PAD_TO := 0xfff01000 ...@@ -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) LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
AFLAGS += -DCONFIG_NAND_SPL AFLAGS += -DCONFIG_NAND_SPL
CFLAGS += -DCONFIG_NAND_SPL CFLAGS += -DCONFIG_NAND_SPL
...@@ -93,7 +93,7 @@ $(obj)ns16550.c: ...@@ -93,7 +93,7 @@ $(obj)ns16550.c:
$(obj)resetvec.S: $(obj)resetvec.S:
@rm -f $(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: $(obj)fixed_ivor.S:
@rm -f $(obj)fixed_ivor.S @rm -f $(obj)fixed_ivor.S
......
...@@ -29,7 +29,7 @@ PAD_TO := 0xfff01000 ...@@ -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) LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
AFLAGS += -DCONFIG_NAND_SPL AFLAGS += -DCONFIG_NAND_SPL
CFLAGS += -DCONFIG_NAND_SPL CFLAGS += -DCONFIG_NAND_SPL
...@@ -93,7 +93,7 @@ $(obj)ns16550.c: ...@@ -93,7 +93,7 @@ $(obj)ns16550.c:
$(obj)resetvec.S: $(obj)resetvec.S:
@rm -f $(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: $(obj)fixed_ivor.S:
@rm -f $(obj)fixed_ivor.S @rm -f $(obj)fixed_ivor.S
......
...@@ -46,7 +46,7 @@ $(onenandobj)u-boot.lds: $(LDSCRIPT) ...@@ -46,7 +46,7 @@ $(onenandobj)u-boot.lds: $(LDSCRIPT)
# from cpu directory # from cpu directory
$(obj)start.S: $(obj)start.S:
@rm -f $@ @rm -f $@
ln -s $(SRCTREE)/cpu/$(CPU)/start.S $@ ln -s $(SRCTREE)/$(CPUDIR)/start.S $@
# from onenand_ipl directory # from onenand_ipl directory
$(obj)onenand_ipl.h: $(obj)onenand_ipl.h:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册