From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Beno=C3=AEt_Th=C3=A9baudeau?= Date: Fri, 1 Mar 2013 17:33:10 +0100 (CET) Subject: [U-Boot] [PATCH v8 31/31] arm: Remove duplicated start.S code In-Reply-To: <1818681530.215073.1362153044809.JavaMail.root@advansee.com> References: <1362139841-16540-1-git-send-email-benoit.thebaudeau@advansee.com> <1362139841-16540-31-git-send-email-benoit.thebaudeau@advansee.com> <20130301164607.5d0258cf@lilith> <1818681530.215073.1362153044809.JavaMail.root@advansee.com> Message-ID: <393365319.216565.1362155590381.JavaMail.root@advansee.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 Friday, March 1, 2013 4:50:44 PM, Beno?t Th?baudeau wrote: > Hi Albert, > > On Friday, March 1, 2013 4:46:07 PM, Albert ARIBAUD wrote: > > Hi Beno?t, > > > > On Fri, 1 Mar 2013 13:10:40 +0100, Beno?t Th?baudeau > > wrote: > > > > > Factorize start.S code as much as possible. > > > > > > Functions that may need to be customized for some start.S are defined > > > weak > > > for > > > that purpose. > > > > > > relocate_code_prepare() and relocate_code_finish() are introduced as > > > hooks > > > to be > > > executed at the beginning and at the end of relocate_code() if needed by > > > some > > > start.S, e.g. for special cache or MMU operations. > > > > NAK. > > > > 1. I don't like this idea of planting hooks inside relocate-code(). > > This function is about relocating code, not about MMU stuff. If there > > are any MMU steps to be performed between calls to board_init_f(), > > relocate_code() or board_init_r(), I want them laid out as calls of > > their own right in crt0.S. > > I also don't like it. The finish hook was used by SMDK6400 before it was > removed, and the prepare hook is still used by pxa. > > So is it OK for you if I just drop relocate_code_finish() and move and > rename the call to relocate_code_prepare() to crt0.S? > > > 2. If we're going to factorize out relocate_code() from the various > > start.S files, I want it moved not in crt0.S but in its own file. > > It is not in crt0.S, but in arch/arm/include/asm/start_marco.S, which is > almost its own file apart from another macro. > > > This > > way, i) people can easily create binaries which use crt0.S but do not > > relocate, ii) people who want to make relocate_code() a C function > > will have it easier, and iii) crt0.S keeps being the ugly ASM glue > > needed for flash inits, relocation and RAM inits to have a C proper > > run-time environment. > > Which is already the case with this implementation? And in case you ask, with relocate_code() as a function in its own file instead of a macro called from start.S, it does not work because of the _start-relative word values that require relocate_code() to be in _start's section. Best regards, Beno?t