aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/fdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/of/fdt.c')
-rw-r--r--drivers/of/fdt.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index dd9057cb7aa7..f41d739aa2f7 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -83,3 +83,19 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node,
83 83
84 return rc; 84 return rc;
85} 85}
86
87/**
88 * of_get_flat_dt_root - find the root node in the flat blob
89 */
90unsigned long __init of_get_flat_dt_root(void)
91{
92 unsigned long p = ((unsigned long)initial_boot_params) +
93 initial_boot_params->off_dt_struct;
94
95 while (*((u32 *)p) == OF_DT_NOP)
96 p += 4;
97 BUG_ON(*((u32 *)p) != OF_DT_BEGIN_NODE);
98 p += 4;
99 return _ALIGN(p + strlen((char *)p) + 1, 4);
100}
101