From 866d52126901583c9a575a4e7288fe55c62ce2e6 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Wed, 25 Jan 2012 15:03:19 +0100 Subject: [PATCH] --- yaml --- r: 309067 b: refs/heads/master c: 7d6168e57610a51404fb30e500345e2d92c20b18 h: refs/heads/master i: 309065: 5bbf2c4c95e7c0985a13c131ef32ab1a40126b4f 309063: 3b1f2b6ae7090e9bbd4b564efa3e176d5015c882 v: v3 --- [refs] | 2 +- trunk/arch/mips/include/asm/prom.h | 11 +++++++++++ trunk/arch/mips/kernel/prom.c | 11 +++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 7460d7ce5d8b..1a74c91bcd0a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0a4c531c2124cbb700484787327c516abbd76e70 +refs/heads/master: 7d6168e57610a51404fb30e500345e2d92c20b18 diff --git a/trunk/arch/mips/include/asm/prom.h b/trunk/arch/mips/include/asm/prom.h index 40ed25952e6b..7206d445bab8 100644 --- a/trunk/arch/mips/include/asm/prom.h +++ b/trunk/arch/mips/include/asm/prom.h @@ -36,6 +36,17 @@ static inline unsigned long pci_address_to_pio(phys_addr_t address) } #define pci_address_to_pio pci_address_to_pio +struct boot_param_header; + +extern void __dt_setup_arch(struct boot_param_header *bph); + +#define dt_setup_arch(sym) \ +({ \ + extern struct boot_param_header __dtb_##sym##_begin; \ + \ + __dt_setup_arch(&__dtb_##sym##_begin); \ +}) + #else /* CONFIG_OF */ static inline void device_tree_init(void) { } #endif /* CONFIG_OF */ diff --git a/trunk/arch/mips/kernel/prom.c b/trunk/arch/mips/kernel/prom.c index 558b5395795d..4c788d259539 100644 --- a/trunk/arch/mips/kernel/prom.c +++ b/trunk/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; +}