From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Fri, 24 Aug 2012 08:55:38 -0700 Subject: [U-Boot] [PATCH 3/6] SPL: Port SPL framework to powerpc In-Reply-To: <503726D0.7000407@denx.de> References: <1345709565-28862-1-git-send-email-sr@denx.de> <1345709565-28862-4-git-send-email-sr@denx.de> <5036A317.7020908@ti.com> <503726D0.7000407@denx.de> Message-ID: <5037A3FA.5070505@ti.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 08/24/2012 12:01 AM, Stefan Roese wrote: > Hi Tom, > > On 08/23/2012 11:39 PM, Tom Rini wrote: >> On 08/23/2012 01:12 AM, Stefan Roese wrote: >> >>> This patch enables the SPL framework to be used on powerpc platforms >>> and not only ARM. >> [snip] >>> +#ifdef CONFIG_ARM >>> gd = &gdata; >>> +#endif >> >> So, here's what I don't understand. On ARM, in general, we can't rely >> on the global data pointer register (r8) to be set to a useful value, so >> we do the above to ensure it points to something useful. Are you always >> able to rely on r2 it looks like pointing to something useful? Or do >> you take care of this much earlier on in powerpc? Thanks! > > You are correct, I missed something here. r2 was still configured to the > value written to it from the "real" U-Boot (pointing to internal SRAM). > > I can't use the code in preloader_console_init() though to setup the gd > pointer. As I need to write some values in gd *before* calling > preloader_console_init() (mainly clocks for serial driver). And since > this "gd stuff" is quite platform specific, we should probably move this > into an platform/arch spl file instead. As you also mentioned in another > reply to create an arch/${ARCH}/lib/spl.c file. > > What do you think? Can you move this gd init stuff into such a common > ARM spl file in the next patchset version? Yes. We should probably say it's the job of board_init_f. I know full U-Boot does it at the start of board_init_r but I think for SPL it makes sense to document that board_init_f does any early init it needs to, clears BSS, sets up gd and calls board_init_r. -- Tom