From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D195BC433F5 for ; Mon, 9 May 2022 18:55:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9A26A83F57; Mon, 9 May 2022 20:55:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="hFyvYZ5J"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AFAAB80762; Mon, 9 May 2022 20:55:30 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 230A683EAC for ; Mon, 9 May 2022 20:55:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8060C6130C; Mon, 9 May 2022 18:55:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96F0FC385B2; Mon, 9 May 2022 18:55:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652122521; bh=XwFX5B5t4xnncpS+wFfjJcMTnIklOtCZmF7AW3HLxXc=; h=From:To:Cc:Subject:Date:From; b=hFyvYZ5Jlq3sKiCGOJh5J0JwLRUoH0CC4u0yQOJBc/YjmPJ8Rn4BjbV4bxwUw6gYr W71Zgn9jeEcqZ9hKQD+A+YcOAgTU7+LCRuH0d40JsrJZyaIqrYegal2AlUmaE3W/uT OHLRCxgv2DfEevDCYq+E0iGvhV3iTh1xohpiCXpNddrStmj2IsC+o9QBpZ5tj5mAlw yDu6EYcYNhdPV0+NvzeqmNjA/ShHBtDW+RM8wXt37YH7wkWtD3LxsrbqH6ektc3QzM Boxa9/SBpmeG/+nM1RtTejxXZr/288hTvbvRdonhok87vq4GtjNUl7wYZ3lV6aSyKG z6rT0FlH2+weg== Received: by pali.im (Postfix) id D024C1495; Mon, 9 May 2022 20:55:18 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Simon Glass , Stefan Roese Cc: u-boot@lists.denx.de Subject: [PATCH] SPL: Do not allow enabling SPL symbols for non-SPL builds Date: Mon, 9 May 2022 20:53:50 +0200 Message-Id: <20220509185350.19752-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean It does not make sense to enable SPL options when not building SPL binary. So disallow selecting SPL options for non-SPL builds. Signed-off-by: Pali Rohár --- arch/arm/Kconfig | 6 +++++- arch/arm/cpu/armv8/Kconfig | 2 ++ common/Kconfig | 5 +++++ common/spl/Kconfig | 4 ++-- drivers/firmware/Kconfig | 1 + drivers/gpio/Kconfig | 1 + drivers/misc/Kconfig | 1 + drivers/mmc/Kconfig | 5 +++++ drivers/mtd/spi/Kconfig | 1 + drivers/power/Kconfig | 1 + drivers/power/acpi_pmc/Kconfig | 1 + drivers/power/regulator/Kconfig | 1 + fs/cbfs/Kconfig | 1 + lib/Kconfig | 10 +++++++++- 14 files changed, 36 insertions(+), 4 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 0afec5155b1b..e4b2b76650fe 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -985,7 +985,7 @@ config ARCH_MX6 imply SYS_THUMB_BUILD imply SPL_SEPARATE_BSS -if ARCH_MX6 +if ARCH_MX6 && SPL config SPL_LDSCRIPT default "arch/arm/mach-omap2/u-boot-spl.lds" endif @@ -2343,7 +2343,11 @@ source "arch/arm/Kconfig.debug" endmenu +if SPL + config SPL_LDSCRIPT default "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" if (ARCH_MX23 || ARCH_MX28) && !SPL_FRAMEWORK default "arch/arm/cpu/arm1136/u-boot-spl.lds" if CPU_ARM1136 default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARM64 + +endif diff --git a/arch/arm/cpu/armv8/Kconfig b/arch/arm/cpu/armv8/Kconfig index 09f3f50fa22f..0476446bc5ba 100644 --- a/arch/arm/cpu/armv8/Kconfig +++ b/arch/arm/cpu/armv8/Kconfig @@ -76,6 +76,7 @@ config ARMV8_SEC_FIRMWARE_SUPPORT config SPL_ARMV8_SEC_FIRMWARE_SUPPORT bool "Enable ARMv8 secure monitor firmware framework support for SPL" + depends on SPL select SPL_FIT select SPL_OF_LIBFDT help @@ -83,6 +84,7 @@ config SPL_ARMV8_SEC_FIRMWARE_SUPPORT config SPL_RECOVER_DATA_SECTION bool "save/restore SPL data section" + depends on SPL help Say Y here to save SPL data section for cold boot, and restore at warm boot in SPL phase. diff --git a/common/Kconfig b/common/Kconfig index a96842a5c11d..8e59dcef4b8b 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -81,10 +81,14 @@ config LOGLEVEL 8 - debug content 9 - debug hardware I/O +if SPL + config SPL_LOGLEVEL int default LOGLEVEL +endif + config TPL_LOGLEVEL int default LOGLEVEL @@ -241,6 +245,7 @@ config SYS_STDIO_DEREGISTER config SPL_SYS_STDIO_DEREGISTER bool "Allow deregistering stdio devices in SPL" + depends on SPL help Generally there is no need to deregister stdio devices since they are never deactivated. But if a stdio device is used which can be diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 84f2847c724b..3cfb19331272 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -19,6 +19,8 @@ config SPL help If you want to build SPL as well as the normal image, say Y. +if SPL + config SPL_FRAMEWORK bool "Support SPL based upon the common SPL framework" depends on SPL @@ -150,8 +152,6 @@ config HANDOFF in boot. It is available in gd->handoff. The state state is set up in SPL (or TPL if that is being used). -if SPL - config SPL_HANDOFF bool "Pass hand-off information from SPL to U-Boot proper" depends on HANDOFF && SPL_BLOBLIST diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index ef958b3a7a4e..55069e395ff2 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -3,6 +3,7 @@ config FIRMWARE config SPL_FIRMWARE bool "Enable Firmware driver support in SPL" + depends on SPL depends on FIRMWARE config SPL_ARM_PSCI_FW diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 149a62ffe611..3ba97515b718 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -490,6 +490,7 @@ config DM_PCA953X config SPL_DM_PCA953X bool "PCA95[357]x, PCA9698, TCA64xx, and MAX7310 I/O ports in SPL" + depends on SPL depends on DM_GPIO help Say yes here to provide access to several register-oriented diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 9af806a20ae9..b99e7c25b807 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -492,6 +492,7 @@ config FS_LOADER config SPL_FS_LOADER bool "Enable loader driver for file system" + depends on SPL help This is file system generic loader which can be used to load the file image from the storage into target such as memory. diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index f04cc44e1973..a3f0cd00ed74 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -123,6 +123,7 @@ config MMC_IO_VOLTAGE config SPL_MMC_IO_VOLTAGE bool "Support IO voltage configuration in SPL" + depends on SPL help IO voltage configuration allows selecting the voltage level of the IO lines (not the level of main supply). This is required for UHS @@ -153,6 +154,7 @@ config MMC_HS400_ES_SUPPORT config SPL_MMC_HS400_ES_SUPPORT bool "enable HS400 Enhanced Strobe support in SPL" + depends on SPL help The HS400 Enhanced Strobe mode is support by some eMMC. The bus frequency is up to 200MHz. This mode does not tune the IO. @@ -166,6 +168,7 @@ config MMC_HS400_SUPPORT config SPL_MMC_HS400_SUPPORT bool "enable HS400 support in SPL" + depends on SPL select SPL_MMC_HS200_SUPPORT help The HS400 mode is support by some eMMC. The bus frequency is up to @@ -179,6 +182,7 @@ config MMC_HS200_SUPPORT config SPL_MMC_HS200_SUPPORT bool "enable HS200 support in SPL" + depends on SPL help The HS200 mode is support by some eMMC. The bus frequency is up to 200MHz. This mode requires tuning the IO. @@ -478,6 +482,7 @@ config MMC_SDHCI_ADMA config SPL_MMC_SDHCI_ADMA bool "Support SDHCI ADMA2 in SPL" + depends on SPL depends on MMC_SDHCI select MMC_SDHCI_ADMA_HELPERS help diff --git a/drivers/mtd/spi/Kconfig b/drivers/mtd/spi/Kconfig index f350c7e5dc21..eed51bb22b09 100644 --- a/drivers/mtd/spi/Kconfig +++ b/drivers/mtd/spi/Kconfig @@ -248,6 +248,7 @@ config SPI_FLASH_MTD config SPL_SPI_FLASH_MTD bool "SPI flash MTD support for SPL" + depends on SPL depends on SPI_FLASH help Enable the MTD support for the SPI flash layer in SPL. diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig index 2c20dc7c8318..1d184b285875 100644 --- a/drivers/power/Kconfig +++ b/drivers/power/Kconfig @@ -29,6 +29,7 @@ config POWER_LEGACY config SPL_POWER_LEGACY bool "Legacy power support in SPL" + depends on SPL default y if POWER_LEGACY help Note: This is a legacy option. Use SPL_DM_PMIC instead. diff --git a/drivers/power/acpi_pmc/Kconfig b/drivers/power/acpi_pmc/Kconfig index fcd50e36cad4..8b712abc41e9 100644 --- a/drivers/power/acpi_pmc/Kconfig +++ b/drivers/power/acpi_pmc/Kconfig @@ -8,6 +8,7 @@ config ACPI_PMC config SPL_ACPI_PMC bool "Power Manager (x86 PMC) support in SPL" + depends on SPL default y if ACPI_PMC help Enable support for an x86-style power-management controller which diff --git a/drivers/power/regulator/Kconfig b/drivers/power/regulator/Kconfig index cd253b95f2f0..dde694a5c44b 100644 --- a/drivers/power/regulator/Kconfig +++ b/drivers/power/regulator/Kconfig @@ -148,6 +148,7 @@ config DM_REGULATOR_FIXED config SPL_DM_REGULATOR_FIXED bool "Enable Driver Model for REGULATOR Fixed value in SPL" + depends on SPL_DM_REGULATOR depends on DM_REGULATOR_FIXED select SPL_DM_REGULATOR_COMMON ---help--- diff --git a/fs/cbfs/Kconfig b/fs/cbfs/Kconfig index 03980d830d30..b6639928f4af 100644 --- a/fs/cbfs/Kconfig +++ b/fs/cbfs/Kconfig @@ -9,6 +9,7 @@ config FS_CBFS config SPL_FS_CBFS bool "Enable CBFS (Coreboot Filesystem) in SPL" + depends on SPL help Define this to enable support for reading from a Coreboot filesystem. This is a ROM-based filesystem used for accessing files diff --git a/lib/Kconfig b/lib/Kconfig index acc0ac081a44..299381ac80d5 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -239,6 +239,7 @@ config GENERATE_ACPI_TABLE config SPL_TINY_MEMSET bool "Use a very small memset() in SPL" + depends on SPL help The faster memset() is the arch-specific one (if available) enabled by CONFIG_USE_ARCH_MEMSET. If that is not enabled, we can still get @@ -556,6 +557,7 @@ config MD5 config SPL_MD5 bool "Support MD5 algorithm in SPL" + depends on SPL help This option enables MD5 support in SPL. MD5 is an algorithm designed in 1991 that produces a 16-byte digest (or checksum) from its input @@ -642,6 +644,7 @@ config ZSTD config SPL_LZ4 bool "Enable LZ4 decompression support in SPL" + depends on SPL help This enables support for the LZ4 decompression algorithm in SPL. LZ4 is a lossless data compression algorithm that is focused on @@ -650,6 +653,7 @@ config SPL_LZ4 config SPL_LZMA bool "Enable LZMA decompression support for SPL build" + depends on SPL help This enables support for LZMA compression algorithm for SPL boot. @@ -661,22 +665,26 @@ config VPL_LZMA config SPL_LZO bool "Enable LZO decompression support in SPL" + depends on SPL help This enables support for LZO compression algorithm in the SPL. config SPL_GZIP bool "Enable gzip decompression support for SPL build" + depends on SPL select SPL_ZLIB help This enables support for the GZIP compression algorithm for SPL boot. config SPL_ZLIB bool + depends on SPL help This enables compression lib for SPL boot. config SPL_ZSTD bool "Enable Zstandard decompression support in SPL" + depends on SPL select XXHASH help This enables Zstandard decompression library in the SPL. @@ -749,7 +757,7 @@ config SPL_OF_LIBFDT config SPL_OF_LIBFDT_ASSUME_MASK hex "Mask of conditions to assume for libfdt" - depends on SPL_OF_LIBFDT || FIT + depends on SPL_OF_LIBFDT || (SPL && FIT) default 0xff help Use this to change the assumptions made by libfdt in SPL about the -- 2.20.1