From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Sat, 28 Sep 2013 22:39:32 +0200 Subject: [U-Boot] [RFC 0/3] ARM: cleanup gd init In-Reply-To: <523F363F.10700@myspectrum.nl> References: <1377361963-11381-1-git-send-email-jeroen@myspectrum.nl> <523F363F.10700@myspectrum.nl> Message-ID: <20130928223932.2f831bb0@lilith> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Jeroen, On Sun, 22 Sep 2013 20:26:07 +0200, Jeroen Hofstee wrote: > Hello, > > On 08/24/2013 06:32 PM, Jeroen Hofstee wrote: > > 4) Keep the s_init in crt0.S or move it to the board_init_f? > > The disadvantage of the later is that all the different > > board_init_f's need to call system_init. > Since this has been on the mailing-list for a month without a reply, > let's push this a bit. > > Moving s_init to board_init_f is not smart since there are many > board_init_f already and likely there will be more in the future > since SPL uses it as well. It also provides a chance to save bootrom > registers to gd. After boad_init_f r1 is clobbered at least.. Not sure what you mean by there being "many" board_init_f()s -- I count five occurrences, one of which is the standard board_init_f(), one is a weak default in SPL, and three are custom versions; the last four may or may not be merged into 'the' board_init_f() one. Regarding saving bootrom (or other) registers, that is a feature for start.S, more precisely from _start, which is the only place in the whole of U-Boot that has not clobbered any register yet. The right process is thus to split s_init(): any part that deals with saving registers at boot should go in start.S; any part that deals with anything else and is not absolutely required before entering crt0.S should move in a function called from board_init_f(). > Regards, > Jeroen Amicalement, -- Albert.