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>
master
Adam Ford 6 years ago committed by Tom Rini
parent 560eeee8c2
commit 1811a928c6
  1. 1
      arch/Kconfig
  2. 3
      cmd/Kconfig
  3. 2
      cmd/blk_common.c
  4. 14
      disk/part.c
  5. 2
      disk/part_amiga.c
  6. 2
      disk/part_dos.c
  7. 2
      disk/part_efi.c
  8. 2
      disk/part_iso.c
  9. 2
      disk/part_mac.c
  10. 1
      drivers/ata/Kconfig
  11. 7
      drivers/block/Kconfig
  12. 4
      drivers/block/blk_legacy.c
  13. 1
      drivers/mmc/Kconfig
  14. 1
      drivers/nvme/Kconfig
  15. 1
      drivers/scsi/Kconfig
  16. 15
      include/config_fallbacks.h
  17. 1
      include/configs/blanche.h
  18. 3
      include/configs/dragonboard410c.h
  19. 3
      include/configs/dragonboard820c.h
  20. 1
      lib/efi_loader/Kconfig

@ -74,6 +74,7 @@ config SANDBOX
select DM_SPI select DM_SPI
select DM_GPIO select DM_GPIO
select DM_MMC select DM_MMC
select HAVE_BLOCK_DEVICE
select LZO select LZO
imply CMD_GETTIME imply CMD_GETTIME
imply CMD_HASH imply CMD_HASH

@ -672,6 +672,7 @@ config CMD_GPT
bool "GPT (GUID Partition Table) command" bool "GPT (GUID Partition Table) command"
select PARTITION_UUIDS select PARTITION_UUIDS
select EFI_PARTITION select EFI_PARTITION
select HAVE_BLOCK_DEVICE
imply RANDOM_UUID imply RANDOM_UUID
help help
Enable the 'gpt' command to ready and write GPT style partition Enable the 'gpt' command to ready and write GPT style partition
@ -819,6 +820,7 @@ config CMD_ONENAND
config CMD_PART config CMD_PART
bool "part" bool "part"
select PARTITION_UUIDS select PARTITION_UUIDS
select HAVE_BLOCK_DEVICE
help help
Read and display information about the partition table on Read and display information about the partition table on
various media. various media.
@ -911,6 +913,7 @@ config CMD_UNIVERSE
config CMD_USB config CMD_USB
bool "usb" bool "usb"
select HAVE_BLOCK_DEVICE
help help
USB support. USB support.

