msm: 8960: Add correct PASR mask support

The current system does not use the correct PASR masks for turning
off sections of memory. It will also crash if the SPARSEMEM section_size
is changed to smaller values.

This fix calculates the correct masks and removes the dependency on
the SPARSEMEM section_size. It will accurately calculate the mask
regardless of memory size and configuration.

MAX_NR_REGIONS has been increased to 32 to account for the largest
system containing four memory banks, each divided into 8 sections.

Change-Id: Idaf05a06c1430e6d353fddafa305b57e400dfb8c
CRs-fixed: 329575
Signed-off-by: Jack Cheung <jackc@codeaurora.org>
diff --git a/arch/arm/mach-msm/include/mach/memory.h b/arch/arm/mach-msm/include/mach/memory.h
index 9cd73db..e1fc054 100644
--- a/arch/arm/mach-msm/include/mach/memory.h
+++ b/arch/arm/mach-msm/include/mach/memory.h
@@ -1,7 +1,7 @@
 /* arch/arm/mach-msm/include/mach/memory.h
  *
  * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2009-2012, Code Aurora Forum. All rights reserved.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
@@ -23,8 +23,13 @@
 #define MAX_PHYSMEM_BITS 32
 #define SECTION_SIZE_BITS 28
 
-/* Maximum number of Memory Regions */
-#define MAX_NR_REGIONS 4
+/* Maximum number of Memory Regions
+*  The largest system can have 4 memory banks, each divided into 8 regions
+*/
+#define MAX_NR_REGIONS 32
+
+/* The number of regions each memory bank is divided into */
+#define NR_REGIONS_PER_BANK 8
 
 /* Certain configurations of MSM7x30 have multiple memory banks.
 *  One or more of these banks can contain holes in the memory map as well.