public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] sunxi: display: Align end of memory to work around a linux-4.0 bug
@ 2015-04-24 18:39 Hans de Goede
  2015-05-02 13:21 ` Ian Campbell
  0 siblings, 1 reply; 7+ messages in thread
From: Hans de Goede @ 2015-04-24 18:39 UTC (permalink / raw)
  To: u-boot

Linux-4.0 as shipped has a bug causing it to not boot if the end of memory
is not aligned to a multiple of 2 MiB. For details see the linux-arm
mailing list post titled:
"Memory size unaligned to section boundary"
http://www.spinics.net/lists/arm-kernel/msg413811.html

This is something which specifically hits the sunxi display driver because
we carve out the exact needed framebuffer size at the top of mem, this
commit works around this issue by aligning the carve out.

Cc: Stefan Agner <stefan@agner.ch>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/video/sunxi_display.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/video/sunxi_display.c b/drivers/video/sunxi_display.c
index 95cfe94..4607269 100644
--- a/drivers/video/sunxi_display.c
+++ b/drivers/video/sunxi_display.c
@@ -1278,6 +1278,19 @@ int sunxi_simplefb_setup(void *blob)
 	 */
 	start = gd->bd->bi_dram[0].start;
 	size = gd->bd->bi_dram[0].size - sunxi_display.fb_size;
+
+	/*
+	 * Linux-4.0 as shipped has a bug causing it not boot if the end
+	 * of memory is not aligned to a multiple of 2 MiB. For details
+	 * see the linux-arm mailing list post titled:
+	 * "Memory size unaligned to section boundary"
+	 * http://www.spinics.net/lists/arm-kernel/msg413811.html
+	 *
+	 * This workaround should be removed once the bug has been fixed
+	 * and we no longer care about the Linux versions with the bug.
+	 */
+	size &= ~(2 * 1024 * 1024 - 1);
+
 	ret = fdt_fixup_memory_banks(blob, &start, &size, 1);
 	if (ret) {
 		eprintf("Cannot setup simplefb: Error reserving memory\n");
-- 
2.3.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-05-12 14:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-24 18:39 [U-Boot] [PATCH] sunxi: display: Align end of memory to work around a linux-4.0 bug Hans de Goede
2015-05-02 13:21 ` Ian Campbell
2015-05-04  8:51   ` Hans de Goede
2015-05-04  9:36     ` Ian Campbell
2015-05-05  9:39       ` Mark Rutland
2015-05-12 13:53         ` Mark Rutland
2015-05-12 14:31           ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox