aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/lantiq/prom.c
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2012-07-22 02:56:00 -0400
committerRalf Baechle <ralf@linux-mips.org>2012-08-01 11:58:04 -0400
commita9188bc1628366bea7157209df93acc0f74625cc (patch)
tree3664c8dff1ae8d1da38ebfeff676c416fd30c28b /arch/mips/lantiq/prom.c
parente29b72f5e129b4dd4b77dc01dba340006bb103f8 (diff)
MIPS: Lantiq: Add device_tree_init function
Add a lantiq specific version of device_tree_init. The generic MIPS version was removed by. commit 594e966bc412d64eec9282d28ce511bdd62fea39 Author: David Daney <david.daney@cavium.com> Date: Thu Jul 5 18:12:38 2012 +0200 MIPS: Prune some target specific code out of prom.c Signed-off-by: John Crispin <blogic@openwrt.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/4116/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/lantiq/prom.c')
-rw-r--r--arch/mips/lantiq/prom.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c
index d185e8477fdf..6cfd6117fbfd 100644
--- a/arch/mips/lantiq/prom.c
+++ b/arch/mips/lantiq/prom.c
@@ -8,7 +8,10 @@
8 8
9#include <linux/export.h> 9#include <linux/export.h>
10#include <linux/clk.h> 10#include <linux/clk.h>
11#include <linux/bootmem.h>
11#include <linux/of_platform.h> 12#include <linux/of_platform.h>
13#include <linux/of_fdt.h>
14
12#include <asm/bootinfo.h> 15#include <asm/bootinfo.h>
13#include <asm/time.h> 16#include <asm/time.h>
14 17
@@ -70,6 +73,25 @@ void __init plat_mem_setup(void)
70 __dt_setup_arch(&__dtb_start); 73 __dt_setup_arch(&__dtb_start);
71} 74}
72 75
76void __init device_tree_init(void)
77{
78 unsigned long base, size;
79
80 if (!initial_boot_params)
81 return;
82
83 base = virt_to_phys((void *)initial_boot_params);
84 size = be32_to_cpu(initial_boot_params->totalsize);
85
86 /* Before we do anything, lets reserve the dt blob */
87 reserve_bootmem(base, size, BOOTMEM_DEFAULT);
88
89 unflatten_device_tree();
90
91 /* free the space reserved for the dt blob */
92 free_bootmem(base, size);
93}
94
73void __init prom_init(void) 95void __init prom_init(void)
74{ 96{
75 /* call the soc specific detetcion code and get it to fill soc_info */ 97 /* call the soc specific detetcion code and get it to fill soc_info */