]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
Move most CONFIG_HAVE_BLOCK_DEVICE to Kconfig
authorAdam Ford <aford173@gmail.com>
Tue, 6 Feb 2018 18:43:56 +0000 (12:43 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 9 Feb 2018 00:09:03 +0000 (19:09 -0500)
config_fallbacks.h has some logic that sets HAVE_BLOCK_DEVICE
based on a list of enabled options.  Moving HAVE_BLOCK_DEVICE to
Kconfig allows us to drastically shrink the logic in
config_fallbacks.h

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rename HAVE_BLOCK_DEVICE to CONFIG_BLOCK_DEVICE]
Signed-off-by: Tom Rini <trini@konsulko.com>
20 files changed:
arch/Kconfig
cmd/Kconfig
cmd/blk_common.c
disk/part.c
disk/part_amiga.c
disk/part_dos.c
disk/part_efi.c
disk/part_iso.c
disk/part_mac.c
drivers/ata/Kconfig
drivers/block/Kconfig
drivers/block/blk_legacy.c
drivers/mmc/Kconfig
drivers/nvme/Kconfig
drivers/scsi/Kconfig
include/config_fallbacks.h
include/configs/blanche.h
include/configs/dragonboard410c.h
include/configs/dragonboard820c.h
lib/efi_loader/Kconfig

index 5d57d6da2c83a25cffed6f74d4f87668dccba8f8..e599e7a39c15f9eca1cb3106731b2f77592f8a43 100644 (file)
@@ -74,6 +74,7 @@ config SANDBOX
        select DM_SPI
        select DM_GPIO
        select DM_MMC
+       select HAVE_BLOCK_DEVICE
        select LZO
        imply CMD_GETTIME
        imply CMD_HASH
index 4d9ef87e94330cdbb014257d41d408ef8b0a14ee..7368b6df5204ea77e10da982aca7f601f6348720 100644 (file)
@@ -672,6 +672,7 @@ config CMD_GPT
        bool "GPT (GUID Partition Table) command"
        select PARTITION_UUIDS
        select EFI_PARTITION
+       select 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 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 HAVE_BLOCK_DEVICE
        help
          USB support.
 
index bf2f626dd652d5a5238b067f2d9fe13fa00a7cdd..643fd0bfbc8bee18c060e67914a1d176b45cd4cf 100644 (file)
@@ -12,7 +12,7 @@
 #include <common.h>
 #include <blk.h>
 
-#ifdef HAVE_BLOCK_DEVICE
+#ifdef CONFIG_HAVE_BLOCK_DEVICE
 int blk_common_cmd(int argc, char * const argv[], enum if_type if_type,
                   int *cur_devnump)
 {
index 66b8101f98c7616410d7e1b97f5f68023cb035c9..e9e18a09106f859f13bb020f0ca3d1a9ccf4076b 100644 (file)
@@ -26,7 +26,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef HAVE_BLOCK_DEVICE
+#ifdef CONFIG_HAVE_BLOCK_DEVICE
 static struct part_driver *part_driver_lookup_type(int part_type)
 {
        struct part_driver *drv =
@@ -80,7 +80,7 @@ struct blk_desc *blk_get_dev(const char *ifname, int dev)
 }
 #endif
 
-#ifdef HAVE_BLOCK_DEVICE
+#ifdef CONFIG_HAVE_BLOCK_DEVICE
 
 /* ------------------------------------------------------------------------- */
 /*
@@ -212,7 +212,7 @@ void dev_print (struct blk_desc *dev_desc)
 }
 #endif
 
-#ifdef HAVE_BLOCK_DEVICE
+#ifdef CONFIG_HAVE_BLOCK_DEVICE
 
 void part_init(struct blk_desc *dev_desc)
 {
@@ -298,12 +298,12 @@ void part_print(struct blk_desc *dev_desc)
                drv->print(dev_desc);
 }
 
-#endif /* HAVE_BLOCK_DEVICE */
+#endif /* CONFIG_HAVE_BLOCK_DEVICE */
 
 int part_get_info(struct blk_desc *dev_desc, int part,
                       disk_partition_t *info)
 {
-#ifdef HAVE_BLOCK_DEVICE
+#ifdef CONFIG_HAVE_BLOCK_DEVICE
        struct part_driver *drv;
 
 #if CONFIG_IS_ENABLED(PARTITION_UUIDS)
@@ -329,7 +329,7 @@ int part_get_info(struct blk_desc *dev_desc, int part,
                PRINTF("## Valid %s partition found ##\n", drv->name);
                return 0;
        }
-#endif /* HAVE_BLOCK_DEVICE */
+#endif /* CONFIG_HAVE_BLOCK_DEVICE */
 
        return -1;
 }
@@ -396,7 +396,7 @@ int blk_get_device_by_str(const char *ifname, const char *dev_hwpart_str,
                goto cleanup;
        }
 
-#ifdef HAVE_BLOCK_DEVICE
+#ifdef CONFIG_HAVE_BLOCK_DEVICE
        /*
         * Updates the partition table for the specified hw partition.
         * Does not need to be done for hwpart 0 since it is default and
index f8dae008d74a8202d6cfcea56b0eba789ea3ead4..1b7d9151381cb5cdb16e9b639dc0bbc5ca585ab2 100644 (file)
@@ -10,7 +10,7 @@
 #include <ide.h>
 #include "part_amiga.h"
 
-#ifdef HAVE_BLOCK_DEVICE
+#ifdef CONFIG_HAVE_BLOCK_DEVICE
 
 #undef AMIGA_DEBUG
 
index 9dd086d3db0610d966f446b0f3ea350de9a71f57..84e672b47b92e23680686833770e87b7a2d86031 100644 (file)
@@ -20,7 +20,7 @@
 #include <memalign.h>
 #include "part_dos.h"
 
-#ifdef HAVE_BLOCK_DEVICE
+#ifdef CONFIG_HAVE_BLOCK_DEVICE
 
 #define DOS_PART_DEFAULT_SECTOR 512
 
index bea8b20bbd17967e2d5f28050260f9708ed09bb8..fb221eec0904b6b3101e376f5d58855b704ce948 100644 (file)
@@ -24,7 +24,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef HAVE_BLOCK_DEVICE
+#ifdef CONFIG_HAVE_BLOCK_DEVICE
 /**
  * efi_crc32() - EFI version of crc32 function
  * @buf: buffer to calculate crc32 of
index 4036b00b2565f9f644323e01df17ef3cf0577e39..ef582de7a116e8d376ef38d08edd322fa1b35aa3 100644 (file)
@@ -10,7 +10,7 @@
 #include <asm/unaligned.h>
 #include "part_iso.h"
 
-#ifdef HAVE_BLOCK_DEVICE
+#ifdef CONFIG_HAVE_BLOCK_DEVICE
 
 /* #define     ISO_PART_DEBUG */
 
index e31bc9060c700668c8e6453fd245572626bb2c6c..e65930d8e7500f5391d6bd3264563aea6df6d97d 100644 (file)
@@ -19,7 +19,7 @@
 #include <ide.h>
 #include "part_mac.h"
 
-#ifdef HAVE_BLOCK_DEVICE
+#ifdef CONFIG_HAVE_BLOCK_DEVICE
 
 /* stdlib.h causes some compatibility problems; should fixe these! -- wd */
 #ifndef __ldiv_t_defined
index 990de72309a222b032798a641042651db467f5e8..86ec628104b2055a82cb67a2058c9376f0986142 100644 (file)
@@ -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
index e2c80f2075e2e15e5dd9dfeafc95043a911f223e..73836ada094be2ed0f94cf033069001b90de71ad 100644 (file)
@@ -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
@@ -41,6 +47,7 @@ config IDE
 
 config SYSTEMACE
        bool "Xilinx SystemACE support"
+       select HAVE_BLOCK_DEVICE
        help
          Adding this option adds support for Xilinx SystemACE chips attached
          via some sort of local bus. The address of the chip must also be
index 16d3bfe7f28262f20955ca783d23e1d38d292ffd..ab42bf76d741bdad8242c07d471053dfdeff6b52 100644 (file)
@@ -69,7 +69,7 @@ static int get_desc(struct blk_driver *drv, int devnum, struct blk_desc **descp)
        return drv->get_dev(devnum, descp);
 }
 
