summaryrefslogtreecommitdiffstats
path: root/arch/mips/boot/main_entry-pbl.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/boot/main_entry-pbl.c')
-rw-r--r--arch/mips/boot/main_entry-pbl.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/mips/boot/main_entry-pbl.c b/arch/mips/boot/main_entry-pbl.c
index e408d29445..e608fcb355 100644
--- a/arch/mips/boot/main_entry-pbl.c
+++ b/arch/mips/boot/main_entry-pbl.c
@@ -31,7 +31,7 @@ extern void *input_data_end;
unsigned long free_mem_ptr;
unsigned long free_mem_end_ptr;
-void pbl_main_entry(void);
+void pbl_main_entry(void *fdt, void *fdt_end);
static unsigned long *ttb;
@@ -46,10 +46,11 @@ static void barebox_uncompress(void *compressed_start, unsigned int len)
pbl_barebox_uncompress((void*)TEXT_BASE, compressed_start, len);
}
-void __section(.text_entry) pbl_main_entry(void)
+void __section(.text_entry) pbl_main_entry(void *fdt, void *fdt_end)
{
- u32 pg_start, pg_end, pg_len;
- void (*barebox)(void);
+ u32 pg_start, pg_end, pg_len, fdt_len;
+ void *fdt_new;
+ void (*barebox)(void *fdt, u32 fdt_len);
puts_ll("pbl_main_entry()\n");
@@ -62,6 +63,10 @@ void __section(.text_entry) pbl_main_entry(void)
barebox_uncompress(&input_data, pg_len);
+ fdt_len = (u32)fdt_end - (u32)fdt;
+ fdt_new = (void *)PAGE_ALIGN_DOWN(STACK_BASE - fdt_len);
+ memcpy(fdt_new, fdt, fdt_len);
+
barebox = (void *)TEXT_BASE;
- barebox();
+ barebox(fdt_new, fdt_len);
}