From: Haavard Skinnemoen Dave Hansen called discontigmem as "legacy", so since there are no AVR32 boards that actually need it, we might as well kill it completely. Which is what this patch does. Whenever someone stumbles across a board with multiple memory banks, I'll implement sparsemem support instead, hopefully with help from Dave and Andy. Signed-off-by: Haavard Skinnemoen Cc: Dave Hansen Cc: Andy Whitcroft Signed-off-by: Andrew Morton --- arch/avr32/mm/Makefile | 1 - arch/avr32/mm/discontig.c | 27 --------------------------- arch/avr32/mm/init.c | 28 +++++----------------------- include/asm-avr32/mmzone.h | 29 ----------------------------- 4 files changed, 5 insertions(+), 80 deletions(-) diff -puN arch/avr32/mm/discontig.c~avr32-kill-config_discontigmem-support-completely /dev/null --- a/arch/avr32/mm/discontig.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2004-2006 Atmel Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include - -#if MAX_NUMNODES != 4 -#error Fix Me Please -#endif - -static bootmem_data_t node_bootmem_data[MAX_NUMNODES]; -pg_data_t discontig_node_data[MAX_NUMNODES] = { - { .bdata = &node_bootmem_data[0] }, - { .bdata = &node_bootmem_data[1] }, - { .bdata = &node_bootmem_data[2] }, - { .bdata = &node_bootmem_data[3] } -}; - -EXPORT_SYMBOL(discontig_node_data); - diff -puN arch/avr32/mm/init.c~avr32-kill-config_discontigmem-support-completely arch/avr32/mm/init.c --- a/arch/avr32/mm/init.c~avr32-kill-config_discontigmem-support-completely +++ a/arch/avr32/mm/init.c @@ -36,10 +36,8 @@ struct page *empty_zero_page; */ unsigned long mmu_context_cache = NO_CONTEXT; -#if !defined(CONFIG_DISCONTIGMEM) -# define START_PFN (NODE_DATA(0)->bdata->node_boot_start >> PAGE_SHIFT) -# define MAX_LOW_PFN (NODE_DATA(0)->bdata->node_low_pfn) -#endif +#define START_PFN (NODE_DATA(0)->bdata->node_boot_start >> PAGE_SHIFT) +#define MAX_LOW_PFN (NODE_DATA(0)->bdata->node_low_pfn) void show_mem(void) { @@ -223,27 +221,15 @@ void __init setup_bootmem(void) #endif } -#ifndef CONFIG_DISCONTIGMEM if (mem_phys->next) - printk(KERN_WARNING "Only using first memory bank " - "since CONFIG_DISCONTIGMEM is off\n"); + printk(KERN_WARNING "Only using first memory bank\n"); + for (bank = mem_phys; bank; bank = NULL) { -#else - for (bank = mem_phys; bank; bank = bank->next, node++) { -#endif first_pfn = PFN_UP(bank->addr); max_low_pfn = max_pfn = PFN_DOWN(bank->addr + bank->size); bootmap_pfn = find_bootmap_pfn(bank); - if (bootmap_pfn > max_pfn) { -#ifndef CONFIG_DISCONTIGMEM + if (bootmap_pfn > max_pfn) panic("No space for bootmem bitmap!\n"); -#else - printk(KERN_WARNING - "Node %u: No space for bootmem bitmap\n", - node); - continue; -#endif - } if (max_low_pfn > MAX_LOWMEM_PFN) { max_low_pfn = MAX_LOWMEM_PFN; @@ -397,9 +383,7 @@ void __init paging_init(void) pgdat->node_id, pgdat->node_mem_map); } -#ifndef CONFIG_DISCONTIGMEM mem_map = NODE_DATA(0)->node_mem_map; -#endif memset(zero_page, 0, PAGE_SIZE); empty_zero_page = virt_to_page(zero_page); @@ -438,9 +422,7 @@ void __init mem_init(void) high_memory = node_high_memory; } -#ifndef CONFIG_DISCONTIGMEM max_mapnr = MAP_NR(high_memory); -#endif codesize = (unsigned long)_etext - (unsigned long)_text; datasize = (unsigned long)_edata - (unsigned long)_data; diff -puN arch/avr32/mm/Makefile~avr32-kill-config_discontigmem-support-completely arch/avr32/mm/Makefile --- a/arch/avr32/mm/Makefile~avr32-kill-config_discontigmem-support-completely +++ a/arch/avr32/mm/Makefile @@ -4,4 +4,3 @@ obj-y += init.o clear_page.o copy_page.o dma-coherent.o obj-y += ioremap.o cache.o fault.o tlb.o -obj-$(CONFIG_DISCONTIGMEM) += discontig.o diff -puN include/asm-avr32/mmzone.h~avr32-kill-config_discontigmem-support-completely /dev/null --- a/include/asm-avr32/mmzone.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2004-2006 Atmel Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#ifndef __ASM_AVR32_MMZONE_H -#define __ASM_AVR32_MMZONE_H - -#include - -#ifdef CONFIG_DISCONTIGMEM - -static inline int pfn_valid(unsigned long pfn) -{ - unsigned long __pfn = (pfn); - int __n = pfn_to_nid(__pfn); - - if (__n < 0) - return 0; - - return __pfn < (NODE_DATA(__n)->node_start_pfn - + NODE_DATA(__n)->node_spanned_pages); -} - -#endif /* CONFIG_DISCONTIGMEM */ - -#endif /* __ASM_AVR32_MMZONE_H */ _