dm: blk: Add a legacy block interface

There is quite a bit of duplicated common code related to block devices
in the IDE and SCSI implementations.

Create some helper functions that can be used to reduce the duplication.
These rely on a linker list of interface-type drivers

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index 3f75934..436b79f 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -7,6 +7,10 @@
 
 obj-$(CONFIG_BLK) += blk-uclass.o
 
+ifndef CONFIG_BLK
+obj-y += blk_legacy.o
+endif
+
 obj-$(CONFIG_AHCI) += ahci-uclass.o
 obj-$(CONFIG_SCSI_AHCI) += ahci.o
 obj-$(CONFIG_DWC_AHSATA) += dwc_ahsata.o