@ -12,7 +12,7 @@
#include <common.h> #include <common.h>
#include <blk.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 blk_common_cmd(int argc, char * const argv[], enum if_type if_type,
int *cur_devnump) int *cur_devnump)
{ {

@ -26,7 +26,7 @@
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
#ifdef HAVE_BLOCK_DEVICE #ifdef CONFIG_HAVE_BLOCK_DEVICE
static struct part_driver *part_driver_lookup_type(int part_type) static struct part_driver *part_driver_lookup_type(int part_type)
{ {
struct part_driver *drv = struct part_driver *drv =
@ -80,7 +80,7 @@ struct blk_desc *blk_get_dev(const char *ifname, int dev)
} }
#endif #endif
#ifdef HAVE_BLOCK_DEVICE #ifdef CONFIG_HAVE_BLOCK_DEVICE
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
/* /*
@ -212,7 +212,7 @@ void dev_print (struct blk_desc *dev_desc)
} }
#endif #endif
#ifdef HAVE_BLOCK_DEVICE #ifdef CONFIG_HAVE_BLOCK_DEVICE
void part_init(struct blk_desc *dev_desc) void part_init(struct blk_desc *dev_desc)
{ {
@ -298,12 +298,12 @@ void part_print(struct blk_desc *dev_desc)
drv->print(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, int part_get_info(struct blk_desc *dev_desc, int part,
disk_partition_t *info) disk_partition_t *info)
{ {
#ifdef HAVE_BLOCK_DEVICE #ifdef CONFIG_HAVE_BLOCK_DEVICE
struct part_driver *drv; struct part_driver *drv;
#if CONFIG_IS_ENABLED(PARTITION_UUIDS) #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); PRINTF("## Valid %s partition found ##\n", drv->name);
return 0; return 0;
} }
#endif /* HAVE_BLOCK_DEVICE */ #endif /* CONFIG_HAVE_BLOCK_DEVICE */
return -1; return -1;
} }
@ -396,7 +396,7 @@ int blk_get_device_by_str(const char *ifname, const char *dev_hwpart_str,
goto cleanup; goto cleanup;
} }
#ifdef HAVE_BLOCK_DEVICE #ifdef CONFIG_HAVE_BLOCK_DEVICE
/* /*
* Updates the partition table for the specified hw partition. * Updates the partition table for the specified hw partition.
* Does not need to be done for hwpart 0 since it is default and * Does not need to be done for hwpart 0 since it is default and

@ -10,7 +10,7 @@
#include <ide.h> #include <ide.h>
#include "part_amiga.h" #include "part_amiga.h"
#ifdef HAVE_BLOCK_DEVICE #ifdef CONFIG_HAVE_BLOCK_DEVICE
#undef AMIGA_DEBUG #undef AMIGA_DEBUG

@ -20,7 +20,7 @@
#include <memalign.h> #include <memalign.h>
#include "part_dos.h" #include "part_dos.h"
#ifdef HAVE_BLOCK_DEVICE #ifdef CONFIG_HAVE_BLOCK_DEVICE
#define DOS_PART_DEFAULT_SECTOR 512 #define DOS_PART_DEFAULT_SECTOR 512

@ -24,7 +24,7 @@
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
#ifdef HAVE_BLOCK_DEVICE #ifdef CONFIG_HAVE_BLOCK_DEVICE
/** /**
* efi_crc32() - EFI version of crc32 function * efi_crc32() - EFI version of crc32 function
* @buf: buffer to calculate crc32 of * @buf: buffer to calculate crc32 of

@ -10,7 +10,7 @@
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include "part_iso.h" #include "part_iso.h"
#ifdef HAVE_BLOCK_DEVICE #ifdef CONFIG_HAVE_BLOCK_DEVICE
/* #define ISO_PART_DEBUG */ /* #define ISO_PART_DEBUG */

@ -19,7 +19,7 @@
#include <ide.h> #include <ide.h>
#include "part_mac.h" #include "part_mac.h"
#ifdef HAVE_BLOCK_DEVICE #ifdef CONFIG_HAVE_BLOCK_DEVICE
/* stdlib.h causes some compatibility problems; should fixe these! -- wd */ /* stdlib.h causes some compatibility problems; should fixe these! -- wd */
#ifndef __ldiv_t_defined #ifndef __ldiv_t_defined

@ -9,6 +9,7 @@ config AHCI
config SATA config SATA
bool "Support SATA controllers" bool "Support SATA controllers"
select HAVE_BLOCK_DEVICE
help help
This enables support for SATA (Serial Advanced Technology This enables support for SATA (Serial Advanced Technology
Attachment), a serial bus standard for connecting to hard drives and Attachment), a serial bus standard for connecting to hard drives and

@ -10,6 +10,11 @@ config BLK
be partitioned into several areas, called 'partitions' in U-Boot. be partitioned into several areas, called 'partitions' in U-Boot.
A filesystem can be placed in each partition. 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 config SPL_BLK
bool "Support block devices in SPL" bool "Support block devices in SPL"
depends on SPL_DM && BLK depends on SPL_DM && BLK
@ -33,6 +38,7 @@ config BLOCK_CACHE
config IDE config IDE
bool "Support IDE controllers" bool "Support IDE controllers"
select HAVE_BLOCK_DEVICE
help help
Enables support for IDE (Integrated Drive Electronics) hard drives. Enables support for IDE (Integrated Drive Electronics) hard drives.
This allows access to raw blocks and filesystems on an IDE drive This allows access to raw blocks and filesystems on an IDE drive
@ -41,6 +47,7 @@ config IDE
config SYSTEMACE config SYSTEMACE
bool "Xilinx SystemACE support" bool "Xilinx SystemACE support"
select HAVE_BLOCK_DEVICE
help help
Adding this option adds support for Xilinx SystemACE chips attached Adding this option adds support for Xilinx SystemACE chips attached
via some sort of local bus. The address of the chip must also be via some sort of local bus. The address of the chip must also be

@ -69,7 +69,7 @@ static int get_desc(struct blk_driver *drv, int devnum, struct blk_desc **descp)
return drv->get_dev(devnum, 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) int blk_list_part(enum if_type if_type)
{ {
struct blk_driver *drv; struct blk_driver *drv;
@ -173,7 +173,7 @@ int blk_show_device(enum if_type if_type, int devnum)
return 0; 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) struct blk_desc *blk_get_devnum_by_type(enum if_type if_type, int devnum)
{ {

@ -3,6 +3,7 @@ menu "MMC Host controller Support"
config MMC config MMC
bool "MMC/SD/SDIO card support" bool "MMC/SD/SDIO card support"
default ARM || PPC || SANDBOX default ARM || PPC || SANDBOX
select HAVE_BLOCK_DEVICE
help help
This selects MultiMediaCard, Secure Digital and Secure This selects MultiMediaCard, Secure Digital and Secure
Digital I/O support. Digital I/O support.

@ -7,6 +7,7 @@
config NVME config NVME
bool "NVM Express device support" bool "NVM Express device support"
depends on BLK && PCI depends on BLK && PCI
select HAVE_BLOCK_DEVICE
help help
This option enables support for NVM Express devices. This option enables support for NVM Express devices.
It supports basic functions of NVMe (read/write). It supports basic functions of NVMe (read/write).

@ -1,5 +1,6 @@
config SCSI config SCSI
bool "Support SCSI controllers" bool "Support SCSI controllers"
select HAVE_BLOCK_DEVICE
help help
This enables support for SCSI (Small Computer System Interface), This enables support for SCSI (Small Computer System Interface),
a parallel interface widely used with storage peripherals such as a parallel interface widely used with storage peripherals such as

@ -29,21 +29,6 @@
#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
#endif #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 */ /* Console I/O Buffer Size */
#ifndef CONFIG_SYS_CBSIZE #ifndef CONFIG_SYS_CBSIZE
#if defined(CONFIG_CMD_KGDB) #if defined(CONFIG_CMD_KGDB)

@ -98,6 +98,5 @@
/* SDHI */ /* SDHI */
#define CONFIG_SH_SDHI_FREQ 97500000 #define CONFIG_SH_SDHI_FREQ 97500000
#define HAVE_BLOCK_DEVICE
#endif /* __BLANCHE_H */ #endif /* __BLANCHE_H */

@ -43,9 +43,6 @@
/* Disabled by default as some sub-commands can brick eMMC */ /* Disabled by default as some sub-commands can brick eMMC */
/*#define CONFIG_SUPPORT_EMMC_BOOT */ /*#define CONFIG_SUPPORT_EMMC_BOOT */
/* Partition table support */
#define HAVE_BLOCK_DEVICE /* Needed for partition commands */
#include <config_distro_defaults.h> #include <config_distro_defaults.h>
/* BOOTP options */ /* BOOTP options */

@ -33,9 +33,6 @@
/* Generic Timer Definitions */ /* Generic Timer Definitions */
#define COUNTER_FREQUENCY 19000000 #define COUNTER_FREQUENCY 19000000
/* Partition table support */
#define HAVE_BLOCK_DEVICE
/* BOOTP options */ /* BOOTP options */
#define CONFIG_BOOTP_BOOTFILESIZE #define CONFIG_BOOTP_BOOTFILESIZE

@ -7,6 +7,7 @@ config EFI_LOADER
depends on !EFI_STUB || !X86 || X86_64 || EFI_STUB_32BIT depends on !EFI_STUB || !X86 || X86_64 || EFI_STUB_32BIT
default y default y
select LIB_UUID select LIB_UUID
select HAVE_BLOCK_DEVICE
help help
Select this option if you want to run EFI applications (like grub2) 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 on top of U-Boot. If this option is enabled, U-Boot will expose EFI

Loading…
Cancel
Save