From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeroen Hofstee Date: Sat, 17 May 2014 00:26:59 +0200 Subject: [U-Boot] armv8 relocation questions In-Reply-To: <20140516211514.GE7207@bill-the-cat> References: <537290F3.4000905@broadcom.com> <61F81D9C-81BA-4567-9B5F-3F5069473201@phytium.com.cn> <53763B78.6030801@broadcom.com> <20140516202825.240C838554C@gemini.denx.de> <20140516211514.GE7207@bill-the-cat> Message-ID: <1400279219.4133.22.camel@yellow> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Tom, On vr, 2014-05-16 at 17:15 -0400, Tom Rini wrote: > On Fri, May 16, 2014 at 10:28:25PM +0200, Wolfgang Denk wrote: > > Dear Darwin, > > > > In message <53763B78.6030801@broadcom.com> you wrote: > > > > > > 3. Fixed offset case: > > > CONFIG_SYS_TEXT_BASE = 0x88000020 > > > > You completely fail to respond to my repeated statement that a > > CONFIG_SYS_TEXT_BASE like this is bogus. > > This. What the heck is going on? CONFIG_SYS_TEXT_BASE is where the > text section ends up, and the rest of the binary that follows, until we > relocate. If we're being loaded by something else, it needs to be > placing us at the right spot. If there's some header on top of the > image to be considered by the loader, adjust where THAT loads us. If we > cannot, then you must change CONFIG_SYS_TEXT_BASE around. Pad things > up a bit for proper alignment. It seems where somewhere around "Doctor, > it hurts when I hit myself with a hammer!" and can't stop hammering our > poor finger. Not really I guess, I read it as "Doctor, it hurts when I hit myself with a hammer!" But morphine prevents it to hurt, so everybody should use morphine. But a bit more serious, as far as understood it u-boot is loaded to the CONFIG_SYS_TEXT_BASE being set, but not aligned to the requirements of adrp (which assumes 4k). Did someone find a decent description of adrp and how it should be relocated? Is adrp always required or an optimization? And yes, obviously obeying alignment requirements before and after relocating obviously helps, but I am also curious how Darwin gets away with this by adding an offset (in the wrong direction) and if this would always work (given the former is fixed). And yes, I don't know a single thing about arm64 so perhaps above sounds completely stupid... Regards, Jeroen