blk: Rename HAVE_BLOCK_DEVICE

This option is fact really related to SPL. For U-Boot proper we always use
driver model for block devices, so CONFIG_BLK is enabled if block devices
are in use.

It is only for SPL that we have two cases:

- SPL_BLK is enabled, in which case we use driver model and blk-uclass.c
- SPL_BLK is not enabled, in which case (if we need block devices) we must
  use blk_legacy.c

Rename the symbol to SPL_LEGACY_BLOCK to make this clear. This is
different enough from BLK and SPL_BLK that there should be no confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2022-08-11 19:34:48 -06:00 committed by Tom Rini
parent 14d2c5d819
commit 7f8967c2b8
19 changed files with 25 additions and 25 deletions

View File

@ -792,7 +792,7 @@ config SPL_DM_MAILBOX
config SPL_MMC config SPL_MMC
bool "Support MMC" bool "Support MMC"
depends on MMC depends on MMC
select HAVE_BLOCK_DEVICE select SPL_LEGACY_BLOCK
help help
Enable support for MMC (Multimedia Card) within SPL. This enables Enable support for MMC (Multimedia Card) within SPL. This enables
the MMC protocol implementation and allows any enabled drivers to the MMC protocol implementation and allows any enabled drivers to
@ -1318,7 +1318,7 @@ config SPL_THERMAL
config SPL_USB_HOST config SPL_USB_HOST
bool "Support USB host drivers" bool "Support USB host drivers"
select HAVE_BLOCK_DEVICE select SPL_LEGACY_BLOCK
help help
Enable access to USB (Universal Serial Bus) host devices so that Enable access to USB (Universal Serial Bus) host devices so that
SPL can load U-Boot from a connected USB peripheral, such as a USB SPL can load U-Boot from a connected USB peripheral, such as a USB

View File

@ -80,7 +80,7 @@ CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_SPL_DM=y CONFIG_SPL_DM=y
CONFIG_BLK=y CONFIG_BLK=y
CONFIG_HAVE_BLOCK_DEVICE=y CONFIG_SPL_LEGACY_BLOCK=y
CONFIG_CLK=y CONFIG_CLK=y
CONFIG_CLK_AT91=y CONFIG_CLK_AT91=y
CONFIG_AT91_GPIO=y CONFIG_AT91_GPIO=y

View File

@ -42,7 +42,7 @@ CONFIG_CMD_NAND=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y
# CONFIG_NET is not set # CONFIG_NET is not set
# CONFIG_DM_DEVICE_REMOVE is not set # CONFIG_DM_DEVICE_REMOVE is not set
CONFIG_HAVE_BLOCK_DEVICE=y CONFIG_SPL_LEGACY_BLOCK=y
CONFIG_BCM6345_GPIO=y CONFIG_BCM6345_GPIO=y
CONFIG_LED=y CONFIG_LED=y
CONFIG_LED_BCM6328=y CONFIG_LED_BCM6328=y

View File

@ -78,7 +78,7 @@ CONFIG_VERSION_VARIABLE=y
CONFIG_NET_RANDOM_ETHADDR=y CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_SPL_DM=y CONFIG_SPL_DM=y
# CONFIG_DM_DEVICE_REMOVE is not set # CONFIG_DM_DEVICE_REMOVE is not set
CONFIG_HAVE_BLOCK_DEVICE=y CONFIG_SPL_LEGACY_BLOCK=y
CONFIG_BOOTCOUNT_LIMIT=y CONFIG_BOOTCOUNT_LIMIT=y
CONFIG_LED=y CONFIG_LED=y
CONFIG_LED_BLINK=y CONFIG_LED_BLINK=y

View File

@ -30,7 +30,8 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_USE_BOOTFILE=y CONFIG_USE_BOOTFILE=y
CONFIG_BOOTFILE="uImage" CONFIG_BOOTFILE="uImage"
CONFIG_BLK=y CONFIG_BLK=y
CONFIG_HAVE_BLOCK_DEVICE=y CONFIG_SPL_LEGACY_BLOCK=y
CONFIG_DM_ETH=y
CONFIG_DM_SERIAL=y CONFIG_DM_SERIAL=y
CONFIG_DEBUG_UART_SHIFT=2 CONFIG_DEBUG_UART_SHIFT=2
CONFIG_SYS_NS16550=y CONFIG_SYS_NS16550=y

View File

@ -40,7 +40,7 @@ CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_DM=y CONFIG_DM=y
CONFIG_SIMPLE_BUS_CORRECT_RANGE=y CONFIG_SIMPLE_BUS_CORRECT_RANGE=y
CONFIG_BLK=y CONFIG_BLK=y
CONFIG_HAVE_BLOCK_DEVICE=y CONFIG_SPL_LEGACY_BLOCK=y
CONFIG_LBA48=y CONFIG_LBA48=y
CONFIG_CHIP_SELECTS_PER_CTRL=0 CONFIG_CHIP_SELECTS_PER_CTRL=0
CONFIG_MPC8XXX_GPIO=y CONFIG_MPC8XXX_GPIO=y

View File

@ -10,8 +10,8 @@ ifdef CONFIG_$(SPL_TPL_)BLK
obj-$(CONFIG_$(SPL_TPL_)PARTITIONS) += disk-uclass.o obj-$(CONFIG_$(SPL_TPL_)PARTITIONS) += disk-uclass.o
endif endif
# Must have BLK or HAVE_BLOCK_DEVICE to support partitions # Must have BLK or SPL_LEGACY_BLOCK to support partitions
ifneq ($(CONFIG_$(SPL_TPL_)BLK),$(CONFIG_HAVE_BLOCK_DEVICE),) ifneq ($(CONFIG_$(SPL_TPL_)BLK),$(CONFIG_SPL_LEGACY_BLOCK),)
obj-$(CONFIG_$(SPL_TPL_)MAC_PARTITION) += part_mac.o obj-$(CONFIG_$(SPL_TPL_)MAC_PARTITION) += part_mac.o
obj-$(CONFIG_$(SPL_TPL_)DOS_PARTITION) += part_dos.o obj-$(CONFIG_$(SPL_TPL_)DOS_PARTITION) += part_dos.o
obj-$(CONFIG_$(SPL_TPL_)ISO_PARTITION) += part_iso.o obj-$(CONFIG_$(SPL_TPL_)ISO_PARTITION) += part_iso.o

View File

@ -27,8 +27,7 @@ int part_create_block_devices(struct udevice *blk_dev)
struct udevice *dev; struct udevice *dev;
int ret; int ret;
if (!CONFIG_IS_ENABLED(PARTITIONS) || if (!CONFIG_IS_ENABLED(PARTITIONS) || !blk_enabled())
!CONFIG_IS_ENABLED(HAVE_BLOCK_DEVICE))
return 0; return 0;
if (device_get_uclass_id(blk_dev) != UCLASS_BLK) if (device_get_uclass_id(blk_dev) != UCLASS_BLK)

View File

@ -57,7 +57,7 @@ In concert with maintainers migrating their block device usage to the
appropriate DM driver, CONFIG_BLK needs to be set as well. The final deadline appropriate DM driver, CONFIG_BLK needs to be set as well. The final deadline
here coincides with the final deadline for migration of the various block here coincides with the final deadline for migration of the various block
subsystems. At this point we will be able to audit and correct the logic in subsystems. At this point we will be able to audit and correct the logic in
Kconfig around using CONFIG_PARTITIONS and CONFIG_HAVE_BLOCK_DEVICE and make Kconfig around using CONFIG_PARTITIONS and CONFIG_SPL_LEGACY_BLOCK and make
use of CONFIG_BLK / CONFIG_SPL_BLK as needed. use of CONFIG_BLK / CONFIG_SPL_BLK as needed.
CONFIG_DM_SPI / CONFIG_DM_SPI_FLASH CONFIG_DM_SPI / CONFIG_DM_SPI_FLASH

View File

@ -59,7 +59,7 @@ obj-$(CONFIG_SPL_WATCHDOG) += watchdog/
obj-$(CONFIG_SPL_USB_HOST) += usb/host/ obj-$(CONFIG_SPL_USB_HOST) += usb/host/
obj-$(CONFIG_OMAP_USB_PHY) += usb/phy/ obj-$(CONFIG_OMAP_USB_PHY) += usb/phy/
obj-$(CONFIG_SPL_SATA) += ata/ scsi/ obj-$(CONFIG_SPL_SATA) += ata/ scsi/
obj-$(CONFIG_HAVE_BLOCK_DEVICE) += block/ obj-$(CONFIG_SPL_LEGACY_BLOCK) += block/
obj-$(CONFIG_SPL_BLK) += block/ obj-$(CONFIG_SPL_BLK) += block/
obj-$(CONFIG_SPL_THERMAL) += thermal/ obj-$(CONFIG_SPL_THERMAL) += thermal/

View File

@ -9,7 +9,7 @@ config AHCI
config SATA config SATA
bool "Support SATA controllers" bool "Support SATA controllers"
select HAVE_BLOCK_DEVICE select SPL_LEGACY_BLOCK
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

View File

@ -11,7 +11,7 @@ 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 config SPL_LEGACY_BLOCK
bool "Enable Legacy Block Device" bool "Enable Legacy Block Device"
help help
Some devices require block support whether or not DM is enabled Some devices require block support whether or not DM is enabled
@ -109,7 +109,7 @@ endif # EFI_MEDIA
config IDE config IDE
bool "Support IDE controllers" bool "Support IDE controllers"
select HAVE_BLOCK_DEVICE select SPL_LEGACY_BLOCK
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
@ -222,7 +222,7 @@ endif # IDE
config LBA48 config LBA48
bool "Enable LBA support for disks larger than 137GB" bool "Enable LBA support for disks larger than 137GB"
depends on HAVE_BLOCK_DEVICE depends on SPL_LEGACY_BLOCK
help help
Set this to enable support for disks larger than 137GB. Set this to enable support for disks larger than 137GB.
Also look at CONFIG_SYS_64BIT_LBA. Without both of these, LBA48 Also look at CONFIG_SYS_64BIT_LBA. Without both of these, LBA48
@ -231,7 +231,7 @@ config LBA48
config SYS_64BIT_LBA config SYS_64BIT_LBA
bool "Enable 64bit number of blocks on a block device" bool "Enable 64bit number of blocks on a block device"
depends on HAVE_BLOCK_DEVICE depends on SPL_LEGACY_BLOCK
help help
Make the block subsystem use 64bit sector addresses, rather than the Make the block subsystem use 64bit sector addresses, rather than the
default of 32bit. default of 32bit.

View File

@ -6,7 +6,7 @@
obj-$(CONFIG_$(SPL_)BLK) += blk-uclass.o obj-$(CONFIG_$(SPL_)BLK) += blk-uclass.o
ifndef CONFIG_$(SPL_)BLK ifndef CONFIG_$(SPL_)BLK
obj-$(CONFIG_HAVE_BLOCK_DEVICE) += blk_legacy.o obj-$(CONFIG_SPL_LEGACY_BLOCK) += blk_legacy.o
endif endif
ifndef CONFIG_SPL_BUILD ifndef CONFIG_SPL_BUILD

View File

@ -3,7 +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 select SPL_LEGACY_BLOCK
select DM_MMC if DM select DM_MMC if DM
help help
This selects MultiMediaCard, Secure Digital and Secure This selects MultiMediaCard, Secure Digital and Secure

View File

@ -4,7 +4,7 @@
config NVME config NVME
bool "NVM Express device support" bool "NVM Express device support"
select HAVE_BLOCK_DEVICE select SPL_LEGACY_BLOCK
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).

View File

@ -1,6 +1,6 @@
config SCSI config SCSI
bool "Support SCSI controllers" bool "Support SCSI controllers"
select HAVE_BLOCK_DEVICE select SPL_LEGACY_BLOCK
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

View File

@ -2,7 +2,7 @@ config PVBLOCK
bool "Xen para-virtualized block device" bool "Xen para-virtualized block device"
depends on DM depends on DM
select BLK select BLK
select HAVE_BLOCK_DEVICE select SPL_LEGACY_BLOCK
help help
This driver implements the front-end of the Xen virtual This driver implements the front-end of the Xen virtual
block device driver. It communicates with a back-end driver block device driver. It communicates with a back-end driver

View File

@ -23,7 +23,7 @@ struct udevice;
static inline bool blk_enabled(void) static inline bool blk_enabled(void)
{ {
return CONFIG_IS_ENABLED(BLK) || IS_ENABLED(CONFIG_HAVE_BLOCK_DEVICE); return CONFIG_IS_ENABLED(BLK) || IS_ENABLED(CONFIG_SPL_LEGACY_BLOCK);
} }
/* Interface types: */ /* Interface types: */

View File

@ -20,7 +20,7 @@ config EFI_LOADER
select EVENT_DYNAMIC select EVENT_DYNAMIC
select LIB_UUID select LIB_UUID
imply PARTITION_UUIDS imply PARTITION_UUIDS
select HAVE_BLOCK_DEVICE select SPL_LEGACY_BLOCK
select REGEX select REGEX
imply FAT imply FAT
imply FAT_WRITE imply FAT_WRITE