Merge tag 'u-boot-amlogic-20210308' of https://gitlab.denx.de/u-boot/custodians/u...
[platform/kernel/u-boot.git] / Makefile
index 89c42c1..d6eda45 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 VERSION = 2021
-PATCHLEVEL = 01
+PATCHLEVEL = 04
 SUBLEVEL =
-EXTRAVERSION = -rc1
+EXTRAVERSION = -rc3
 NAME =
 
 # *DOCUMENTATION*
@@ -792,6 +792,7 @@ libs-y += drivers/usb/dwc3/
 libs-y += drivers/usb/common/
 libs-y += drivers/usb/emul/
 libs-y += drivers/usb/eth/
+libs-$(CONFIG_USB_DEVICE) += drivers/usb/gadget/
 libs-$(CONFIG_USB_GADGET) += drivers/usb/gadget/
 libs-$(CONFIG_USB_GADGET) += drivers/usb/gadget/udc/
 libs-y += drivers/usb/host/
@@ -885,7 +886,7 @@ cmd_static_rela = \
        tools/relocate-rela $(3) $(4) $$start $$end
 else
 quiet_cmd_static_rela =
-cmd_static_rela = true
+cmd_static_rela =
 endif
 
 # Always append INPUTS so that arch config.mk's can add custom ones
@@ -1005,7 +1006,7 @@ cmd_cat = cat $(filter-out $(PHONY), $^) > $@
 append = cat $(filter-out $< $(PHONY), $^) >> $@
 
 quiet_cmd_pad_cat = CAT     $@
-cmd_pad_cat = $(cmd_objcopy) && $(append) || rm -f $@
+cmd_pad_cat = $(cmd_objcopy) && $(append) || { rm -f $@; false; }
 
 quiet_cmd_lzma = LZMA    $@
 cmd_lzma = lzma -c -z -k -9 $< > $@
@@ -1263,11 +1264,6 @@ OBJCOPYFLAGS_u-boot-nodtb.bin := -O binary \
                $(if $(CONFIG_X86_16BIT_INIT),-R .start16 -R .resetvec) \
                $(if $(CONFIG_MPC85XX_HAVE_RESET_VECTOR),-R .bootpg -R .resetvec)
 
-OBJCOPYFLAGS_u-boot-spl.hex = $(OBJCOPYFLAGS_u-boot.hex)
-
-spl/u-boot-spl.hex: spl/u-boot-spl FORCE
-       $(call if_changed,objcopy)
-
 binary_size_check: u-boot-nodtb.bin FORCE
        @file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \
        map_size=$(shell cat u-boot.map | \
@@ -1309,10 +1305,14 @@ init_sp_bss_offset_check: u-boot.dtb FORCE
        fi
 endif
 
-shell_cmd = { $(echo-cmd) $(cmd_$(1)); }
+shell_cmd = { $(call echo-cmd,$(1)) $(cmd_$(1)); }
 
 quiet_cmd_objcopy_uboot = OBJCOPY $@
-cmd_objcopy_uboot = $(cmd_objcopy) && $(call shell_cmd,static_rela,$<,$@,$(CONFIG_SYS_TEXT_BASE)) || rm -f $@
+ifdef cmd_static_rela
+cmd_objcopy_uboot = $(cmd_objcopy) && $(call shell_cmd,static_rela,$<,$@,$(CONFIG_SYS_TEXT_BASE)) || { rm -f $@; false; }
+else
+cmd_objcopy_uboot = $(cmd_objcopy)
+endif
 
 u-boot-nodtb.bin: u-boot FORCE
        $(call if_changed,objcopy_uboot)
@@ -1382,6 +1382,7 @@ MKIMAGEFLAGS_u-boot.img = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
        -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
        -p $(CONFIG_FIT_EXTERNAL_OFFSET) \
        -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" -E \
+       $(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(DEVICE_TREE))) \
        $(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) \
        $(patsubst %,-b arch/$(ARCH)/dts/%.dtbo,$(subst ",,$(CONFIG_OF_OVERLAY_LIST)))
 else
@@ -1542,7 +1543,10 @@ flash.bin: spl/u-boot-spl.bin u-boot.itb FORCE
 endif
 endif
 
-u-boot-with-spl.imx u-boot-with-nand-spl.imx: SPL u-boot.bin FORCE
+u-boot.uim: u-boot.bin FORCE
+       $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
+
+u-boot-with-spl.imx u-boot-with-nand-spl.imx: SPL $(if $(CONFIG_OF_SEPARATE),u-boot.img,u-boot.uim) FORCE
        $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
 
 MKIMAGEFLAGS_u-boot.ubl = -n $(UBL_CONFIG) -T ublimage -e $(CONFIG_SYS_TEXT_BASE)
@@ -1583,13 +1587,16 @@ u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE
 
 ifneq ($(CONFIG_ARCH_SOCFPGA),)
 quiet_cmd_gensplx4 = GENSPLX4 $@
-cmd_gensplx4 = cat     spl/u-boot-spl.sfp spl/u-boot-spl.sfp   \
-                       spl/u-boot-spl.sfp spl/u-boot-spl.sfp > $@ || rm -f $@
+cmd_gensplx4 = $(OBJCOPY) -I binary -O binary --gap-fill=0x0           \
+                       --pad-to=$(CONFIG_SPL_PAD_TO)                   \
+                       spl/u-boot-spl.sfp spl/u-boot-spl.sfp &&        \
+               cat     spl/u-boot-spl.sfp spl/u-boot-spl.sfp           \
+                       spl/u-boot-spl.sfp spl/u-boot-spl.sfp > $@ || { rm -f $@; false; }
 spl/u-boot-splx4.sfp: spl/u-boot-spl.sfp FORCE
        $(call if_changed,gensplx4)
 
 quiet_cmd_socboot = SOCBOOT $@
-cmd_socboot = cat      spl/u-boot-splx4.sfp u-boot.img > $@ || rm -f $@
+cmd_socboot = cat      spl/u-boot-splx4.sfp u-boot.img > $@ || { rm -f $@; false; }
 u-boot-with-spl.sfp: spl/u-boot-splx4.sfp u-boot.img FORCE
        $(call if_changed,socboot)
 
@@ -1599,12 +1606,12 @@ cmd_gensplpadx4 =  dd if=/dev/zero of=spl/u-boot-spl.pad bs=64 count=1024 ; \
                        spl/u-boot-spl.sfp spl/u-boot-spl.pad \
                        spl/u-boot-spl.sfp spl/u-boot-spl.pad \
                        spl/u-boot-spl.sfp spl/u-boot-spl.pad > $@ || \
-                       rm -f $@ spl/u-boot-spl.pad
+                       { rm -f $@ spl/u-boot-spl.pad; false; }
 u-boot-spl-padx4.sfp: spl/u-boot-spl.sfp FORCE
        $(call if_changed,gensplpadx4)
 
 quiet_cmd_socnandboot = SOCNANDBOOT $@
-cmd_socnandboot = cat  u-boot-spl-padx4.sfp u-boot.img > $@ || rm -f $@
+cmd_socnandboot = cat  u-boot-spl-padx4.sfp u-boot.img > $@ || { rm -f $@; false; }
 u-boot-with-nand-spl.sfp: u-boot-spl-padx4.sfp u-boot.img FORCE
        $(call if_changed,socnandboot)
 
@@ -1846,9 +1853,13 @@ prepare: prepare0
 # Generate some files
 # ---------------------------------------------------------------------------
 
+# Use sed to remove leading zeros from PATCHLEVEL to avoid using octal numbers
 define filechk_version.h
        (echo \#define PLAIN_VERSION \"$(UBOOTRELEASE)\"; \
        echo \#define U_BOOT_VERSION \"U-Boot \" PLAIN_VERSION; \
+       echo \#define U_BOOT_VERSION_NUM $(VERSION); \
+       echo \#define U_BOOT_VERSION_NUM_PATCH $$(echo $(PATCHLEVEL) | \
+               sed -e "s/^0*//"); \
        echo \#define CC_VERSION_STRING \"$$(LC_ALL=C $(CC) --version | head -n 1)\"; \
        echo \#define LD_VERSION_STRING \"$$(LC_ALL=C $(LD) --version | head -n 1)\"; )
 endef
@@ -1924,6 +1935,12 @@ spl/u-boot-spl.bin: spl/u-boot-spl
        @:
        $(SPL_SIZE_CHECK)
 
+spl/u-boot-spl-dtb.bin: spl/u-boot-spl
+       @:
+
+spl/u-boot-spl-dtb.hex: spl/u-boot-spl
+       @:
+
 spl/u-boot-spl: tools prepare \
                $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SPL_OF_PLATDATA),dts/dt.dtb) \
                $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_TPL_OF_PLATDATA),dts/dt.dtb)