Commit 1811a928c6c7604d6d05a84b4d552a7c31b4994e
Committed by
Tom Rini
1 parent
560eeee8c2
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
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
- 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
arch/Kconfig
cmd/Kconfig
... | ... | @@ -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 |
cmd/blk_common.c
disk/part.c
... | ... | @@ -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 |
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
... | ... | @@ -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 | { |
drivers/mmc/Kconfig
drivers/nvme/Kconfig
drivers/scsi/Kconfig
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
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
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 |