Skip to contentSkip to conversation

spl: ram: hide SPL_RAM_SUPPORT

PATCH In review Jerome Forissier 4 participants 5 messages Sep 10, 2024 – Sep 24, 2024 USB

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 spl: ram: hide SPL_RAM_SUPPORT

Make SPL_RAM_SUPPORT a hidden Kconfig symbol, automatically selected by SPL_RAM_DEVICE or SPL_DFU. Avoids the situation where SPL_RAM_SUPPORT may be enabled without the other two being enabled, which results in the following build warning:

common/spl/spl_ram.c:19:14: warning: ‘spl_ram_load_read’ defined but not used [-Wunused-function]
19 | static ulong spl_ram_load_read(struct spl_load_info *load, ulong sector,

      |              ^~~~~~~~~~~~~~~~~
---
 common/spl/Kconfig         | 8 ++------
 drivers/usb/gadget/Kconfig | 2 +-
 2 files changed, 3 insertions(+), 7 deletions(-)
common/spl/Kconfig +2 -6
index c08ff064493..885a012461c 100644
@@ -1238,15 +1238,11 @@ config SPL_POWER_DOMAIN
 	  the drivers in drivers/power/domain as part of a SPL build.
 
 config SPL_RAM_SUPPORT
-	bool "Support booting from RAM"
-	default y if MICROBLAZE || ARCH_SOCFPGA || ARCH_TEGRA || ARCH_ZYNQ
-	help
-	  Enable booting of an image in RAM. The image can be preloaded or
-	  it can be loaded by SPL directly into RAM (e.g. using USB).
+	bool
 
 config SPL_RAM_DEVICE
 	bool "Support booting from preloaded image in RAM"
-	depends on SPL_RAM_SUPPORT
+	select SPL_RAM_SUPPORT
 	default y if MICROBLAZE || ARCH_SOCFPGA || ARCH_TEGRA || ARCH_ZYNQ
 	help
 	  Enable booting of an image already loaded in RAM. The image has to
drivers/usb/gadget/Kconfig +1 -1
index 4621a6fd5e6..b1247a9eeae 100644
@@ -323,7 +323,7 @@ config SPL_DFU
 	bool "Support DFU (Device Firmware Upgrade) in SPL"
 	select SPL_HASH
 	select SPL_DFU_NO_RESET
-	depends on SPL_RAM_SUPPORT
+	select SPL_RAM_SUPPORT
 	help
 	  This feature enables the DFU (Device Firmware Upgrade) in SPL with
 	  RAM memory device support. The ROM code will load and execute
Signature · 1 line
2.40.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 42 lines · Jerome Forissier

Make SPL_RAM_SUPPORT a hidden Kconfig symbol, automatically selected by SPL_RAM_DEVICE or SPL_DFU. Avoids the situation where SPL_RAM_SUPPORT may be enabled without the other two being enabled, which results in the following build warning:

common/spl/spl_ram.c:19:14: warning: ‘spl_ram_load_read’ defined but not used [-Wunused-function]
19 | static ulong spl_ram_load_read(struct spl_load_info *load, ulong sector,
| ^~~~~~~~~~~~~~~~~

---
  common/spl/Kconfig         | 8 ++------
  drivers/usb/gadget/Kconfig | 2 +-
  2 files changed, 3 insertions(+), 7 deletions(-)
common/spl/Kconfig +2 -6
index c08ff064493..885a012461c 100644
@@ -1238,15 +1238,11 @@ config SPL_POWER_DOMAIN
  	  the drivers in drivers/power/domain as part of a SPL build.
 
  config SPL_RAM_SUPPORT
-	bool "Support booting from RAM"
-	default y if MICROBLAZE || ARCH_SOCFPGA || ARCH_TEGRA || ARCH_ZYNQ
-	help
-	  Enable booting of an image in RAM. The image can be preloaded or
-	  it can be loaded by SPL directly into RAM (e.g. using USB).
+	bool
 
  config SPL_RAM_DEVICE
  	bool "Support booting from preloaded image in RAM"
-	depends on SPL_RAM_SUPPORT
+	select SPL_RAM_SUPPORT
  	default y if MICROBLAZE || ARCH_SOCFPGA || ARCH_TEGRA || ARCH_ZYNQ
  	help
  	  Enable booting of an image already loaded in RAM. The image has to
drivers/usb/gadget/Kconfig +0 -0
index 4621a6fd5e6..b1247a9eeae 100644

drivers/usb/gadget/Kconfig config SPL_DFU · line 329

Quoted 8 lines
drivers/usb/gadget/Kconfig +1 -1
@@ -323,7 +323,7 @@ config SPL_DFU
  	bool "Support DFU (Device Firmware Upgrade) in SPL"
  	select SPL_HASH
  	select SPL_DFU_NO_RESET
-	depends on SPL_RAM_SUPPORT
+	select SPL_RAM_SUPPORT
  	help
  	  This feature enables the DFU (Device Firmware Upgrade) in SPL with
  	  RAM memory device support. The ROM code will load and execute
Reviewed-by on v2 1/1
#2 lore raw
In reply to Jerome Forissier
Quoted 10 lines · Jerome Forissier

Make SPL_RAM_SUPPORT a hidden Kconfig symbol, automatically selected by SPL_RAM_DEVICE or SPL_DFU. Avoids the situation where SPL_RAM_SUPPORT may be enabled without the other two being enabled, which results in the following build warning:

common/spl/spl_ram.c:19:14: warning: ‘spl_ram_load_read’ defined but not used [-Wunused-function]
19 | static ulong spl_ram_load_read(struct spl_load_info *load, ulong sector,

      |              ^~~~~~~~~~~~~~~~~
Signature · 1 line
Tom
Reviewed-by on v2 1/1
#3 lore raw
In reply to Jerome Forissier

Hi Jerome,

Thank you for the patch.

Quoted 10 lines · Jerome Forissier

Make SPL_RAM_SUPPORT a hidden Kconfig symbol, automatically selected by SPL_RAM_DEVICE or SPL_DFU. Avoids the situation where SPL_RAM_SUPPORT may be enabled without the other two being enabled, which results in the following build warning:

common/spl/spl_ram.c:19:14: warning: ‘spl_ram_load_read’ defined but not used [-Wunused-function]
19 | static ulong spl_ram_load_read(struct spl_load_info *load, ulong sector,

      |              ^~~~~~~~~~~~~~~~~
Quoted 42 lines
---
 common/spl/Kconfig         | 8 ++------
 drivers/usb/gadget/Kconfig | 2 +-
 2 files changed, 3 insertions(+), 7 deletions(-)
common/spl/Kconfig +2 -6
index c08ff064493..885a012461c 100644
@@ -1238,15 +1238,11 @@ config SPL_POWER_DOMAIN
 	  the drivers in drivers/power/domain as part of a SPL build.
 
 config SPL_RAM_SUPPORT
-	bool "Support booting from RAM"
-	default y if MICROBLAZE || ARCH_SOCFPGA || ARCH_TEGRA || ARCH_ZYNQ
-	help
-	  Enable booting of an image in RAM. The image can be preloaded or
-	  it can be loaded by SPL directly into RAM (e.g. using USB).
+	bool
 
 config SPL_RAM_DEVICE
 	bool "Support booting from preloaded image in RAM"
-	depends on SPL_RAM_SUPPORT
+	select SPL_RAM_SUPPORT
 	default y if MICROBLAZE || ARCH_SOCFPGA || ARCH_TEGRA || ARCH_ZYNQ
 	help
 	  Enable booting of an image already loaded in RAM. The image has to
drivers/usb/gadget/Kconfig +1 -1
index 4621a6fd5e6..b1247a9eeae 100644
@@ -323,7 +323,7 @@ config SPL_DFU
 	bool "Support DFU (Device Firmware Upgrade) in SPL"
 	select SPL_HASH
 	select SPL_DFU_NO_RESET
-	depends on SPL_RAM_SUPPORT
+	select SPL_RAM_SUPPORT
 	help
 	  This feature enables the DFU (Device Firmware Upgrade) in SPL with
 	  RAM memory device support. The ROM code will load and execute
Signature · 1 line
2.40.1
#4 lore raw
In reply to Jerome Forissier
Quoted 10 lines · Jerome Forissier

Make SPL_RAM_SUPPORT a hidden Kconfig symbol, automatically selected by SPL_RAM_DEVICE or SPL_DFU. Avoids the situation where SPL_RAM_SUPPORT may be enabled without the other two being enabled, which results in the following build warning:

common/spl/spl_ram.c:19:14: warning: ‘spl_ram_load_read’ defined but not used [-Wunused-function]
19 | static ulong spl_ram_load_read(struct spl_load_info *load, ulong sector,

      |              ^~~~~~~~~~~~~~~~~

[...]

Applied to u-boot/next, thanks!

Signature · 1 line
Tom