mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: uol@pengutronix.de, Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master v2 7/7] firmware: don't hardcode firmware paths in srctree for existence check
Date: Tue, 27 Jun 2023 07:52:39 +0200	[thread overview]
Message-ID: <20230627055239.3908872-8-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230627055239.3908872-1-a.fatoum@pengutronix.de>

Now that PBL firmware can be made optional, we can drop the existence
checks in the Kconfig. These were flawed anyway, because they didn't
take CONFIG_EXTRA_FIRMWARE_DIR into account and they led to issues with
build system recipes that didn't expect firmware to be required before
compilation step at oldconfig/menuconfig time.

This effectively reverts commits:

  624962fb45c6 ("ARM: i.MX: make boards selectable only when firmware files are present")
  4ff2e5510ec9 ("ARM: Rockchip: make boards only selectable when firmware is present")
  41a89611774a ("ARM: rockchip: don't attempt building MACH_RADXA_ROCK5 without firmware")

Reported-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-imx/Kconfig      | 49 ----------------------------------
 arch/arm/mach-rockchip/Kconfig |  6 -----
 firmware/Kconfig               | 39 ---------------------------
 3 files changed, 94 deletions(-)

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 4c93c1244a6a..ef0e5fc5611b 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -555,35 +555,9 @@ if 64BIT
 
 comment "i.MX8M boards"
 
-if !HAVE_FIRMWARE_IMX_LPDDR4_PMU_TRAIN
-comment "LPDDR4 firmware files missing, some boards are not selectable"
-endif
-
-if !HAVE_FIRMWARE_IMX_DDR4_PMU_TRAIN
-comment "DDR4 firmware files missing, some boards are not selectable"
-endif
-
-if !HAVE_FIRMWARE_IMX8MM_ATF
-comment "i.MX8MM TF-A files missing, i.MX8MM boards are disabled"
-endif
-
-if !HAVE_FIRMWARE_IMX8MQ_ATF
-comment "i.MX8MQ TF-A files missing, i.MX8MQ boards are disabled"
-endif
-
-if !HAVE_FIRMWARE_IMX8MN_ATF
-comment "i.MX8MN TF-A files missing, i.MX8MN boards are disabled"
-endif
-
-if !HAVE_FIRMWARE_IMX8MP_ATF
-comment "i.MX8MP TF-A files missing, i.MX8MP boards are disabled"
-endif
-
 config MACH_INNOCOMM_WB15
 	bool "InnoComm WB15 (i.MX8MM) EVK"
 	select ARCH_IMX8MM
-	depends on HAVE_FIRMWARE_IMX_LPDDR4_PMU_TRAIN
-	depends on HAVE_FIRMWARE_IMX8MM_ATF
 	select FIRMWARE_IMX_LPDDR4_PMU_TRAIN
 	select FIRMWARE_IMX8MM_ATF
 	select ARM_SMCCC
@@ -596,8 +570,6 @@ config MACH_INNOCOMM_WB15
 config MACH_MNT_REFORM
 	bool "MNT Reform"
 	select ARCH_IMX8MQ
-	depends on HAVE_FIRMWARE_IMX_LPDDR4_PMU_TRAIN
-	depends on HAVE_FIRMWARE_IMX8MQ_ATF
 	select FIRMWARE_IMX_LPDDR4_PMU_TRAIN
 	select FIRMWARE_IMX8MQ_ATF
 	select ARM_SMCCC
@@ -607,8 +579,6 @@ config MACH_MNT_REFORM
 config MACH_NXP_IMX8MM_EVK
 	bool "NXP i.MX8MM EVK Board"
 	select ARCH_IMX8MM
-	depends on HAVE_FIRMWARE_IMX_LPDDR4_PMU_TRAIN
-	depends on HAVE_FIRMWARE_IMX8MM_ATF
 	select FIRMWARE_IMX_LPDDR4_PMU_TRAIN
 	select FIRMWARE_IMX8MM_ATF
 	select ARM_SMCCC
@@ -620,9 +590,6 @@ config MACH_NXP_IMX8MM_EVK
 config MACH_NXP_IMX8MN_EVK
 	bool "NXP i.MX8MN EVK Board"
 	select ARCH_IMX8MN
-	depends on HAVE_FIRMWARE_IMX_LPDDR4_PMU_TRAIN
-	depends on HAVE_FIRMWARE_IMX_DDR4_PMU_TRAIN
-	depends on HAVE_FIRMWARE_IMX8MN_ATF
 	select FIRMWARE_IMX_LPDDR4_PMU_TRAIN
 	select FIRMWARE_IMX_DDR4_PMU_TRAIN
 	select FIRMWARE_IMX8MN_ATF
@@ -634,8 +601,6 @@ config MACH_NXP_IMX8MN_EVK
 config MACH_NXP_IMX8MP_EVK
 	bool "NXP i.MX8MP EVK Board"
 	select ARCH_IMX8MP
-	depends on HAVE_FIRMWARE_IMX_LPDDR4_PMU_TRAIN
-	depends on HAVE_FIRMWARE_IMX8MP_ATF
 	select FIRMWARE_IMX_LPDDR4_PMU_TRAIN
 	select FIRMWARE_IMX8MP_ATF
 	select ARM_SMCCC
@@ -646,8 +611,6 @@ config MACH_NXP_IMX8MP_EVK
 config MACH_NXP_IMX8MQ_EVK
 	bool "NXP i.MX8MQ EVK Board"
 	select ARCH_IMX8MQ
-	depends on HAVE_FIRMWARE_IMX_LPDDR4_PMU_TRAIN
-	depends on HAVE_FIRMWARE_IMX8MQ_ATF
 	select FIRMWARE_IMX_LPDDR4_PMU_TRAIN
 	select FIRMWARE_IMX8MQ_ATF
 	select ARM_SMCCC
@@ -656,8 +619,6 @@ config MACH_NXP_IMX8MQ_EVK
 config MACH_PHYTEC_SOM_IMX8MQ
 	bool "Phytec i.MX8M SOM"
 	select ARCH_IMX8MQ
-	depends on HAVE_FIRMWARE_IMX_LPDDR4_PMU_TRAIN
-	depends on HAVE_FIRMWARE_IMX8MQ_ATF
 	select FIRMWARE_IMX_LPDDR4_PMU_TRAIN
 	select FIRMWARE_IMX8MQ_ATF
 	select ARM_SMCCC
@@ -666,8 +627,6 @@ config MACH_PHYTEC_SOM_IMX8MQ
 config MACH_POLYHEX_DEBIX
 	bool "Polyhex DEBIX Model-A/B (i.MX8MP) Board"
 	select ARCH_IMX8MP
-	depends on HAVE_FIRMWARE_IMX_LPDDR4_PMU_TRAIN
-	depends on HAVE_FIRMWARE_IMX8MP_ATF
 	select FIRMWARE_IMX_LPDDR4_PMU_TRAIN
 	select FIRMWARE_IMX8MP_ATF
 	select ARM_SMCCC
@@ -678,8 +637,6 @@ config MACH_POLYHEX_DEBIX
 config MACH_PROTONIC_IMX8M
 	bool "Protonic-Holland i.MX8Mx based boards"
 	select ARCH_IMX8MM
-	depends on HAVE_FIRMWARE_IMX_LPDDR4_PMU_TRAIN
-	depends on HAVE_FIRMWARE_IMX8MM_ATF
 	select FIRMWARE_IMX_LPDDR4_PMU_TRAIN
 	select FIRMWARE_IMX8MM_ATF
 	select ARM_SMCCC
@@ -690,8 +647,6 @@ config MACH_PROTONIC_IMX8M
 config MACH_TQ_MBA8MPXL
 	bool "TQ i.MX8MP Dual/Quad on MBa8MPxL Board"
 	select ARCH_IMX8MP
-	depends on HAVE_FIRMWARE_IMX_LPDDR4_PMU_TRAIN
-	depends on HAVE_FIRMWARE_IMX8MP_ATF
 	select FIRMWARE_IMX_LPDDR4_PMU_TRAIN
 	select FIRMWARE_IMX8MP_ATF
 	select ARM_SMCCC
@@ -702,8 +657,6 @@ config MACH_TQ_MBA8MPXL
 config MACH_VARISCITE_DT8MCUSTOMBOARD_IMX8MP
 	bool "Variscite DT8MCustomBoard with DART-MX8M-PLUS"
 	select ARCH_IMX8MP
-	depends on HAVE_FIRMWARE_IMX_LPDDR4_PMU_TRAIN
-	depends on HAVE_FIRMWARE_IMX8MP_ATF
 	select FIRMWARE_IMX_LPDDR4_PMU_TRAIN
 	select FIRMWARE_IMX8MP_ATF
 	select ARM_SMCCC
@@ -714,8 +667,6 @@ config MACH_VARISCITE_DT8MCUSTOMBOARD_IMX8MP
 config MACH_ZII_IMX8MQ_DEV
 	bool "ZII i.MX8MQ based devices"
 	select ARCH_IMX8MQ
-	depends on HAVE_FIRMWARE_IMX_LPDDR4_PMU_TRAIN
-	depends on HAVE_FIRMWARE_IMX8MQ_ATF
 	select FIRMWARE_IMX_LPDDR4_PMU_TRAIN
 	select FIRMWARE_IMX8MQ_ATF
 	select ARM_SMCCC
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index a71c4ae35dd9..8cdf2c28a912 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -75,42 +75,36 @@ if 64BIT
 
 config MACH_RK3568_EVB
 	select ARCH_RK3568
-	depends on $(success,test -e $(srctree)/arch/arm/boards/rockchip-rk3568-evb/sdram-init.bin)
 	bool "RK3568 EVB"
 	help
 	  Say Y here if you are using a RK3568 EVB
 
 config MACH_RK3568_BPI_R2PRO
 	select ARCH_RK3568
-	depends on $(success,test -e $(srctree)/arch/arm/boards/rockchip-rk3568-bpi-r2pro/sdram-init.bin)
 	bool "RK3568 BPI R2PRO"
 	help
 	  Say Y here if you are using a RK3568 Bananpi R2 Pro
 
 config MACH_PINE64_QUARTZ64
 	select ARCH_RK3568
-	depends on $(success,test -e $(srctree)/arch/arm/boards/pine64-quartz64/sdram-init.bin)
 	bool "Pine64 Quartz64"
 	help
 	  Say Y here if you are using a Pine64 Quartz64
 
 config MACH_RADXA_ROCK3
 	select ARCH_RK3568
-	depends on $(success,test -e $(srctree)/arch/arm/boards/radxa-rock3/sdram-init.bin)
 	bool "Radxa ROCK3"
 	help
 	  Say Y here if you are using a Radxa ROCK3
 
 config MACH_RADXA_ROCK5
 	select ARCH_RK3588
-	depends on $(success,test -e $(srctree)/arch/arm/boards/radxa-rock5/sdram-init.bin)
 	bool "Radxa ROCK5"
 	help
 	  Say Y here if you are using a Radxa ROCK5
 
 config MACH_RADXA_CM3
 	select ARCH_RK3568
-	depends on $(success,test -e $(srctree)/arch/arm/boards/radxa-cm3/sdram-init.bin)
 	bool "Radxa CM3"
 	help
 	  Say Y here if you are using a Radxa CM3
diff --git a/firmware/Kconfig b/firmware/Kconfig
index 56d6d0d6c030..3328dbc0b111 100644
--- a/firmware/Kconfig
+++ b/firmware/Kconfig
@@ -20,74 +20,35 @@ config MISSING_FIRMWARE_ERROR
 	  If in doubt, say Y and refer to the documentation on where to acquire the
 	  needed firmware.
 
-config HAVE_FIRMWARE_IMX_LPDDR4_PMU_TRAIN
-	bool
-	default y
-	depends on $(success,test -e $(srctree)/firmware/lpddr4_pmu_train_1d_dmem.bin)
-	depends on $(success,test -e $(srctree)/firmware/lpddr4_pmu_train_1d_imem.bin)
-	depends on $(success,test -e $(srctree)/firmware/lpddr4_pmu_train_2d_dmem.bin)
-	depends on $(success,test -e $(srctree)/firmware/lpddr4_pmu_train_2d_imem.bin)
-
 config FIRMWARE_IMX_LPDDR4_PMU_TRAIN
 	bool
 
