diff options
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/include/asm/prom.h | 11 | ||||
-rw-r--r-- | arch/mips/kernel/prom.c | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/arch/mips/include/asm/prom.h b/arch/mips/include/asm/prom.h index 40ed25952e6b..7206d445bab8 100644 --- a/arch/mips/include/asm/prom.h +++ b/arch/mips/include/asm/prom.h | |||
@@ -36,6 +36,17 @@ static inline unsigned long pci_address_to_pio(phys_addr_t address) | |||
36 | } | 36 | } |
37 | #define pci_address_to_pio pci_address_to_pio | 37 | #define pci_address_to_pio pci_address_to_pio |
38 | 38 | ||
39 | struct boot_param_header; | ||
40 | |||
41 | extern void __dt_setup_arch(struct boot_param_header *bph); | ||
42 | |||
43 | #define dt_setup_arch(sym) \ | ||
44 | ({ \ | ||
45 | extern struct boot_param_header __dtb_##sym##_begin; \ | ||
46 | \ | ||
47 | __dt_setup_arch(&__dtb_##sym##_begin); \ | ||
48 | }) | ||
49 | |||
39 | #else /* CONFIG_OF */ | 50 | #else /* CONFIG_OF */ |
40 | static inline void device_tree_init(void) { } | 51 | static inline void device_tree_init(void) { } |
41 | #endif /* CONFIG_OF */ | 52 | #endif /* CONFIG_OF */ |
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) | |||
95 | /* free the space reserved for the dt blob */ | 95 | /* free the space reserved for the dt blob */ |
96 | free_mem_mach(base, size); | 96 | free_mem_mach(base, size); |
97 | } | 97 | } |
98 | |||
99 | void __init __dt_setup_arch(struct boot_param_header *bph) | ||
100 | { | ||
101 | if (be32_to_cpu(bph->magic) != OF_DT_HEADER) { | ||
102 | pr_err("DTB has bad magic, ignoring builtin OF DTB\n"); | ||
103 | |||
104 | return; | ||
105 | } | ||
106 | |||
107 | initial_boot_params = bph; | ||
108 | } | ||