dm: Move the tree/uclass dump code into its own file

In SPL it is sometimes useful to be able to obtain a dump of the current
driver model state. Since commands are not available, provide a way to
directly call the functions to output this information.

Adjust the existing commands to use these functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/core/Makefile b/drivers/core/Makefile
index a3fec38..ed21fed 100644
--- a/drivers/core/Makefile
+++ b/drivers/core/Makefile
@@ -9,3 +9,4 @@
 obj-$(CONFIG_OF_CONTROL) += simple-bus.o
 endif
 obj-$(CONFIG_DM_DEVICE_REMOVE)	+= device-remove.o
+obj-$(CONFIG_DM)	+= dump.o