diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2012-01-25 15:03:19 +0100 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2012-05-15 17:49:19 +0200 |
commit | 7d6168e57610a51404fb30e500345e2d92c20b18 (patch) | |
tree | f3848ea8c3b177217f778498500a8abce9299389 /arch/mips/kernel/prom.c | |
parent | 0a4c531c2124cbb700484787327c516abbd76e70 (diff) | |
download | linux-7d6168e57610a51404fb30e500345e2d92c20b18.tar.bz2 |
MIPS: Add helper function to allow platforms to point at a DTB.
Add __dt_setup_arch() that can be called to load a builtin DT.
Additionally we add a macro to allow loading a specific symbol
from the __dtb_* section.
Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3715/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/prom.c')
-rw-r--r-- | arch/mips/kernel/prom.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c index 558b5395795d..4c788d259539 100644 --- a/arch/mips/kernel/prom.c +++ b/arch/mips/kernel/prom.c @@ -95,3 +95,14 @@ void __init device_tree_init(void) /* free the space reserved for the dt blob */ free_mem_mach(base, size); } + +void __init __dt_setup_arch(struct boot_param_header *bph) +{ + if (be32_to_cpu(bph->magic) != OF_DT_HEADER) { + pr_err("DTB has bad magic, ignoring builtin OF DTB\n"); + + return; + } + + initial_boot_params = bph; +} |