ARM: dts: imx8mm-verdin: drop rgmii_rxc_dly/txc_dly
[oweals/u-boot.git] / Makefile
index 3000d30be23c708de27d6bab1eb7f0b4a9582bd8..55aa90cf17fa111e7c9adcf7dbf5ec75afeaa5bd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 VERSION = 2020
-PATCHLEVEL = 01
+PATCHLEVEL = 04
 SUBLEVEL =
-EXTRAVERSION = -rc1
+EXTRAVERSION = -rc3
 NAME =
 
 # *DOCUMENTATION*
@@ -17,6 +17,25 @@ NAME =
 # o Look for make include files relative to root of kernel src
 MAKEFLAGS += -rR --include-dir=$(CURDIR)
 
+# Determine host architecture
+include include/host_arch.h
+MK_ARCH="${shell uname -m}"
+unexport HOST_ARCH
+ifeq ("x86_64", $(MK_ARCH))
+  export HOST_ARCH=$(HOST_ARCH_X86_64)
+else ifneq (,$(findstring $(MK_ARCH), "i386" "i486" "i586" "i686"))
+  export HOST_ARCH=$(HOST_ARCH_X86)
+else ifneq (,$(findstring $(MK_ARCH), "aarch64" "armv8l"))
+  export HOST_ARCH=$(HOST_ARCH_AARCH64)
+else ifeq ("armv7l", $(MK_ARCH))
+  export HOST_ARCH=$(HOST_ARCH_ARM)
+else ifeq ("riscv32", $(MK_ARCH))
+  export HOST_ARCH=$(HOST_ARCH_RISCV32)
+else ifeq ("riscv64", $(MK_ARCH))
+  export HOST_ARCH=$(HOST_ARCH_RISCV64)
+endif
+undefine MK_ARCH
+
 # Avoid funny character set dependencies
 unexport LC_ALL
 LC_COLLATE=C
@@ -653,11 +672,12 @@ endif
 endif
 
 KBUILD_CFLAGS += $(call cc-option,-Wno-format-nonliteral)
+KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
+
 ifeq ($(cc-name),clang)
 KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
 KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
 KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
-KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
 KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
 endif
 
@@ -712,11 +732,6 @@ libs-y += drivers/
 libs-y += drivers/dma/
 libs-y += drivers/gpio/
 libs-y += drivers/i2c/
-libs-y += drivers/mtd/
-libs-$(CONFIG_CMD_NAND) += drivers/mtd/nand/raw/
-libs-y += drivers/mtd/onenand/
-libs-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/
-libs-y += drivers/mtd/spi/
 libs-y += drivers/net/
 libs-y += drivers/net/phy/
 libs-y += drivers/power/ \
@@ -732,6 +747,7 @@ libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
 libs-$(CONFIG_SYS_FSL_MMDC) += drivers/ddr/fsl/
 libs-$(CONFIG_$(SPL_)ALTERA_SDRAM) += drivers/ddr/altera/
 libs-y += drivers/serial/
+libs-y += drivers/usb/cdns3/
 libs-y += drivers/usb/dwc3/
 libs-y += drivers/usb/common/
 libs-y += drivers/usb/emul/
@@ -747,9 +763,12 @@ libs-y += cmd/
 libs-y += common/
 libs-y += env/
 libs-$(CONFIG_API) += api/
-libs-$(CONFIG_HAS_POST) += post/
+ifdef CONFIG_POST
+libs-y += post/
+endif
 libs-$(CONFIG_UNIT_TEST) += test/ test/dm/
 libs-$(CONFIG_UT_ENV) += test/env/
+libs-$(CONFIG_UT_OPTEE) += test/optee/
 libs-$(CONFIG_UT_OVERLAY) += test/overlay/
 
 libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/)
@@ -892,8 +911,8 @@ ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy)
 ALL-y += u-boot-with-dtb.bin
 endif
 
-ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL)$(CONFIG_TPL),yyy)
-ALL-y += idbloader.img
+ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy)
+ALL-y += u-boot-rockchip.bin
 endif
 
 LDFLAGS_u-boot += $(LDFLAGS_FINAL)
@@ -964,7 +983,7 @@ ifneq ($(CONFIG_DM_MMC)$(CONFIG_OF_CONTROL)$(CONFIG_BLK),yyy)
        @echo >&2 "This board does not use CONFIG_DM_MMC. Please update"
        @echo >&2 "the board to use CONFIG_DM_MMC before the v2019.04 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 "See doc/driver-model/migration.rst for more info."
        @echo >&2 "===================================================="
 endif
 endif
