From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeroen Hofstee Date: Wed, 21 Aug 2013 18:22:59 +0200 Subject: [U-Boot] [PATCH v2 3/4] ARM: use r9 for gd In-Reply-To: <52125692.7010001@myspectrum.nl> References: <1376254719-15594-1-git-send-email-jeroen@myspectrum.nl> <1376504746-15173-1-git-send-email-jeroen@myspectrum.nl> <1376504746-15173-4-git-send-email-jeroen@myspectrum.nl> <520F4514.1000804@myspectrum.nl> <52125692.7010001@myspectrum.nl> Message-ID: <5214E963.3020208@myspectrum.nl> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Simon, On 08/19/2013 07:32 PM, Jeroen Hofstee wrote: > > On 08/19/2013 05:08 AM, Simon Glass wrote: >> On Sat, Aug 17, 2013 at 3:40 AM, Jeroen Hofstee >> wrote: >>> >>> This patch assumes only crt0.S sets the register used for >>> gd in asm. I just noticed cpu/armv7/lowlevel_init.S does set gd >>> manually, so all users of the common board.c are likely >>> bricked with the patch as is. Looking into it.... >> I may misunderstood what you are saying here, > > Likely, this is not about how to set reserve gd, but why gd > is setup twice. The answer is because some more cleanup > is needed (which deserves its own patch). > Right... Now I understand what you were talking about. Gd is actually setup _three_ times in a row: 1) cpu/armv7/lowlevel_init.S 2) ./arch/arm/lib/crt0.S 3) common/board_f.c >> but I believe that the >> code in common/board_f.c which creates a global_data on the stack can >> be removed for ARM now that Albert has tidied all this up with the >> crt0.S changes, etc. So in common/board_f.c something like: >> >> void board_init_f(ulong boot_flags) >> { >> /* These two archs set up the global_data before board_init_f() */ >> #if !defined(CONFIG_X86) && !defined(CONFIG_ARM) >> gd_t data; >> >> gd = &data; >> #endif >> >> gd->flags = boot_flags; >> > Yup understood now, this makes sense (but as part of a cleanup patchset) Thanks, Regards, Jeroen