diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.autoconf | 42 | ||||
-rw-r--r-- | scripts/Makefile.spl | 20 | ||||
-rwxr-xr-x | scripts/build-whitelist.sh | 15 | ||||
-rwxr-xr-x | scripts/check-config.sh | 9 | ||||
-rwxr-xr-x | scripts/checkpatch.pl | 4 | ||||
-rw-r--r-- | scripts/config_whitelist.txt | 16 | ||||
-rwxr-xr-x | scripts/get_default_envs.sh | 34 |
7 files changed, 79 insertions, 61 deletions
diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf index 01a739d..2f85eb9 100644 --- a/scripts/Makefile.autoconf +++ b/scripts/Makefile.autoconf @@ -46,7 +46,7 @@ quiet_cmd_autoconf_dep = GEN $@ -MQ include/config/auto.conf $(srctree)/include/common.h > $@ || { \ rm $@; false; \ } -include/autoconf.mk.dep: FORCE +include/autoconf.mk.dep: include/config.h FORCE $(call cmd,autoconf_dep) # We are migrating from board headers to Kconfig little by little. @@ -58,32 +58,44 @@ include/autoconf.mk.dep: FORCE # same CONFIG macros quiet_cmd_autoconf = GEN $@ cmd_autoconf = \ - $(CPP) $(c_flags) $2 -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && { \ - sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp | \ + sed -n -f $(srctree)/tools/scripts/define2mk.sed $< | \ while read line; do \ if [ -n "${KCONFIG_IGNORE_DUPLICATES}" ] || \ ! grep -q "$${line%=*}=" include/config/auto.conf; then \ echo "$$line"; \ fi \ - done > $@; \ - rm $@.tmp; \ - } || { \ - rm $@.tmp; false; \ + done > $@ + +quiet_cmd_u_boot_cfg = CFG $@ + cmd_u_boot_cfg = \ + $(CPP) $(c_flags) $2 -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && { \ + grep 'define CONFIG_' $@.tmp > $@; \ + rm $@.tmp; \ + } || { \ + rm $@.tmp; false; \ } -include/autoconf.mk: FORCE - $(call cmd,autoconf) +u-boot.cfg: include/config.h FORCE + $(call cmd,u_boot_cfg) -spl/include/autoconf.mk: FORCE +spl/u-boot.cfg: include/config.h FORCE $(Q)mkdir -p $(dir $@) - $(call cmd,autoconf,-DCONFIG_SPL_BUILD) + $(call cmd,u_boot_cfg,-DCONFIG_SPL_BUILD) -tpl/include/autoconf.mk: FORCE +tpl/u-boot.cfg: include/config.h FORCE $(Q)mkdir -p $(dir $@) - $(call cmd,autoconf,-DCONFIG_SPL_BUILD -DCONFIG_TPL_BUILD) + $(call cmd,u_boot_cfg,-DCONFIG_SPL_BUILD -DCONFIG_TPL_BUILD) + +include/autoconf.mk: u-boot.cfg + $(call cmd,autoconf) -include/autoconf.mk include/autoconf.mk.dep \ - spl/include/autoconf.mk tpl/include/autoconf.mk: include/config.h +spl/include/autoconf.mk: spl/u-boot.cfg + $(Q)mkdir -p $(dir $@) + $(call cmd,autoconf) + +tpl/include/autoconf.mk: tpl/u-boot.cfg + $(Q)mkdir -p $(dir $@) + $(call cmd,autoconf) # include/config.h # Prior to Kconfig, it was generated by mkconfig. Now it is created here. diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 4febc6b..e8cf9f3 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -156,7 +156,7 @@ spl/boot.bin: $(obj)/u-boot-spl.bin FORCE $(call if_changed,mkimage) endif -ALL-y += $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN).cfg +ALL-y += $(obj)/$(SPL_BIN).bin ifdef CONFIG_SAMSUNG ALL-y += $(obj)/$(BOARD)-spl.bin @@ -216,24 +216,6 @@ quiet_cmd_fdtgrep = FDTGREP $@ $(obj)/$(SPL_BIN).dtb: dts/dt.dtb $(objtree)/tools/fdtgrep FORCE $(call if_changed,fdtgrep) -quiet_cmd_cpp_cfg = CFG $@ -cmd_cpp_cfg = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \ - -DDO_DEPS_ONLY -D__ASSEMBLY__ -x assembler-with-cpp -P -dM -E -o $@ $< - -# If .u-boot.cfg.d is still present, then either: -# a) The previous build used a Makefile that used if_changed rather than -# if_changed_dep when building u-boot.cfg, and hence any later builds will -# be unaware of the dependencies for u-boot.cfg. In this case, we must -# delete u-boot.cfg to force it and .u-boot.cfg.cmd to be rebuilt the -# correct way. -# b) The previous build failed or was interrupted while building u-boot.cfg, -# so deleting u-boot.cfg isn't going to cause any additional work. -ifneq ($(wildcard $(obj)/.$(SPL_BIN).d),) - unused := $(shell rm -f $(obj)/$(SPL_BIN).cfg) -endif -$(obj)/$(SPL_BIN).cfg: include/config.h FORCE - $(call if_changed_dep,cpp_cfg) - pythonpath = PYTHONPATH=tools quiet_cmd_dtocc = DTOC C $@ diff --git a/scripts/build-whitelist.sh b/scripts/build-whitelist.sh index 7cf7a66..f169eaa 100755 --- a/scripts/build-whitelist.sh +++ b/scripts/build-whitelist.sh @@ -45,7 +45,18 @@ cat `find . -name "Kconfig*"` |sed -n \ # Use only the options that are present in the first file but not the second. comm -23 scripts/config_whitelist.txt.tmp1 scripts/config_whitelist.txt.tmp2 \ - |sort |uniq >scripts/config_whitelist.txt -rm scripts/config_whitelist.txt.tmp1 scripts/config_whitelist.txt.tmp2 + |sort |uniq >scripts/config_whitelist.txt.tmp3 + +# If scripts/config_whitelist.txt already exists, take the intersection of the +# current list and the new one. We do not want to increase whitelist options. +if [ -r scripts/config_whitelist.txt ]; then + comm -12 scripts/config_whitelist.txt.tmp3 scripts/config_whitelist.txt \ + > scripts/config_whitelist.txt.tmp4 + mv scripts/config_whitelist.txt.tmp4 scripts/config_whitelist.txt +else + mv scripts/config_whitelist.txt.tmp3 scripts/config_whitelist.txt +fi + +rm scripts/config_whitelist.txt.tmp* unset LC_ALL LC_COLLATE diff --git a/scripts/check-config.sh b/scripts/check-config.sh index 28c8fe9..6618dfb 100755 --- a/scripts/check-config.sh +++ b/scripts/check-config.sh @@ -5,13 +5,8 @@ # Check that the u-boot.cfg file provided does not introduce any new # ad-hoc CONFIG options # -# You can generate the list of current ad-hoc CONFIG options (those which are -# not in Kconfig) with this command: -# -# export LC_ALL=C LC_COLLATE=C -# git grep CONFIG_ |tr ' \t' '\n\n' |sed -n 's/^\(CONFIG_[A-Z0-9_]*\).*/\1/p' \ -# |sort |uniq >scripts/config_whitelist.txt; -# unset LC_ALL LC_COLLATE +# Use scripts/build-whitelist.sh to generate the list of current ad-hoc +# CONFIG options (those which are not in Kconfig). # Usage # check-config.sh <path to u-boot.cfg> <path to whitelist file> <source dir> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 24831b3..84f5756 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -4263,7 +4263,7 @@ sub process { } } -# check for case / default statements not preceeded by break/fallthrough/switch +# check for case / default statements not preceded by break/fallthrough/switch if ($line =~ /^.\s*(?:case\s+(?:$Ident|$Constant)\s*|default):/) { my $has_break = 0; my $has_statement = 0; @@ -4284,7 +4284,7 @@ sub process { } if (!$has_break && $has_statement) { WARN("MISSING_BREAK", - "Possible switch case/default not preceeded by break or fallthrough comment\n" . $herecurr); + "Possible switch case/default not preceded by break or fallthrough comment\n" . $herecurr); } } diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index efa95f0..3621c91 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1,4 +1,3 @@ -CONFIG_ CONFIG_16BIT CONFIG_33 CONFIG_400MHZ_MODE @@ -890,7 +889,6 @@ CONFIG_DMC_DDRTR2 CONFIG_DNET_AUTONEG_TIMEOUT CONFIG_DNP5370_EXT_WD_DISABLE CONFIG_DOS_PARTITION -CONFIG_DPLL_SSC_RATE_1PER CONFIG_DP_DDR_CTRL CONFIG_DP_DDR_DIMM_SLOTS_PER_CTLR CONFIG_DP_DDR_NUM_CTRLS @@ -1252,10 +1250,8 @@ CONFIG_FLASH_VERIFY CONFIG_FMAN_ENET CONFIG_FM_PLAT_CLK_DIV CONFIG_FO300 -CONFIG_FOO CONFIG_FORCE_DDR_DATA_BUS_WIDTH_32 CONFIG_FORMIKE -CONFIG_FPGA CONFIG_FPGA_ALTERA CONFIG_FPGA_COUNT CONFIG_FPGA_CYCLON2 @@ -1264,7 +1260,6 @@ CONFIG_FPGA_SOCFPGA CONFIG_FPGA_SPARTAN2 CONFIG_FPGA_SPARTAN3 CONFIG_FPGA_STRATIX_V -CONFIG_FPGA_XILINX CONFIG_FPGA_ZYNQPL CONFIG_FSLDMAFEC CONFIG_FSL_CADMUS @@ -1655,7 +1650,6 @@ CONFIG_ICACHE CONFIG_ICACHE_OFF CONFIG_ICON CONFIG_ICS307_REFCLK_HZ -CONFIG_IDENT_STRING CONFIG_IDE_8xx_DIRECT CONFIG_IDE_8xx_PCCARD CONFIG_IDE_INIT_POSTRESET @@ -1728,7 +1722,6 @@ CONFIG_IRAM_TOP CONFIG_IRDA_BASE CONFIG_ISO_PARTITION CONFIG_ISP1362_USB -CONFIG_IS_ CONFIG_IS_BUILTIN CONFIG_IS_ENABLED CONFIG_IS_INVALID @@ -3985,8 +3978,6 @@ CONFIG_SCSI_SYM53C8XX CONFIG_SC_TIMER_CLK CONFIG_SDCARD CONFIG_SDHCI -CONFIG_SDHCI_CMD_DEFAULT_TIMEOUT -CONFIG_SDHCI_CMD_MAX_TIMEOUT CONFIG_SDRAM_BANK0 CONFIG_SDRAM_BANK1 CONFIG_SDRAM_ECC @@ -4245,7 +4236,6 @@ CONFIG_SPL_BOOTROM_SAVE CONFIG_SPL_BOOT_DEVICE CONFIG_SPL_BSS_MAX_SIZE CONFIG_SPL_BSS_START_ADDR -CONFIG_SPL_BUILD CONFIG_SPL_CMT CONFIG_SPL_CMT_DEBUG CONFIG_SPL_COMMON_INIT_DDR @@ -4253,7 +4243,6 @@ CONFIG_SPL_CONSOLE CONFIG_SPL_DISPLAY_PRINT CONFIG_SPL_ETH_DEVICE CONFIG_SPL_FLUSH_IMAGE -CONFIG_SPL_FOO CONFIG_SPL_FRAMEWORK CONFIG_SPL_FSL_PBL CONFIG_SPL_FS_LOAD_ARGS_NAME @@ -7922,7 +7911,6 @@ CONFIG_SYS_XIMG_LEN CONFIG_SYS_XLB_PIPELINING CONFIG_SYS_XSVF_DEFAULT_ADDR CONFIG_SYS_XWAY_EBU_BOOTCFG -CONFIG_SYS_XXX CONFIG_SYS_ZYNQ_QSPI_WAIT CONFIG_SYS_ZYNQ_SPI_WAIT CONFIG_SYS_i2C_FSL @@ -7992,7 +7980,6 @@ CONFIG_TI_SPI_MMAP CONFIG_TMU_CMD_DTT CONFIG_TMU_TIMER CONFIG_TOTAL5200 -CONFIG_TPL_BUILD CONFIG_TPL_DRIVERS_MISC_SUPPORT CONFIG_TPL_PAD_TO CONFIG_TPM_TIS_BASE_ADDRESS @@ -8406,6 +8393,3 @@ CONFIG_ZYNQ_SDHCI_MAX_FREQ CONFIG_ZYNQ_SDHCI_MIN_FREQ CONFIG_ZYNQ_SERIAL CONFIG_eTSEC_MDIO_BUS -CONFIG_n -CONFIG_prefix -CONFIG_xxx diff --git a/scripts/get_default_envs.sh b/scripts/get_default_envs.sh new file mode 100755 index 0000000..7955db6 --- /dev/null +++ b/scripts/get_default_envs.sh @@ -0,0 +1,34 @@ +#! /bin/bash +# +# Copyright (C) 2016, Lukasz Majewski <l.majewski@majess.pl> +# +# SPDX-License-Identifier: GPL-2.0+ +# + +# This file extracts default envs from built u-boot +# usage: get_default_envs.sh > u-boot-env-default.txt +set -ue + +ENV_OBJ_FILE="env_common.o" +ENV_OBJ_FILE_COPY="copy_${ENV_OBJ_FILE}" + +echoerr() { echo "$@" 1>&2; } + +path=$(readlink -f $0) +env_obj_file_path=$(find ${path%/scripts*} -not -path "*/spl/*" \ + -name "${ENV_OBJ_FILE}") +[ -z "${env_obj_file_path}" ] && \ + { echoerr "File '${ENV_OBJ_FILE}' not found!"; exit 1; } + +cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY} + +# NOTE: objcopy saves its output to file passed in +# (copy_env_common.o in this case) +objcopy -O binary -j ".rodata.default_environment" ${ENV_OBJ_FILE_COPY} + +# Replace default '\0' with '\n' and sort entries +tr '\0' '\n' < ${ENV_OBJ_FILE_COPY} | sort -u + +rm ${ENV_OBJ_FILE_COPY} + +exit 0 |