[PATCH 10/23] blk: Rename HAVE_BLOCK_DEVICE

Simon Glass sjg at chromium.org
Fri Aug 12 03:34:52 CEST 2022


Hi Takahiro,

On Sun, 7 Aug 2022 at 18:49, AKASHI Takahiro <takahiro.akashi at linaro.org> wrote:
>
> On Sun, Aug 07, 2022 at 09:46:55AM -0600, Simon Glass wrote:
> > 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 at chromium.org>
> > ---
> >
> >  common/spl/Kconfig                             | 4 ++--
> >  configs/axm_defconfig                          | 2 +-
> >  configs/bcm968380gerg_ram_defconfig            | 2 +-
> >  configs/gardena-smart-gateway-mt7688_defconfig | 2 +-
> >  configs/nsim_hs38_defconfig                    | 2 +-
> >  configs/qemu-ppce500_defconfig                 | 2 +-
> >  disk/Makefile                                  | 4 ++--
> >  disk/disk-uclass.c                             | 3 +--
> >  doc/develop/driver-model/migration.rst         | 2 +-
> >  drivers/Makefile                               | 2 +-
> >  drivers/ata/Kconfig                            | 2 +-
> >  drivers/block/Kconfig                          | 8 ++++----
> >  drivers/block/Makefile                         | 2 +-
> >  drivers/mmc/Kconfig                            | 2 +-
> >  drivers/nvme/Kconfig                           | 2 +-
> >  drivers/scsi/Kconfig                           | 2 +-
> >  drivers/xen/Kconfig                            | 2 +-
> >  include/blk.h                                  | 2 +-
> >  lib/efi_loader/Kconfig                         | 2 +-
> >  19 files changed, 24 insertions(+), 25 deletions(-)
> >
> > diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> > index ee98810e9e9..4c3e74ae5eb 100644
> > --- a/common/spl/Kconfig
> > +++ b/common/spl/Kconfig
> > @@ -792,7 +792,7 @@ config SPL_DM_MAILBOX
> >  config SPL_MMC
> >       bool "Support MMC"
> >       depends on MMC
> > -     select HAVE_BLOCK_DEVICE
> > +     select SPL_LEGACY_BLOCK
> >       help
> >         Enable support for MMC (Multimedia Card) within SPL. This enables
> >         the MMC protocol implementation and allows any enabled drivers to
> > @@ -1318,7 +1318,7 @@ config SPL_THERMAL
> >
> >  config SPL_USB_HOST
> >       bool "Support USB host drivers"
> > -     select HAVE_BLOCK_DEVICE
> > +     select SPL_LEGACY_BLOCK
> >       help
> >         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
> > diff --git a/configs/axm_defconfig b/configs/axm_defconfig
> > index a5f60bd8d0c..c42fb37d6c9 100644
> > --- a/configs/axm_defconfig
> > +++ b/configs/axm_defconfig
> > @@ -80,7 +80,7 @@ CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
> >  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> >  CONFIG_SPL_DM=y
> >  CONFIG_BLK=y
> > -CONFIG_HAVE_BLOCK_DEVICE=y
> > +CONFIG_SPL_LEGACY_BLOCK=y
> >  CONFIG_CLK=y
> >  CONFIG_CLK_AT91=y
> >  CONFIG_AT91_GPIO=y
> > diff --git a/configs/bcm968380gerg_ram_defconfig b/configs/bcm968380gerg_ram_defconfig
> > index 0475535e991..246add6029c 100644
> > --- a/configs/bcm968380gerg_ram_defconfig
> > +++ b/configs/bcm968380gerg_ram_defconfig
> > @@ -42,7 +42,7 @@ CONFIG_CMD_NAND=y
> >  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> >  # CONFIG_NET 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_LED=y
> >  CONFIG_LED_BCM6328=y
> > diff --git a/configs/gardena-smart-gateway-mt7688_defconfig b/configs/gardena-smart-gateway-mt7688_defconfig
> > index b9ee281be9f..fdfab14d53e 100644
> > --- a/configs/gardena-smart-gateway-mt7688_defconfig
> > +++ b/configs/gardena-smart-gateway-mt7688_defconfig
> > @@ -78,7 +78,7 @@ CONFIG_VERSION_VARIABLE=y
> >  CONFIG_NET_RANDOM_ETHADDR=y
> >  CONFIG_SPL_DM=y
> >  # CONFIG_DM_DEVICE_REMOVE is not set
> > -CONFIG_HAVE_BLOCK_DEVICE=y
> > +CONFIG_SPL_LEGACY_BLOCK=y
> >  CONFIG_BOOTCOUNT_LIMIT=y
> >  CONFIG_LED=y
> >  CONFIG_LED_BLINK=y
> > diff --git a/configs/nsim_hs38_defconfig b/configs/nsim_hs38_defconfig
> > index 3c3d1812a79..3f23fc4189f 100644
> > --- a/configs/nsim_hs38_defconfig
> > +++ b/configs/nsim_hs38_defconfig
> > @@ -30,7 +30,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> >  CONFIG_USE_BOOTFILE=y
> >  CONFIG_BOOTFILE="uImage"
> >  CONFIG_BLK=y
> > -CONFIG_HAVE_BLOCK_DEVICE=y
> > +CONFIG_SPL_LEGACY_BLOCK=y
> >  CONFIG_DM_ETH=y
> >  CONFIG_DM_SERIAL=y
> >  CONFIG_DEBUG_UART_SHIFT=2
> > diff --git a/configs/qemu-ppce500_defconfig b/configs/qemu-ppce500_defconfig
> > index 034f7e6935b..3241f5520eb 100644
> > --- a/configs/qemu-ppce500_defconfig
> > +++ b/configs/qemu-ppce500_defconfig
> > @@ -40,7 +40,7 @@ CONFIG_NET_RANDOM_ETHADDR=y
> >  CONFIG_DM=y
> >  CONFIG_SIMPLE_BUS_CORRECT_RANGE=y
> >  CONFIG_BLK=y
> > -CONFIG_HAVE_BLOCK_DEVICE=y
> > +CONFIG_SPL_LEGACY_BLOCK=y
> >  CONFIG_LBA48=y
> >  CONFIG_CHIP_SELECTS_PER_CTRL=0
> >  CONFIG_MPC8XXX_GPIO=y
> > diff --git a/disk/Makefile b/disk/Makefile
> > index 458e21e3fb7..45588cf66e4 100644
> > --- a/disk/Makefile
> > +++ b/disk/Makefile
> > @@ -10,8 +10,8 @@ ifdef CONFIG_$(SPL_TPL_)BLK
> >  obj-$(CONFIG_$(SPL_TPL_)PARTITIONS)  += disk-uclass.o
> >  endif
> >
> > -# Must have BLK or HAVE_BLOCK_DEVICE to support partitions
> > -ifneq ($(CONFIG_$(SPL_TPL_)BLK),$(CONFIG_HAVE_BLOCK_DEVICE),)
> > +# Must have BLK or SPL_LEGACY_BLOCK to support partitions
> > +ifneq ($(CONFIG_$(SPL_TPL_)BLK),$(CONFIG_SPL_LEGACY_BLOCK),)
> >  obj-$(CONFIG_$(SPL_TPL_)MAC_PARTITION)   += part_mac.o
> >  obj-$(CONFIG_$(SPL_TPL_)DOS_PARTITION)   += part_dos.o
> >  obj-$(CONFIG_$(SPL_TPL_)ISO_PARTITION)   += part_iso.o
> > diff --git a/disk/disk-uclass.c b/disk/disk-uclass.c
> > index f3fb942a6b9..9351a5cfa68 100644
> > --- a/disk/disk-uclass.c
> > +++ b/disk/disk-uclass.c
> > @@ -27,8 +27,7 @@ int part_create_block_devices(struct udevice *blk_dev)
> >       struct udevice *dev;
> >       int ret;
> >
> > -     if (!CONFIG_IS_ENABLED(PARTITIONS) ||
> > -         !CONFIG_IS_ENABLED(HAVE_BLOCK_DEVICE))
> > +     if (!CONFIG_IS_ENABLED(PARTITIONS) || !blk_enabled())
>
> This hunk should be moved to patch#7?

I suppose it could but this is a different step IMO.

Regards,
Simon


More information about the U-Boot mailing list