From 60a8cf5db8ab69ad10721bd63bfa31429b05fc58 Mon Sep 17 00:00:00 2001 From: Tobias Deiminger Date: Tue, 20 Jun 2023 00:41:02 +0200 Subject: [PATCH 01/10] Kbuild: Fix cleanup of generated sources in tools On 'make clean', generated C files in tools/env/ and tools/boot/ are currently not removed, but they should. Auto-generation for shared sources was first introduced with ad80c4a3220b ("kbuild, tools: generate wrapper C sources automatically by Makefile"). Cleanup later regressed (see Fixes:), because shared files were moved out of lib/ and common/, but 'clean-dirs := lib common' was not adjusted accordingly. Further, the generated tools/env/embedded.c became a sibling to project files, which prevents directory-wise cleanup at all. To solve it, we establishe tools/generated/ as the sole place for generated sources. Wrappers are now generated as tools/generated//, and 'make clean' can remove tools/generated/ as a whole (Linux Makefile.asm-generic headers are cleaned similarly). This way we don't have to maintain separate clean-files or clean-dirs entries for each single added or moved wrapper file. Fixes: 0649cd0d4908 ("Move environment files from common/ to env/") Fixes: 19a91f2464a8 ("Create a new boot/ directory") Signed-off-by: Tobias Deiminger [trini: Correct mkfwupdate case] Signed-off-by: Tom Rini --- tools/Makefile | 66 +++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index a0cd87ff93a..3d0c4b0dd6a 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -48,20 +48,20 @@ hostprogs-$(CONFIG_VIDEO_LOGO) += bmp_logo HOSTCFLAGS_bmp_logo.o := -pedantic hostprogs-$(BUILD_ENVCRC) += envcrc -envcrc-objs := envcrc.o lib/crc32.o env/embedded.o lib/sha1.o +envcrc-objs := envcrc.o generated/lib/crc32.o generated/env/embedded.o generated/lib/sha1.o hostprogs-$(CONFIG_CMD_NET) += gen_eth_addr HOSTCFLAGS_gen_eth_addr.o := -pedantic hostprogs-$(CONFIG_CMD_NET) += gen_ethaddr_crc -gen_ethaddr_crc-objs := gen_ethaddr_crc.o lib/crc8.o +gen_ethaddr_crc-objs := gen_ethaddr_crc.o generated/lib/crc8.o HOSTCFLAGS_gen_ethaddr_crc.o := -pedantic hostprogs-$(CONFIG_CMD_LOADS) += img2srec HOSTCFLAGS_img2srec.o := -pedantic hostprogs-y += mkenvimage -mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o +mkenvimage-objs := mkenvimage.o os_support.o generated/lib/crc32.o hostprogs-y += dumpimage mkimage hostprogs-$(CONFIG_TOOLS_LIBCRYPTO) += fit_info fit_check_sign @@ -71,30 +71,30 @@ ifneq ($(CONFIG_CMD_BOOTEFI_SELFTEST)$(CONFIG_FWU_MDATA_GPT_BLK),) hostprogs-y += file2include endif -FIT_OBJS-y := fit_common.o fit_image.o image-host.o boot/image-fit.o -FIT_SIG_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := image-sig-host.o boot/image-fit-sig.o -FIT_CIPHER_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := boot/image-cipher.o +FIT_OBJS-y := fit_common.o fit_image.o image-host.o generated/boot/image-fit.o +FIT_SIG_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := image-sig-host.o generated/boot/image-fit-sig.o +FIT_CIPHER_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := generated/boot/image-cipher.o # The following files are synced with upstream DTC. # Use synced versions from scripts/dtc/libfdt/. LIBFDT_OBJS := $(addprefix libfdt/, fdt.o fdt_ro.o fdt_wip.o fdt_sw.o fdt_rw.o \ fdt_strerror.o fdt_empty_tree.o fdt_addresses.o fdt_overlay.o) -RSA_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix lib/rsa/, \ +RSA_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix generated/lib/rsa/, \ rsa-sign.o rsa-verify.o \ rsa-mod-exp.o) -ECDSA_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix lib/ecdsa/, ecdsa-libcrypto.o) +ECDSA_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix generated/lib/ecdsa/, ecdsa-libcrypto.o) -AES_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix lib/aes/, \ +AES_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix generated/lib/aes/, \ aes-encrypt.o aes-decrypt.o) # Cryptographic helpers and image types that depend on openssl/libcrypto LIBCRYPTO_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := \ - lib/fdt-libcrypto.o \ + generated/lib/fdt-libcrypto.o \ sunxi_toc0.o -ROCKCHIP_OBS = lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o +ROCKCHIP_OBS = generated/lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o # common objs for dumpimage and mkimage dumpimage-mkimage-objs := aisimage.o \ @@ -102,20 +102,20 @@ dumpimage-mkimage-objs := aisimage.o \ $(FIT_OBJS-y) \ $(FIT_SIG_OBJS-y) \ $(FIT_CIPHER_OBJS-y) \ - boot/fdt_region.o \ - boot/bootm.o \ - lib/crc32.o \ + generated/boot/fdt_region.o \ + generated/boot/bootm.o \ + generated/lib/crc32.o \ default_image.o \ - lib/fdtdec_common.o \ - lib/fdtdec.o \ - boot/image.o \ - boot/image-host.o \ + generated/lib/fdtdec_common.o \ + generated/lib/fdtdec.o \ + generated/boot/image.o \ + generated/boot/image-host.o \ imagetool.o \ imximage.o \ imx8image.o \ imx8mimage.o \ kwbimage.o \ - lib/md5.o \ + generated/lib/md5.o \ lpc32xximage.o \ mxsimage.o \ omapimage.o \ @@ -128,12 +128,12 @@ dumpimage-mkimage-objs := aisimage.o \ $(ROCKCHIP_OBS) \ socfpgaimage.o \ sunxi_egon.o \ - lib/crc16-ccitt.o \ - lib/hash-checksum.o \ - lib/sha1.o \ - lib/sha256.o \ - lib/sha512.o \ - common/hash.o \ + generated/lib/crc16-ccitt.o \ + generated/lib/hash-checksum.o \ + generated/lib/sha1.o \ + generated/lib/sha256.o \ + generated/lib/sha512.o \ + generated/common/hash.o \ ublimage.o \ zynqimage.o \ zynqmpimage.o \ @@ -213,7 +213,7 @@ HOSTCFLAGS_mxsboot.o := -pedantic hostprogs-$(CONFIG_ARCH_SUNXI) += mksunxiboot hostprogs-$(CONFIG_ARCH_SUNXI) += sunxi-spl-image-builder -sunxi-spl-image-builder-objs := sunxi-spl-image-builder.o lib/bch.o +sunxi-spl-image-builder-objs := sunxi-spl-image-builder.o generated/lib/bch.o hostprogs-$(CONFIG_NETCONSOLE) += ncb @@ -221,16 +221,16 @@ hostprogs-$(CONFIG_ARCH_KIRKWOOD) += kwboot hostprogs-$(CONFIG_ARCH_MVEBU) += kwboot hostprogs-y += proftool -proftool-objs = proftool.o lib/abuf.o +proftool-objs = proftool.o generated/lib/abuf.o hostprogs-$(CONFIG_STATIC_RELA) += relocate-rela hostprogs-$(CONFIG_RISCV) += prelink-riscv hostprogs-$(CONFIG_ARCH_OCTEON) += update_octeon_header -update_octeon_header-objs := update_octeon_header.o lib/crc32.o +update_octeon_header-objs := update_octeon_header.o generated/lib/crc32.o hostprogs-y += fdtgrep -fdtgrep-objs += $(LIBFDT_OBJS) boot/fdt_region.o fdtgrep.o +fdtgrep-objs += $(LIBFDT_OBJS) generated/boot/fdt_region.o fdtgrep.o ifneq ($(TOOLS_ONLY),y) hostprogs-y += spl_size_limit @@ -251,7 +251,7 @@ HOSTLDLIBS_mkeficapsule += \ $(shell pkg-config --libs uuid 2> /dev/null || echo "-luuid") hostprogs-$(CONFIG_TOOLS_MKEFICAPSULE) += mkeficapsule -mkfwumdata-objs := mkfwumdata.o lib/crc32.o +mkfwumdata-objs := mkfwumdata.o generated/lib/crc32.o HOSTLDLIBS_mkfwumdata += -luuid hostprogs-$(CONFIG_TOOLS_MKFWUMDATA) += mkfwumdata @@ -266,12 +266,12 @@ HOSTCFLAGS_sha256.o := -pedantic HOSTCFLAGS_sha512.o := -pedantic -DCONFIG_SHA512 -DCONFIG_SHA384 quiet_cmd_wrap = WRAP $@ -cmd_wrap = echo "\#include <../$(patsubst $(obj)/%,%,$@)>" >$@ +cmd_wrap = echo "\#include <../$(patsubst $(obj)/generated/%,%,$@)>" >$@ -$(obj)/boot/%.c $(obj)/common/%.c $(obj)/env/%.c $(obj)/lib/%.c: +$(obj)/generated/%.c: $(call cmd,wrap) -clean-dirs := lib common +clean-dirs := generated always := $(hostprogs-y) From c623642d29be5c8036104351d27cea6b55adf769 Mon Sep 17 00:00:00 2001 From: Tobias Deiminger Date: Tue, 20 Jun 2023 00:41:03 +0200 Subject: [PATCH 02/10] Adjust gitignore for tools/generated/ Tell git that auto-generated C sources are now exclusively expected under tools/generated/. Signed-off-by: Tobias Deiminger --- tools/.gitignore | 1 + tools/env/.gitignore | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/.gitignore b/tools/.gitignore index cda3ea628c3..941d38de212 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -34,6 +34,7 @@ /relocate-rela /spl_size_limit /sunxi-spl-image-builder +/tools/generated/**/*.c /update_octeon_header /version.h /xway-swap-bytes diff --git a/tools/env/.gitignore b/tools/env/.gitignore index 8d28b2b70be..804abacc6e4 100644 --- a/tools/env/.gitignore +++ b/tools/env/.gitignore @@ -1,3 +1,2 @@ -embedded.c fw_printenv fw_printenv_unstripped From 45e636f41fe84895f49d565a6b3e4dacbce8a1fd Mon Sep 17 00:00:00 2001 From: Tobias Deiminger Date: Tue, 20 Jun 2023 00:41:04 +0200 Subject: [PATCH 03/10] Kbuild: Fix cleanup of VPL VPL artifacts like example vpl/u-boot-vpl are currently not removed by 'make clean'. We can clean them just as it's already done for SPL and TPL. Fixes: f86ca5ad8f78 ("Introduce Verifying Program Loader (VPL)") Signed-off-by: Tobias Deiminger --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 813ad3e6732..8d9aef464d0 100644 --- a/Makefile +++ b/Makefile @@ -2152,7 +2152,7 @@ CHANGELOG: # Directories & files removed with 'make clean' CLEAN_DIRS += $(MODVERDIR) \ - $(foreach d, spl tpl, $(patsubst %,$d/%, \ + $(foreach d, spl tpl vpl, $(patsubst %,$d/%, \ $(filter-out include, $(shell ls -1 $d 2>/dev/null)))) CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h \ @@ -2167,7 +2167,7 @@ CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h \ idbloader-spi.img lib/efi_loader/helloworld_efi.S # Directories & files removed with 'make mrproper' -MRPROPER_DIRS += include/config include/generated spl tpl \ +MRPROPER_DIRS += include/config include/generated spl tpl vpl \ .tmp_objdiff doc/output include/asm # Remove include/asm symlink created by U-Boot before v2014.01 From 3d3eeae9bf61f472cea2e16fdce8615312f84ac8 Mon Sep 17 00:00:00 2001 From: Tobias Deiminger Date: Tue, 20 Jun 2023 00:41:05 +0200 Subject: [PATCH 04/10] Kbuild: Fix cleanup of *.dtb for some archs 'make clean' did not descend into arch/$ARCH/dts for arc, m68k, nios2, sh, xtensa. Fix it by adding the missing archs to the explicit clean-dirs list. Signed-off-by: Tobias Deiminger --- dts/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dts/Makefile b/dts/Makefile index cb311138295..3437e54033d 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -63,4 +63,6 @@ spl_dtbs: $(obj)/dt-$(SPL_NAME).dtb clean-files := dt.dtb.S # Let clean descend into dts directories -subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/mips/dts ../arch/sandbox/dts ../arch/x86/dts ../arch/powerpc/dts ../arch/riscv/dts +subdir- += ../arch/arc/dts ../arch/arm/dts ../arch/m68k/dts ../arch/microblaze/dts \ + ../arch/mips/dts ../arch/nios2/dts ../arch/powerpc/dts ../arch/riscv/dts \ + ../arch/sandbox/dts ../arch/sh/dts ../arch/x86/dts ../arch/xtensa/dts From 57fdec65c5d9d6e16ed273243178eb3dc95c8a88 Mon Sep 17 00:00:00 2001 From: Tobias Deiminger Date: Tue, 20 Jun 2023 00:41:06 +0200 Subject: [PATCH 05/10] Kbuild: Fix cleanup of *.dtbo for sandbox sandbox can generate DT overlays, but they were not cleaned. Extend the explicit clean-files list accordingly. Fixes: 95300f203f32 ("pytest: add sandbox test for "extension" command") Signed-off-by: Tobias Deiminger --- arch/sandbox/dts/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sandbox/dts/Makefile b/arch/sandbox/dts/Makefile index b6a88479b22..f810b4752f5 100644 --- a/arch/sandbox/dts/Makefile +++ b/arch/sandbox/dts/Makefile @@ -18,4 +18,4 @@ PHONY += dtbs dtbs: $(addprefix $(obj)/, $(dtb-y)) @: -clean-files := *.dtb +clean-files := *.dtb *.dtbo From 42c0e5bb054da1437fe847bfd4063768c08d39ca Mon Sep 17 00:00:00 2001 From: Tobias Deiminger Date: Tue, 20 Jun 2023 00:41:07 +0200 Subject: [PATCH 06/10] test: Find leftovers after clean/mrproper Docs describe 'make clean' to delete most generated files, 'make mrproper' to delete current configuration and all generated files. This test tries to assert it. Idea is to search remaining files by patterns in copies of the initial out-of-source build, which has two advantages: - looking in an out-of-source build dir allows to tell generated source code from committed source code - copying is fast (compared to rebuilding each time) which allows to do a "world clean" Signed-off-by: Tobias Deiminger --- test/py/tests/test_cleanup_build.py | 105 ++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 test/py/tests/test_cleanup_build.py diff --git a/test/py/tests/test_cleanup_build.py b/test/py/tests/test_cleanup_build.py new file mode 100644 index 00000000000..5206ff73ec7 --- /dev/null +++ b/test/py/tests/test_cleanup_build.py @@ -0,0 +1,105 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2023 Tobias Deiminger + +"""Test for unexpected leftovers after make clean""" + +import itertools +import os +import pathlib +import shutil +import sys + +import pytest + +# pylint: disable=redefined-outer-name + + +@pytest.fixture +def tmp_copy_of_builddir(u_boot_config, tmp_path): + """For each test, provide a temporary copy of the initial build directory.""" + shutil.copytree( + u_boot_config.build_dir, + tmp_path, + symlinks=True, + dirs_exist_ok=True, + ) + return tmp_path + + +@pytest.fixture(scope="module") +def run_make(u_boot_log): + """Provide function to run and log make without connecting to u-boot console.""" + runner = u_boot_log.get_runner("make", sys.stdout) + + def _run_make(build_dir, target): + cmd = ["make", f"O={build_dir}", target] + runner.run(cmd) + + yield _run_make + runner.close() + + +@pytest.fixture(scope="module") +def most_generated_files(): + """Path.glob style patterns to describe what should be removed by 'make clean'.""" + return ( + "**/*.c", + "**/*.dtb", + "**/*.dtbo", + "**/*.o", + "**/*.py", + "**/*.pyc", + "**/*.so", + "**/*.srec", + "u-boot*", + "[svt]pl/u-boot*", + ) + + +@pytest.fixture(scope="module") +def all_generated_files(most_generated_files): + """Path.glob style patterns to describe what should be removed by 'make mrproper'.""" + return most_generated_files + (".config", "**/*.h") + + +def find_files(search_dir, include_patterns, exclude_dirs=None): + """Find files matching include_patterns, unless it's in one of exclude_dirs. + + include_patterns -- Path.glob style pattern relative to search dir + exclude_dir -- directories to exclude, expected relative to search dir + """ + matches = [] + exclude_dirs = [] if exclude_dirs is None else exclude_dirs + for abs_path in itertools.chain.from_iterable( + pathlib.Path(search_dir).glob(pattern) for pattern in include_patterns + ): + if abs_path.is_dir(): + continue + rel_path = pathlib.Path(os.path.relpath(abs_path, search_dir)) + if not any( + rel_path.is_relative_to(exclude_dir) for exclude_dir in exclude_dirs + ): + matches.append(rel_path) + return matches + + +def test_clean(run_make, tmp_copy_of_builddir, most_generated_files): + """Test if 'make clean' deletes most generated files.""" + run_make(tmp_copy_of_builddir, "clean") + leftovers = find_files( + tmp_copy_of_builddir, + most_generated_files, + exclude_dirs=["scripts", "test/overlay"], + ) + assert not leftovers, f"leftovers: {', '.join(map(str, leftovers))}" + + +def test_mrproper(run_make, tmp_copy_of_builddir, all_generated_files): + """Test if 'make mrproper' deletes current configuration and all generated files.""" + run_make(tmp_copy_of_builddir, "mrproper") + leftovers = find_files( + tmp_copy_of_builddir, + all_generated_files, + exclude_dirs=["test/overlay"], + ) + assert not leftovers, f"leftovers: {', '.join(map(str, leftovers))}" From aadc1a60694bfee09203fb30357ac9887d9691e2 Mon Sep 17 00:00:00 2001 From: Ying Sun Date: Sun, 25 Jun 2023 16:24:47 +0800 Subject: [PATCH 07/10] cmd: CONFIG_CMD_SAVES depends on CONFIG_CMD_LOADS CONFIG_CMD_SAVES is used to enable support for the "saveenv" command and is only implemented in cmd/load.c when "#if defined(CONFIG_CMD_LOADS)" is met. It is recommended to add dependency constraints to its definition. Prevents "saveenv" command from not being supported when "CONFIG_CMD_SAVES=y CONFIG_CMD_LOADS=n". Suggested-by: Yanjie Ren Signed-off-by: Ying Sun Reviewed-by: Simon Glass --- cmd/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/Kconfig b/cmd/Kconfig index 02e54f1e50f..c1941849f98 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1228,6 +1228,7 @@ config LOADS_ECHO config CMD_SAVES bool "saves - Save a file over serial in S-Record format" + depends on CMD_LOADS help Provides a way to save a binary file using the Motorola S-Record format over the serial line. From 29f925d8f9c7d0e1aea340e537e2423f659f851d Mon Sep 17 00:00:00 2001 From: Ying Sun Date: Sun, 25 Jun 2023 16:52:07 +0800 Subject: [PATCH 08/10] common: Kconfig: SYS_CONSOLE_ENV_OVERWRITE depends on SYS_CONSOLE_IS_IN_ENV CONFIG_SYS_CONSOLE_ENV_OVERWRITE is implemented in common/console.c when "#if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV)" is met. It is recommended to add dependency constraints to its definition. Suggested-by: Yanjie Ren Signed-off-by: Ying Sun --- common/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/common/Kconfig b/common/Kconfig index bbabadb35e1..42baca20a61 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -256,6 +256,7 @@ config SYS_CONSOLE_OVERWRITE_ROUTINE config SYS_CONSOLE_ENV_OVERWRITE bool "Update environment variables during console init" + depends on SYS_CONSOLE_IS_IN_ENV help The console environment variables (stdout, stdin, stderr) can be used to determine the correct console devices on start-up. This From 0f42f8995593570b0a0d0726cd1f021b5f90172f Mon Sep 17 00:00:00 2001 From: Ying Sun Date: Sun, 25 Jun 2023 17:18:21 +0800 Subject: [PATCH 09/10] tpl: Kconfig: TPL_BANNER_PRINT depends on DEBUG_UART && TPL_SERIAL As implemented in the arch/arm/mach-rockchip/tpl.c file, the CONFIG_TPL_BANNER_PRINT option will not work if either of these options is not enabled. Add dependency constraints to the CONFIG_TPL_BANNER_PRINT option definition to prevent configuration problems where option is enabled but do not take effect. Suggested-by: Yanjie Ren Signed-off-by: Ying Sun --- common/spl/Kconfig.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/common/spl/Kconfig.tpl b/common/spl/Kconfig.tpl index 1874f9db4f9..3d6cf1e59f3 100644 --- a/common/spl/Kconfig.tpl +++ b/common/spl/Kconfig.tpl @@ -43,6 +43,7 @@ config TPL_FRAMEWORK config TPL_BANNER_PRINT bool "Enable output of the TPL banner 'U-Boot TPL ...'" + depends on DEBUG_UART && TPL_SERIAL default y help If this option is enabled, TPL will print the banner with version From 99a0532a2d09edac8d8cf59deb68e03f3275e494 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 4 Jul 2023 14:05:13 +0200 Subject: [PATCH 10/10] sysreset: Change Kconfig GPIO dependency DM_GPIO depends on GPIO to be enabled but select will cause that DM_GPIO is selected without GPIO which ends up in compilation error: undefined reference to `dm_gpio_set_value' undefined reference to `dm_gpio_get_value' undefined reference to `dm_gpio_free' undefined reference to `gpio_request_by_name' Signed-off-by: Michal Simek [trini: Fix configs which had relied on these select's] Signed-off-by: Tom Rini --- configs/ge_b1x5v2_defconfig | 1 + configs/microblaze-generic_defconfig | 1 + configs/qemu-ppce500_defconfig | 1 + drivers/sysreset/Kconfig | 4 ++-- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configs/ge_b1x5v2_defconfig b/configs/ge_b1x5v2_defconfig index faa22f93924..b3b69a642a4 100644 --- a/configs/ge_b1x5v2_defconfig +++ b/configs/ge_b1x5v2_defconfig @@ -14,6 +14,7 @@ CONFIG_ENV_SECT_SIZE=0x10000 # CONFIG_GE_RTC is not set CONFIG_MX6QDL=y CONFIG_TARGET_GE_B1X5V2=y +CONFIG_DM_GPIO=y CONFIG_DEFAULT_DEVICE_TREE="imx6dl-b1x5v2" CONFIG_SPL_TEXT_BASE=0x00908000 CONFIG_SPL_SERIAL=y diff --git a/configs/microblaze-generic_defconfig b/configs/microblaze-generic_defconfig index 6aa1d03e5b6..589da3226da 100644 --- a/configs/microblaze-generic_defconfig +++ b/configs/microblaze-generic_defconfig @@ -4,6 +4,7 @@ CONFIG_SYS_MALLOC_LEN=0xc0000 CONFIG_SYS_MALLOC_F_LEN=0x400 CONFIG_NR_DRAM_BANKS=1 CONFIG_ENV_SIZE=0x20000 +CONFIG_DM_GPIO=y CONFIG_DEFAULT_DEVICE_TREE="microblaze-generic" CONFIG_SYS_PROMPT="U-Boot-mONStR> " CONFIG_SPL_SERIAL=y diff --git a/configs/qemu-ppce500_defconfig b/configs/qemu-ppce500_defconfig index 105b937efae..5f0746e4e27 100644 --- a/configs/qemu-ppce500_defconfig +++ b/configs/qemu-ppce500_defconfig @@ -1,6 +1,7 @@ CONFIG_PPC=y CONFIG_TEXT_BASE=0xf00000 CONFIG_ENV_SIZE=0x2000 +CONFIG_DM_GPIO=y CONFIG_DEFAULT_DEVICE_TREE="qemu-ppce500" CONFIG_SYS_MONITOR_LEN=524288 CONFIG_SYS_CLK_FREQ=33000000 diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig index 03f7fdd5978..bdbe2a95364 100644 --- a/drivers/sysreset/Kconfig +++ b/drivers/sysreset/Kconfig @@ -61,14 +61,14 @@ endif config POWEROFF_GPIO bool "Enable support for GPIO poweroff driver" - select DM_GPIO + depends on DM_GPIO help Support for system poweroff using a GPIO pin. This can be used for systems having a single GPIO to trigger a system poweroff. config SYSRESET_GPIO bool "Enable support for GPIO reset driver" - select DM_GPIO + depends on DM_GPIO help Reset support via GPIO pin connected reset logic. This is used for example on Microblaze where reset logic can be controlled via GPIO