Skip to contentSkip to conversation

arm64: zynqmp: Add missing ZYNQMP_FIRMWARE dependencies

PATCH Applied Ashok Reddy Soma 2 participants 2 messages Feb 1, 2023 – Feb 3, 2023

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: zynqmp: Add missing ZYNQMP_FIRMWARE dependencies

From: Algapally Santosh Sagar <[email protected]>

There are missing Kconfig dependencies in the code which is using firmware interface.
The commit 71efd45a5fc7 ("arm64: zynqmp: Change firmware dependency") add option to also disable ZYNQMP_FIRMWARE. But not all Kconfig dependencies were properly described and also sdhci and gem drivers didn't protect the code properly.
So, add the missing ZYNQMP_FIRMWARE dependencies.

---

 board/xilinx/zynqmp/Kconfig | 1 +
 drivers/clk/Kconfig         | 4 ++--
 drivers/fpga/Kconfig        | 2 +-
 drivers/mmc/zynq_sdhci.c    | 4 ++--
 drivers/net/zynq_gem.c      | 2 +-
 5 files changed, 7 insertions(+), 6 deletions(-)
board/xilinx/zynqmp/Kconfig +1 -0
index 7d1f7398c3..ffa2f0215d 100644
@@ -6,6 +6,7 @@ if ARCH_ZYNQMP
 
 config CMD_ZYNQMP
 	bool "Enable ZynqMP specific commands"
+	depends on ZYNQMP_FIRMWARE
 	default y
 	help
 	  Enable ZynqMP specific commands like "zynqmp secure"
drivers/clk/Kconfig +2 -2
index 09aa97ee8c..42280cbf83 100644
@@ -185,7 +185,7 @@ config CLK_VERSACLOCK
 config CLK_VERSAL
 	bool "Enable clock driver support for Versal"
 	depends on (ARCH_VERSAL || ARCH_VERSAL_NET)
-	select ZYNQMP_FIRMWARE
+	imply ZYNQMP_FIRMWARE
 	help
 	  This clock driver adds support for clock realted settings for
 	  Versal platform.
@@ -219,7 +219,7 @@ config CLK_ZYNQ
 config CLK_ZYNQMP
 	bool "Enable clock driver support for ZynqMP"
 	depends on ARCH_ZYNQMP
-	select ZYNQMP_FIRMWARE
+	imply ZYNQMP_FIRMWARE
 	help
 	  This clock driver adds support for clock realted settings for
 	  ZynqMP platform.
drivers/fpga/Kconfig +1 -1
index 4113de230c..f8b0aeb3ee 100644
@@ -63,7 +63,7 @@ config FPGA_XILINX
 
 config FPGA_ZYNQMPPL
 	bool "Enable Xilinx FPGA driver for ZynqMP"
-	depends on FPGA_XILINX
+	depends on FPGA_XILINX && ZYNQMP_FIRMWARE
 	help
 	  Enable FPGA driver for loading bitstream in BIT and BIN format
 	  on Xilinx Zynq UltraScale+ (ZynqMP) device.
drivers/mmc/zynq_sdhci.c +2 -2
index 91e309d275..8b559d8a7a 100644
@@ -988,7 +988,7 @@ static const struct sdhci_ops arasan_ops = {
 };
 #endif
 
