ARM: OMAP2+: Fix GPMC remap for devices using an offset
[sfrench/cifs-2.6.git] / arch / arm / mach-omap2 / gpmc.c
index 84e57e6fbc26332dcc2bbddefc60146661393ec4..9fe8c949305c3aff97626ca3edd5268696d57a8f 100644 (file)
@@ -527,6 +527,14 @@ static int gpmc_cs_remap(int cs, u32 base)
                pr_err("%s: requested chip-select is disabled\n", __func__);
                return -ENODEV;
        }
+
+       /*
+        * Make sure we ignore any device offsets from the GPMC partition
+        * allocated for the chip select and that the new base confirms
+        * to the GPMC 16MB minimum granularity.
+        */ 
+       base &= ~(SZ_16M - 1);
+
        gpmc_cs_get_memconf(cs, &old_base, &size);
        if (base == old_base)
                return 0;