test: Move some test drivers into their own file

At present several test drivers are part of the test file itself. Some of
these are useful for of-platdata tests. Separate them out so we can use
them for other things also.

A few adjustments are needed so this driver can build for sandbox_spl as
well.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 29432ae..7d2a299 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -343,6 +343,15 @@
 	  can make requests to the BPMP. This driver is similar to an MFD
 	  driver in the Linux kernel.
 
+config TEST_DRV
+	bool "Enable support for test drivers"
+	default y if SANDBOX
+	help
+	  This enables drivers and uclasses that provides a way of testing the
+	  operations of memory allocation and driver/uclass methods in driver
+	  model. This should only be enabled for testing as it is not useful for
+	  anything else.
+
 config TWL4030_LED
 	bool "Enable TWL4030 LED controller"
 	help