-#ifdef HAVE_BLOCK_DEVICE
+#ifdef CONFIG_HAVE_BLOCK_DEVICE
 int blk_list_part(enum if_type if_type)
 {
        struct blk_driver *drv;
@@ -173,7 +173,7 @@ int blk_show_device(enum if_type if_type, int devnum)
 
        return 0;
 }
-#endif /* HAVE_BLOCK_DEVICE */
+#endif /* CONFIG_HAVE_BLOCK_DEVICE */
 
 struct blk_desc *blk_get_devnum_by_type(enum if_type if_type, int devnum)
 {
index d5e2816ef086f6dd56ca61468d450082f3c8f819..f2d82565822b85d6d5bd9ea03c6a4f18ac143433 100644 (file)
@@ -3,6 +3,7 @@ menu "MMC Host controller Support"
 config MMC
        bool "MMC/SD/SDIO card support"
        default ARM || PPC || SANDBOX
+       select HAVE_BLOCK_DEVICE
        help
          This selects MultiMediaCard, Secure Digital and Secure
          Digital I/O support.
index cad8dbc97b2dd769f5227b0ece63431e195ed9de..30974fd3cf75d2b47895787e158f61d5ba548195 100644 (file)
@@ -7,6 +7,7 @@
 config NVME
        bool "NVM Express device support"
        depends on BLK && PCI
+       select HAVE_BLOCK_DEVICE
        help
          This option enables support for NVM Express devices.
          It supports basic functions of NVMe (read/write).
index db1606e3ce6613c1af2e4bd074c17fe90de8d0f8..3c826c95b78f562369255cfa76952718eef69339 100644 (file)
@@ -1,5 +1,6 @@
 config SCSI
        bool "Support SCSI controllers"
+       select HAVE_BLOCK_DEVICE
        help
          This enables support for SCSI (Small Computer System Interface),
          a parallel interface widely used with storage peripherals such as
index 70013fe1d076e3adb638c9db9a44f727035a8a00..3d68d9fe31a83146ac72e6858bd20568fbd4fb80 100644 (file)
 #define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
 #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) || \
-       (defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)) || \
-       defined(CONFIG_SANDBOX)
-#define HAVE_BLOCK_DEVICE
-#endif
-
 /* Console I/O Buffer Size */
 #ifndef CONFIG_SYS_CBSIZE
 #if defined(CONFIG_CMD_KGDB)
index 4948bbb063d9c669c190e949ea98a317e7a8a0c7..74f669525df354ec2609a5cff3f8557d7ed507b8 100755 (executable)
@@ -98,6 +98,5 @@
 
 /* SDHI */
 #define CONFIG_SH_SDHI_FREQ    97500000
-#define HAVE_BLOCK_DEVICE
 
 #endif /* __BLANCHE_H */
index 530d667da8f0de23bd01eeea4ceb95c2a73381b9..d19e60a6be1c66314dc6e970e7ecfaf8d82dc27e 100644 (file)
@@ -43,9 +43,6 @@
 /* Disabled by default as some sub-commands can brick eMMC */
 /*#define CONFIG_SUPPORT_EMMC_BOOT */
 
-/* Partition table support */
-#define HAVE_BLOCK_DEVICE /* Needed for partition commands */
-
 #include <config_distro_defaults.h>
 
 /* BOOTP options */
index e28a956e92001795e31f0b04cf8f37387f3c2286..c07be34d1b50be6b0e6bd1efbcae8a889403f7a6 100644 (file)
@@ -33,9 +33,6 @@
 /* Generic Timer Definitions */
 #define COUNTER_FREQUENCY              19000000
 
-/* Partition table support */
-#define HAVE_BLOCK_DEVICE
-
 /* BOOTP options */
 #define CONFIG_BOOTP_BOOTFILESIZE
 
index 5461833aeb2f4f020b687a5f41e64ba34c38c16a..83d75c4fdc93a1ec49bb8d622a856931d47009d3 100644 (file)
@@ -7,6 +7,7 @@ config EFI_LOADER
        depends on !EFI_STUB || !X86 || X86_64 || EFI_STUB_32BIT
        default y
        select LIB_UUID
+       select HAVE_BLOCK_DEVICE
        help
          Select this option if you want to run EFI applications (like grub2)
          on top of U-Boot. If this option is enabled, U-Boot will expose EFI