-config HAVE_FIRMWARE_IMX_DDR4_PMU_TRAIN
-	bool
-	default y
-	depends on $(success,test -e $(srctree)/firmware/ddr4_dmem_1d.bin)
-	depends on $(success,test -e $(srctree)/firmware/ddr4_dmem_2d.bin)
-	depends on $(success,test -e $(srctree)/firmware/ddr4_imem_1d.bin)
-	depends on $(success,test -e $(srctree)/firmware/ddr4_imem_2d.bin)
-
 config FIRMWARE_IMX_DDR4_PMU_TRAIN
 	bool
 
-config HAVE_FIRMWARE_IMX8MM_ATF
-	bool
-	default y
-	depends on $(success,test -e $(srctree)/firmware/imx8mm-bl31.bin)
-
 config FIRMWARE_IMX8MM_ATF
 	bool
 
-config HAVE_FIRMWARE_IMX8MN_ATF
-	bool
-	default y
-	depends on $(success,test -e $(srctree)/firmware/imx8mn-bl31.bin)
-
 config FIRMWARE_IMX8MN_ATF
 	bool
 
-config HAVE_FIRMWARE_IMX8MP_ATF
-	bool
-	default y
-	depends on $(success,test -e $(srctree)/firmware/imx8mp-bl31.bin)
-
 config FIRMWARE_IMX8MP_ATF
 	bool
 
-config HAVE_FIRMWARE_IMX8MQ_ATF
-	bool
-	default y
-	depends on $(success,test -e $(srctree)/firmware/imx8mq-bl31.bin)
-
 config FIRMWARE_IMX8MQ_ATF
 	bool
 
 config FIRMWARE_IMX8MM_OPTEE
 	bool "install OP-TEE on i.MX8MM boards"
 	depends on FIRMWARE_IMX8MM_ATF && PBL_OPTEE
-	depends on $(success,test -e $(srctree)/firmware/imx8mm-bl32.bin)
 
 config FIRMWARE_IMX8MN_OPTEE
 	bool "install OP-TEE on i.MX8MN boards"
 	depends on FIRMWARE_IMX8MN_ATF && PBL_OPTEE
-	depends on $(success,test -e $(srctree)/firmware/imx8mn-bl32.bin)
 
 config FIRMWARE_IMX8MP_OPTEE
 	bool "install OP-TEE on i.MX8MP boards"
 	depends on FIRMWARE_IMX8MP_ATF && PBL_OPTEE
-	depends on $(success,test -e $(srctree)/firmware/imx8mp-bl32.bin)
 
 config FIRMWARE_CCBV2_OPTEE
 	bool
-- 
2.39.2




  parent reply	other threads:[~2023-06-27  5:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-27  5:52 [PATCH master v2 0/7] firmware: optionally turn missing firmware errors into warnings Ahmad Fatoum
2023-06-27  5:52 ` [PATCH master v2 1/7] firmware: reference pointer alignment defined in <asm-generic/pointer.h> Ahmad Fatoum
2023-06-28  7:14   ` Sascha Hauer
2023-06-27  5:52 ` [PATCH master v2 2/7] firmware: mark firmware used in PBL as pbl-only Ahmad Fatoum
2023-06-27  5:52 ` [PATCH master v2 3/7] firmware: turn missing firmware into linker error Ahmad Fatoum
2023-06-27  5:52 ` [PATCH master v2 4/7] firmware: optionally turn missing firmware errors into warnings Ahmad Fatoum
2023-06-27  5:52 ` [PATCH master v2 5/7] ARM64: Rockchip: gracefully handle missing firmware Ahmad Fatoum
2023-06-27  5:52 ` [PATCH master v2 6/7] ARM64: unset CONFIG_MISSING_FIRMWARE_ERROR for Rockchip/i.MX Ahmad Fatoum
2023-06-27  5:52 ` Ahmad Fatoum [this message]
2023-06-28  8:45 ` [PATCH master v2 0/7] firmware: optionally turn missing firmware errors into warnings Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230627055239.3908872-8-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=uol@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox