From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Date: Fri, 16 Mar 2007 10:02:13 +0100 Subject: [U-Boot-Users] [PATCH] Fix the condition to detect if an image is already in its place In-Reply-To: <20070315231448.A21DE353A6C@atlas.denx.de> References: <20070315223514.GA51@informatik.uni-freiburg.de> <20070315231448.A21DE353A6C@atlas.denx.de> Message-ID: <20070316090213.GA4940@informatik.uni-freiburg.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Wolfgang, Wolfgang Denk wrote: > In message <20070315223514.GA51@informatik.uni-freiburg.de> you wrote: > > > > Do you admit that the first branch of the if I changed asserts the > > header to start at ih_load and the other asserts the data to start at > > ih_load? So if you have an XIP image in RAM starting at a wrong > > address, booting will fail. > > XIP = eXecute In Place, i. e. the image is run directly from flash / > ROM, without loading it to RAM at all. That's clear, yes. I recognize that my example is notional. But the other way round makes more sense. If you have a non-XIP image then it is not moved if it was loaded to ih_load or (ih_load - 0x40). This implies that do_bootm_linux is called either with the data starting at addr or addr + sizeof(image_header_t). Then the ugly fix is to check if (image_header_t)addr->ih_magic == IH_MAGIC and if so move the image there. In my eyes this is unneeded code duplication. Would you think the fix being correct if that xip patch were not relying on that behaviour? If so, not taking the patch because of this IMHO is a poor policy. > > BTW: I couldn't find this config item "Make a XIP (eXecute in Place) > > kernel", neither in Linus nor in your tree: > > If you had read the page I referred you to, you should have seen the > link at the end, which indicates pretty clearly which tree was used. caught guilty, sorry. Best regards Uwe -- Uwe Kleine-K?nig http://www.google.com/search?q=Planck%27s+constant%3D