Commit be370302 authored by Russell King's avatar Russell King

ARM: Remove DISCONTIGMEM support

Everything should now be using sparsemem rather than discontigmem, so
remove the code supporting discontigmem from ARM.
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 79612395
...@@ -719,7 +719,6 @@ config ARCH_SHARK ...@@ -719,7 +719,6 @@ config ARCH_SHARK
config ARCH_LH7A40X config ARCH_LH7A40X
bool "Sharp LH7A40X" bool "Sharp LH7A40X"
select CPU_ARM922T select CPU_ARM922T
select ARCH_DISCONTIGMEM_ENABLE if !LH7A40X_CONTIGMEM
select ARCH_SPARSEMEM_ENABLE if !LH7A40X_CONTIGMEM select ARCH_SPARSEMEM_ENABLE if !LH7A40X_CONTIGMEM
select ARCH_USES_GETTIMEOFFSET select ARCH_USES_GETTIMEOFFSET
help help
...@@ -1241,10 +1240,6 @@ config OABI_COMPAT ...@@ -1241,10 +1240,6 @@ config OABI_COMPAT
config ARCH_HAS_HOLES_MEMORYMODEL config ARCH_HAS_HOLES_MEMORYMODEL
bool bool
# Discontigmem is deprecated
config ARCH_DISCONTIGMEM_ENABLE
bool
config ARCH_SPARSEMEM_ENABLE config ARCH_SPARSEMEM_ENABLE
bool bool
...@@ -1252,13 +1247,7 @@ config ARCH_SPARSEMEM_DEFAULT ...@@ -1252,13 +1247,7 @@ config ARCH_SPARSEMEM_DEFAULT
def_bool ARCH_SPARSEMEM_ENABLE def_bool ARCH_SPARSEMEM_ENABLE
config ARCH_SELECT_MEMORY_MODEL config ARCH_SELECT_MEMORY_MODEL
def_bool ARCH_DISCONTIGMEM_ENABLE && ARCH_SPARSEMEM_ENABLE def_bool ARCH_SPARSEMEM_ENABLE
config NODES_SHIFT
int
default "4" if ARCH_LH7A40X
default "2"
depends on NEED_MULTIPLE_NODES
config HIGHMEM config HIGHMEM
bool "High Memory Support (EXPERIMENTAL)" bool "High Memory Support (EXPERIMENTAL)"
......
...@@ -234,76 +234,11 @@ static inline __deprecated void *bus_to_virt(unsigned long x) ...@@ -234,76 +234,11 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
* virt_to_page(k) convert a _valid_ virtual address to struct page * * virt_to_page(k) convert a _valid_ virtual address to struct page *
* virt_addr_valid(k) indicates whether a virtual address is valid * virt_addr_valid(k) indicates whether a virtual address is valid
*/ */
#ifndef CONFIG_DISCONTIGMEM
#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET #define ARCH_PFN_OFFSET PHYS_PFN_OFFSET
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) #define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)
#define PHYS_TO_NID(addr) (0)
#else /* CONFIG_DISCONTIGMEM */
/*
* This is more complex. We have a set of mem_map arrays spread
* around in memory.
*/
#include <linux/numa.h>
#define arch_pfn_to_nid(pfn) PFN_TO_NID(pfn)
#define arch_local_page_offset(pfn, nid) LOCAL_MAP_NR((pfn) << PAGE_SHIFT)
#define virt_to_page(kaddr) \
(ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr))
#define virt_addr_valid(kaddr) (KVADDR_TO_NID(kaddr) < MAX_NUMNODES)
/*
* Common discontigmem stuff.
* PHYS_TO_NID is used by the ARM kernel/setup.c
*/
#define PHYS_TO_NID(addr) PFN_TO_NID((addr) >> PAGE_SHIFT)
/*
* Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory
* and returns the mem_map of that node.
*/
#define ADDR_TO_MAPBASE(kaddr) NODE_MEM_MAP(KVADDR_TO_NID(kaddr))
/*
* Given a page frame number, find the owning node of the memory
* and returns the mem_map of that node.
*/
#define PFN_TO_MAPBASE(pfn) NODE_MEM_MAP(PFN_TO_NID(pfn))
#ifdef NODE_MEM_SIZE_BITS
#define NODE_MEM_SIZE_MASK ((1 << NODE_MEM_SIZE_BITS) - 1)
/*
* Given a kernel address, find the home node of the underlying memory.
*/
#define KVADDR_TO_NID(addr) \
(((unsigned long)(addr) - PAGE_OFFSET) >> NODE_MEM_SIZE_BITS)
/*
* Given a page frame number, convert it to a node id.
*/
#define PFN_TO_NID(pfn) \
(((pfn) - PHYS_PFN_OFFSET) >> (NODE_MEM_SIZE_BITS - PAGE_SHIFT))
/*
* Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory
* and returns the index corresponding to the appropriate page in the
* node's mem_map.
*/
#define LOCAL_MAP_NR(addr) \
(((unsigned long)(addr) & NODE_MEM_SIZE_MASK) >> PAGE_SHIFT)
#endif /* NODE_MEM_SIZE_BITS */
#endif /* !CONFIG_DISCONTIGMEM */
/* /*
* Optional coherency support. Currently used only by selected * Optional coherency support. Currently used only by selected
* Intel XSC3-based systems. * Intel XSC3-based systems.
......
/*
* arch/arm/include/asm/mmzone.h
*
* 1999-12-29 Nicolas Pitre Created
*
* 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_MMZONE_H
#define __ASM_MMZONE_H
/*
* Currently defined in arch/arm/mm/discontig.c
*/
extern pg_data_t discontig_node_data[];
/*
* Return a pointer to the node data for node n.
*/
#define NODE_DATA(nid) (&discontig_node_data[nid])
/*
* NODE_MEM_MAP gives the kaddr for the mem_map of the node.
*/
#define NODE_MEM_MAP(nid) (NODE_DATA(nid)->node_mem_map)
#include <mach/memory.h>
#endif
...@@ -201,8 +201,7 @@ static struct tagtable __tagtable_##fn __tag = { tag, fn } ...@@ -201,8 +201,7 @@ static struct tagtable __tagtable_##fn __tag = { tag, fn }
struct membank { struct membank {
unsigned long start; unsigned long start;
unsigned long size; unsigned long size;
unsigned short node; unsigned int highmem;
unsigned short highmem;
}; };
struct meminfo { struct meminfo {
...@@ -212,9 +211,8 @@ struct meminfo { ...@@ -212,9 +211,8 @@ struct meminfo {
extern struct meminfo meminfo; extern struct meminfo meminfo;
#define for_each_nodebank(iter,mi,no) \ #define for_each_bank(iter,mi) \
for (iter = 0; iter < (mi)->nr_banks; iter++) \ for (iter = 0; iter < (mi)->nr_banks; iter++)
if ((mi)->bank[iter].node == no)
#define bank_pfn_start(bank) __phys_to_pfn((bank)->start) #define bank_pfn_start(bank) __phys_to_pfn((bank)->start)
#define bank_pfn_end(bank) __phys_to_pfn((bank)->start + (bank)->size) #define bank_pfn_end(bank) __phys_to_pfn((bank)->start + (bank)->size)
......
...@@ -402,13 +402,12 @@ static int __init arm_add_memory(unsigned long start, unsigned long size) ...@@ -402,13 +402,12 @@ static int __init arm_add_memory(unsigned long start, unsigned long size)
size -= start & ~PAGE_MASK; size -= start & ~PAGE_MASK;
bank->start = PAGE_ALIGN(start); bank->start = PAGE_ALIGN(start);
bank->size = size & PAGE_MASK; bank->size = size & PAGE_MASK;
bank->node = PHYS_TO_NID(start);
/* /*
* Check whether this memory region has non-zero size or * Check whether this memory region has non-zero size or
* invalid node number. * invalid node number.
*/ */
if (bank->size == 0 || bank->node >= MAX_NUMNODES) if (bank->size == 0)
return -EINVAL; return -EINVAL;
meminfo.nr_banks++; meminfo.nr_banks++;
......
...@@ -14,14 +14,4 @@ ...@@ -14,14 +14,4 @@
#define PHYS_OFFSET UL(0xf0000000) #define PHYS_OFFSET UL(0xf0000000)
/*
* The nodes are the followings:
*
* node 0: 0xf000.0000 - 0xf3ff.ffff
* node 1: 0xf400.0000 - 0xf7ff.ffff
* node 2: 0xf800.0000 - 0xfbff.ffff
* node 3: 0xfc00.0000 - 0xffff.ffff
*/
#define NODE_MEM_SIZE_BITS 26
#endif /* __ASM_ARCH_MEMORY_H */ #endif /* __ASM_ARCH_MEMORY_H */
...@@ -30,7 +30,6 @@ config ARCH_CLEP7312 ...@@ -30,7 +30,6 @@ config ARCH_CLEP7312
config ARCH_EDB7211 config ARCH_EDB7211
bool "EDB7211" bool "EDB7211"
select ISA select ISA
select ARCH_DISCONTIGMEM_ENABLE
select ARCH_SPARSEMEM_ENABLE select ARCH_SPARSEMEM_ENABLE
select ARCH_SELECT_MEMORY_MODEL select ARCH_SELECT_MEMORY_MODEL
help help
......
...@@ -32,7 +32,6 @@ fixup_clep7312(struct machine_desc *desc, struct tag *tags, ...@@ -32,7 +32,6 @@ fixup_clep7312(struct machine_desc *desc, struct tag *tags,
mi->nr_banks=1; mi->nr_banks=1;
mi->bank[0].start = 0xc0000000; mi->bank[0].start = 0xc0000000;
mi->bank[0].size = 0x01000000; mi->bank[0].size = 0x01000000;
mi->bank[0].node = 0;
} }
......
...@@ -43,10 +43,8 @@ fixup_edb7211(struct machine_desc *desc, struct tag *tags, ...@@ -43,10 +43,8 @@ fixup_edb7211(struct machine_desc *desc, struct tag *tags,
*/ */
mi->bank[0].start = 0xc0000000; mi->bank[0].start = 0xc0000000;
mi->bank[0].size = 8*1024*1024; mi->bank[0].size = 8*1024*1024;
mi->bank[0].node = 0;
mi->bank[1].start = 0xc1000000; mi->bank[1].start = 0xc1000000;
mi->bank[1].size = 8*1024*1024; mi->bank[1].size = 8*1024*1024;
mi->bank[1].node = 1;
mi->nr_banks = 2; mi->nr_banks = 2;
} }
......
...@@ -39,7 +39,6 @@ struct meminfo memmap = { ...@@ -39,7 +39,6 @@ struct meminfo memmap = {
{ {
.start = 0xC0000000, .start = 0xC0000000,
.size = 0x01000000, .size = 0x01000000,
.node = 0
}, },
}, },
}; };
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#ifndef __ASM_ARCH_MEMORY_H #ifndef __ASM_ARCH_MEMORY_H
#define __ASM_ARCH_MEMORY_H #define __ASM_ARCH_MEMORY_H
/* /*
* Physical DRAM offset. * Physical DRAM offset.
*/ */
...@@ -72,7 +71,6 @@ ...@@ -72,7 +71,6 @@
* node 2: 0xd0000000 - 0xd7ffffff * node 2: 0xd0000000 - 0xd7ffffff
* node 3: 0xd8000000 - 0xdfffffff * node 3: 0xd8000000 - 0xdfffffff
*/ */
#define NODE_MEM_SIZE_BITS 24
#define SECTION_SIZE_BITS 24 #define SECTION_SIZE_BITS 24
#define MAX_PHYSMEM_BITS 32 #define MAX_PHYSMEM_BITS 32
......
...@@ -69,6 +69,4 @@ static inline unsigned long __lbus_to_virt(dma_addr_t x) ...@@ -69,6 +69,4 @@ static inline unsigned long __lbus_to_virt(dma_addr_t x)
#endif /* CONFIG_ARCH_IOP13XX */ #endif /* CONFIG_ARCH_IOP13XX */
#endif /* !ASSEMBLY */ #endif /* !ASSEMBLY */
#define PFN_TO_NID(addr) (0)
#endif #endif
...@@ -19,50 +19,6 @@ ...@@ -19,50 +19,6 @@
*/ */
#define PHYS_OFFSET UL(0xc0000000) #define PHYS_OFFSET UL(0xc0000000)
#ifdef CONFIG_DISCONTIGMEM
/*
* Given a kernel address, find the home node of the underlying memory.
*/
# ifdef CONFIG_LH7A40X_ONE_BANK_PER_NODE
# define KVADDR_TO_NID(addr) \
( ((((unsigned long) (addr) - PAGE_OFFSET) >> 24) & 1)\
| ((((unsigned long) (addr) - PAGE_OFFSET) >> 25) & ~1))
# else /* 2 banks per node */
# define KVADDR_TO_NID(addr) \
(((unsigned long) (addr) - PAGE_OFFSET) >> 26)
# endif
/*
* Given a page frame number, convert it to a node id.
*/
# ifdef CONFIG_LH7A40X_ONE_BANK_PER_NODE
# define PFN_TO_NID(pfn) \
(((((pfn) - PHYS_PFN_OFFSET) >> (24 - PAGE_SHIFT)) & 1)\
| ((((pfn) - PHYS_PFN_OFFSET) >> (25 - PAGE_SHIFT)) & ~1))
# else /* 2 banks per node */
# define PFN_TO_NID(pfn) \
(((pfn) - PHYS_PFN_OFFSET) >> (26 - PAGE_SHIFT))
#endif
/*
* Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory
* and returns the index corresponding to the appropriate page in the
* node's mem_map.
*/
# ifdef CONFIG_LH7A40X_ONE_BANK_PER_NODE
# define LOCAL_MAP_NR(addr) \
(((unsigned long)(addr) & 0x003fffff) >> PAGE_SHIFT)
# else /* 2 banks per node */
# define LOCAL_MAP_NR(addr) \
(((unsigned long)(addr) & 0x01ffffff) >> PAGE_SHIFT)
# endif
#endif
/* /*
* Sparsemem version of the above * Sparsemem version of the above
*/ */
......
...@@ -50,7 +50,6 @@ static void __init trout_fixup(struct machine_desc *desc, struct tag *tags, ...@@ -50,7 +50,6 @@ static void __init trout_fixup(struct machine_desc *desc, struct tag *tags,
{ {
mi->nr_banks = 1; mi->nr_banks = 1;
mi->bank[0].start = PHYS_OFFSET; mi->bank[0].start = PHYS_OFFSET;
mi->bank[0].node = PHYS_TO_NID(PHYS_OFFSET);
mi->bank[0].size = (101*1024*1024); mi->bank[0].size = (101*1024*1024);
} }
......
...@@ -715,7 +715,6 @@ static void __init fixup_corgi(struct machine_desc *desc, ...@@ -715,7 +715,6 @@ static void __init fixup_corgi(struct machine_desc *desc,
sharpsl_save_param(); sharpsl_save_param();
mi->nr_banks=1; mi->nr_banks=1;
mi->bank[0].start = 0xa0000000; mi->bank[0].start = 0xa0000000;
mi->bank[0].node = 0;
if (machine_is_corgi()) if (machine_is_corgi())
mi->bank[0].size = (32*1024*1024); mi->bank[0].size = (32*1024*1024);
else else
......
...@@ -34,7 +34,6 @@ void __init eseries_fixup(struct machine_desc *desc, ...@@ -34,7 +34,6 @@ void __init eseries_fixup(struct machine_desc *desc,
{ {
mi->nr_banks=1; mi->nr_banks=1;
mi->bank[0].start = 0xa0000000; mi->bank[0].start = 0xa0000000;
mi->bank[0].node = 0;
if (machine_is_e800()) if (machine_is_e800())
mi->bank[0].size = (128*1024*1024); mi->bank[0].size = (128*1024*1024);
else else
......
...@@ -26,8 +26,7 @@ extern unsigned int get_clk_frequency_khz(int info); ...@@ -26,8 +26,7 @@ extern unsigned int get_clk_frequency_khz(int info);
#define SET_BANK(__nr,__start,__size) \ #define SET_BANK(__nr,__start,__size) \
mi->bank[__nr].start = (__start), \ mi->bank[__nr].start = (__start), \
mi->bank[__nr].size = (__size), \ mi->bank[__nr].size = (__size)
mi->bank[__nr].node = (((unsigned)(__start) - PHYS_OFFSET) >> 27)
#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
......
...@@ -17,18 +17,6 @@ ...@@ -17,18 +17,6 @@
*/ */
#define PHYS_OFFSET UL(0xa0000000) #define PHYS_OFFSET UL(0xa0000000)
/*
* The nodes are matched with the physical SDRAM banks as follows:
*
* node 0: 0xa0000000-0xa3ffffff --> 0xc0000000-0xc3ffffff
* node 1: 0xa4000000-0xa7ffffff --> 0xc4000000-0xc7ffffff
* node 2: 0xa8000000-0xabffffff --> 0xc8000000-0xcbffffff
* node 3: 0xac000000-0xafffffff --> 0xcc000000-0xcfffffff
*
* This needs a node mem size of 26 bits.
*/
#define NODE_MEM_SIZE_BITS 26
#if !defined(__ASSEMBLY__) && defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI) #if !defined(__ASSEMBLY__) && defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)
void cmx2xx_pci_adjust_zones(int node, unsigned long *size, void cmx2xx_pci_adjust_zones(int node, unsigned long *size,
unsigned long *holes); unsigned long *holes);
......
...@@ -463,7 +463,6 @@ static void __init fixup_poodle(struct machine_desc *desc, ...@@ -463,7 +463,6 @@ static void __init fixup_poodle(struct machine_desc *desc,
sharpsl_save_param(); sharpsl_save_param();
mi->nr_banks=1; mi->nr_banks=1;
mi->bank[0].start = 0xa0000000; mi->bank[0].start = 0xa0000000;
mi->bank[0].node = 0;
mi->bank[0].size = (32*1024*1024); mi->bank[0].size = (32*1024*1024);
} }
......
...@@ -847,7 +847,6 @@ static void __init fixup_spitz(struct machine_desc *desc, ...@@ -847,7 +847,6 @@ static void __init fixup_spitz(struct machine_desc *desc,
sharpsl_save_param(); sharpsl_save_param();
mi->nr_banks = 1; mi->nr_banks = 1;
mi->bank[0].start = 0xa0000000; mi->bank[0].start = 0xa0000000;
mi->bank[0].node = 0;
mi->bank[0].size = (64*1024*1024); mi->bank[0].size = (64*1024*1024);
} }
......
...@@ -948,7 +948,6 @@ static void __init fixup_tosa(struct machine_desc *desc, ...@@ -948,7 +948,6 @@ static void __init fixup_tosa(struct machine_desc *desc,
sharpsl_save_param(); sharpsl_save_param();
mi->nr_banks=1; mi->nr_banks=1;
mi->bank[0].start = 0xa0000000; mi->bank[0].start = 0xa0000000;
mi->bank[0].node = 0;
mi->bank[0].size = (64*1024*1024); mi->bank[0].size = (64*1024*1024);
} }
......
...@@ -119,7 +119,6 @@ static void __init smdk2413_fixup(struct machine_desc *desc, ...@@ -119,7 +119,6 @@ static void __init smdk2413_fixup(struct machine_desc *desc,
mi->nr_banks=1; mi->nr_banks=1;
mi->bank[0].start = 0x30000000; mi->bank[0].start = 0x30000000;
mi->bank[0].size = SZ_64M; mi->bank[0].size = SZ_64M;
mi->bank[0].node = 0;
} }
} }
......
...@@ -137,7 +137,6 @@ static void __init vstms_fixup(struct machine_desc *desc, ...@@ -137,7 +137,6 @@ static void __init vstms_fixup(struct machine_desc *desc,
mi->nr_banks=1; mi->nr_banks=1;
mi->bank[0].start = 0x30000000; mi->bank[0].start = 0x30000000;
mi->bank[0].size = SZ_64M; mi->bank[0].size = SZ_64M;
mi->bank[0].node = 0;
} }
} }
......
...@@ -13,8 +13,7 @@ extern void __init sa1100_init_gpio(void); ...@@ -13,8 +13,7 @@ extern void __init sa1100_init_gpio(void);
#define SET_BANK(__nr,__start,__size) \ #define SET_BANK(__nr,__start,__size) \
mi->bank[__nr].start = (__start), \ mi->bank[__nr].start = (__start), \
mi->bank[__nr].size = (__size), \ mi->bank[__nr].size = (__size)
mi->bank[__nr].node = (((unsigned)(__start) - PHYS_OFFSET) >> 27)
extern void (*sa1100fb_backlight_power)(int on); extern void (*sa1100fb_backlight_power)(int on);
extern void (*sa1100fb_lcd_power)(int on); extern void (*sa1100fb_lcd_power)(int on);
......
...@@ -15,7 +15,6 @@ endif ...@@ -15,7 +15,6 @@ endif
obj-$(CONFIG_MODULES) += proc-syms.o obj-$(CONFIG_MODULES) += proc-syms.o
obj-$(CONFIG_ALIGNMENT_TRAP) += alignment.o obj-$(CONFIG_ALIGNMENT_TRAP) += alignment.o
obj-$(CONFIG_DISCONTIGMEM) += discontig.o
obj-$(CONFIG_HIGHMEM) += highmem.o obj-$(CONFIG_HIGHMEM) += highmem.o
obj-$(CONFIG_CPU_ABRT_NOMMU) += abort-nommu.o obj-$(CONFIG_CPU_ABRT_NOMMU) += abort-nommu.o
......
/*
* linux/arch/arm/mm/discontig.c
*
* Discontiguous memory support.
*
* Initial code: Copyright (C) 1999-2000 Nicolas Pitre
*
* 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 <linux/module.h>
#include <linux/mmzone.h>
#include <linux/bootmem.h>
#if MAX_NUMNODES != 4 && MAX_NUMNODES != 16
# error Fix Me Please
#endif
/*
* Our node_data structure for discontiguous memory.
*/
pg_data_t discontig_node_data[MAX_NUMNODES] = {
{ .bdata = &bootmem_node_data[0] },
{ .bdata = &bootmem_node_data[1] },
{ .bdata = &bootmem_node_data[2] },
{ .bdata = &bootmem_node_data[3] },
#if MAX_NUMNODES == 16
{ .bdata = &bootmem_node_data[4] },
{ .bdata = &bootmem_node_data[5] },
{ .bdata = &bootmem_node_data[6] },
{ .bdata = &bootmem_node_data[7] },
{ .bdata = &bootmem_node_data[8] },
{ .bdata = &bootmem_node_data[9] },
{ .bdata = &bootmem_node_data[10] },
{ .bdata = &bootmem_node_data[11] },
{ .bdata = &bootmem_node_data[12] },
{ .bdata = &bootmem_node_data[13] },
{ .bdata = &bootmem_node_data[14] },
{ .bdata = &bootmem_node_data[15] },
#endif
};
EXPORT_SYMBOL(discontig_node_data);
This diff is collapsed.
...@@ -28,7 +28,5 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page ...@@ -28,7 +28,5 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page
#endif #endif
struct pglist_data;
void __init bootmem_init(void); void __init bootmem_init(void);
void reserve_node_zero(struct pglist_data *pgdat); void reserve_special_regions(void);
...@@ -827,9 +827,9 @@ static inline void prepare_page_table(void) ...@@ -827,9 +827,9 @@ static inline void prepare_page_table(void)
} }
/* /*
* Reserve the various regions of node 0 * Reserve the various regions
*/ */
void __init reserve_node_zero(pg_data_t *pgdat) void __init reserve_special_regions(void)
{ {
unsigned long res_size = 0; unsigned long res_size = 0;
...@@ -838,19 +838,17 @@ void __init reserve_node_zero(pg_data_t *pgdat) ...@@ -838,19 +838,17 @@ void __init reserve_node_zero(pg_data_t *pgdat)
* Note that this can only be in node 0. * Note that this can only be in node 0.
*/ */
#ifdef CONFIG_XIP_KERNEL #ifdef CONFIG_XIP_KERNEL
reserve_bootmem_node(pgdat, __pa(_data), _end - _data, reserve_bootmem(__pa(_data), _end - _data, BOOTMEM_DEFAULT);
BOOTMEM_DEFAULT);
#else #else
reserve_bootmem_node(pgdat, __pa(_stext), _end - _stext, reserve_bootmem(__pa(_stext), _end - _stext, BOOTMEM_DEFAULT);
BOOTMEM_DEFAULT);
#endif #endif
/* /*
* Reserve the page tables. These are already in use, * Reserve the page tables. These are already in use,
* and can only be in node 0. * and can only be in node 0.
*/ */
reserve_bootmem_node(pgdat, __pa(swapper_pg_dir), reserve_bootmem(__pa(swapper_pg_dir),
PTRS_PER_PGD * sizeof(pgd_t), BOOTMEM_DEFAULT); PTRS_PER_PGD * sizeof(pgd_t), BOOTMEM_DEFAULT);
/* /*
* Hmm... This should go elsewhere, but we really really need to * Hmm... This should go elsewhere, but we really really need to
...@@ -874,29 +872,22 @@ void __init reserve_node_zero(pg_data_t *pgdat) ...@@ -874,29 +872,22 @@ void __init reserve_node_zero(pg_data_t *pgdat)
if (machine_is_h1940() || machine_is_rx3715() if (machine_is_h1940() || machine_is_rx3715()
|| machine_is_rx1950()) { || machine_is_rx1950()) {
reserve_bootmem_node(pgdat, 0x30003000, 0x1000, reserve_bootmem(0x30003000, 0x1000, BOOTMEM_DEFAULT);
BOOTMEM_DEFAULT); reserve_bootmem(0x30081000, 0x1000, BOOTMEM_DEFAULT);
reserve_bootmem_node(pgdat, 0x30081000, 0x1000,
BOOTMEM_DEFAULT);
} }
if (machine_is_palmld() || machine_is_palmtx()) { if (machine_is_palmld() || machine_is_palmtx()) {
reserve_bootmem_node(pgdat, 0xa0000000, 0x1000, reserve_bootmem(0xa0000000, 0x1000, BOOTMEM_EXCLUSIVE);
BOOTMEM_EXCLUSIVE); reserve_bootmem(0xa0200000, 0x1000, BOOTMEM_EXCLUSIVE);
reserve_bootmem_node(pgdat, 0xa0200000, 0x1000,
BOOTMEM_EXCLUSIVE);
} }
if (machine_is_treo680() || machine_is_centro()) { if (machine_is_treo680() || machine_is_centro()) {
reserve_bootmem_node(pgdat, 0xa0000000, 0x1000, reserve_bootmem(0xa0000000, 0x1000, BOOTMEM_EXCLUSIVE);
BOOTMEM_EXCLUSIVE); reserve_bootmem(0xa2000000, 0x1000, BOOTMEM_EXCLUSIVE);
reserve_bootmem_node(pgdat, 0xa2000000, 0x1000,
BOOTMEM_EXCLUSIVE);
} }
if (machine_is_palmt5()) if (machine_is_palmt5())
reserve_bootmem_node(pgdat, 0xa0200000, 0x1000, reserve_bootmem(0xa0200000, 0x1000, BOOTMEM_EXCLUSIVE);
BOOTMEM_EXCLUSIVE);
/* /*
* U300 - This platform family can share physical memory * U300 - This platform family can share physical memory
...@@ -920,8 +911,7 @@ void __init reserve_node_zero(pg_data_t *pgdat) ...@@ -920,8 +911,7 @@ void __init reserve_node_zero(pg_data_t *pgdat)
res_size = __pa(swapper_pg_dir) - PHYS_OFFSET; res_size = __pa(swapper_pg_dir) - PHYS_OFFSET;
#endif #endif
if (res_size) if (res_size)
reserve_bootmem_node(pgdat, PHYS_OFFSET, res_size, reserve_bootmem(PHYS_OFFSET, res_size, BOOTMEM_DEFAULT);
BOOTMEM_DEFAULT);
} }
/* /*
......
...@@ -18,20 +18,18 @@ ...@@ -18,20 +18,18 @@
#include "mm.h" #include "mm.h"
/* /*
* Reserve the various regions of node 0 * Reserve the various regions
*/ */
void __init reserve_node_zero(pg_data_t *pgdat) void __init reserve_special_regions(void)
{ {
/* /*
* Register the kernel text and data with bootmem. * Register the kernel text and data with bootmem.
* Note that this can only be in node 0. * Note that this can only be in node 0.
*/ */
#ifdef CONFIG_XIP_KERNEL #ifdef CONFIG_XIP_KERNEL
reserve_bootmem_node(pgdat, __pa(_data), _end - _data, reserve_bootmem(__pa(_data), _end - _data, BOOTMEM_DEFAULT);
BOOTMEM_DEFAULT);
#else #else
reserve_bootmem_node(pgdat, __pa(_stext), _end - _stext, reserve_bootmem(__pa(_stext), _end - _stext, BOOTMEM_DEFAULT);
BOOTMEM_DEFAULT);
#endif #endif
/* /*
...@@ -39,8 +37,7 @@ void __init reserve_node_zero(pg_data_t *pgdat) ...@@ -39,8 +37,7 @@ void __init reserve_node_zero(pg_data_t *pgdat)
* some architectures which the DRAM is the exception vector to trap, * some architectures which the DRAM is the exception vector to trap,
* alloc_page breaks with error, although it is not NULL, but "0." * alloc_page breaks with error, although it is not NULL, but "0."
*/ */
reserve_bootmem_node(pgdat, CONFIG_VECTORS_BASE, PAGE_SIZE, reserve_bootmem(CONFIG_VECTORS_BASE, PAGE_SIZE, BOOTMEM_DEFAULT);
BOOTMEM_DEFAULT);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment