[U-Boot] [PATCH] Move most CONFIG_HAVE_BLOCK_DEVICE to Kconfig

Adam Ford aford173 at gmail.com
Tue Feb 6 18:43:56 UTC 2018


config_fallbacks.h has some logic that sets HAVE_BLOCK_DEVICE
based on a list of enabled options.  Moving HAVE_BLOCK_DEIVCE to
Kconfig allows us to drastically shrink the logic in
config_fallbacks.h

Signed-off-by: Adam Ford <aford173 at gmail.com>
---
 arch/Kconfig               |  1 +
 cmd/Kconfig                |  3 +++
 drivers/ata/Kconfig        |  1 +
 drivers/block/Kconfig      |  6 ++++++
 drivers/mmc/Kconfig        |  1 +
 drivers/nvme/Kconfig       |  1 +
 drivers/scsi/Kconfig       |  1 +
 include/config_fallbacks.h | 10 +---------
 8 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index 5d57d6d..3079f0d 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -74,6 +74,7 @@ config SANDBOX
 	select DM_SPI
 	select DM_GPIO
 	select DM_MMC
+	select CONFIG_SANDBOX
 	select LZO
 	imply CMD_GETTIME
 	imply CMD_HASH
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 4d9ef87..26de43f 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -672,6 +672,7 @@ config CMD_GPT
 	bool "GPT (GUID Partition Table) command"
 	select PARTITION_UUIDS
 	select EFI_PARTITION
+	select CONFIG_HAVE_BLOCK_DEVICE
 	imply RANDOM_UUID
 	help
 	  Enable the 'gpt' command to ready and write GPT style partition
@@ -819,6 +820,7 @@ config CMD_ONENAND
 config CMD_PART
 	bool "part"
 	select PARTITION_UUIDS
+	select CONFIG_HAVE_BLOCK_DEVICE
 	help
 	  Read and display information about the partition table on
 	  various media.
@@ -911,6 +913,7 @@ config CMD_UNIVERSE
 
 config CMD_USB
 	bool "usb"
+	select CONFIG_HAVE_BLOCK_DEVICE
 	help
 	  USB support.
 
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 990de72..86ec628 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -9,6 +9,7 @@ config AHCI
 
 config SATA
 	bool "Support SATA controllers"
+	select HAVE_BLOCK_DEVICE
 	help
 	  This enables support for SATA (Serial Advanced Technology
 	  Attachment), a serial bus standard for connecting to hard drives and
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index 2676089..81a4085 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -10,6 +10,11 @@ config BLK
 	  be partitioned into several areas, called 'partitions' in U-Boot.
 	  A filesystem can be placed in each partition.
 
+config HAVE_BLOCK_DEVICE
+	bool "Enable Legacy Block Device"
+	help
+	  Some devices require block support whether or not DM is enabled
+	  
 config SPL_BLK
 	bool "Support block devices in SPL"
 	depends on SPL_DM && BLK
@@ -33,6 +38,7 @@ config BLOCK_CACHE
 
 config IDE
 	bool "Support IDE controllers"
+	select HAVE_BLOCK_DEVICE
 	help
 	  Enables support for IDE (Integrated Drive Electronics) hard drives.
 	  This allows access to raw blocks and filesystems on an IDE drive
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index a1b21fd..d12a166 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -3,6 +3,7 @@ menu "MMC Host controller Support"
 config MMC
 	bool "MMC/SD/SDIO card support"
 	default ARM || PPC || SANDBOX
+	select CONFIG_HAVE_BLOCK_DEVICE
 	help
 	  This selects MultiMediaCard, Secure Digital and Secure
 	  Digital I/O support.
diff --git a/drivers/nvme/Kconfig b/drivers/nvme/Kconfig
index cad8dbc..67d9171 100644
--- a/drivers/nvme/Kconfig
+++ b/drivers/nvme/Kconfig
@@ -7,6 +7,7 @@
 config NVME
 	bool "NVM Express device support"
 	depends on BLK && PCI
+	select CONFIG_HAVE_BLOCK_DEVICE
 	help
 	  This option enables support for NVM Express devices.
 	  It supports basic functions of NVMe (read/write).
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index db1606e..c061620 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -1,5 +1,6 @@
 config SCSI
 	bool "Support SCSI controllers"
+	select CONFIG_HAVE_BLOCK_DEVICE
 	help
 	  This enables support for SCSI (Small Computer System Interface),
 	  a parallel interface widely used with storage peripherals such as
diff --git a/include/config_fallbacks.h b/include/config_fallbacks.h
index c0f23e0..99b50d1 100644
--- a/include/config_fallbacks.h
+++ b/include/config_fallbacks.h
@@ -30,15 +30,7 @@
 #endif
 
 /* Rather than repeat this expression each time, add a define for it */
-#if defined(CONFIG_IDE) || \
-	defined(CONFIG_SATA) || \
-	defined(CONFIG_SCSI) || \
-	defined(CONFIG_CMD_USB) || \
-	defined(CONFIG_CMD_PART) || \
-	defined(CONFIG_CMD_GPT) || \
-	defined(CONFIG_MMC) || \
-	defined(CONFIG_NVME) || \
-	defined(CONFIG_SYSTEMACE) || \
+#if 	defined(CONFIG_SYSTEMACE) || \
 	(defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)) || \
 	defined(CONFIG_SANDBOX)
 #define CONFIG_HAVE_BLOCK_DEVICE
-- 
2.7.4



More information about the U-Boot mailing list