All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/23] blk: Rationalise the block interface
@ 2022-08-07 15:46 Simon Glass
  2022-08-07 15:46 ` [PATCH 01/23] binman: Put fake files in a subdirectory Simon Glass
                   ` (22 more replies)
  0 siblings, 23 replies; 37+ messages in thread
From: Simon Glass @ 2022-08-07 15:46 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Heinrich Schuchardt, Simon Glass, AKASHI Takahiro,
	Alexander Graf, Alexandru Gagniuc, Alexey Brodkin,
	Alper Nebi Yasak, Anastasiia Lukianenko, Andrew Davis,
	Andrew Scull, Artem Lapkin, Ashok Reddy Soma, Aswath Govindraju,
	Bharat Gooty, Bin Meng, Chris Morgan, Denys Drozdov,
	Fabio Estevam, Fabio Estevam, Francesco Dolcini, Gary Bisson,
	Heiko Schocher, Huang Jianan, Ilias Apalodimas, Jaehoon Chung,
	Jens Wiklander, Joe Hershberger, Judy Wang, Kever Yang,
	Loic Poulain, Lukasz Majewski, Marcel Ziswiler, Marek Behún,
	Marek Vasut, Mark Kettenis, Masahisa Kojima, Max Merchel,
	Michal Simek, Oleksandr Andrushchenko, Oleksandr Suvorov,
	Oleksii Bidnichenko, Ovidiu Panait, Pali Rohár,
	Patrice Chotard, Patrick Delaunay, Peng Fan, Philippe Reynes,
	Philippe Schenker, Ramon Fried, Rayagonda Kokatanur,
	Ricardo Salveti, Rick Chen, Sean Anderson, Stefan Roese,
	Thomas Huth, Tony Dinh, TsiChung Liew, Wolfgang Denk, Ye Li,
	Ying-Chun Liu (PaulLiu),
	schspa, uboot-stm32

The block interface has two separate implementations, one using driver
model and one not. The latter is really only needed for SPL, where
size constraints allegedly don't allow use of driver model. Of course
we still need space for filesystems and other code, so it isn't clear
that driver model is anything more than the straw that breaks the
camel's back.

The driver model version uses a uclass ID for the interface time, but
converts back and forth between that and if_type, which is the legacy
type.

The HAVE_BLOCK_DEVICE define is mostly a hangover from the old days.
At present its main purpose is to enable the legacy block implementation
in SPL.

Finally the use of 'select' to enable BLK does not work very well. It
causes kconfig errors when another option depends on BLK and it is
not recommended by the kconfig style guide.

This series aims to clean things up:
- Enable BLK based on whether different media types are used, but still
  allow boards to disable it
- Rename HAVE_BLOCK_DEVICE to indicates its real purpose
- Drop if_type and use the uclass instead
- Drop some obsolete if_type values

An issue not resolved by this series is that the sandbox host interface
does not actually have a device. At present it uses the root device, which
was convenience for the driver model conversion but not really correct. It
should be possible to clean this up, in a future series.

Another minor issue is the use of UCLASS_USB for a mass-storage device.
This has been the case for a while and is not addresed by this series,
other than to add a comment.

Note that this test relies on Tom Rini's series to drop various boards
including warp and cm_t335

Finally, a patch is included to make binman put fake files in a
subdirectory, since repeated runs of certain boards can cause unrelated
failues (e.g. chromebook_coral) when fake files are left around.


Simon Glass (23):
  binman: Put fake files in a subdirectory
  disk: Correct help for TPL_PARTITIONS
  blk: Enable CONFIG_BLK for all media
  ata: Fix an instance of SPL_SATA_SUPPORT
  sandbox: Avoid defining HAVE_BLOCK_DEVICE in Konfig
  disk: Use Makefile to omit partition drivers
  blk: Use a function for whether block devices are available
  cmd: Drop use of HAVE_BLOCK_DEVICE
  blk: Drop unnecessary #ifdef in in blk_legacy
  blk: Rename HAVE_BLOCK_DEVICE
  blk: Select SPL_LEGACY_BLOCK automatically
  blk: Drop unnecessary CONFIG_SPL_LEGACY_BLOCK in defconfigs
  blk: Hide the BLK and SPL_LEGACY_BLOCK options
  blk: Drop IF_TYPE_DOC
  ide: Use a flag for an ATAPI device
  blk: Drop IF_TYPE_ATAPI
  blk: Drop IF_TYPE_SD
  blk: Rename var in blk_get_devnum_by_typename()
  blk: Rewrite if_type to name functions
  efi: Correct assumption about if_type
  blk: Switch over to using uclass IDs
  blk: Drop if_type
  blk: Rename if_type to uclass_id

 arch/Kconfig                                  |   1 -
 arch/arm/Kconfig                              |   1 -
 .../mach-stm32mp/cmd_stm32prog/stm32prog.c    |   4 +-
 board/st/common/stm32mp_dfu.c                 |   2 +-
 board/toradex/common/tdx-cfg-block.c          |   4 +-
 cmd/Kconfig                                   |   5 -
 cmd/Makefile                                  |   2 +-
 cmd/bcb.c                                     |   4 +-
 cmd/blk_common.c                              |  18 +-
 cmd/ide.c                                     |   2 +-
 cmd/lsblk.c                                   |   2 +-
 cmd/mmc.c                                     |  10 +-
 cmd/mvebu/bubt.c                              |   2 +-
 cmd/nvme.c                                    |   4 +-
 cmd/pvblock.c                                 |   2 +-
 cmd/sata.c                                    |   4 +-
 cmd/scsi.c                                    |   2 +-
 cmd/usb.c                                     |   2 +-
 cmd/virtio.c                                  |   2 +-
 common/spl/Kconfig                            |   2 -
 common/spl/spl_sata.c                         |   2 +-
 common/spl/spl_usb.c                          |   2 +-
 common/usb_storage.c                          |  10 +-
 configs/M5253DEMO_defconfig                   |   1 +
 configs/axm_defconfig                         |   1 -
 configs/bcm968380gerg_ram_defconfig           |   1 -
 .../gardena-smart-gateway-mt7688_defconfig    |   1 -
 configs/nsim_hs38_defconfig                   |   1 -
 configs/qemu-ppce500_defconfig                |   1 -
 disk/Kconfig                                  |   4 +-
 disk/Makefile                                 |   4 +
 disk/disk-uclass.c                            |  11 +-
 disk/part.c                                   | 156 +++++--------
 disk/part_amiga.c                             |   4 -
 disk/part_dos.c                               |   4 -
 disk/part_efi.c                               |   3 -
 disk/part_iso.c                               |   3 -
 disk/part_mac.c                               |   3 -
 doc/develop/driver-model/migration.rst        |   2 +-
 doc/develop/uefi/uefi.rst                     |   2 +-
 doc/usage/partitions.rst                      |   2 +-
 drivers/Makefile                              |   3 +-
 drivers/ata/Kconfig                           |   4 +-
 drivers/ata/dwc_ahsata.c                      |   2 +-
 drivers/ata/fsl_sata.c                        |   2 +-
 drivers/ata/sata.c                            |   2 +-
 drivers/ata/sata_mv.c                         |   2 +-
 drivers/ata/sata_sil.c                        |   2 +-
 drivers/block/Kconfig                         |  20 +-
 drivers/block/Makefile                        |   2 +-
 drivers/block/blk-uclass.c                    | 219 +++++++++---------
 drivers/block/blk_legacy.c                    |  60 +++--
 drivers/block/efi_blk.c                       |   2 +-
 drivers/block/ide.c                           |  16 +-
 drivers/block/sandbox.c                       |  14 +-
 drivers/dfu/dfu_mmc.c                         |   6 +-
 drivers/mmc/Kconfig                           |   1 -
 drivers/mmc/mmc-uclass.c                      |  12 +-
 drivers/mmc/mmc_legacy.c                      |   8 +-
 drivers/mmc/mmc_write.c                       |   4 +-
 drivers/net/fsl_enetc.c                       |  12 +-
 drivers/net/fsl_enetc.h                       |   2 +-
 drivers/nvme/Kconfig                          |   2 -
 drivers/nvme/nvme.c                           |   2 +-
 drivers/scsi/Kconfig                          |   2 -
 drivers/scsi/scsi.c                           |  12 +-
 drivers/tee/optee/rpmb.c                      |   4 +-
 drivers/virtio/Kconfig                        |   1 -
 drivers/virtio/virtio_blk.c                   |   4 +-
 drivers/xen/Kconfig                           |   1 -
 drivers/xen/pvblock.c                         |   6 +-
 env/mmc.c                                     |   4 +-
 fs/fat/fat.c                                  |   4 +-
 include/blk.h                                 | 141 +++++------
 include/efi_api.h                             |   4 +-
 include/efi_loader.h                          |   4 +-
 include/mmc.h                                 |   2 +-
 lib/efi_driver/efi_block_device.c             |   4 +-
 lib/efi_loader/Kconfig                        |   1 -
 lib/efi_loader/efi_device_path.c              |   2 +-
 lib/efi_loader/efi_device_path_to_text.c      |   4 +-
 lib/efi_loader/efi_disk.c                     |  28 +--
 lib/efi_loader/efi_net.c                      |   2 +-
 lib/efi_loader/efi_var_file.c                 |   4 +-
 test/dm/blk.c                                 |  24 +-
 tools/binman/control.py                       |  10 +-
 tools/binman/entry.py                         |  25 +-
 tools/binman/ftest.py                         |  30 ++-
 88 files changed, 492 insertions(+), 523 deletions(-)

-- 
2.37.1.559.g78731f0fdb-goog


^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2022-08-12  1:42 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-07 15:46 [PATCH 00/23] blk: Rationalise the block interface Simon Glass
2022-08-07 15:46 ` [PATCH 01/23] binman: Put fake files in a subdirectory Simon Glass
2022-08-07 15:46 ` [PATCH 02/23] disk: Correct help for TPL_PARTITIONS Simon Glass
2022-08-08  7:38   ` Heinrich Schuchardt
2022-08-07 15:46 ` [PATCH 03/23] blk: Enable CONFIG_BLK for all media Simon Glass
2022-08-08  8:00   ` Heinrich Schuchardt
2022-08-12  1:34     ` Simon Glass
2022-08-07 15:46 ` [PATCH 04/23] ata: Fix an instance of SPL_SATA_SUPPORT Simon Glass
2022-08-08  8:02   ` Heinrich Schuchardt
2022-08-07 15:46 ` [PATCH 05/23] sandbox: Avoid defining HAVE_BLOCK_DEVICE in Konfig Simon Glass
2022-08-07 15:46 ` [PATCH 06/23] disk: Use Makefile to omit partition drivers Simon Glass
2022-08-07 15:46 ` [PATCH 07/23] blk: Use a function for whether block devices are available Simon Glass
2022-08-07 15:46 ` [PATCH 08/23] cmd: Drop use of HAVE_BLOCK_DEVICE Simon Glass
2022-08-07 15:46 ` [PATCH 09/23] blk: Drop unnecessary #ifdef in in blk_legacy Simon Glass
2022-08-07 15:46 ` [PATCH 10/23] blk: Rename HAVE_BLOCK_DEVICE Simon Glass
2022-08-08  0:49   ` AKASHI Takahiro
2022-08-12  1:34     ` Simon Glass
2022-08-07 15:46 ` [PATCH 11/23] blk: Select SPL_LEGACY_BLOCK automatically Simon Glass
2022-08-07 15:46 ` [PATCH 12/23] blk: Drop unnecessary CONFIG_SPL_LEGACY_BLOCK in defconfigs Simon Glass
2022-08-07 15:46 ` [PATCH 13/23] blk: Hide the BLK and SPL_LEGACY_BLOCK options Simon Glass
2022-08-08  8:09   ` Heinrich Schuchardt
2022-08-12  1:34     ` Simon Glass
2022-08-07 15:46 ` [PATCH 14/23] blk: Drop IF_TYPE_DOC Simon Glass
2022-08-07 15:47 ` [PATCH 15/23] ide: Use a flag for an ATAPI device Simon Glass
2022-08-07 15:47 ` [PATCH 16/23] blk: Drop IF_TYPE_ATAPI Simon Glass
2022-08-07 15:47 ` [PATCH 17/23] blk: Drop IF_TYPE_SD Simon Glass
2022-08-07 15:47 ` [PATCH 18/23] blk: Rename var in blk_get_devnum_by_typename() Simon Glass
2022-08-07 15:47 ` [PATCH 19/23] blk: Rewrite if_type to name functions Simon Glass
2022-08-07 15:47 ` [PATCH 20/23] efi: Correct assumption about if_type Simon Glass
2022-08-07 15:47 ` [PATCH 21/23] blk: Switch over to using uclass IDs Simon Glass
2022-08-08  1:05   ` AKASHI Takahiro
2022-08-12  1:34     ` Simon Glass
2022-08-07 15:47 ` [PATCH 22/23] blk: Drop if_type Simon Glass
2022-08-07 15:47 ` [PATCH 23/23] blk: Rename if_type to uclass_id Simon Glass
2022-08-08  1:32   ` AKASHI Takahiro
2022-08-08  2:00     ` AKASHI Takahiro
2022-08-12  1:34       ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.