]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/glsdk-u-boot.git/blobdiff - Makefile
sandbox: Add basic test for command execution
[glsdk/glsdk-u-boot.git] / Makefile
index 2629682be3362fde50a2b65e14349e9455c103b0..20fa27220ac9b855d81078aa05f330e5514c1dc2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2011
+# (C) Copyright 2000-2012
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 # MA 02111-1307 USA
 #
 
-VERSION = 2011
-PATCHLEVEL = 12
+VERSION = 2012
+PATCHLEVEL = 07
 SUBLEVEL =
-EXTRAVERSION = -rc3
+EXTRAVERSION =
 ifneq "$(SUBLEVEL)" ""
 U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 else
@@ -174,6 +174,8 @@ include $(TOPDIR)/config.mk
 # that (or fail if absent).  Otherwise, search for a linker script in a
 # standard location.
 
+LDSCRIPT_MAKEFILE_DIR = $(dir $(LDSCRIPT))
+
 ifndef LDSCRIPT
        #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
        ifdef CONFIG_SYS_LDSCRIPT
@@ -182,6 +184,7 @@ ifndef LDSCRIPT
        endif
 endif
 
+# If there is no specified link script, we look in a number of places for it
 ifndef LDSCRIPT
        ifeq ($(CONFIG_NAND_U_BOOT),y)
                LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
@@ -195,6 +198,11 @@ ifndef LDSCRIPT
        ifeq ($(wildcard $(LDSCRIPT)),)
                LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot.lds
        endif
+       ifeq ($(wildcard $(LDSCRIPT)),)
+               LDSCRIPT := $(TOPDIR)/arch/$(ARCH)/cpu/u-boot.lds
+               # We don't expect a Makefile here
+               LDSCRIPT_MAKEFILE_DIR =
+       endif
        ifeq ($(wildcard $(LDSCRIPT)),)
 $(error could not find linker script)
        endif
@@ -221,6 +229,9 @@ LIBS  = lib/libgeneric.o
 LIBS += lib/lzma/liblzma.o
 LIBS += lib/lzo/liblzo.o
 LIBS += lib/zlib/libz.o
+ifeq ($(CONFIG_TIZEN),y)
+LIBS += lib/tizen/libtizen.o
+endif
 LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
        "board/$(VENDOR)/common/lib$(VENDOR).o"; fi)
 LIBS += $(CPUDIR)/lib$(CPU).o
@@ -293,8 +304,9 @@ LIBS += common/libcommon.o
 LIBS += lib/libfdt/libfdt.o
 LIBS += api/libapi.o
 LIBS += post/libpost.o
+LIBS += test/libtest.o
 
-ifneq ($(CONFIG_AM335X)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),)
+ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),)
 LIBS += $(CPUDIR)/omap-common/libomap-common.o
 endif
 
@@ -336,6 +348,7 @@ export PLATFORM_LIBS
 # on the fly.
 LDPPFLAGS += \
        -include $(TOPDIR)/include/u-boot/u-boot.lds.h \
+       -DCPUDIR=$(CPUDIR) \
        $(shell $(LD) --version | \
          sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
 
@@ -366,7 +379,6 @@ ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
 ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
 ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
-ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
 ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
 ALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin
 
@@ -429,10 +441,38 @@ $(obj)u-boot.ubl:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
                rm $(obj)u-boot-ubl.bin
                rm $(obj)spl/u-boot-spl-pad.bin
 
+$(obj)u-boot.ais:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
+               $(obj)tools/mkimage -s -n /dev/null -T aisimage \
+                       -e $(CONFIG_SPL_TEXT_BASE) \
+                       -d $(obj)spl/u-boot-spl.bin \
+                       $(obj)spl/u-boot-spl.ais
+               $(OBJCOPY) ${OBJCFLAGS} -I binary \
+                       --pad-to=$(CONFIG_SPL_MAX_SIZE) -O binary \
+                       $(obj)spl/u-boot-spl.ais $(obj)spl/u-boot-spl-pad.ais
+               cat $(obj)spl/u-boot-spl-pad.ais $(obj)u-boot.bin > \
+                       $(obj)u-boot.ais
+               rm $(obj)spl/u-boot-spl{,-pad}.ais
+
 $(obj)u-boot.sb:       $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin
                elftosb -zdf imx28 -c $(TOPDIR)/board/$(BOARDDIR)/u-boot.bd \
                        -o $(obj)u-boot.sb
 
+# On x600 (SPEAr600) U-Boot is appended to U-Boot SPL.
+# Both images are created using mkimage (crc etc), so that the ROM
+# bootloader can check its integrity. Padding needs to be done to the
+# SPL image (with mkimage header) and not the binary. Otherwise the resulting image
+# which is loaded/copied by the ROM bootloader to SRAM doesn't fit.
+# The resulting image containing both U-Boot images is called u-boot.spr
+$(obj)u-boot.spr:      $(obj)u-boot.img $(obj)spl/u-boot-spl.bin
+               $(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
+               -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n XLOADER \
+               -d $(obj)spl/u-boot-spl.bin $(obj)spl/u-boot-spl.img
+               tr "\000" "\377" < /dev/zero | dd ibs=1 count=$(CONFIG_SPL_PAD_TO) \
+                       of=$(obj)spl/u-boot-spl-pad.img 2>/dev/null
+               dd if=$(obj)spl/u-boot-spl.img of=$(obj)spl/u-boot-spl-pad.img \
+                       conv=notrunc 2>/dev/null
+               cat $(obj)spl/u-boot-spl-pad.img $(obj)u-boot.img > $@
+
 ifeq ($(CONFIG_SANDBOX),y)
 GEN_UBOOT = \
                cd $(LNDIR) && $(CC) $(SYMS) -T $(obj)u-boot.lds \
@@ -490,11 +530,6 @@ onenand_ipl:       $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
 $(obj)u-boot-onenand.bin:      onenand_ipl $(obj)u-boot.bin
                cat $(ONENAND_BIN) $(obj)u-boot.bin > $(obj)u-boot-onenand.bin
 
-mmc_spl:       $(TIMESTAMP_FILE) $(VERSION_FILE) depend
-               $(MAKE) -C mmc_spl/board/$(BOARDDIR) all
-
-$(obj)mmc_spl/u-boot-mmc-spl.bin:      mmc_spl
-
 $(obj)spl/u-boot-spl.bin:      $(SUBDIR_TOOLS) depend
                $(MAKE) -C spl all
 
@@ -507,7 +542,7 @@ depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) \
                $(obj)include/autoconf.mk \
                $(obj)include/generated/generic-asm-offsets.h \
                $(obj)include/generated/asm-offsets.h
-               for dir in $(SUBDIRS) $(CPUDIR) $(dir $(LDSCRIPT)) ; do \
+               for dir in $(SUBDIRS) $(CPUDIR) $(LDSCRIPT_MAKEFILE_DIR) ; do \
                        $(MAKE) -C $$dir _depend ; done
 
 TAG_SUBDIRS = $(SUBDIRS)
@@ -517,6 +552,11 @@ TAG_SUBDIRS += include
 FIND := find
 FINDFLAGS := -L
 
+checkstack:
+               $(CROSS_COMPILE)objdump -d $(obj)u-boot \
+                       `$(FIND) $(obj) -name u-boot-spl -print` | \
+                       perl $(src)tools/checkstack.pl $(ARCH)
+
 tags ctags:
                ctags -w -o $(obj)ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
                                                -name '*.[chS]' -print`
@@ -536,6 +576,13 @@ SYSTEM_MAP = \
 $(obj)System.map:      $(obj)u-boot
                @$(call SYSTEM_MAP,$<) > $(obj)System.map
 
+checkthumb:
+       @if test $(call cc-version) -lt 0404; then \
+               echo -n '*** Your GCC does not produce working '; \
+               echo 'binaries in THUMB mode.'; \
+               echo '*** Your board is configured for THUMB mode.'; \
+               false; \
+       fi
 #
 # Auto-generate the autoconf.mk file (which is included by all makefiles)
 #
@@ -571,7 +618,7 @@ $(obj)lib/asm-offsets.s:    $(obj)include/autoconf.mk.dep \
 
 $(obj)include/generated/asm-offsets.h: $(obj)include/autoconf.mk.dep \
        $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s
-       @echo Generating $@
+       @$(XECHO) Generating $@
        tools/scripts/make-asm-offsets $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s $@
 
 $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s:  $(obj)include/autoconf.mk.dep
@@ -655,14 +702,6 @@ ucname     = $(shell echo $(1) | sed -e 's/\(.*\)_config/\U\1/')
 # ARM
 #========================================================================
 
-spear300_config \
-spear310_config \
-spear320_config :      unconfig
-       @$(MKCONFIG) -n $@ -t $@ spear3xx arm arm926ejs $(@:_config=) spear spear
-
-spear600_config :      unconfig
-       @$(MKCONFIG) -n $@ -t $@ spear6xx arm arm926ejs $(@:_config=) spear spear
-
 SX1_stdout_serial_config \
 SX1_config:            unconfig
        @mkdir -p $(obj)include
@@ -673,18 +712,6 @@ SX1_config:                unconfig
        fi;
        @$(MKCONFIG) -n $@ SX1 arm arm925t sx1
 
-#########################################################################
-## XScale Systems
-#########################################################################
-
-pdnb3_config \
-scpu_config:   unconfig
-       @mkdir -p $(obj)include
-       @if [ "$(findstring scpu_,$@)" ] ; then \
-               echo "#define CONFIG_SCPU"      >>$(obj)include/config.h ; \
-       fi
-       @$(MKCONFIG) -n $@ -a pdnb3 arm ixp pdnb3 prodrive
-
 #########################################################################
 ## ARM1176 Systems
 #########################################################################
@@ -723,6 +750,7 @@ clean:
               $(obj)tools/gdb/{astest,gdbcont,gdbsend}                   \
               $(obj)tools/gen_eth_addr    $(obj)tools/img2srec           \
               $(obj)tools/mk{env,}image   $(obj)tools/mpc86x_clk         \
+              $(obj)tools/mk{smdk5250,}spl                               \
               $(obj)tools/ncb             $(obj)tools/ubsha1
        @rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image}        \
               $(obj)board/matrix_vision/*/bootscript.img                 \
@@ -737,14 +765,13 @@ clean:
        @rm -f $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s
        @rm -f $(obj)nand_spl/{u-boot.lds,u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map,System.map}
        @rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
-       @rm -f $(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
        @rm -f $(ONENAND_BIN)
        @rm -f $(obj)onenand_ipl/u-boot.lds
        @rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.lds,u-boot-spl.map}
        @rm -f $(obj)MLO
        @rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
        @find $(OBJTREE) -type f \
-               \( -name 'core' -o -name '*.bak' -o -name '*~' \
+               \( -name 'core' -o -name '*.bak' -o -name '*~' -o -name '*.su' \
                -o -name '*.o'  -o -name '*.a' -o -name '*.exe' \) -print \
                | xargs rm -f
 
@@ -762,16 +789,17 @@ clobber:  tidy
        @rm -f $(obj)u-boot.kwb
        @rm -f $(obj)u-boot.imx
        @rm -f $(obj)u-boot.ubl
+       @rm -f $(obj)u-boot.ais
        @rm -f $(obj)u-boot.dtb
        @rm -f $(obj)u-boot.sb
-       @rm -f $(obj)tools/inca-swap-bytes
+       @rm -f $(obj)u-boot.spr
+       @rm -f $(obj)tools/xway-swap-bytes
        @rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
        @rm -f $(obj)arch/powerpc/cpu/mpc83xx/ddr-gen?.c
        @rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
        @rm -fr $(obj)include/generated
        @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f
        @[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name "*" -type l -print | xargs rm -f
-       @[ ! -d $(obj)mmc_spl ] || find $(obj)mmc_spl -name "*" -type l -print | xargs rm -f
        @rm -f $(obj)dts/*.tmp
 
 mrproper \