From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Tue, 12 Mar 2019 15:42:24 -0400 Subject: [U-Boot] [PATCH 3/4] ARM: renesas: Save boot parameters passed in by ATF In-Reply-To: References: <20190305032557.19788-1-marek.vasut+renesas@gmail.com> <20190305032557.19788-3-marek.vasut+renesas@gmail.com> Message-ID: <20190312194224.GR4690@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Mar 12, 2019 at 07:59:40PM +0100, Eugeniu Rosca wrote: > Hi Marek, > > On Tue, Mar 5, 2019 at 4:41 AM Marek Vasut wrote: > [..] > > +.align 8 > > +.globl rcar_atf_boot_args > > +rcar_atf_boot_args: > > + .dword 0 > > + .dword 0 > > + .dword 0 > > + .dword 0 > > + > > +ENTRY(save_boot_params) > > + adr x8, rcar_atf_boot_args > > + stp x0, x1, [x8], #16 > > + stp x2, x3, [x8], #16 > > + b save_boot_params_ret > > +ENDPROC(save_boot_params) > > What about relocating the function to C like in [1] and passing the 4 > arguments to it from ASM like in [2]? > This would allow to: > - reduce asm operations to minimum (mov and bl) and make code transparent. > - avoid custom globals and store the ATF information in some C-defined struct. > > [1] https://github.com/ARM-software/arm-trusted-firmware/blob/c48d02bade88b07fa7f43aa44e5217f68e5d047f/bl1/bl1_main.c#L263 > [2] https://github.com/ARM-software/arm-trusted-firmware/blob/c48d02bade88b07fa7f43aa44e5217f68e5d047f/bl1/aarch32/bl1_exceptions.S#L133 This is super early in the boot process and I'm really not a fan in general of writing and calling C before we have things setup for C calls to actually work normally, even more so for small things that can be commented to be obvious as to what's going on. -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: