xtensa: cope with ram beginning at higher addresses
authorJohannes Weiner <jw@emlix.com>
Wed, 4 Mar 2009 15:21:30 +0000 (16:21 +0100)
committerChris Zankel <chris@zankel.net>
Fri, 3 Apr 2009 06:41:08 +0000 (23:41 -0700)
commitc947a585ab13f310c9223284dfd502790abd05f9
tree1295ce0f825139326eb3d894eaddcf8027953e96
parent264da9f708b130122d881fa4570d1cd618440a73
xtensa: cope with ram beginning at higher addresses

The current assumption of the memory code is that the first RAM PFN in
the system is 0.

Adjust the relevant code to play well with setups where memory starts
at higher addresses, indicated by PLATFORM_DEFAULT_MEM_START.

The new memory model looks like this:

+----------+--+----------------------+----------------+
|          |  |                      |                |
|          |  |         RAM          |                |
|          |  |                      |                |
+----------+--+----------------------+----------------+
|          |  |                      |                |
+- PFN 0   |  +- min_low_pfn         +- max_low_pfn   +- max_pfn
           |
           +- ARCH_PFN_OFFSET
           +- PLATFORM_DEFAULT_MEM_START >> PAGE_SIZE

The memory map contains pages starting from pfn ARCH_PFN_OFFSET up to
max_low_pfn.  The only zone used right now will span exactly the same
region.

Usually, ARCH_PFN_OFFSET and min_low_pfn are the same value.  Handle
them separately for robustness.  Gapping pages will be in the memory
map but marked as reserved and won't be touched.

Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
arch/xtensa/include/asm/page.h
arch/xtensa/mm/init.c