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.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/arch/sandbox/board/dtb.c b/arch/sandbox/board/dtb.c
index d11bde0249..4a8cbfb26f 100644
--- a/arch/sandbox/board/dtb.c
+++ b/arch/sandbox/board/dtb.c
@@ -32,32 +32,14 @@ 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;
-
- ret = of_property_write_u32(root, "#size-cells", 2);
- if (ret)
- return ret;
- }
-
- if (IS_ERR(root))
- return PTR_ERR(root);
+ if (!dtb)
+ dtb = __dtb_sandbox_start;
- of_set_root_node(root);
- of_fix_tree(root);
- if (IS_ENABLED(CONFIG_OFDEVICE))
- of_probe();
+ barebox_register_fdt(dtb);
return 0;
}