Commit 1811a928c6c7604d6d05a84b4d552a7c31b4994e

Authored by Adam Ford
Committed by Tom Rini
1 parent 560eeee8c2

Move most CONFIG_HAVE_BLOCK_DEVICE to Kconfig

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>

Showing 20 changed files with 31 additions and 37 deletions Side-by-side Diff

... ... @@ -74,6 +74,7 @@
74 74 select DM_SPI
75 75 select DM_GPIO
76 76 select DM_MMC
  77 + select HAVE_BLOCK_DEVICE
77 78 select LZO
78 79 imply CMD_GETTIME
79 80 imply CMD_HASH
... ... @@ -672,6 +672,7 @@
672 672 bool "GPT (GUID Partition Table) command"
673 673 select PARTITION_UUIDS
674 674 select EFI_PARTITION
  675 + select HAVE_BLOCK_DEVICE
675 676 imply RANDOM_UUID
676 677 help
677 678 Enable the 'gpt' command to ready and write GPT style partition
... ... @@ -819,6 +820,7 @@
819 820 config CMD_PART
820 821 bool "part"
821 822 select PARTITION_UUIDS
  823 + select HAVE_BLOCK_DEVICE
822 824 help
823 825 Read and display information about the partition table on
824 826 various media.
... ... @@ -911,6 +913,7 @@
911 913  
912 914 config CMD_USB
913 915 bool "usb"
  916 + select HAVE_BLOCK_DEVICE
914 917 help
915 918 USB support.
916 919  
... ... @@ -12,7 +12,7 @@
12 12 #include <common.h>
13 13 #include <blk.h>
14 14  
15   -#ifdef HAVE_BLOCK_DEVICE
  15 +#ifdef CONFIG_HAVE_BLOCK_DEVICE
16 16 int blk_common_cmd(int argc, char * const argv[], enum if_type if_type,
17 17 int *cur_devnump)
18 18 {
... ... @@ -26,7 +26,7 @@
26 26  
27 27 DECLARE_GLOBAL_DATA_PTR;
28 28  
29   -#ifdef HAVE_BLOCK_DEVICE
  29 +#ifdef CONFIG_HAVE_BLOCK_DEVICE
30 30 static struct part_driver *part_driver_lookup_type(int part_type)
31 31 {
32 32 struct part_driver *drv =
... ... @@ -80,7 +80,7 @@
80 80 }
81 81 #endif
82 82  
83   -#ifdef HAVE_BLOCK_DEVICE
  83 +#ifdef CONFIG_HAVE_BLOCK_DEVICE
84 84  
85 85 /* ------------------------------------------------------------------------- */
86 86 /*
... ... @@ -212,7 +212,7 @@
212 212 }
213 213 #endif
214 214  
215   -#ifdef HAVE_BLOCK_DEVICE
  215 +#ifdef CONFIG_HAVE_BLOCK_DEVICE
216 216  
217 217 void part_init(struct blk_desc *dev_desc)
218 218 {
219 219  
... ... @@ -298,12 +298,12 @@
298 298 drv->print(dev_desc);
299 299 }
300 300  
301   -#endif /* HAVE_BLOCK_DEVICE */
  301 +#endif /* CONFIG_HAVE_BLOCK_DEVICE */
302 302  
303 303 int part_get_info(struct blk_desc *dev_desc, int part,
304 304 disk_partition_t *info)
305 305 {
306   -#ifdef HAVE_BLOCK_DEVICE
  306 +#ifdef CONFIG_HAVE_BLOCK_DEVICE
307 307 struct part_driver *drv;
308 308  
309 309 #if CONFIG_IS_ENABLED(PARTITION_UUIDS)
... ... @@ -329,7 +329,7 @@
329 329 PRINTF("## Valid %s partition found ##\n", drv->name);
330 330 return 0;
331 331 }
332   -#endif /* HAVE_BLOCK_DEVICE */
  332 +#endif /* CONFIG_HAVE_BLOCK_DEVICE */
333 333  
334 334 return -1;
335 335 }
... ... @@ -396,7 +396,7 @@
396 396 goto cleanup;
397 397 }
398 398  
399   -#ifdef HAVE_BLOCK_DEVICE
  399 +#ifdef CONFIG_HAVE_BLOCK_DEVICE
400 400 /*
401 401 * Updates the partition table for the specified hw partition.
402 402 * Does not need to be done for hwpart 0 since it is default and
... ... @@ -10,7 +10,7 @@
10 10 #include <ide.h>
11 11 #include "part_amiga.h"
12 12  
13   -#ifdef HAVE_BLOCK_DEVICE
  13 +#ifdef CONFIG_HAVE_BLOCK_DEVICE
14 14  
15 15 #undef AMIGA_DEBUG
16 16  
... ... @@ -20,7 +20,7 @@
20 20 #include <memalign.h>
21 21 #include "part_dos.h"
22 22  
23   -#ifdef HAVE_BLOCK_DEVICE
  23 +#ifdef CONFIG_HAVE_BLOCK_DEVICE
24 24  
25 25 #define DOS_PART_DEFAULT_SECTOR 512
26 26  
... ... @@ -24,7 +24,7 @@
24 24  
25 25 DECLARE_GLOBAL_DATA_PTR;
26 26  
27   -#ifdef HAVE_BLOCK_DEVICE
  27 +#ifdef CONFIG_HAVE_BLOCK_DEVICE
28 28 /**
29 29 * efi_crc32() - EFI version of crc32 function
30 30 * @buf: buffer to calculate crc32 of
... ... @@ -10,7 +10,7 @@
10 10 #include <asm/unaligned.h>
11 11 #include "part_iso.h"
12 12  
13   -#ifdef HAVE_BLOCK_DEVICE
  13 +#ifdef CONFIG_HAVE_BLOCK_DEVICE
14 14  
15 15 /* #define ISO_PART_DEBUG */
16 16  
... ... @@ -19,7 +19,7 @@
19 19 #include <ide.h>
20 20 #include "part_mac.h"
21 21  
22   -#ifdef HAVE_BLOCK_DEVICE
  22 +#ifdef CONFIG_HAVE_BLOCK_DEVICE
23 23  
24 24 /* stdlib.h causes some compatibility problems; should fixe these! -- wd */
25 25 #ifndef __ldiv_t_defined
... ... @@ -9,6 +9,7 @@
9 9  
10 10 config SATA
11 11 bool "Support SATA controllers"
  12 + select HAVE_BLOCK_DEVICE
12 13 help
13 14 This enables support for SATA (Serial Advanced Technology
14 15 Attachment), a serial bus standard for connecting to hard drives and
drivers/block/Kconfig
... ... @@ -10,6 +10,11 @@
10 10 be partitioned into several areas, called 'partitions' in U-Boot.
11 11 A filesystem can be placed in each partition.
12 12  
  13 +config HAVE_BLOCK_DEVICE
  14 + bool "Enable Legacy Block Device"
  15 + help
  16 + Some devices require block support whether or not DM is enabled
  17 +
13 18 config SPL_BLK
14 19 bool "Support block devices in SPL"
15 20 depends on SPL_DM && BLK
... ... @@ -33,6 +38,7 @@
33 38  
34 39 config IDE
35 40 bool "Support IDE controllers"
  41 + select HAVE_BLOCK_DEVICE
36 42 help
37 43 Enables support for IDE (Integrated Drive Electronics) hard drives.
38 44 This allows access to raw blocks and filesystems on an IDE drive
... ... @@ -41,6 +47,7 @@
41 47  
42 48 config SYSTEMACE
43 49 bool "Xilinx SystemACE support"
  50 + select HAVE_BLOCK_DEVICE
44 51 help
45 52 Adding this option adds support for Xilinx SystemACE chips attached
46 53 via some sort of local bus. The address of the chip must also be
drivers/block/blk_legacy.c
... ... @@ -69,7 +69,7 @@
69 69 return drv->get_dev(devnum, descp);
70 70 }
71 71  
72   -#ifdef HAVE_BLOCK_DEVICE
  72 +#ifdef CONFIG_HAVE_BLOCK_DEVICE
73 73 int blk_list_part(enum if_type if_type)
74 74 {
75 75 struct blk_driver *drv;
... ... @@ -173,7 +173,7 @@
173 173  
174 174 return 0;
175 175 }
176   -#endif /* HAVE_BLOCK_DEVICE */
  176 +#endif /* CONFIG_HAVE_BLOCK_DEVICE */
177 177  
178 178 struct blk_desc *blk_get_devnum_by_type(enum if_type if_type, int devnum)
179 179 {
... ... @@ -3,6 +3,7 @@
3 3 config MMC
4 4 bool "MMC/SD/SDIO card support"
5 5 default ARM || PPC || SANDBOX
  6 + select HAVE_BLOCK_DEVICE
6 7 help
7 8 This selects MultiMediaCard, Secure Digital and Secure
8 9 Digital I/O support.
drivers/nvme/Kconfig
... ... @@ -7,6 +7,7 @@
7 7 config NVME
8 8 bool "NVM Express device support"
9 9 depends on BLK && PCI
  10 + select HAVE_BLOCK_DEVICE
10 11 help
11 12 This option enables support for NVM Express devices.
12 13 It supports basic functions of NVMe (read/write).
drivers/scsi/Kconfig
1 1 config SCSI
2 2 bool "Support SCSI controllers"
  3 + select HAVE_BLOCK_DEVICE
3 4 help
4 5 This enables support for SCSI (Small Computer System Interface),
5 6 a parallel interface widely used with storage peripherals such as
include/config_fallbacks.h
... ... @@ -29,21 +29,6 @@
29 29 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
30 30 #endif
31 31  
32   -/* Rather than repeat this expression each time, add a define for it */
33   -#if defined(CONFIG_IDE) || \
34   - defined(CONFIG_SATA) || \
35   - defined(CONFIG_SCSI) || \
36   - defined(CONFIG_CMD_USB) || \
37   - defined(CONFIG_CMD_PART) || \
38   - defined(CONFIG_CMD_GPT) || \
39   - defined(CONFIG_MMC) || \
40   - defined(CONFIG_NVME) || \
41   - defined(CONFIG_SYSTEMACE) || \
42   - (defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)) || \
43   - defined(CONFIG_SANDBOX)
44   -#define HAVE_BLOCK_DEVICE
45   -#endif
46   -
47 32 /* Console I/O Buffer Size */
48 33 #ifndef CONFIG_SYS_CBSIZE
49 34 #if defined(CONFIG_CMD_KGDB)
include/configs/blanche.h
... ... @@ -98,7 +98,6 @@
98 98  
99 99 /* SDHI */
100 100 #define CONFIG_SH_SDHI_FREQ 97500000
101   -#define HAVE_BLOCK_DEVICE
102 101  
103 102 #endif /* __BLANCHE_H */
include/configs/dragonboard410c.h
... ... @@ -43,9 +43,6 @@
43 43 /* Disabled by default as some sub-commands can brick eMMC */
44 44 /*#define CONFIG_SUPPORT_EMMC_BOOT */
45 45  
46   -/* Partition table support */
47   -#define HAVE_BLOCK_DEVICE /* Needed for partition commands */
48   -
49 46 #include <config_distro_defaults.h>
50 47  
51 48 /* BOOTP options */
include/configs/dragonboard820c.h
... ... @@ -33,9 +33,6 @@
33 33 /* Generic Timer Definitions */
34 34 #define COUNTER_FREQUENCY 19000000
35 35  
36   -/* Partition table support */
37   -#define HAVE_BLOCK_DEVICE
38   -
39 36 /* BOOTP options */
40 37 #define CONFIG_BOOTP_BOOTFILESIZE
41 38  
lib/efi_loader/Kconfig
... ... @@ -7,6 +7,7 @@
7 7 depends on !EFI_STUB || !X86 || X86_64 || EFI_STUB_32BIT
8 8 default y
9 9 select LIB_UUID
  10 + select HAVE_BLOCK_DEVICE
10 11 help
11 12 Select this option if you want to run EFI applications (like grub2)
12 13 on top of U-Boot. If this option is enabled, U-Boot will expose EFI