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

MIPS: replace add_memory_region with memblock

add_memory_region was the old interface for registering memory and
was already changed to used memblock internaly. Replace it by
directly calling memblock functions.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

+82 -149
+2 -1
arch/mips/alchemy/common/prom.c
··· 35 35 36 36 #include <linux/init.h> 37 37 #include <linux/kernel.h> 38 + #include <linux/memblock.h> 38 39 #include <linux/sizes.h> 39 40 #include <linux/string.h> 40 41 ··· 94 93 if (!memsize_str || kstrtoul(memsize_str, 0, &memsize)) 95 94 memsize = SZ_64M; /* minimum memsize is 64MB RAM */ 96 95 97 - add_memory_region(0, memsize, BOOT_MEM_RAM); 96 + memblock_add(0, memsize); 98 97 } 99 98 100 99 static inline unsigned char str2hexnum(unsigned char c)
+1 -1
arch/mips/ar7/memory.c
··· 47 47 unsigned long pages; 48 48 49 49 pages = memsize() >> PAGE_SHIFT; 50 - add_memory_region(PHYS_OFFSET, pages << PAGE_SHIFT, BOOT_MEM_RAM); 50 + memblock_add(PHYS_OFFSET, pages << PAGE_SHIFT); 51 51 } 52 52 53 53 void __init prom_free_prom_memory(void)
+2 -1
arch/mips/ath25/ar2315.c
··· 19 19 #include <linux/bitops.h> 20 20 #include <linux/irqdomain.h> 21 21 #include <linux/interrupt.h> 22 + #include <linux/memblock.h> 22 23 #include <linux/platform_device.h> 23 24 #include <linux/reboot.h> 24 25 #include <asm/bootinfo.h> ··· 267 266 memsize <<= 1 + ATH25_REG_MS(memcfg, AR2315_MEM_CFG_COL_WIDTH); 268 267 memsize <<= 1 + ATH25_REG_MS(memcfg, AR2315_MEM_CFG_ROW_WIDTH); 269 268 memsize <<= 3; 270 - add_memory_region(0, memsize, BOOT_MEM_RAM); 269 + memblock_add(0, memsize); 271 270 iounmap(sdram_base); 272 271 273 272 ar2315_rst_base = ioremap(AR2315_RST_BASE, AR2315_RST_SIZE);
+2 -1
arch/mips/ath25/ar5312.c
··· 19 19 #include <linux/bitops.h> 20 20 #include <linux/irqdomain.h> 21 21 #include <linux/interrupt.h> 22 + #include <linux/memblock.h> 22 23 #include <linux/platform_device.h> 23 24 #include <linux/mtd/physmap.h> 24 25 #include <linux/reboot.h> ··· 364 363 memsize = (bank0_ac ? (1 << (bank0_ac + 1)) : 0) + 365 364 (bank1_ac ? (1 << (bank1_ac + 1)) : 0); 366 365 memsize <<= 20; 367 - add_memory_region(0, memsize, BOOT_MEM_RAM); 366 + memblock_add(0, memsize); 368 367 iounmap(sdram_base); 369 368 370 369 ar5312_rst_base = ioremap(AR5312_RST_BASE, AR5312_RST_SIZE);
+2 -1
arch/mips/bcm47xx/prom.c
··· 27 27 #include <linux/init.h> 28 28 #include <linux/types.h> 29 29 #include <linux/kernel.h> 30 + #include <linux/memblock.h> 30 31 #include <linux/spinlock.h> 31 32 #include <linux/ssb/ssb_driver_chipcommon.h> 32 33 #include <linux/ssb/ssb_regs.h> ··· 98 97 */ 99 98 if (c->cputype == CPU_74K && (mem == (128 << 20))) 100 99 mem -= 0x1000; 101 - add_memory_region(0, mem, BOOT_MEM_RAM); 100 + memblock_add(0, mem); 102 101 } 103 102 104 103 /*
+1 -1
arch/mips/bcm47xx/setup.c
··· 141 141 142 142 /* 143 143 * Memory setup is done in the early part of MIPS's arch_mem_init. It's supposed 144 - * to detect memory and record it with add_memory_region. 144 + * to detect memory and record it with memblock_add. 145 145 * Any extra initializaion performed here must not use kmalloc or bootmem. 146 146 */ 147 147 void __init plat_mem_setup(void)
+1 -1
arch/mips/bcm63xx/setup.c
··· 146 146 147 147 void __init plat_mem_setup(void) 148 148 { 149 - add_memory_region(0, bcm63xx_get_memory_size(), BOOT_MEM_RAM); 149 + memblock_add(0, bcm63xx_get_memory_size()); 150 150 151 151 _machine_halt = bcm63xx_machine_halt; 152 152 _machine_restart = __bcm63xx_machine_reboot;
+10 -14
arch/mips/cavium-octeon/setup.c
··· 16 16 #include <linux/export.h> 17 17 #include <linux/interrupt.h> 18 18 #include <linux/io.h> 19 + #include <linux/memblock.h> 19 20 #include <linux/serial.h> 20 21 #include <linux/smp.h> 21 22 #include <linux/types.h> ··· 931 930 { 932 931 if (addr > *mem && addr < *mem + *size) { 933 932 u64 inc = addr - *mem; 934 - add_memory_region(*mem, inc, BOOT_MEM_RAM); 933 + memblock_add(*mem, inc); 935 934 *mem += inc; 936 935 *size -= inc; 937 936 } ··· 993 992 994 993 /* Crashkernel ignores bootmem list. It relies on mem=X@Y option */ 995 994 #ifdef CONFIG_CRASH_DUMP 996 - add_memory_region(reserve_low_mem, max_memory, BOOT_MEM_RAM); 995 + memblock_add(reserve_low_mem, max_memory); 997 996 total += max_memory; 998 997 #else 999 998 #ifdef CONFIG_KEXEC 1000 999 if (crashk_size > 0) { 1001 - add_memory_region(crashk_base, crashk_size, BOOT_MEM_RAM); 1000 + memblock_add(crashk_base, crashk_size); 1002 1001 crashk_end = crashk_base + crashk_size; 1003 1002 } 1004 1003 #endif 1005 1004 /* 1006 - * When allocating memory, we want incrementing addresses from 1007 - * bootmem_alloc so the code in add_memory_region can merge 1008 - * regions next to each other. 1005 + * When allocating memory, we want incrementing addresses, 1006 + * which is handled by memblock 1009 1007 */ 1010 1008 cvmx_bootmem_lock(); 1011 1009 while (total < max_memory) { ··· 1039 1039 */ 1040 1040 if (memory < crashk_base && end > crashk_end) { 1041 1041 /* region is fully in */ 1042 - add_memory_region(memory, 1043 - crashk_base - memory, 1044 - BOOT_MEM_RAM); 1042 + memblock_add(memory, crashk_base - memory); 1045 1043 total += crashk_base - memory; 1046 - add_memory_region(crashk_end, 1047 - end - crashk_end, 1048 - BOOT_MEM_RAM); 1044 + memblock_add(crashk_end, end - crashk_end); 1049 1045 total += end - crashk_end; 1050 1046 continue; 1051 1047 } ··· 1069 1073 */ 1070 1074 mem_alloc_size -= end - crashk_base; 1071 1075 #endif 1072 - add_memory_region(memory, mem_alloc_size, BOOT_MEM_RAM); 1076 + memblock_add(memory, mem_alloc_size); 1073 1077 total += mem_alloc_size; 1074 1078 /* Recovering mem_alloc_size */ 1075 1079 mem_alloc_size = 4 << 20; ··· 1084 1088 1085 1089 /* Adjust for physical offset. */ 1086 1090 kernel_start &= ~0xffffffff80000000ULL; 1087 - add_memory_region(kernel_start, kernel_size, BOOT_MEM_RAM); 1091 + memblock_add(kernel_start, kernel_size); 1088 1092 #endif /* CONFIG_CRASH_DUMP */ 1089 1093 1090 1094 #ifdef CONFIG_CAVIUM_RESERVE32
+2 -1
arch/mips/cobalt/setup.c
··· 13 13 #include <linux/interrupt.h> 14 14 #include <linux/io.h> 15 15 #include <linux/ioport.h> 16 + #include <linux/memblock.h> 16 17 #include <linux/pm.h> 17 18 18 19 #include <asm/bootinfo.h> ··· 113 112 strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE); 114 113 } 115 114 116 - add_memory_region(0x0, memsz, BOOT_MEM_RAM); 115 + memblock_add(0, memsz); 117 116 118 117 setup_8250_early_printk_port(CKSEG1ADDR(0x1c800000), 0, 0); 119 118 }
+3 -5
arch/mips/dec/prom/memory.c
··· 12 12 #include <linux/types.h> 13 13 14 14 #include <asm/addrspace.h> 15 - #include <asm/bootinfo.h> 16 15 #include <asm/dec/machtype.h> 17 16 #include <asm/dec/prom.h> 18 17 #include <asm/page.h> ··· 49 50 } 50 51 memcpy((void *)(CKSEG0 + 0x80), &old_handler, 0x80); 51 52 52 - add_memory_region(0, (unsigned long)memory_page - CKSEG1 - CHUNK_SIZE, 53 - BOOT_MEM_RAM); 53 + memblock_add(0, (unsigned long)memory_page - CKSEG1 - CHUNK_SIZE); 54 54 } 55 55 56 56 /* ··· 74 76 else if (!mem_size) 75 77 mem_start += (8 * bm->pagesize); 76 78 else { 77 - add_memory_region(mem_start, mem_size, BOOT_MEM_RAM); 79 + memblock_add(mem_start, mem_size); 78 80 mem_start += mem_size + (8 * bm->pagesize); 79 81 mem_size = 0; 80 82 } 81 83 } 82 84 if (mem_size) 83 - add_memory_region(mem_start, mem_size, BOOT_MEM_RAM); 85 + memblock_add(mem_start, mem_size); 84 86 } 85 87 86 88 void __init prom_meminit(u32 magic)
+20 -8
arch/mips/fw/arc/memory.c
··· 68 68 : arc_mtypes[a.arc] 69 69 #endif 70 70 71 + enum { 72 + mem_free, mem_prom_used, mem_reserved 73 + }; 74 + 71 75 static inline int memtype_classify_arcs(union linux_memtypes type) 72 76 { 73 77 switch (type.arcs) { 74 78 case arcs_fcontig: 75 79 case arcs_free: 76 - return BOOT_MEM_RAM; 80 + return mem_free; 77 81 case arcs_atmp: 78 - return BOOT_MEM_ROM_DATA; 82 + return mem_prom_used; 79 83 case arcs_eblock: 80 84 case arcs_rvpage: 81 85 case arcs_bmem: 82 86 case arcs_prog: 83 87 case arcs_aperm: 84 - return BOOT_MEM_RESERVED; 88 + return mem_reserved; 85 89 default: 86 90 BUG(); 87 91 } ··· 97 93 switch (type.arc) { 98 94 case arc_free: 99 95 case arc_fcontig: 100 - return BOOT_MEM_RAM; 96 + return mem_free; 101 97 case arc_atmp: 102 - return BOOT_MEM_ROM_DATA; 98 + return mem_prom_used; 103 99 case arc_eblock: 104 100 case arc_rvpage: 105 101 case arc_bmem: 106 102 case arc_prog: 107 103 case arc_aperm: 108 - return BOOT_MEM_RESERVED; 104 + return mem_reserved; 109 105 default: 110 106 BUG(); 111 107 } ··· 147 143 size = p->pages << ARC_PAGE_SHIFT; 148 144 type = prom_memtype_classify(p->type); 149 145 150 - add_memory_region(base, size, type); 146 + /* ignore mirrored RAM on IP28/IP30 */ 147 + if (base < PHYS_OFFSET) 148 + continue; 151 149 152 - if (type == BOOT_MEM_ROM_DATA) { 150 + memblock_add(base, size); 151 + 152 + if (type == mem_reserved) 153 + memblock_reserve(base, size); 154 + 155 + if (type == mem_prom_used) { 156 + memblock_reserve(base, size); 153 157 if (nr_prom_mem >= 5) { 154 158 pr_err("Too many ROM DATA regions"); 155 159 continue;
+2 -2
arch/mips/fw/sni/sniprom.c
··· 11 11 12 12 #include <linux/kernel.h> 13 13 #include <linux/init.h> 14 + #include <linux/memblock.h> 14 15 #include <linux/string.h> 15 16 #include <linux/console.h> 16 17 ··· 132 131 } 133 132 pr_debug("Bank%d: %08x @ %08x\n", i, 134 133 memconf[i].size, memconf[i].base); 135 - add_memory_region(memconf[i].base, memconf[i].size, 136 - BOOT_MEM_RAM); 134 + memblock_add(memconf[i].base, memconf[i].size); 137 135 } 138 136 } 139 137
-7
arch/mips/include/asm/bootinfo.h
··· 90 90 91 91 extern unsigned long mips_machtype; 92 92 93 - #define BOOT_MEM_RAM 1 94 - #define BOOT_MEM_ROM_DATA 2 95 - #define BOOT_MEM_RESERVED 3 96 - #define BOOT_MEM_INIT_RAM 4 97 - #define BOOT_MEM_NOMAP 5 98 - 99 - extern void add_memory_region(phys_addr_t start, phys_addr_t size, long type); 100 93 extern void detect_memory_region(phys_addr_t start, phys_addr_t sz_min, phys_addr_t sz_max); 101 94 102 95 extern void prom_init(void);
+1
arch/mips/include/asm/netlogic/psb-bootinfo.h
··· 87 87 uint32_t type; /* type of memory segment */ 88 88 } map[NLM_BOOT_MEM_MAP_MAX]; 89 89 }; 90 + #define NLM_BOOT_MEM_RAM 1 90 91 91 92 /* Pointer to saved boot loader info */ 92 93 extern struct psb_info nlm_prom_info;
-25
arch/mips/kernel/prom.c
··· 36 36 } 37 37 38 38 #ifdef CONFIG_USE_OF 39 - void __init early_init_dt_add_memory_arch(u64 base, u64 size) 40 - { 41 - if (base >= PHYS_ADDR_MAX) { 42 - pr_warn("Trying to add an invalid memory region, skipped\n"); 43 - return; 44 - } 45 - 46 - /* Truncate the passed memory region instead of type casting */ 47 - if (base + size - 1 >= PHYS_ADDR_MAX || base + size < base) { 48 - pr_warn("Truncate memory region %llx @ %llx to size %llx\n", 49 - size, base, PHYS_ADDR_MAX - base); 50 - size = PHYS_ADDR_MAX - base; 51 - } 52 - 53 - add_memory_region(base, size, BOOT_MEM_RAM); 54 - } 55 - 56 - int __init early_init_dt_reserve_memory_arch(phys_addr_t base, 57 - phys_addr_t size, bool nomap) 58 - { 59 - add_memory_region(base, size, 60 - nomap ? BOOT_MEM_NOMAP : BOOT_MEM_RESERVED); 61 - 62 - return 0; 63 - } 64 39 65 40 void __init __dt_setup_arch(void *bph) 66 41 {
+6 -44
arch/mips/kernel/setup.c
··· 91 91 EXPORT_SYMBOL(ARCH_PFN_OFFSET); 92 92 #endif 93 93 94 - void __init add_memory_region(phys_addr_t start, phys_addr_t size, long type) 95 - { 96 - /* 97 - * Note: This function only exists for historical reason, 98 - * new code should use memblock_add or memblock_add_node instead. 99 - */ 100 - 101 - /* 102 - * If the region reaches the top of the physical address space, adjust 103 - * the size slightly so that (start + size) doesn't overflow 104 - */ 105 - if (start + size - 1 == PHYS_ADDR_MAX) 106 - --size; 107 - 108 - /* Sanity check */ 109 - if (start + size < start) { 110 - pr_warn("Trying to add an invalid memory region, skipped\n"); 111 - return; 112 - } 113 - 114 - if (start < PHYS_OFFSET) 115 - return; 116 - 117 - memblock_add(start, size); 118 - /* Reserve any memory except the ordinary RAM ranges. */ 119 - switch (type) { 120 - case BOOT_MEM_RAM: 121 - break; 122 - 123 - case BOOT_MEM_NOMAP: /* Discard the range from the system. */ 124 - memblock_remove(start, size); 125 - break; 126 - 127 - default: /* Reserve the rest of the memory types at boot time */ 128 - memblock_reserve(start, size); 129 - break; 130 - } 131 - } 132 - 133 94 void __init detect_memory_region(phys_addr_t start, phys_addr_t sz_min, phys_addr_t sz_max) 134 95 { 135 96 void *dm = &detect_magic; ··· 107 146 ((unsigned long long) sz_min) / SZ_1M, 108 147 ((unsigned long long) sz_max) / SZ_1M); 109 148 110 - add_memory_region(start, size, BOOT_MEM_RAM); 149 + memblock_add(start, size); 111 150 } 112 151 113 152 /* ··· 361 400 if (*p == '@') 362 401 start = memparse(p + 1, &p); 363 402 364 - add_memory_region(start, size, BOOT_MEM_RAM); 403 + memblock_add(start, size); 365 404 366 405 return 0; 367 406 } ··· 387 426 388 427 if (*p == '@') { 389 428 start_at = memparse(p+1, &p); 390 - add_memory_region(start_at, mem_size, BOOT_MEM_RAM); 429 + memblock_add(start_at, mem_size); 391 430 } else if (*p == '#') { 392 431 pr_err("\"memmap=nn#ss\" (force ACPI data) invalid on MIPS\n"); 393 432 return -EINVAL; 394 433 } else if (*p == '$') { 395 434 start_at = memparse(p+1, &p); 396 - add_memory_region(start_at, mem_size, BOOT_MEM_RESERVED); 435 + memblock_add(start_at, mem_size); 436 + memblock_reserve(start_at, mem_size); 397 437 } else { 398 438 pr_err("\"memmap\" invalid format!\n"); 399 439 return -EINVAL; ··· 606 644 * arch_mem_init - initialize memory management subsystem 607 645 * 608 646 * o plat_mem_setup() detects the memory configuration and will record detected 609 - * memory areas using add_memory_region. 647 + * memory areas using memblock_add. 610 648 * 611 649 * At this stage the memory configuration of the system is known to the 612 650 * kernel but generic memory management system is still entirely uninitialized.
+2 -10
arch/mips/loongson2ef/common/mem.c
··· 17 17 18 18 void __init prom_init_memory(void) 19 19 { 20 - add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM); 21 - 22 - add_memory_region(memsize << 20, LOONGSON_PCI_MEM_START - (memsize << 23 - 20), BOOT_MEM_RESERVED); 20 + memblock_add(0x0, (memsize << 20)); 24 21 25 22 #ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG 26 23 { ··· 38 41 39 42 #ifdef CONFIG_64BIT 40 43 if (highmemsize > 0) 41 - add_memory_region(LOONGSON_HIGHMEM_START, 42 - highmemsize << 20, BOOT_MEM_RAM); 43 - 44 - add_memory_region(LOONGSON_PCI_MEM_END + 1, LOONGSON_HIGHMEM_START - 45 - LOONGSON_PCI_MEM_END - 1, BOOT_MEM_RESERVED); 46 - 44 + memblock_add(LOONGSON_HIGHMEM_START, highmemsize << 20); 47 45 #endif /* !CONFIG_64BIT */ 48 46 } 49 47
+2 -2
arch/mips/loongson32/common/prom.c
··· 7 7 8 8 #include <linux/io.h> 9 9 #include <linux/init.h> 10 + #include <linux/memblock.h> 10 11 #include <linux/serial_reg.h> 11 - #include <asm/bootinfo.h> 12 12 #include <asm/fw/fw.h> 13 13 14 14 #include <loongson1.h> ··· 42 42 43 43 void __init plat_mem_setup(void) 44 44 { 45 - add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM); 45 + memblock_add(0x0, (memsize << 20)); 46 46 }
+1 -1
arch/mips/netlogic/xlp/setup.c
··· 89 89 if (map[i] > 0x10000000 && map[i] < 0x20000000) 90 90 map[i] = 0x20000000; 91 91 92 - add_memory_region(map[i], map[i+1] - map[i], BOOT_MEM_RAM); 92 + memblock_add(map[i], map[i+1] - map[i]); 93 93 } 94 94 } 95 95
+3 -2
arch/mips/netlogic/xlr/setup.c
··· 34 34 35 35 #include <linux/kernel.h> 36 36 #include <linux/serial_8250.h> 37 + #include <linux/memblock.h> 37 38 #include <linux/pm.h> 38 39 39 40 #include <asm/idle.h> ··· 150 149 151 150 bootm = (void *)(long)nlm_prom_info.psb_mem_map; 152 151 for (i = 0; i < bootm->nr_map; i++) { 153 - if (bootm->map[i].type != BOOT_MEM_RAM) 152 + if (bootm->map[i].type != NLM_BOOT_MEM_RAM) 154 153 continue; 155 154 start = bootm->map[i].addr; 156 155 size = bootm->map[i].size; ··· 159 158 if (i == 0 && start == 0 && size == 0x0c000000) 160 159 size = 0x0ff00000; 161 160 162 - add_memory_region(start, size - pref_backup, BOOT_MEM_RAM); 161 + memblock_add(start, size - pref_backup); 163 162 } 164 163 } 165 164
+1 -2
arch/mips/ralink/of.c
··· 84 84 if (memory_dtb) 85 85 of_scan_flat_dt(early_init_dt_scan_memory, NULL); 86 86 else if (soc_info.mem_size) 87 - add_memory_region(soc_info.mem_base, soc_info.mem_size * SZ_1M, 88 - BOOT_MEM_RAM); 87 + memblock_add(soc_info.mem_base, soc_info.mem_size * SZ_1M); 89 88 else 90 89 detect_memory_region(soc_info.mem_base, 91 90 soc_info.mem_size_min * SZ_1M,
+1 -1
arch/mips/rb532/prom.c
··· 126 126 127 127 /* give all RAM to boot allocator, 128 128 * except for the first 0x400 and the last 0x200 bytes */ 129 - add_memory_region(ddrbase + 0x400, memsize - 0x600, BOOT_MEM_RAM); 129 + memblock_add(ddrbase + 0x400, memsize - 0x600); 130 130 }
+2 -1
arch/mips/sgi-ip32/ip32-memory.c
··· 9 9 #include <linux/types.h> 10 10 #include <linux/init.h> 11 11 #include <linux/kernel.h> 12 + #include <linux/memblock.h> 12 13 #include <linux/mm.h> 13 14 14 15 #include <asm/ip32/crime.h> ··· 37 36 38 37 printk("CRIME MC: bank %u base 0x%016Lx size %LuMiB\n", 39 38 bank, base, size >> 20); 40 - add_memory_region(base, size, BOOT_MEM_RAM); 39 + memblock_add(base, size); 41 40 } 42 41 } 43 42
+7 -9
arch/mips/sibyte/common/cfe.c
··· 114 114 if (initrd_start) { 115 115 if ((initrd_pstart > addr) && 116 116 (initrd_pstart < (addr + size))) { 117 - add_memory_region(addr, 118 - initrd_pstart - addr, 119 - BOOT_MEM_RAM); 117 + memblock_add(addr, 118 + initrd_pstart - addr); 120 119 rd_flag = 1; 121 120 } 122 121 if ((initrd_pend > addr) && 123 122 (initrd_pend < (addr + size))) { 124 - add_memory_region(initrd_pend, 125 - (addr + size) - initrd_pend, 126 - BOOT_MEM_RAM); 123 + memblock_add(initrd_pend, 124 + (addr + size) - initrd_pend); 127 125 rd_flag = 1; 128 126 } 129 127 } ··· 140 142 */ 141 143 if (size > 512) 142 144 size -= 512; 143 - add_memory_region(addr, size, BOOT_MEM_RAM); 145 + memblock_add(addr, size); 144 146 } 145 147 board_mem_region_addrs[board_mem_region_count] = addr; 146 148 board_mem_region_sizes[board_mem_region_count] = size; ··· 156 158 } 157 159 #ifdef CONFIG_BLK_DEV_INITRD 158 160 if (initrd_start) { 159 - add_memory_region(initrd_pstart, initrd_pend - initrd_pstart, 160 - BOOT_MEM_RESERVED); 161 + memblock_add(initrd_pstart, initrd_pend - initrd_pstart); 162 + memblock_reserve(initrd_pstart, initrd_pend - initrd_pstart); 161 163 } 162 164 #endif 163 165 }
+2 -2
arch/mips/txx9/jmr3927/prom.c
··· 37 37 */ 38 38 #include <linux/init.h> 39 39 #include <linux/kernel.h> 40 - #include <asm/bootinfo.h> 40 + #include <linux/memblock.h> 41 41 #include <asm/txx9/generic.h> 42 42 #include <asm/txx9/jmr3927.h> 43 43 ··· 47 47 if ((tx3927_ccfgptr->ccfg & TX3927_CCFG_TLBOFF) == 0) 48 48 pr_err("TX3927 TLB off\n"); 49 49 50 - add_memory_region(0, JMR3927_SDRAM_SIZE, BOOT_MEM_RAM); 50 + memblock_add(0, JMR3927_SDRAM_SIZE); 51 51 txx9_sio_putchar_init(TX3927_SIO_REG(1)); 52 52 }
+3 -2
arch/mips/txx9/rbtx4927/prom.c
··· 29 29 * with this program; if not, write to the Free Software Foundation, Inc., 30 30 * 675 Mass Ave, Cambridge, MA 02139, USA. 31 31 */ 32 + 32 33 #include <linux/init.h> 33 - #include <asm/bootinfo.h> 34 + #include <linux/memblock.h> 34 35 #include <asm/txx9/generic.h> 35 36 #include <asm/txx9/rbtx4927.h> 36 37 37 38 void __init rbtx4927_prom_init(void) 38 39 { 39 - add_memory_region(0, tx4927_get_mem_size(), BOOT_MEM_RAM); 40 + memblock_add(0, tx4927_get_mem_size()); 40 41 txx9_sio_putchar_init(TX4927_SIO_REG(0) & 0xfffffffffULL); 41 42 }
+1 -2
arch/mips/txx9/rbtx4938/prom.c
··· 12 12 13 13 #include <linux/init.h> 14 14 #include <linux/memblock.h> 15 - #include <asm/bootinfo.h> 16 15 #include <asm/txx9/generic.h> 17 16 #include <asm/txx9/rbtx4938.h> 18 17 19 18 void __init rbtx4938_prom_init(void) 20 19 { 21 - add_memory_region(0, tx4938_get_mem_size(), BOOT_MEM_RAM); 20 + memblock_add(0, tx4938_get_mem_size()); 22 21 txx9_sio_putchar_init(TX4938_SIO_REG(0) & 0xfffffffffULL); 23 22 }
+2 -2
arch/mips/txx9/rbtx4939/prom.c
··· 7 7 */ 8 8 9 9 #include <linux/init.h> 10 - #include <asm/bootinfo.h> 10 + #include <linux/memblock.h> 11 11 #include <asm/txx9/generic.h> 12 12 #include <asm/txx9/rbtx4939.h> 13 13 ··· 23 23 win = ____raw_readq(&tx4939_ddrcptr->win[i]); 24 24 start = (unsigned long)(win >> 48); 25 25 size = (((unsigned long)(win >> 32) & 0xffff) + 1) - start; 26 - add_memory_region(start << 20, size << 20, BOOT_MEM_RAM); 26 + memblock_add(start << 20, size << 20); 27 27 } 28 28 txx9_sio_putchar_init(TX4939_SIO_REG(0) & 0xfffffffffULL); 29 29 }