imx: mx6sabresd: fix boot hang with video
[oweals/u-boot.git] / Makefile
index c52a33b403239554e29779a213a53424bae86539..059978bfe683ad000b83fc56096f8b71eb8397bf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 VERSION = 2019
-PATCHLEVEL = 04
+PATCHLEVEL = 07
 SUBLEVEL =
-EXTRAVERSION = -rc4
+EXTRAVERSION = -rc2
 NAME =
 
 # *DOCUMENTATION*
@@ -291,6 +291,9 @@ DARWIN_MINOR_VERSION        = $(shell sw_vers -productVersion | cut -f 2 -d '.')
 os_x_before    = $(shell if [ $(DARWIN_MAJOR_VERSION) -le $(1) -a \
        $(DARWIN_MINOR_VERSION) -le $(2) ] ; then echo "$(3)"; else echo "$(4)"; fi ;)
 
+os_x_after = $(shell if [ $(DARWIN_MAJOR_VERSION) -ge $(1) -a \
+       $(DARWIN_MINOR_VERSION) -ge $(2) ] ; then echo "$(3)"; else echo "$(4)"; fi ;)  
+
 # Snow Leopards build environment has no longer restrictions as described above
 HOSTCC       = $(call os_x_before, 10, 5, "cc", "gcc")
 HOSTCFLAGS  += $(call os_x_before, 10, 4, "-traditional-cpp")
@@ -300,6 +303,10 @@ HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress")
 # in some host tools which is a problem then ... so disable ASLR for these
 # tools
 HOSTLDFLAGS += $(call os_x_before, 10, 7, "", "-Xlinker -no_pie")
+
+# macOS Mojave (10.14.X) 
+# Undefined symbols for architecture x86_64: "_PyArg_ParseTuple"
+HOSTLDFLAGS += $(call os_x_after, 10, 14, "-lpython -dynamclib", "")
 endif
 
 # Decide whether to build built-in, modular, or both.
@@ -706,7 +713,7 @@ libs-y += drivers/spi/
 libs-$(CONFIG_FMAN_ENET) += drivers/net/fm/
 libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
 libs-$(CONFIG_SYS_FSL_MMDC) += drivers/ddr/fsl/
-libs-$(CONFIG_ALTERA_SDRAM) += drivers/ddr/altera/
+libs-$(CONFIG_$(SPL_)ALTERA_SDRAM) += drivers/ddr/altera/
 libs-y += drivers/serial/
 libs-y += drivers/usb/dwc3/
 libs-y += drivers/usb/common/
@@ -893,7 +900,7 @@ cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
        >$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
 
 quiet_cmd_mkfitimage = MKIMAGE $@
-cmd_mkfitimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -f $(U_BOOT_ITS) -E -p $(CONFIG_FIT_EXTERNAL_OFFSET) $@\
+cmd_mkfitimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -f $(U_BOOT_ITS) -p $(CONFIG_FIT_EXTERNAL_OFFSET) $@\
        >$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
 
 quiet_cmd_cat = CAT     $@
@@ -938,11 +945,22 @@ ifneq ($(CONFIG_DM_USB)$(CONFIG_OF_CONTROL)$(CONFIG_BLK),yyy)
        @echo >&2 "===================================================="
 endif
 endif
-ifeq ($(CONFIG_LIBATA)$(CONFIG_MVSATA_IDE),y)
-ifneq ($(CONFIG_DM_SCSI),y)
+ifeq ($(CONFIG_MVSATA_IDE),y)
+       @echo >&2 "===================== WARNING ======================"
+       @echo >&2 "This board does use CONFIG_MVSATA_IDE which is not"
+       @echo >&2 "ported to driver-model (DM) yet. Please update the storage"
+       @echo >&2 "controller driver to use CONFIG_AHCI before the v2019.07"
+       @echo >&2 "release."
+       @echo >&2 "Failure to update by the deadline may result in board removal."
+       @echo >&2 "See doc/driver-model/MIGRATION.txt for more info."
+       @echo >&2 "===================================================="
+endif
+ifeq ($(CONFIG_LIBATA),y)
+ifneq ($(CONFIG_AHCI),y)
        @echo >&2 "===================== WARNING ======================"
-       @echo >&2 "This board does not use CONFIG_DM_SCSI. Please update"
-       @echo >&2 "the storage controller to use CONFIG_DM_SCSI before the v2019.07 release."
+       @echo >&2 "This board does use CONFIG_LIBATA but has CONFIG_AHCI not"
+       @echo >&2 "enabled. Please update the storage controller driver to use"
+       @echo >&2 "CONFIG_AHCI before the v2019.07 release."
        @echo >&2 "Failure to update by the deadline may result in board removal."
        @echo >&2 "See doc/driver-model/MIGRATION.txt for more info."
        @echo >&2 "===================================================="
@@ -996,6 +1014,17 @@ ifneq ($(CONFIG_DM_SPI_FLASH)$(CONFIG_OF_CONTROL),yy)
        @echo >&2 "See doc/driver-model/MIGRATION.txt for more info."
        @echo >&2 "===================================================="
 endif
+endif
+ifneq ($(CONFIG_WATCHDOG)$(CONFIG_HW_WATCHDOG),)
+ifneq ($(CONFIG_WDT),y)
+       @echo >&2 "===================== WARNING ======================"
+       @echo >&2 "This board does not use CONFIG_WDT (DM watchdog support)."
+       @echo >&2 "Please update the board to use CONFIG_WDT before the"
+       @echo >&2 "v2019.10 release."
+       @echo >&2 "Failure to update by the deadline may result in board removal."
+       @echo >&2 "See doc/driver-model/MIGRATION.txt for more info."
+       @echo >&2 "===================================================="
+endif
 endif
        @# Check that this build does not use CONFIG options that we do not
        @# know about unless they are in Kconfig. All the existing CONFIG
@@ -1013,15 +1042,38 @@ quiet_cmd_copy = COPY    $@
 
 ifeq ($(CONFIG_MULTI_DTB_FIT),y)
 
+ifeq ($(CONFIG_MULTI_DTB_FIT_LZO),y)
+FINAL_DTB_CONTAINER = fit-dtb.blob.lzo
+else ifeq ($(CONFIG_MULTI_DTB_FIT_GZIP),y)
+FINAL_DTB_CONTAINER = fit-dtb.blob.gz
+else
+FINAL_DTB_CONTAINER = fit-dtb.blob
+endif
+
+fit-dtb.blob.gz: fit-dtb.blob
+       @gzip -kf9 $< > $@
+
+fit-dtb.blob.lzo: fit-dtb.blob
+       @lzop -f9 $< > $@
+
 fit-dtb.blob: dts/dt.dtb FORCE
        $(call if_changed,mkimage)
+ifneq ($(SOURCE_DATE_EPOCH),)
+       touch -d @$(SOURCE_DATE_EPOCH) fit-dtb.blob
+       chmod 0600 fit-dtb.blob
+endif
 
 MKIMAGEFLAGS_fit-dtb.blob = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
        -a 0 -e 0 -E \
        $(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) -d /dev/null
 
-u-boot-fit-dtb.bin: u-boot-nodtb.bin fit-dtb.blob
+ifneq ($(EXT_DTB),)
+u-boot-fit-dtb.bin: u-boot-nodtb.bin $(EXT_DTB)
+               $(call if_changed,cat)
+else
+u-boot-fit-dtb.bin: u-boot-nodtb.bin $(FINAL_DTB_CONTAINER)
        $(call if_changed,cat)
+endif
 
 u-boot.bin: u-boot-fit-dtb.bin FORCE
        $(call if_changed,copy)
@@ -1200,6 +1252,12 @@ u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl u-boot-ivt.img: \
        $(call if_changed,mkimage)
        $(BOARD_SIZE_CHECK)
 
+ifeq ($(CONFIG_SPL_LOAD_FIT_FULL),y)
+MKIMAGEFLAGS_u-boot.itb =
+else
+MKIMAGEFLAGS_u-boot.itb = -E
+endif
+
 u-boot.itb: u-boot-nodtb.bin dts/dt.dtb $(U_BOOT_ITS) FORCE
        $(call if_changed,mkfitimage)
        $(BOARD_SIZE_CHECK)
@@ -1219,9 +1277,11 @@ else
 SPL_PAYLOAD := u-boot.bin
 endif
 
+SPL_IMAGE := $(CONFIG_SPL_IMAGE:"%"=%)
+
 OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \
                                   --pad-to=$(CONFIG_SPL_PAD_TO)
-u-boot-with-spl.bin: spl/u-boot-spl.bin $(SPL_PAYLOAD) FORCE
+u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
        $(call if_changed,pad_cat)
 
 ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
@@ -1335,6 +1395,7 @@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \
 
 u-boot.rom: u-boot-x86-16bit.bin u-boot.bin \
                $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \
+               $(if $(CONFIG_TPL_X86_16BIT_INIT),tpl/u-boot-tpl.bin) \
                $(if $(CONFIG_HAVE_REFCODE),refcode.bin) FORCE
        $(call if_changed,binman)
 
@@ -1734,7 +1795,7 @@ CLEAN_DIRS  += $(MODVERDIR) \
                        $(filter-out include, $(shell ls -1 $d 2>/dev/null))))
 
 CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h \
-              boot* u-boot* MLO* SPL System.map fit-dtb.blob
+              boot* u-boot* MLO* SPL System.map fit-dtb.blob*
 
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl \
@@ -1932,6 +1993,13 @@ endif
        $(build)=$(build-dir) $(@:.ko=.o)
        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
 
+quiet_cmd_genenv = GENENV $@
+cmd_genenv = $(OBJCOPY) --dump-section .rodata.default_environment=$@ env/common.o; \
+       sed --in-place -e 's/\x00/\x0A/g' $@
+
+u-boot-initial-env: u-boot.bin
+       $(call if_changed,genenv)
+
 # Consistency checks
 # ---------------------------------------------------------------------------