Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be370302 authored by Russell King's avatar Russell King
Browse files

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
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -719,7 +719,6 @@ config ARCH_SHARK
config ARCH_LH7A40X
	bool "Sharp LH7A40X"
	select CPU_ARM922T
	select ARCH_DISCONTIGMEM_ENABLE if !LH7A40X_CONTIGMEM
	select ARCH_SPARSEMEM_ENABLE if !LH7A40X_CONTIGMEM
	select ARCH_USES_GETTIMEOFFSET
	help
@@ -1241,10 +1240,6 @@ config OABI_COMPAT
config ARCH_HAS_HOLES_MEMORYMODEL
	bool

# Discontigmem is deprecated
config ARCH_DISCONTIGMEM_ENABLE
	bool

config ARCH_SPARSEMEM_ENABLE
	bool

@@ -1252,13 +1247,7 @@ config ARCH_SPARSEMEM_DEFAULT
	def_bool ARCH_SPARSEMEM_ENABLE

config ARCH_SELECT_MEMORY_MODEL
	def_bool ARCH_DISCONTIGMEM_ENABLE && ARCH_SPARSEMEM_ENABLE

config NODES_SHIFT
	int
	default "4" if ARCH_LH7A40X
	default "2"
	depends on NEED_MULTIPLE_NODES
	def_bool ARCH_SPARSEMEM_ENABLE

config HIGHMEM
	bool "High Memory Support (EXPERIMENTAL)"
+0 −65
Original line number Diff line number Diff line
@@ -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_addr_valid(k)	indicates whether a virtual address is valid
 */
#ifndef CONFIG_DISCONTIGMEM

#define ARCH_PFN_OFFSET		PHYS_PFN_OFFSET

#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 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
 * Intel XSC3-based systems.

arch/arm/include/asm/mmzone.h

deleted100644 → 0
+0 −30
Original line number Diff line number Diff line
/*
 *  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
+3 −5
Original line number Diff line number Diff line
@@ -201,8 +201,7 @@ static struct tagtable __tagtable_##fn __tag = { tag, fn }
struct membank {
	unsigned long start;
	unsigned long size;
	unsigned short node;
	unsigned short highmem;
	unsigned int highmem;
};

struct meminfo {
@@ -212,9 +211,8 @@ struct meminfo {

extern struct meminfo meminfo;

#define for_each_nodebank(iter,mi,no)			\
	for (iter = 0; iter < (mi)->nr_banks; iter++)	\
		if ((mi)->bank[iter].node == no)
#define for_each_bank(iter,mi)				\
	for (iter = 0; iter < (mi)->nr_banks; iter++)

#define bank_pfn_start(bank)	__phys_to_pfn((bank)->start)
#define bank_pfn_end(bank)	__phys_to_pfn((bank)->start + (bank)->size)
+1 −2
Original line number Diff line number Diff line
@@ -402,13 +402,12 @@ static int __init arm_add_memory(unsigned long start, unsigned long size)
	size -= start & ~PAGE_MASK;
	bank->start = PAGE_ALIGN(start);
	bank->size  = size & PAGE_MASK;
	bank->node  = PHYS_TO_NID(start);

	/*
	 * Check whether this memory region has non-zero size or
	 * invalid node number.
	 */
	if (bank->size == 0 || bank->node >= MAX_NUMNODES)
	if (bank->size == 0)
		return -EINVAL;

	meminfo.nr_banks++;
Loading