-#if defined(CONFIG_ARCH_ZYNQMP)
+#if defined(CONFIG_ARCH_ZYNQMP) && defined(CONFIG_ZYNQMP_FIRMWARE)
 static int sdhci_zynqmp_set_dynamic_config(struct arasan_sdhci_priv *priv,
 					   struct udevice *dev)
 {
@@ -1090,7 +1090,7 @@ static int arasan_sdhci_probe(struct udevice *dev)
 
 	host = priv->host;
 
-#if defined(CONFIG_ARCH_ZYNQMP)
+#if defined(CONFIG_ARCH_ZYNQMP) && defined(CONFIG_ZYNQMP_FIRMWARE)
 	if (device_is_compatible(dev, "xlnx,zynqmp-8.9a")) {
 		ret = zynqmp_pm_is_function_supported(PM_IOCTL,
 						      IOCTL_SET_SD_CONFIG);
drivers/net/zynq_gem.c +1 -1
index cc49788012..211b2c6e55 100644
@@ -738,7 +738,7 @@ static int gem_zynqmp_set_dynamic_config(struct udevice *dev)
 	u32 pm_info[2];
 	int ret;
 
-	if (IS_ENABLED(CONFIG_ARCH_ZYNQMP)) {
+	if (IS_ENABLED(CONFIG_ARCH_ZYNQMP) && IS_ENABLED(CONFIG_ZYNQMP_FIRMWARE)) {
 		if (!zynqmp_pm_is_function_supported(PM_IOCTL,
 						     IOCTL_SET_GEM_CONFIG)) {
 			ret = ofnode_read_u32_array(dev_ofnode(dev),
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 95 lines · Ashok Reddy Soma

From: Algapally Santosh Sagar <[email protected]>

There are missing Kconfig dependencies in the code which is using firmware interface.
The commit 71efd45a5fc7 ("arm64: zynqmp: Change firmware dependency") add option to also disable ZYNQMP_FIRMWARE. But not all Kconfig dependencies were properly described and also sdhci and gem drivers didn't protect the code properly.
So, add the missing ZYNQMP_FIRMWARE dependencies.

---

  board/xilinx/zynqmp/Kconfig | 1 +
  drivers/clk/Kconfig         | 4 ++--
  drivers/fpga/Kconfig        | 2 +-
  drivers/mmc/zynq_sdhci.c    | 4 ++--
  drivers/net/zynq_gem.c      | 2 +-
  5 files changed, 7 insertions(+), 6 deletions(-)
board/xilinx/zynqmp/Kconfig +1 -0
index 7d1f7398c3..ffa2f0215d 100644
@@ -6,6 +6,7 @@ if ARCH_ZYNQMP
 
  config CMD_ZYNQMP
  	bool "Enable ZynqMP specific commands"
+	depends on ZYNQMP_FIRMWARE
  	default y
  	help
  	  Enable ZynqMP specific commands like "zynqmp secure"
drivers/clk/Kconfig +2 -2
index 09aa97ee8c..42280cbf83 100644
@@ -185,7 +185,7 @@ config CLK_VERSACLOCK
  config CLK_VERSAL
  	bool "Enable clock driver support for Versal"
  	depends on (ARCH_VERSAL || ARCH_VERSAL_NET)
-	select ZYNQMP_FIRMWARE
+	imply ZYNQMP_FIRMWARE
  	help
  	  This clock driver adds support for clock realted settings for
  	  Versal platform.
@@ -219,7 +219,7 @@ config CLK_ZYNQ
  config CLK_ZYNQMP
  	bool "Enable clock driver support for ZynqMP"
  	depends on ARCH_ZYNQMP
-	select ZYNQMP_FIRMWARE
+	imply ZYNQMP_FIRMWARE
  	help
  	  This clock driver adds support for clock realted settings for
  	  ZynqMP platform.
drivers/fpga/Kconfig +1 -1
index 4113de230c..f8b0aeb3ee 100644
@@ -63,7 +63,7 @@ config FPGA_XILINX
 
  config FPGA_ZYNQMPPL
  	bool "Enable Xilinx FPGA driver for ZynqMP"
-	depends on FPGA_XILINX
+	depends on FPGA_XILINX && ZYNQMP_FIRMWARE
  	help
  	  Enable FPGA driver for loading bitstream in BIT and BIN format
  	  on Xilinx Zynq UltraScale+ (ZynqMP) device.
drivers/mmc/zynq_sdhci.c +2 -2
index 91e309d275..8b559d8a7a 100644
@@ -988,7 +988,7 @@ static const struct sdhci_ops arasan_ops = {
  };
  #endif
 
-#if defined(CONFIG_ARCH_ZYNQMP)
+#if defined(CONFIG_ARCH_ZYNQMP) && defined(CONFIG_ZYNQMP_FIRMWARE)
  static int sdhci_zynqmp_set_dynamic_config(struct arasan_sdhci_priv *priv,
  					   struct udevice *dev)
  {
@@ -1090,7 +1090,7 @@ static int arasan_sdhci_probe(struct udevice *dev)
 
  	host = priv->host;
 
-#if defined(CONFIG_ARCH_ZYNQMP)
+#if defined(CONFIG_ARCH_ZYNQMP) && defined(CONFIG_ZYNQMP_FIRMWARE)
  	if (device_is_compatible(dev, "xlnx,zynqmp-8.9a")) {
  		ret = zynqmp_pm_is_function_supported(PM_IOCTL,
  						      IOCTL_SET_SD_CONFIG);
drivers/net/zynq_gem.c +0 -0
index cc49788012..211b2c6e55 100644

drivers/net/zynq_gem.c static int gem_zynqmp_set_dynamic_config(struct udevice *dev) · line 744

Quoted 8 lines
drivers/net/zynq_gem.c +1 -1
@@ -738,7 +738,7 @@ static int gem_zynqmp_set_dynamic_config(struct udevice *dev)
  	u32 pm_info[2];
  	int ret;
 
-	if (IS_ENABLED(CONFIG_ARCH_ZYNQMP)) {
+	if (IS_ENABLED(CONFIG_ARCH_ZYNQMP) && IS_ENABLED(CONFIG_ZYNQMP_FIRMWARE)) {
  		if (!zynqmp_pm_is_function_supported(PM_IOCTL,
  						     IOCTL_SET_GEM_CONFIG)) {
  			ret = ofnode_read_u32_array(dev_ofnode(dev),

Applied.
M