]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - Makefile
ARM: Davinci: added missing registers to hardware.h
[karo-tx-uboot.git] / Makefile
index 86542514f57d8c7f23c04cddf26da8c40913f3f1..571c3eb2d1a82a58d448e3a5dcd689d5f627b507 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -142,9 +142,6 @@ unexport CDPATH
 SUBDIR_TOOLS = tools
 SUBDIR_EXAMPLES = examples/standalone examples/api
 SUBDIRS = $(SUBDIR_TOOLS)
-ifndef CONFIG_SANDBOX
-SUBDIRS += $(SUBDIR_EXAMPLES)
-endif
 
 .PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE)
 
@@ -157,6 +154,10 @@ all:
 sinclude $(obj)include/autoconf.mk.dep
 sinclude $(obj)include/autoconf.mk
 
+ifndef CONFIG_SANDBOX
+SUBDIRS += $(SUBDIR_EXAMPLES)
+endif
+
 # load ARCH, BOARD, and CPU configuration
 include $(obj)include/config.mk
 export ARCH CPU BOARD VENDOR SOC
@@ -229,6 +230,9 @@ endif
 ifeq ($(CPU),ixp)
 LIBS += arch/arm/cpu/ixp/npe/libnpe.o
 endif
+ifeq ($(CONFIG_OF_EMBED),y)
+LIBS += dts/libdts.o
+endif
 LIBS += arch/$(ARCH)/lib/lib$(ARCH).o
 LIBS += fs/cramfs/libcramfs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o \
        fs/reiserfs/libreiserfs.o fs/ext2/libext2fs.o fs/yaffs2/libyaffs2.o \
@@ -286,6 +290,9 @@ LIBS += lib/libfdt/libfdt.o
 LIBS += api/libapi.o
 LIBS += post/libpost.o
 
+ifeq ($(SOC),am33xx)
+LIBS += $(CPUDIR)/omap-common/libomap-common.o
+endif
 ifeq ($(SOC),omap3)
 LIBS += $(CPUDIR)/omap-common/libomap-common.o
 endif
@@ -314,7 +321,7 @@ else
 PLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc
 endif
 else
-PLATFORM_LIBGCC = -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
+PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
 endif
 PLATFORM_LIBS += $(PLATFORM_LIBGCC)
 export PLATFORM_LIBS
@@ -356,9 +363,17 @@ 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
 
 all:           $(ALL-y) $(SUBDIR_EXAMPLES)
 
+$(obj)u-boot.dtb:      $(obj)u-boot
+               $(MAKE) -C dts binary
+               mv $(obj)dts/dt.dtb $@
+
+$(obj)u-boot-dtb.bin:  $(obj)u-boot.bin $(obj)u-boot.dtb
+               cat $^ >$@
+
 $(obj)u-boot.hex:      $(obj)u-boot
                $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
 
@@ -401,9 +416,13 @@ $(obj)u-boot.sha1: $(obj)u-boot.bin
 $(obj)u-boot.dis:      $(obj)u-boot
                $(OBJDUMP) -d $< > $@
 
-$(obj)u-boot.ubl:       $(obj)u-boot-nand.bin
+$(obj)u-boot.ubl:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
+               $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin
+               cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $(obj)u-boot-ubl.bin
                $(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \
-               -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
+               -e $(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin $(obj)u-boot.ubl
+               rm $(obj)u-boot-ubl.bin
+               rm $(obj)spl/u-boot-spl-pad.bin
 
 ifeq ($(CONFIG_SANDBOX),y)
 GEN_UBOOT = \
@@ -518,7 +537,7 @@ $(obj)include/autoconf.mk.dep: $(obj)include/config.h include/common.h
        @$(XECHO) Generating $@ ; \
        set -e ; \
        : Generate the dependancies ; \
-       $(CC) -x c -DDO_DEPS_ONLY -M $(HOSTCFLAGS) $(CPPFLAGS) \
+       $(CC) -x c -DDO_DEPS_ONLY -M $(CFLAGS) $(CPPFLAGS) \
                -MQ $(obj)include/autoconf.mk include/common.h > $@
 
 $(obj)include/autoconf.mk: $(obj)include/config.h
@@ -879,6 +898,7 @@ clobber:    clean
        @rm -f $(obj)u-boot.kwb
        @rm -f $(obj)u-boot.imx
        @rm -f $(obj)u-boot.ubl
+       @rm -f $(obj)u-boot.dtb
        @rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes}
        @rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
        @rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
@@ -886,6 +906,7 @@ clobber:    clean
        @[ ! -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 \
 distclean:     clobber unconfig