diff mbox

[U-Boot,4/7] dm: REMOVE: sandbox binding experiment

Message ID 1345564853-24500-5-git-send-email-marex@denx.de
State Deferred
Headers show

Commit Message

Marek Vasut Aug. 21, 2012, 4 p.m. UTC
Signed-off-by: Marek Vasut <marex@denx.de>
---
 arch/sandbox/lib/board.c |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff mbox

Patch

diff --git a/arch/sandbox/lib/board.c b/arch/sandbox/lib/board.c
index c173bf9..b6b3768 100644
--- a/arch/sandbox/lib/board.c
+++ b/arch/sandbox/lib/board.c
@@ -47,6 +47,8 @@ 
 
 #include <os.h>
 
+#include <dm/manager.h>
+
 DECLARE_GLOBAL_DATA_PTR;
 
 static gd_t gd_mem;
@@ -232,6 +234,23 @@  void board_init_r(gd_t *id, ulong dest_addr)
 	mem_malloc_init((ulong)gd->ram_buf + gd->ram_size - TOTAL_MALLOC_LEN,
 			TOTAL_MALLOC_LEN);
 
+	dm_init();
+	static const struct driver_info info = {
+		.name = "demo_drv",
+		.platform_data = NULL
+	};
+	struct instance *root = get_root_instance();
+	struct instance *demo1, *demo2, *demo3;
+	demo1 =	driver_bind(root, &info);
+		driver_bind(root, &info);
+				driver_bind(demo1, &info);
+				driver_bind(demo1, &info);
+			demo2 = driver_bind(demo1, &info);
+				demo3 = driver_bind(demo2, &info);
+	driver_bind(demo2, &info);
+
+	demo_hello(demo2);
+
 	/* initialize environment */
 	env_relocate();