Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360684
b: refs/heads/master
c: 2270e6d
h: refs/heads/master
v: v3
  • Loading branch information
James Hogan committed Mar 2, 2013
1 parent 6276286 commit ab6969d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d7900504480ea9d49a6b5f8811f2678ad08d3255
refs/heads/master: 2270e6d30bb6601ffd42e9d972442df0499ad547
1 change: 1 addition & 0 deletions trunk/arch/metag/include/asm/prom.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define HAVE_ARCH_DEVTREE_FIXUPS

extern struct machine_desc *setup_machine_fdt(void *dt);
extern void copy_fdt(void);
extern void metag_dt_memblock_reserve(void);

#endif /* __ASM_METAG_PROM_H */
17 changes: 17 additions & 0 deletions trunk/arch/metag/kernel/devtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,20 @@ struct machine_desc * __init setup_machine_fdt(void *dt)

return mdesc_best;
}

/**
* copy_fdt - Copy device tree into non-init memory.
*
* We must copy the flattened device tree blob into non-init memory because the
* unflattened device tree will reference the strings in it directly.
*/
void __init copy_fdt(void)
{
void *alloc = early_init_dt_alloc_memory_arch(
be32_to_cpu(initial_boot_params->totalsize), 0x40);
if (alloc) {
memcpy(alloc, initial_boot_params,
be32_to_cpu(initial_boot_params->totalsize));
initial_boot_params = alloc;
}
}
2 changes: 2 additions & 0 deletions trunk/arch/metag/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ void __init setup_arch(char **cmdline_p)
cpu_2_hwthread_id[smp_processor_id()] = hard_processor_id();
hwthread_id_2_cpu[hard_processor_id()] = smp_processor_id();

/* Copy device tree blob into non-init memory before unflattening */
copy_fdt();
unflatten_device_tree();

#ifdef CONFIG_SMP
Expand Down

0 comments on commit ab6969d

Please sign in to comment.