Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / arch / arm / plat-omap / sram.c
index e757183..b7bf09b 100644 (file)
@@ -11,6 +11,7 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -157,12 +158,14 @@ static struct map_desc omap_sram_io_desc[] __initdata = {
        {       /* .length gets filled in at runtime */
                .virtual        = OMAP1_SRAM_VA,
                .pfn            = __phys_to_pfn(OMAP1_SRAM_PA),
-               .type           = MT_MEMORY
+               .type           = MT_DEVICE
        }
 };
 
 /*
- * Note that we cannot use ioremap for SRAM, as clock init needs SRAM early.
+ * In order to use last 2kB of SRAM on 1611b, we must round the size
+ * up to multiple of PAGE_SIZE. We cannot use ioremap for SRAM, as
+ * clock init needs SRAM early.
  */
 void __init omap_map_sram(void)
 {
@@ -182,7 +185,8 @@ void __init omap_map_sram(void)
                omap_sram_io_desc[0].pfn = __phys_to_pfn(base);
        }
 
-       omap_sram_io_desc[0].length = 1024 * 1024;      /* Use section desc */
+       omap_sram_io_desc[0].length = (omap_sram_size + PAGE_SIZE-1)/PAGE_SIZE;
+       omap_sram_io_desc[0].length *= PAGE_SIZE;
        iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc));
 
        printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n",