Merge branch '2022-09-16-rationalize-the-block-interface' into next
authorTom Rini <trini@konsulko.com>
Fri, 16 Sep 2022 19:35:47 +0000 (15:35 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 16 Sep 2022 19:35:47 +0000 (15:35 -0400)
commite17213b781ca86b40d2432aac1c6481308cff396
treecce42cf3f4efee4ef239560c0a3c8eeb0ec47110
parent6ec7207ab3c4dad098967fef5df75e25240fd852
parentec8bdc914c8328993cee62e01b4107b802cf45cc
Merge branch '2022-09-16-rationalize-the-block-interface' into next

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.