public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v2 00/24] blk: Rationalise the block interface
@ 2022-08-12  1:34 Simon Glass
  2022-08-12  1:34 ` [PATCH v2 01/24] disk: Correct help for TPL_PARTITIONS Simon Glass
                   ` (24 more replies)
  0 siblings, 25 replies; 42+ messages in thread
From: Simon Glass @ 2022-08-12  1:34 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, Ashok Reddy Soma, Aswath Govindraju, Bharat Gooty,
	Bin Meng, Chris Morgan, Denys Drozdov, Francesco Dolcini,
	Gary Bisson, Heiko Schocher, Huang Jianan, Ilias Apalodimas,
	Jaehoon Chung, Jens Wiklander, Joe Hershberger, Judy Wang,
	Loic Poulain, Lukasz Majewski, Marcel Ziswiler, Marek Behún,
	Marek Vasut, Mark Kettenis, Markus Niebel, 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, 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.

Changes in v2:
- Update commit message
- Fix SPL_PARTITIONS too
- Add SATA also
- Refer to a suffix, not a prefix
- Add new patch to handle UCLASS_EFI_MEDIA in dev_print()
- Add new patch to drop ifname field from struct efi_disk_obj
- Use conv_uclass_id() instead of the confusing uclass_id_to_uclass_id()

Simon Glass (24):
  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
  disk: Handle UCLASS_EFI_MEDIA in dev_print()
  blk: Drop if_type
  efi: Drop ifname field from struct efi_disk_obj
  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                                  |   8 +-
 disk/Makefile                                 |   4 +
 disk/disk-uclass.c                            |  11 +-
 disk/part.c                                   | 161 ++++++-------
 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 +-
 85 files changed, 444 insertions(+), 515 deletions(-)

-- 
2.37.1.595.g718a3a8f04-goog


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

end of thread, other threads:[~2022-09-16 19:37 UTC | newest]

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox