From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrianov, Vitaly Date: Fri, 7 Mar 2014 16:41:43 +0000 Subject: [U-Boot] [U-Boot PATCH v2 08/12] k2hk: add support for k2hk SOC and EVM In-Reply-To: <5318CCA4.9040800@ti.com> References: <1392918914-15564-1-git-send-email-m-karicheri2@ti.com> <1392918914-15564-9-git-send-email-m-karicheri2@ti.com> <20140225221143.GK16805@bill-the-cat> <5318CCA4.9040800@ti.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Tom, [snip] > >> > >>> + "fdt_high=0xffffffff\0" \ > >> > >> Please don't do this, set it to the top of kernel low mem. > >> > > > > The EVM may have up to 8GB of DDR and u-boot can see the first 2GB > > with physical address range 0x80000000-0xffffffff. > > If we don't use the "fdt_high" environment variable, u-boot relocates > > the dtb to the end of that memory, which is outside of the lowmem. > [snip] > > But K2 lowmem VA starts from 0xc0000000 and has size ~760MB. That > > corresponds to the physical range 0x80000000-0xaf800000. > > That is why we have to use the "fdt_high=0xffffffff" environment > variable. > > > > Have I missed something I u-boot memory configuration? > > Is there a way to tell u-boot to relocate fdt to the end lowmem? > > Yes, set fdt_high to 0xaf800000 instead :) > I think there is a bug in the lmb_alloc_base() and this approach doesn't work. else if (lmbbase < max_addr) { base = min(lmbbase + lmbsize, max_addr); base = lmb_align_down(base - size, align); } else For boards that have DDR@the end of 32 bit address space the (lmbbase + lmbsize) = 0 which is < max_addr. So, base becomes 0, and moved to the "end of DDR" - size on the next line. I tried a quick fix in the __lmb_alloc_base() and got the fdt relocated correctly. As I'm not sure that is only one buggy place in the lmb.c I don't want to commit the quick fix. Let's leave the "fdt_high=0xffffffff" in the Keystone2 for awhile and change it later when we fix the bug. Thanks, Vitaly