Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Prune some target specific code out of prom.c

This code is not common enough to be in a shared file. It is also not
used by any existing boards, so just remove it.

[ralf@linux-mips.org: Dropped removal of irq_create_of_mapping which was
already removed by abd2363f6a5f1030b935e0bdc15cf917313b3b10
[irq_domain/mips: Allow irq_domain on MIPS]. Moved device_tree_init() and
dependencies to its sole user, the XLP code.]

Signed-off-by: David Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: devicetree-discuss@lists.ozlabs.org
Cc: grant.likely@secretlab.ca
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/2946/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

David Daney and committed by
Ralf Baechle
b01da9f1 736b1c9c

+35 -32
-3
arch/mips/include/asm/prom.h
··· 20 20 extern int early_init_dt_scan_memory_arch(unsigned long node, 21 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 23 extern void device_tree_init(void); 27 24 28 25 static inline unsigned long pci_address_to_pio(phys_addr_t address)
-29
arch/mips/kernel/prom.c
··· 35 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 38 void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) 49 39 { 50 40 return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS)); ··· 65 75 /* Scan memory nodes */ 66 76 of_scan_flat_dt(early_init_dt_scan_root, NULL); 67 77 of_scan_flat_dt(early_init_dt_scan_memory_arch, NULL); 68 - } 69 - 70 - void __init device_tree_init(void) 71 - { 72 - unsigned long base, size; 73 - 74 - if (!initial_boot_params) 75 - return; 76 - 77 - base = virt_to_phys((void *)initial_boot_params); 78 - size = be32_to_cpu(initial_boot_params->totalsize); 79 - 80 - /* Before we do anything, lets reserve the dt blob */ 81 - reserve_mem_mach(base, size); 82 - 83 - unflatten_device_tree(); 84 - 85 - /* free the space reserved for the dt blob */ 86 - free_mem_mach(base, size); 87 78 } 88 79 89 80 void __init __dt_setup_arch(struct boot_param_header *bph)
+1
arch/mips/netlogic/xlp/Makefile
··· 1 1 obj-y += setup.o platform.o nlm_hal.o 2 + obj-$(CONFIG_OF) += of.o 2 3 obj-$(CONFIG_SMP) += wakeup.o
+34
arch/mips/netlogic/xlp/of.c
··· 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 + }