[U-Boot] [PATCH 15/31] sandbox: Add a test device that uses of-platdata

Simon Glass sjg at chromium.org
Wed Jun 8 04:47:53 CEST 2016


Add a simple test device that provides a check that the of-platdata
feature is working correctly.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/sandbox/cpu/spl.c        |  9 +++++++++
 arch/sandbox/dts/sandbox.dts  | 13 +++++++++++++
 include/configs/sandbox_spl.h |  2 ++
 3 files changed, 24 insertions(+)

diff --git a/arch/sandbox/cpu/spl.c b/arch/sandbox/cpu/spl.c
index e17c0ed..b064709 100644
--- a/arch/sandbox/cpu/spl.c
+++ b/arch/sandbox/cpu/spl.c
@@ -49,3 +49,12 @@ int spl_board_load_image(void)
 	/* Hopefully this will not return */
 	return os_spl_to_uboot(fname);
 }
+
+void spl_board_init(void)
+{
+	struct udevice *dev;
+	int ret;
+
+	ret = uclass_first_device(UCLASS_MISC, &dev);
+	printf("ret=%d, dev=%p\n", ret, dev);
+}
diff --git a/arch/sandbox/dts/sandbox.dts b/arch/sandbox/dts/sandbox.dts
index 2ae4014..3455bc0 100644
--- a/arch/sandbox/dts/sandbox.dts
+++ b/arch/sandbox/dts/sandbox.dts
@@ -172,6 +172,19 @@
 		};
 	};
 
+	spl-test {
+		u-boot,dm-pre-reloc;
+		compatible = "sandbox,spl-test";
+		boolval;
+		intval = <1>;
+		intarray = <2 3 4>;
+		byteval = [05];
+		bytearray = [06 07 08];
+		longbytearray = [09 0a 0b 0c 0d 0e 0f 10 11];
+		string = "message";
+		stringarray = "multi-word", "message";
+	};
+
 	square {
 		compatible = "demo-shape";
 		colour = "blue";
diff --git a/include/configs/sandbox_spl.h b/include/configs/sandbox_spl.h
index 7b5c3f3..ffc3098 100644
--- a/include/configs/sandbox_spl.h
+++ b/include/configs/sandbox_spl.h
@@ -8,6 +8,8 @@
 
 #include <configs/sandbox.h>
 
+#define CONFIG_SPL_BOARD_INIT
+
 #define CONFIG_SPL_DRIVERS_MISC_SUPPORT
 #define CONFIG_SPL_ENV_SUPPORT
 #define CONFIG_SPL_FRAMEWORK
-- 
2.8.0.rc3.226.g39d4020



More information about the U-Boot mailing list