rpi: limit size of the RAM to the multiple of the MMU_SECTION_SIZE
[platform/kernel/u-boot.git] / board / raspberrypi / rpi / rpi.c
index 1f77c82..497f2f7 100644 (file)
@@ -297,6 +297,13 @@ int dram_init(void)
 
        gd->ram_size = msg->get_arm_mem.body.resp.mem_size;
 
+       /*
+        * In some configurations the memory size returned by VideoCore
+        * is not aligned to the section size, what is mandatory for
+        * the u-boot's memory setup.
+        */
+       gd->ram_size &= ~MMU_SECTION_SIZE;
+
        return 0;
 }