diff options
| -rw-r--r-- | arch/mips/include/asm/prom.h | 3 | ||||
| -rw-r--r-- | arch/mips/kernel/prom.c | 29 | ||||
| -rw-r--r-- | arch/mips/netlogic/xlp/Makefile | 1 | ||||
| -rw-r--r-- | arch/mips/netlogic/xlp/of.c | 34 |
4 files changed, 35 insertions, 32 deletions
diff --git a/arch/mips/include/asm/prom.h b/arch/mips/include/asm/prom.h index 7206d445bab8..8808bf548b99 100644 --- a/arch/mips/include/asm/prom.h +++ b/arch/mips/include/asm/prom.h | |||
| @@ -20,9 +20,6 @@ | |||
| 20 | extern int early_init_dt_scan_memory_arch(unsigned long node, | 20 | extern int early_init_dt_scan_memory_arch(unsigned long node, |
| 21 | const char *uname, int depth, void *data); | 21 | const char *uname, int depth, void *data); |
| 22 | 22 | ||
| 23 | extern int reserve_mem_mach(unsigned long addr, unsigned long size); | ||
| 24 | extern void free_mem_mach(unsigned long addr, unsigned long size); | ||
| 25 | |||
| 26 | extern void device_tree_init(void); | 23 | extern void device_tree_init(void); |
| 27 | 24 | ||
| 28 | static inline unsigned long pci_address_to_pio(phys_addr_t address) | 25 | static inline unsigned long pci_address_to_pio(phys_addr_t address) |
diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c index f11b2bbb826d..028f6f837ef9 100644 --- a/arch/mips/kernel/prom.c +++ b/arch/mips/kernel/prom.c | |||
| @@ -35,16 +35,6 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) | |||
| 35 | return add_memory_region(base, size, BOOT_MEM_RAM); | 35 | return add_memory_region(base, size, BOOT_MEM_RAM); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | int __init reserve_mem_mach(unsigned long addr, unsigned long size) | ||
| 39 | { | ||
| 40 | return reserve_bootmem(addr, size, BOOTMEM_DEFAULT); | ||
| 41 | } | ||
| 42 | |||
| 43 | void __init free_mem_mach(unsigned long addr, unsigned long size) | ||
| 44 | { | ||
| 45 | return free_bootmem(addr, size); | ||
| 46 | } | ||
| 47 | |||
| 48 | void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) | 38 | void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) |
| 49 | { | 39 | { |
| 50 | return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS)); | 40 | return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS)); |
| @@ -77,25 +67,6 @@ void __init early_init_devtree(void *params) | |||
| 77 | of_scan_flat_dt(early_init_dt_scan_memory_arch, NULL); | 67 | of_scan_flat_dt(early_init_dt_scan_memory_arch, NULL); |
| 78 | } | 68 | } |
| 79 | 69 | ||
| 80 | void __init device_tree_init(void) | ||
| 81 | { | ||
| 82 | unsigned long base, size; | ||
| 83 | |||
| 84 | if (!initial_boot_params) | ||
| 85 | return; | ||
| 86 | |||
| 87 | base = virt_to_phys((void *)initial_boot_params); | ||
| 88 | size = be32_to_cpu(initial_boot_params->totalsize); | ||
| 89 | |||
| 90 | /* Before we do anything, lets reserve the dt blob */ | ||
| 91 | reserve_mem_mach(base, size); | ||
| 92 | |||
| 93 | unflatten_device_tree(); | ||
| 94 | |||
| 95 | /* free the space reserved for the dt blob */ | ||
| 96 | free_mem_mach(base, size); | ||
| 97 | } | ||
| 98 | |||
| 99 | void __init __dt_setup_arch(struct boot_param_header *bph) | 70 | void __init __dt_setup_arch(struct boot_param_header *bph) |
| 100 | { | 71 | { |
| 101 | if (be32_to_cpu(bph->magic) != OF_DT_HEADER) { | 72 | if (be32_to_cpu(bph->magic) != OF_DT_HEADER) { |
diff --git a/arch/mips/netlogic/xlp/Makefile b/arch/mips/netlogic/xlp/Makefile index b93ed83474ec..9007ef0c398e 100644 --- a/arch/mips/netlogic/xlp/Makefile +++ b/arch/mips/netlogic/xlp/Makefile | |||
| @@ -1,2 +1,3 @@ | |||
| 1 | obj-y += setup.o platform.o nlm_hal.o | 1 | obj-y += setup.o platform.o nlm_hal.o |
| 2 | obj-$(CONFIG_OF) += of.o | ||
| 2 | obj-$(CONFIG_SMP) += wakeup.o | 3 | obj-$(CONFIG_SMP) += wakeup.o |
diff --git a/arch/mips/netlogic/xlp/of.c b/arch/mips/netlogic/xlp/of.c new file mode 100644 index 000000000000..8e3921c0c201 --- /dev/null +++ b/arch/mips/netlogic/xlp/of.c | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | #include <linux/bootmem.h> | ||
| 2 | #include <linux/init.h> | ||
| 3 | #include <linux/io.h> | ||
| 4 | #include <linux/of_fdt.h> | ||
| 5 | #include <asm/byteorder.h> | ||
| 6 | |||
| 7 | static int __init reserve_mem_mach(unsigned long addr, unsigned long size) | ||
| 8 | { | ||
| 9 | return reserve_bootmem(addr, size, BOOTMEM_DEFAULT); | ||
| 10 | } | ||
| 11 | |||
| 12 | void __init free_mem_mach(unsigned long addr, unsigned long size) | ||
| 13 | { | ||
| 14 | return free_bootmem(addr, size); | ||
| 15 | } | ||
| 16 | |||
| 17 | void __init device_tree_init(void) | ||
| 18 | { | ||
| 19 | unsigned long base, size; | ||
| 20 | |||
| 21 | if (!initial_boot_params) | ||
| 22 | return; | ||
| 23 | |||
| 24 | base = virt_to_phys((void *)initial_boot_params); | ||
| 25 | size = be32_to_cpu(initial_boot_params->totalsize); | ||
| 26 | |||
| 27 | /* Before we do anything, lets reserve the dt blob */ | ||
| 28 | reserve_mem_mach(base, size); | ||
| 29 | |||
| 30 | unflatten_device_tree(); | ||
| 31 | |||
| 32 | /* free the space reserved for the dt blob */ | ||
| 33 | free_mem_mach(base, size); | ||
| 34 | } | ||
