Skip to contentSkip to conversation

Make FPGA a menuconfig to ease disabling it all

PATCH In review Vincent Legoll 4 participants 7 messages Apr 14, 2017 – May 24, 2017 FPGA manager framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make FPGA a menuconfig to ease disabling it all

No need to get into the submenu to disable all FPGA-related config entries

---
 drivers/fpga/Kconfig | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)
drivers/fpga/Kconfig +8 -13
index ce861a2..fa1a95e 100644
@@ -2,32 +2,30 @@
 # FPGA framework configuration
 #
 
-menu "FPGA Configuration Support"
-
-config FPGA
+menuconfig FPGA
 	tristate "FPGA Configuration Framework"
 	help
 	  Say Y here if you want support for configuring FPGAs from the
 	  kernel.  The FPGA framework adds a FPGA manager class and FPGA
 	  manager drivers.
 
-if FPGA
-
 config FPGA_REGION
 	tristate "FPGA Region"
-	depends on OF && FPGA_BRIDGE
+	depends on FPGA && OF && FPGA_BRIDGE
 	help
 	  FPGA Regions allow loading FPGA images under control of
 	  the Device Tree.
 
 config FPGA_MGR_SOCFPGA
 	tristate "Altera SOCFPGA FPGA Manager"
+	depends on FPGA
 	depends on ARCH_SOCFPGA || COMPILE_TEST
 	help
 	  FPGA manager driver support for Altera SOCFPGA.
 
 config FPGA_MGR_SOCFPGA_A10
 	tristate "Altera SoCFPGA Arria10"
+	depends on FPGA
 	depends on ARCH_SOCFPGA || COMPILE_TEST
 	select REGMAP_MMIO
 	help
@@ -35,6 +33,7 @@ config FPGA_MGR_SOCFPGA_A10
 
 config FPGA_MGR_ZYNQ_FPGA
 	tristate "Xilinx Zynq FPGA"
+	depends on FPGA
 	depends on ARCH_ZYNQ || COMPILE_TEST
 	depends on HAS_DMA
 	help
@@ -42,27 +41,23 @@ config FPGA_MGR_ZYNQ_FPGA
 
 config FPGA_BRIDGE
 	tristate "FPGA Bridge Framework"
-	depends on OF
+	depends on FPGA && OF
 	help
 	  Say Y here if you want to support bridges connected between host
 	  processors and FPGAs or between FPGAs.
 
 config SOCFPGA_FPGA_BRIDGE
 	tristate "Altera SoCFPGA FPGA Bridges"
-	depends on ARCH_SOCFPGA && FPGA_BRIDGE
+	depends on FPGA && ARCH_SOCFPGA && FPGA_BRIDGE
 	help
 	  Say Y to enable drivers for FPGA bridges for Altera SOCFPGA
 	  devices.
 
 config ALTERA_FREEZE_BRIDGE
 	tristate "Altera FPGA Freeze Bridge"
-	depends on ARCH_SOCFPGA && FPGA_BRIDGE
+	depends on FPGA && ARCH_SOCFPGA && FPGA_BRIDGE
 	help
 	  Say Y to enable drivers for Altera FPGA Freeze bridges.  A
 	  freeze bridge is a bridge that exists in the FPGA fabric to
 	  isolate one region of the FPGA from the busses while that
 	  region is being reprogrammed.
-
-endif # FPGA
-
-endmenu
Signature · 1 line
2.9.3
#1 lore raw
Quoted 17 lines · Vincent Legoll

No need to get into the submenu to disable all FPGA-related config entries

---
 drivers/fpga/Kconfig | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)
drivers/fpga/Kconfig +0 -2
index ce861a2..fa1a95e 100644
@@ -2,32 +2,30 @@
 # FPGA framework configuration
 #
 
-menu "FPGA Configuration Support"
-

drivers/fpga/Kconfig line 15

Quoted 10 lines
drivers/fpga/Kconfig +1 -3
-config FPGA
+menuconfig FPGA
 	tristate "FPGA Configuration Framework"
 	help
 	  Say Y here if you want support for configuring FPGAs from the
 	  kernel.  The FPGA framework adds a FPGA manager class and FPGA
 	  manager drivers.
 
-if FPGA
-

why not leave the "if FPGA" end "endif # FPGA" lines and not add "depends on FPGA" to each entry?

Quoted 61 lines
drivers/fpga/Kconfig +7 -8
 config FPGA_REGION
 	tristate "FPGA Region"
-	depends on OF && FPGA_BRIDGE
+	depends on FPGA && OF && FPGA_BRIDGE
 	help
 	  FPGA Regions allow loading FPGA images under control of
 	  the Device Tree.
 
 config FPGA_MGR_SOCFPGA
 	tristate "Altera SOCFPGA FPGA Manager"
+	depends on FPGA
 	depends on ARCH_SOCFPGA || COMPILE_TEST
 	help
 	  FPGA manager driver support for Altera SOCFPGA.
 
 config FPGA_MGR_SOCFPGA_A10
 	tristate "Altera SoCFPGA Arria10"
+	depends on FPGA
 	depends on ARCH_SOCFPGA || COMPILE_TEST
 	select REGMAP_MMIO
 	help
@@ -35,6 +33,7 @@ config FPGA_MGR_SOCFPGA_A10
 
 config FPGA_MGR_ZYNQ_FPGA
 	tristate "Xilinx Zynq FPGA"
+	depends on FPGA
 	depends on ARCH_ZYNQ || COMPILE_TEST
 	depends on HAS_DMA
 	help
@@ -42,27 +41,23 @@ config FPGA_MGR_ZYNQ_FPGA
 
 config FPGA_BRIDGE
 	tristate "FPGA Bridge Framework"
-	depends on OF
+	depends on FPGA && OF
 	help
 	  Say Y here if you want to support bridges connected between host
 	  processors and FPGAs or between FPGAs.
 
 config SOCFPGA_FPGA_BRIDGE
 	tristate "Altera SoCFPGA FPGA Bridges"
-	depends on ARCH_SOCFPGA && FPGA_BRIDGE
+	depends on FPGA && ARCH_SOCFPGA && FPGA_BRIDGE
 	help
 	  Say Y to enable drivers for FPGA bridges for Altera SOCFPGA
 	  devices.
 
 config ALTERA_FREEZE_BRIDGE
 	tristate "Altera FPGA Freeze Bridge"
-	depends on ARCH_SOCFPGA && FPGA_BRIDGE
+	depends on FPGA && ARCH_SOCFPGA && FPGA_BRIDGE
 	help
 	  Say Y to enable drivers for Altera FPGA Freeze bridges.  A
 	  freeze bridge is a bridge that exists in the FPGA fabric to
 	  isolate one region of the FPGA from the busses while that
 	  region is being reprogrammed.
-
-endif # FPGA
-
-endmenu
Signature · 1 line
~Randy
#2 lore raw

Hello Randy,

you mean like the following ?

Looks like this is working as intended and much simpler, thanks.

#3 lore raw

PATCH 1/1 Make FPGA a menuconfig to ease disabling it all

No need to get into the submenu to disable all FPGA-related config entries

---
 drivers/fpga/Kconfig | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/fpga/Kconfig +1 -5
index ce861a2..2cb9b81 100644
@@ -2,9 +2,7 @@
 # FPGA framework configuration
 #
 
-menu "FPGA Configuration Support"
-
-config FPGA
+menuconfig FPGA
 	tristate "FPGA Configuration Framework"
 	help
 	  Say Y here if you want support for configuring FPGAs from the
@@ -64,5 +62,3 @@ config ALTERA_FREEZE_BRIDGE
 	  region is being reprogrammed.
 
 endif # FPGA
-
-endmenu
Signature · 1 line
2.9.3
#4 lore raw

On Fri, Apr 14, 2017 at 5:39 PM, Vincent Legoll
<[email protected]> wrote:

Hi Vincent,

Thanks!

Alan

Quoted 3 lines

No need to get into the submenu to disable all FPGA-related config entries

Quoted 28 lines
---
 drivers/fpga/Kconfig | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/fpga/Kconfig +1 -6
index ce861a2..2cb9b81 100644
@@ -2,9 +2,7 @@
 # FPGA framework configuration
 #
 
-menu "FPGA Configuration Support"
-
-config FPGA
+menuconfig FPGA
        tristate "FPGA Configuration Framework"
        help
          Say Y here if you want support for configuring FPGAs from the
@@ -64,5 +62,3 @@ config ALTERA_FREEZE_BRIDGE
          region is being reprogrammed.
 
 endif # FPGA
-
-endmenu
--

2.9.3

#5 lore raw
Quoted 12 lines · Alan Tull

On Fri, Apr 14, 2017 at 5:39 PM, Vincent Legoll
<[email protected]> wrote:

Hi Vincent,

Thanks!

Alan

Quoted 3 lines

No need to get into the submenu to disable all FPGA-related config entries

Quoted 31 lines
Quoted 28 lines
---
 drivers/fpga/Kconfig | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/fpga/Kconfig +1 -6
index ce861a2..2cb9b81 100644
@@ -2,9 +2,7 @@
 # FPGA framework configuration
 #
 
-menu "FPGA Configuration Support"
-
-config FPGA
+menuconfig FPGA
        tristate "FPGA Configuration Framework"
        help
          Say Y here if you want support for configuring FPGAs from the
@@ -64,5 +62,3 @@ config ALTERA_FREEZE_BRIDGE
          region is being reprogrammed.
 
 endif # FPGA
-
-endmenu
--

2.9.3

#6 lore raw
In reply to Vincent Legoll
Quoted 6 lines · Vincent Legoll

Hello Randy,

you mean like the following ?

Looks like this is working as intended and much simpler, thanks.

Yes, like that. Thanks.

Signature · 1 line
~Randy