[PATCH 03/23] blk: Enable CONFIG_BLK for all media

Heinrich Schuchardt xypron.glpk at gmx.de
Mon Aug 8 10:00:47 CEST 2022


On 8/7/22 17:46, Simon Glass wrote:
> Enable this option on all boards which support block devices. Drop the
> related depencies on BLK since these are not needed anymore.
>
> Disable BLOCK_CACHE on M5253DEMO as this causes a build error.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
>   arch/arm/Kconfig            | 1 -
>   configs/M5253DEMO_defconfig | 1 +
>   drivers/ata/Kconfig         | 1 -
>   drivers/block/Kconfig       | 3 ++-
>   drivers/nvme/Kconfig        | 1 -
>   drivers/scsi/Kconfig        | 1 -
>   drivers/virtio/Kconfig      | 1 -
>   7 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 949ebb46ba2..3cb949af165 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1016,7 +1016,6 @@ config ARCH_NPCM
>   config ARCH_APPLE
>   	bool "Apple SoCs"
>   	select ARM64
> -	select BLK
>   	select CLK
>   	select CMD_USB
>   	select DM
> diff --git a/configs/M5253DEMO_defconfig b/configs/M5253DEMO_defconfig
> index 79382eb0fe4..a73aca082c3 100644
> --- a/configs/M5253DEMO_defconfig
> +++ b/configs/M5253DEMO_defconfig
> @@ -25,6 +25,7 @@ CONFIG_CMD_EXT2=y
>   CONFIG_CMD_FAT=y
>   CONFIG_MAC_PARTITION=y
>   CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> +# CONFIG_BLOCK_CACHE is not set
>   CONFIG_SYS_IDE_MAXBUS=1
>   CONFIG_SYS_ATA_STRIDE=4
>   CONFIG_SYS_ATA_DATA_OFFSET=0xA0
> diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
> index 7715c403656..7d2315bd4a2 100644
> --- a/drivers/ata/Kconfig
> +++ b/drivers/ata/Kconfig
> @@ -9,7 +9,6 @@ config AHCI
>
>   config SATA
>   	bool "Support SATA controllers"
> -	depends on BLK
>   	select HAVE_BLOCK_DEVICE
>   	help
>   	  This enables support for SATA (Serial Advanced Technology
> diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
> index b5b482086af..79cdb62aa81 100644
> --- a/drivers/block/Kconfig
> +++ b/drivers/block/Kconfig
> @@ -1,7 +1,8 @@
>   config BLK
>   	bool "Support block devices"
>   	depends on DM
> -	default y if DM_MMC || DM_USB
> +	default y if MMC || USB || SCSI || NVME || IDE || AHCI
> +	default y if EFI_MEDIA || VIRTIO_BLK || PVBLOCK

Shouldn't SATA be in this list?

The logic in this patch is wrong.

Default y means that a user may configure BLK=n even if VIRTIO_BLK=y.
With patch 1-3 applied qemu-riscv64_smode_defconfig plus DM_MMC=n, BLK=n
does not compile.

VIRTIO_BLK must depend on BLK=y. Same for all other drivers.
Or you must otherwise ensure that BLK=n does not lead to a build failure.

Best regards

Heinrich


>   	help
>   	  Enable support for block devices, such as SCSI, MMC and USB
>   	  flash sticks. These provide a block-level interface which permits
> diff --git a/drivers/nvme/Kconfig b/drivers/nvme/Kconfig
> index 0cb465160bb..2a103ab5ed7 100644
> --- a/drivers/nvme/Kconfig
> +++ b/drivers/nvme/Kconfig
> @@ -4,7 +4,6 @@
>
>   config NVME
>   	bool "NVM Express device support"
> -	depends on BLK
>   	select HAVE_BLOCK_DEVICE
>   	help
>   	  This option enables support for NVM Express devices.
> diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
> index c400e2de16a..19872fb52d8 100644
> --- a/drivers/scsi/Kconfig
> +++ b/drivers/scsi/Kconfig
> @@ -10,7 +10,6 @@ config SCSI
>
>   config DM_SCSI
>   	bool "Support SCSI controllers with driver model"
> -	depends on BLK
>   	help
>   	  This option enables the SCSI (Small Computer System Interface) uclass
>   	  which supports SCSI and SATA HDDs. For every device configuration
> diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig
> index 586263ec884..852f6735b60 100644
> --- a/drivers/virtio/Kconfig
> +++ b/drivers/virtio/Kconfig
> @@ -64,7 +64,6 @@ config VIRTIO_NET
>   config VIRTIO_BLK
>   	bool "virtio block driver"
>   	depends on VIRTIO
> -	depends on BLK
>   	help
>   	  This is the virtual block driver for virtio. It can be used with
>   	  QEMU based targets.



More information about the U-Boot mailing list