From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Date: Thu, 19 Mar 2015 19:04:50 +0100 Subject: [U-Boot] 64Bit device tree compilation In-Reply-To: References: <3f62a8de0f4742688d0f151fa43f04af@IL-EXCH02.marvell.com> Message-ID: <20150319180447.GA11052@ulmo.nvidia.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Mar 19, 2015 at 07:43:35AM -0600, Simon Glass wrote: > Hi Hanna, > > On 18 March 2015 at 11:17, Hanna Hawa wrote: > > Hi Simon, > > > > > > > > My name is Hanna, I?m working in Software team in Marvell with Yehuda. > > > > > > > > I?m trying to run U-Boot with FDT in 64Bit. > > > > I?ve issue when I?m trying to load the image on my board, I got abort > > (**Synchronous Abort**) > > > > Exactly when the U-boot run fdt_addr_to_cpu(*cell) under lib/fdtdec.c > > > > > > > > The issue is the format of the FDT is 32Bit, and Big Endian mode. > > > > > > > > After some debug, I changed the typedef of fdt_size, and fdt_addr to be u32. > > > > Also fdt_addr_to_cpu, and fdt_size_to_cpu to use u32 swap, it works. > > > > > > > > My question is: > > > > Is that correct to change the typedef to use u32Bit? > > What do you have CONFIG_PHYS_64BIT set to? That is supposed to > indicate the machine word size. Do you have a 64-bit CPU? > > I recall someone reporting that on 64-bit machines things like '*cell' > can fail because the address is not always 64-bit aligned. But on > 64-bit machines, fdt_addr_t should be 64-bit, so changing it to 32-bit > seems wrong since you may not be able to address everything (e.g. the > reg properties will be limited to the first 4GB). > > I suspect it is wrong to use *cell. Instead we could use > fdtdec_get_number(cell, ) or similar logic. Any existing use of > fdt_addr_t/fdt_size_t to access a cell is wrong, i.e. in > fdtdec_get_addr_size() and fdtdec_decode_region(). You could send a > patch for that. I have a couple of patches for this kind of issue that I encountered during recent bring-up of 64-bit U-Boot on Tegra210. I'm on my way out of the office right now, but I'll send out the patches tomorrow. Thierry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: not available URL: