video: dcu: make sure memory size aligns to section size
authorStefan Agner <stefan.agner@toradex.com>
Thu, 23 Apr 2015 15:01:50 +0000 (17:01 +0200)
committerStefan Agner <stefan.agner@toradex.com>
Thu, 23 Apr 2015 15:18:46 +0000 (17:18 +0200)
Align the reported memory size to 1MiB, which is the section size
in the Linux memory managment system. This avoids triggering an
issue which leads to freeze the Linux kernel very early:
http://thread.gmane.org/gmane.linux.ports.arm.kernel/408378

drivers/video/fsl_dcu_fb.c

index 37f0f51c5b29b2bf5a278ce125916a9a8228b1ff..4ee823e1d32dbae840f6b26a87313bf4d33e5124 100644 (file)
@@ -445,6 +445,13 @@ int fsl_dcu_fixedfb_setup(void *blob)
 
        start = gd->bd->bi_dram[0].start;
        size = gd->fb_base - gd->bd->bi_dram[0].start;
+
+       /*
+        * Align size on section size (1 MiB). The Linux kernel would crash
+        * otherwise, this seems to be a limitation/bug of the Linux
+        * kernel currently (Linux ~4.0)
+        */
+       size &= 0xfff00000;
        ret = fdt_fixup_memory_banks(blob, &start, &size, 1);
        if (ret) {
                eprintf("Cannot setup fb: Error reserving memory\n");