summaryrefslogtreecommitdiffstats
path: root/arch/sandbox/board/dtb.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sandbox/board/dtb.c')
-rw-r--r--arch/sandbox/board/dtb.c33
1 files changed, 5 insertions, 28 deletions
diff --git a/arch/sandbox/board/dtb.c b/arch/sandbox/board/dtb.c
index af4a64a9c7..98d2e774b8 100644
--- a/arch/sandbox/board/dtb.c
+++ b/arch/sandbox/board/dtb.c
@@ -2,9 +2,6 @@
* Copyright (c) 2013 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
* Copyright (c) 2015 Marc Kleine-Budde <mkl@pengutronix.de>, Pengutronix
*
- * See file CREDITS for list of people who contributed to this
- * project.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
@@ -35,33 +32,13 @@ int barebox_register_dtb(const void *new_dtb)
return 0;
}
+extern char __dtb_sandbox_start[];
+
static int of_sandbox_init(void)
{
- struct device_node *root;
- int ret;
-
- if (dtb) {
- root = of_unflatten_dtb(dtb);
- } else {
- root = of_new_node(NULL, NULL);
-
- ret = of_property_write_u32(root, "#address-cells", 2);
- if (ret)
- return ret;
+ if (!dtb)
+ dtb = __dtb_sandbox_start;
- ret = of_property_write_u32(root, "#size-cells", 1);
- if (ret)
- return ret;
- }
-
- if (IS_ERR(root))
- return PTR_ERR(root);
-
- of_set_root_node(root);
- of_fix_tree(root);
- if (IS_ENABLED(CONFIG_OFDEVICE))
- of_probe();
-
- return 0;
+ return barebox_register_fdt(dtb);
}
core_initcall(of_sandbox_init);