diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2011-01-13 17:36:09 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-01-16 00:01:58 -0500 |
commit | 672c54466d24994eb9633f993862c89539504a42 (patch) | |
tree | e08f17e5fa260676912eb9b7d2263d47d667fdec | |
parent | 1b59be2a6cdcb5a12e18d8315c07c94a624de48f (diff) |
dt/flattree: Return virtual address from early_init_dt_alloc_memory_arch()
The physical address is never used by the device tree code when
allocating memory for unflattening. Change the architecture's alloc
hook to return the virutal address instead.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
-rw-r--r-- | arch/microblaze/kernel/prom.c | 4 | ||||
-rw-r--r-- | arch/mips/kernel/prom.c | 6 | ||||
-rw-r--r-- | arch/powerpc/kernel/prom.c | 4 | ||||
-rw-r--r-- | drivers/of/fdt.c | 8 | ||||
-rw-r--r-- | include/linux/of_fdt.h | 2 |
5 files changed, 8 insertions, 16 deletions
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c index c881393f07fd..bceaa5543e39 100644 --- a/arch/microblaze/kernel/prom.c +++ b/arch/microblaze/kernel/prom.c | |||
@@ -47,9 +47,9 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) | |||
47 | memblock_add(base, size); | 47 | memblock_add(base, size); |
48 | } | 48 | } |
49 | 49 | ||
50 | u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align) | 50 | void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) |
51 | { | 51 | { |
52 | return memblock_alloc(size, align); | 52 | return __va(memblock_alloc(size, align)); |
53 | } | 53 | } |
54 | 54 | ||
55 | #ifdef CONFIG_EARLY_PRINTK | 55 | #ifdef CONFIG_EARLY_PRINTK |
diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c index 9dbe58368953..a19811e98a41 100644 --- a/arch/mips/kernel/prom.c +++ b/arch/mips/kernel/prom.c | |||
@@ -45,11 +45,9 @@ void __init free_mem_mach(unsigned long addr, unsigned long size) | |||
45 | return free_bootmem(addr, size); | 45 | return free_bootmem(addr, size); |
46 | } | 46 | } |
47 | 47 | ||
48 | u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align) | 48 | void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) |
49 | { | 49 | { |
50 | return virt_to_phys( | 50 | return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS)); |
51 | __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS)) | ||
52 | ); | ||
53 | } | 51 | } |
54 | 52 | ||
55 | #ifdef CONFIG_BLK_DEV_INITRD | 53 | #ifdef CONFIG_BLK_DEV_INITRD |
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 9e3132db718b..7185f0da7dc3 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -519,9 +519,9 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) | |||
519 | memblock_add(base, size); | 519 | memblock_add(base, size); |
520 | } | 520 | } |
521 | 521 | ||
522 | u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align) | 522 | void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) |
523 | { | 523 | { |
524 | return memblock_alloc(size, align); | 524 | return __va(memblock_alloc(size, align)); |
525 | } | 525 | } |
526 | 526 | ||
527 | #ifdef CONFIG_BLK_DEV_INITRD | 527 | #ifdef CONFIG_BLK_DEV_INITRD |
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index c787c3d95c60..af824e7e0367 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c | |||
@@ -692,12 +692,6 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, | |||
692 | return 1; | 692 | return 1; |
693 | } | 693 | } |
694 | 694 | ||
695 | static void *__init early_device_tree_alloc(u64 size, u64 align) | ||
696 | { | ||
697 | unsigned long mem = early_init_dt_alloc_memory_arch(size, align); | ||
698 | return __va(mem); | ||
699 | } | ||
700 | |||
701 | /** | 695 | /** |
702 | * unflatten_device_tree - create tree of device_nodes from flat blob | 696 | * unflatten_device_tree - create tree of device_nodes from flat blob |
703 | * | 697 | * |
@@ -709,7 +703,7 @@ static void *__init early_device_tree_alloc(u64 size, u64 align) | |||
709 | void __init unflatten_device_tree(void) | 703 | void __init unflatten_device_tree(void) |
710 | { | 704 | { |
711 | __unflatten_device_tree(initial_boot_params, &allnodes, | 705 | __unflatten_device_tree(initial_boot_params, &allnodes, |
712 | early_device_tree_alloc); | 706 | early_init_dt_alloc_memory_arch); |
713 | 707 | ||
714 | /* Get pointer to OF "/chosen" node for use everywhere */ | 708 | /* Get pointer to OF "/chosen" node for use everywhere */ |
715 | of_chosen = of_find_node_by_path("/chosen"); | 709 | of_chosen = of_find_node_by_path("/chosen"); |
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 0ef22a1f129e..c84d900fbbb3 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h | |||
@@ -97,7 +97,7 @@ extern void early_init_dt_check_for_initrd(unsigned long node); | |||
97 | extern int early_init_dt_scan_memory(unsigned long node, const char *uname, | 97 | extern int early_init_dt_scan_memory(unsigned long node, const char *uname, |
98 | int depth, void *data); | 98 | int depth, void *data); |
99 | extern void early_init_dt_add_memory_arch(u64 base, u64 size); | 99 | extern void early_init_dt_add_memory_arch(u64 base, u64 size); |
100 | extern u64 early_init_dt_alloc_memory_arch(u64 size, u64 align); | 100 | extern void * early_init_dt_alloc_memory_arch(u64 size, u64 align); |
101 | extern u64 dt_mem_next_cell(int s, __be32 **cellp); | 101 | extern u64 dt_mem_next_cell(int s, __be32 **cellp); |
102 | 102 | ||
103 | /* | 103 | /* |