@@ -974,7 +993,7 @@ ifneq ($(CONFIG_DM_USB)$(CONFIG_OF_CONTROL)$(CONFIG_BLK),yyy)
        @echo >&2 "This board does not use CONFIG_DM_USB. Please update"
        @echo >&2 "the board to use CONFIG_DM_USB 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 "See doc/driver-model/migration.rst for more info."
        @echo >&2 "===================================================="
 endif
 endif
@@ -985,7 +1004,7 @@ ifeq ($(CONFIG_MVSATA_IDE),y)
        @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 "See doc/driver-model/migration.rst for more info."
        @echo >&2 "===================================================="
 endif
 ifeq ($(CONFIG_LIBATA),y)
@@ -995,7 +1014,7 @@ ifneq ($(CONFIG_AHCI),y)
        @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 "See doc/driver-model/migration.rst for more info."
        @echo >&2 "===================================================="
 endif
 endif
@@ -1005,7 +1024,7 @@ ifneq ($(CONFIG_DM_PCI),y)
        @echo >&2 "This board does not use CONFIG_DM_PCI Please update"
        @echo >&2 "the board to use CONFIG_DM_PCI 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 "See doc/driver-model/migration.rst for more info."
        @echo >&2 "===================================================="
 endif
 endif
@@ -1015,7 +1034,7 @@ ifneq ($(CONFIG_DM_VIDEO),y)
        @echo >&2 "This board does not use CONFIG_DM_VIDEO Please update"
        @echo >&2 "the board to use CONFIG_DM_VIDEO 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 "See doc/driver-model/migration.rst for more info."
        @echo >&2 "===================================================="
 endif
 endif
@@ -1033,7 +1052,7 @@ ifneq ($(CONFIG_DM_SPI_FLASH)$(CONFIG_OF_CONTROL),yy)
        @echo >&2 "This board does not use CONFIG_DM_SPI_FLASH. Please update"
        @echo >&2 "the board to use CONFIG_SPI_FLASH 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 "See doc/driver-model/migration.rst for more info."
        @echo >&2 "===================================================="
 endif
 endif
@@ -1044,7 +1063,7 @@ ifneq ($(CONFIG_WDT),y)
        @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 "See doc/driver-model/migration.rst for more info."
        @echo >&2 "===================================================="
 endif
 endif
@@ -1125,7 +1144,15 @@ u-boot.bin: u-boot-nodtb.bin FORCE
        $(call if_changed,copy)
 endif
 
-%.imx: %.bin
+# we call Makefile in arch/arm/mach-imx which
+# has targets which are dependent on targets defined
+# here. make could not resolve them and we must ensure
+# that they are finished before calling imx targets
+ifeq ($(CONFIG_MULTI_DTB_FIT),y)
+IMX_DEPS = u-boot-fit-dtb.bin
+endif
+
+%.imx: $(IMX_DEPS) %.bin
        $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
        $(BOARD_SIZE_CHECK)
 
@@ -1241,7 +1268,7 @@ u-boot.ldr.hex u-boot.ldr.srec: u-boot.ldr FORCE
 # from the SPL U-Boot version.
 #
 ifndef CONFIG_SYS_UBOOT_START
-CONFIG_SYS_UBOOT_START := 0
+CONFIG_SYS_UBOOT_START := $(CONFIG_SYS_TEXT_BASE)
 endif
 
 # Boards with more complex image requirements can provide an .its source file
@@ -1268,7 +1295,8 @@ 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 ",,$(CONFIG_OF_LIST)))
+       $(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) \
+       $(patsubst %,-b arch/$(ARCH)/dts/%.dtbo,$(subst ",,$(CONFIG_OF_OVERLAY_LIST)))
 else
 MKIMAGEFLAGS_u-boot.img = -A $(ARCH) -T firmware -C none -O u-boot \
        -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
@@ -1277,7 +1305,6 @@ MKIMAGEFLAGS_u-boot-ivt.img = -A $(ARCH) -T firmware_ivt -C none -O u-boot \
        -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
        -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
 u-boot-ivt.img: MKIMAGEOUTPUT = u-boot-ivt.img.log
-CLEAN_FILES += u-boot-ivt.img.log u-boot-dtb.imx.log SPL.log u-boot.imx.log
 endif
 
 MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img)
@@ -1351,13 +1378,39 @@ u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
        $(call if_changed,pad_cat)
 
 ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
-MKIMAGEFLAGS_u-boot-tpl.img = -n $(CONFIG_SYS_SOC) -T rksd
-tpl/u-boot-tpl.img: tpl/u-boot-tpl.bin FORCE
+
+# rockchip image type
+ifeq ($(CONFIG_SPL_SPI_LOAD),y)
+ROCKCHIP_IMG_TYPE := rkspi
+else
+ROCKCHIP_IMG_TYPE := rksd
+endif
+
+# TPL + SPL
+ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy)
+MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
+tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
        $(call if_changed,mkimage)
-idbloader.img: tpl/u-boot-tpl.img spl/u-boot-spl.bin FORCE
+idbloader.img: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
        $(call if_changed,cat)
+else
+MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
+idbloader.img: spl/u-boot-spl.bin FORCE
+       $(call if_changed,mkimage)
 endif
 
+ifeq ($(CONFIG_ARM64),)
+u-boot-rockchip.bin: idbloader.img u-boot.img FORCE
+       $(call if_changed,binman)
+else
+OBJCOPYFLAGS_u-boot-rockchip.bin = -I binary -O binary \
+       --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
+u-boot-rockchip.bin: idbloader.img u-boot.itb FORCE
+       $(call if_changed,pad_cat)
+endif # CONFIG_ARM64
+
+endif # CONFIG_ARCH_ROCKCHIP
+
 ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
 MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE)
 
@@ -1377,7 +1430,6 @@ lpc32xx-boot-1.bin: lpc32xx-spl.img FORCE
 lpc32xx-full.bin: lpc32xx-boot-0.bin lpc32xx-boot-1.bin u-boot.img FORCE
        $(call if_changed,cat)
 
-CLEAN_FILES += lpc32xx-*
 endif
 
 OBJCOPYFLAGS_u-boot-with-tpl.bin = -I binary -O binary \
@@ -1447,6 +1499,17 @@ cmd_socboot = cat        spl/u-boot-spl.sfp spl/u-boot-spl.sfp   \
                        u-boot.img > $@ || rm -f $@
 u-boot-with-spl.sfp: spl/u-boot-spl.sfp u-boot.img FORCE
        $(call if_changed,socboot)
+
+quiet_cmd_socnandboot = SOCNANDBOOT $@
+cmd_socnandboot =  dd if=/dev/zero of=spl/u-boot-spl.pad bs=64 count=1024 ; \
+                  cat  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 \
+                       spl/u-boot-spl.sfp spl/u-boot-spl.pad \
+                       u-boot.img > $@ || rm -f $@ spl/u-boot-spl.pad
+u-boot-with-nand-spl.sfp: spl/u-boot-spl.sfp u-boot.img FORCE
+       $(call if_changed,socnandboot)
+
 endif
 
 ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy)
@@ -1654,7 +1717,7 @@ u-boot.sym: u-boot FORCE
 # make sure no implicit rule kicks in
 $(sort $(u-boot-init) $(u-boot-main)): $(u-boot-dirs) ;
 
-# Handle descending into subdirectories listed in $(vmlinux-dirs)
+# Handle descending into subdirectories listed in $(u-boot-dirs)
 # Preset locale variables to speed up the build process. Limit locale
 # tweaks to this spot to avoid wrong language settings when running
 # make menuconfig etc.
@@ -1856,6 +1919,7 @@ checkarmreloc: u-boot
        fi
 
 tools/version.h: include/version.h
+       $(Q)mkdir -p $(dir $@)
        $(call if_changed,copy)
 
 envtools: scripts_basic $(version_h) $(timestamp_h) tools/version.h
@@ -1891,7 +1955,10 @@ CLEAN_DIRS  += $(MODVERDIR) \
                        $(filter-out include, $(shell ls -1 $d 2>/dev/null))))
 
 CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h tools/version.h \
-              boot* u-boot* MLO* SPL System.map fit-dtb.blob*
+              boot* u-boot* MLO* SPL System.map fit-dtb.blob* \
+              u-boot-ivt.img.log u-boot-dtb.imx.log SPL.log u-boot.imx.log \
+              lpc32xx-* bl31.c bl31.elf bl31_*.bin image.map tispl.bin* \
+              idbloader.img flash.bin flash.log
 
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl \
@@ -1921,12 +1988,12 @@ clean: $(clean-dirs)
                -o -name '*.ko.*' -o -name '*.su' -o -name '*.pyc' \
                -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
                -o -name '*.lex.c' -o -name '*.tab.[ch]' \
+               -o -name '*.asn1.[ch]' \
                -o -name '*.symtypes' -o -name 'modules.order' \
                -o -name modules.builtin -o -name '.tmp_*.o.*' \
                -o -name 'dsdt.aml' -o -name 'dsdt.asl.tmp' -o -name 'dsdt.c' \
                -o -name '*.efi' -o -name '*.gcno' -o -name '*.so' \) \
-               -type f -print | xargs rm -f \
-               bl31.c bl31.elf bl31_*.bin image.map tispl.bin*
+               -type f -print | xargs rm -f
 
 # mrproper - Delete all generated files, including .config
 #