VERSION = 2022
PATCHLEVEL = 01
SUBLEVEL =
-EXTRAVERSION = -rc3
+EXTRAVERSION =
NAME =
# *DOCUMENTATION*
no-dot-config-targets := clean clobber mrproper distclean \
help %docs check% coccicheck \
- ubootversion backup tests check qcheck tcheck
+ ubootversion backup tests check qcheck tcheck pylint
config-targets := 0
mixed-targets := 0
endif
endif
INPUTS-$(CONFIG_TPL) += tpl/u-boot-tpl.bin
-INPUTS-$(CONFIG_OF_SEPARATE) += u-boot.dtb
-INPUTS-$(CONFIG_BINMAN_STANDALONE_FDT) += u-boot.dtb
+
+# Allow omitting the .dtb output if it is not normally used
+INPUTS-$(CONFIG_OF_SEPARATE) += $(if $(CONFIG_OF_OMIT_DTB),dts/dt.dtb,u-boot.dtb)
ifeq ($(CONFIG_SPL_FRAMEWORK),y)
INPUTS-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img
endif
cmd_cfgcheck = $(srctree)/scripts/check-config.sh $2 \
$(srctree)/scripts/config_whitelist.txt $(srctree)
+quiet_cmd_ofcheck = OFCHK $2
+cmd_ofcheck = $(srctree)/scripts/check-of.sh $2 \
+ $(srctree)/scripts/of_allowlist.txt
+
# Concat the value of all the CONFIGs (result is 'y' or 'yy', etc. )
got = $(foreach cfg,$(1),$($(cfg)))
$(CONFIG_WATCHDOG)$(CONFIG_HW_WATCHDOG))
$(call deprecated,CONFIG_DM_ETH,Ethernet drivers,v2020.07,$(CONFIG_NET))
$(call deprecated,CONFIG_DM_I2C,I2C drivers,v2022.04,$(CONFIG_SYS_I2C_LEGACY))
+ $(call deprecated,CONFIG_DM_KEYBOARD,Keyboard drivers,v2022.10,$(CONFIG_KEYBOARD))
+ @# CONFIG_SYS_TIMER_RATE has brackets in it for some boards which
+ @# confuses this rule. Use if() to send just a single character which
+ @# is enable to tell 'deprecated' that one of these symbols exists
+ $(call deprecated,CONFIG_TIMER,Timer drivers,v2023.01,$(if $(strip $(CONFIG_SYS_TIMER_RATE)$(CONFIG_SYS_TIMER_COUNTER)),x))
+ $(call deprecated,CONFIG_DM_SERIAL,Serial drivers,v2023.04,$(CONFIG_SERIAL))
@# Check that this build does not use CONFIG options that we do not
@# know about unless they are in Kconfig. All the existing CONFIG
@# options are whitelisted, so new ones should not be added.
$(call cmd,cfgcheck,u-boot.cfg)
+ @# Check that this build does not override OF_HAS_PRIOR_STAGE by
+ @# disabling OF_BOARD.
+ $(call cmd,ofcheck,$(KCONFIG_CONFIG))
PHONY += dtbs
dtbs: dts/dt.dtb
u-boot-dtb.bin: u-boot-nodtb.bin dts/dt.dtb FORCE
$(call if_changed,cat)
-else ifeq ($(CONFIG_OF_SEPARATE),y)
+else ifeq ($(CONFIG_OF_SEPARATE).$(CONFIG_OF_OMIT_DTB),y.)
u-boot-dtb.bin: u-boot-nodtb.bin dts/dt.dtb FORCE
$(call if_changed,cat)
--toolpath $(objtree)/tools \
$(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \
build -u -d u-boot.dtb -O . -m --allow-missing \
+ --fake-ext-blobs \
-I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
-I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \
$(foreach f,$(BINMAN_INDIRS),-I $(f)) \
u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl u-boot-ivt.img: \
$(if $(CONFIG_SPL_LOAD_FIT),u-boot-nodtb.bin \
- $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SANDBOX)$(CONFIG_BINMAN_STANDALONE_FDT),dts/dt.dtb) \
+ $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SANDBOX),dts/dt.dtb) \
,$(UBOOT_BIN)) FORCE
$(call if_changed,mkimage)
$(BOARD_SIZE_CHECK)
quiet_cmd_u-boot__ ?= LD $@
cmd_u-boot__ ?= $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_u-boot) -o $@ \
-T u-boot.lds $(u-boot-init) \
- $(if $(CONFIG_EFI_APP_64BIT),,--whole-archive) \
+ --whole-archive \
$(u-boot-main) \
- $(if $(CONFIG_EFI_APP_64BIT),,--no-whole-archive) \
+ --no-whole-archive \
$(PLATFORM_LIBS) -Map u-boot.map; \
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
endif
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 defconfig keep-syms-lto.c
+ idbloader.img flash.bin flash.log defconfig keep-syms-lto.c \
+ mkimage-out.spl.mkimage mkimage.spl.mkimage imx-boot.map \
+ itb.fit.fit itb.fit.itb itb.map spl.map
# Directories & files removed with 'make mrproper'
MRPROPER_DIRS += include/config include/generated spl tpl \
-type f -print | xargs rm -f
@rm -f boards.cfg CHANGELOG
+# See doc/develop/python_cq.rst
+PHONY += pylint
+PYLINT_BASE := scripts/pylint.base
+PYLINT_CUR := pylint.cur
+PYLINT_DIFF := pylint.diff
+pylint:
+ $(Q)echo "Running pylint on all files (summary in $(PYLINT_CUR); output in pylint.out/)"
+ $(Q)mkdir -p pylint.out
+ $(Q)rm -f pylint.out/out*
+ $(Q)find tools test -name "*.py" \
+ | xargs -n1 -P$(shell nproc 2>/dev/null || echo 1) \
+ sh -c 'pylint --reports=y --exit-zero -f parseable --ignore-imports=yes $$@ > pylint.out/$$(echo $$@ | tr / _ | sed s/.py//)' _
+ $(Q)rm -f $(PYLINT_CUR)
+ $(Q)( cd pylint.out; for f in *; do \
+ sed -ne "s/Your code has been rated at \([-0-9.]*\).*/$$f \1/p" $$f; \
+ done ) | sort > $(PYLINT_CUR)
+ $(Q)base=$$(mktemp) cur=$$(mktemp); cut -d' ' -f1 $(PYLINT_BASE) >$$base; \
+ cut -d' ' -f1 $(PYLINT_CUR) >$$cur; \
+ comm -3 $$base $$cur > $(PYLINT_DIFF); \
+ if [ -s $(PYLINT_DIFF) ]; then \
+ echo "Files have been added/removed. Try:\n\tcp $(PYLINT_CUR) $(PYLINT_BASE)"; \
+ echo; \
+ echo "Added files:"; \
+ comm -13 $$base $$cur; \
+ echo; \
+ echo "Removed files:"; \
+ comm -23 $$base $$cur; \
+ false; \
+ else \
+ rm $$base $$cur $(PYLINT_DIFF); \
+ fi
+ $(Q)bad=false; while read base_file base_val <&3 && read cur_file cur_val <&4; do \
+ if awk "BEGIN {exit !($$cur_val < $$base_val)}"; then \
+ echo "$$base_file: Score was $$base_val, now $$cur_val"; \
+ bad=true; fi; \
+ done 3<$(PYLINT_BASE) 4<$(PYLINT_CUR); \
+ if $$bad; then \
+ echo "Some files have regressed, please fix"; \
+ false; \
+ else \
+ echo "No pylint regressions"; \
+ fi
+
backup:
F=`basename $(srctree)` ; cd .. ; \
gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
@echo ' check - Run all automated tests that use sandbox'
@echo ' qcheck - Run quick automated tests that use sandbox'
@echo ' tcheck - Run quick automated tests on tools'
+ @echo ' pylint - Run pylint on all Python files'
@echo ''
@echo 'Other generic targets:'
@echo ' all - Build all necessary images depending on configuration'