From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Date: Tue, 03 Feb 2015 18:59:47 +0100 Subject: [U-Boot] [PATCH 1/2] sunxi: video: Do not use CONFIG_SYS_MEM_TOP_HIDE for the framebuffer In-Reply-To: <1422969603.9323.72.camel@hellion.org.uk> References: <1422903473-3822-1-git-send-email-hdegoede@redhat.com> <1422969603.9323.72.camel@hellion.org.uk> Message-ID: <54D10C93.4060002@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On 02/03/2015 02:20 PM, Ian Campbell wrote: > On Mon, 2015-02-02 at 19:57 +0100, Hans de Goede wrote: >> @@ -1237,6 +1243,20 @@ int sunxi_simplefb_setup(void *blob) >> return 0; /* Keep older kernels working */ >> } >> >> + /* >> + * Do not report the framebuffer as free RAM to Linux, note we cannot >> + * use fdt_add_mem_rsv() here, because then it is still seen as RAM, >> + * and Linux refuses to iomap RAM on ARM, see: >> + * linux/arch/arm/mm/ioremap.c around line 301. > > A little bit Linux centric ;-) > > I'd suggest s/Linux/OS for the first one and s/and Linux refuses/for > example Linux refuses/. OK, will fix. >> + */ >> + start = gd->bd->bi_dram[0].start; >> + size = gd->bd->bi_dram[0].size - CONFIG_SUNXI_MAX_FB_SIZE; >> + ret = fdt_fixup_memory_banks(blob, &start, &size, 1); > > I suppose this is currently safe when put up against arch_fixup_fdt(), > but it might be a bit fragile against future changes? We get called after arch_fixup_fdt(), so we should be able to simply override what it has setup in the fdt. > I'm not sure what else we can do though, directly adjusting > gd->bd->bi_dram[0].size seems iffy. > > Perhaps a hook called from arch_fixup_fdt which is passed the arrays > which are about to be passed to fdt_fixup_memory_banks so it can adjust > them? Then we need to keep track of if that callback succeeded, because without the reservation we should not enable simplefb. I would prefer to just keep this bit as is. Regards, Hans