Hi Andre,
Subject: Re: commit 75fab6496e5fce9a11 ("libc: memset: improve performance by avoiding single byte writes") causing BL31 boot failure on Renesas RZ/G2 platforms.
On 11/10/2020 19:23, Biju Das wrote:
Hi Biju,
Found the root cause, the new changes corrupting the registers used by
console.S.
So I have fixed the issue. Please find the attached patch.
Good find for the source of the register corruption, but unfortunately this patch won't cut it:
- I am not sure you are actually allowed to call a C function from this context. I
need to check back with the team tomorrow to find the reason these console_*_register functions are all in assembly. I don't see any assembly callers, but there is (was?) surely a reason behind this. I think this was meant to be called either early in the game (before we have a SP), or during a crash, again with no C context.
- Since this function is called *from* C, you need to adhere to the
AAPCS(64) standard, which means your function must preserve x19-x28. So you would need to save x24 and x25 to the stack. If we have one already at this point (see above).
May be we could call "rcar_log_init" from "c" file, ie, just after the " rcar_console_runtime_init()" instead of assembly? https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/plat/rene...
Cheers, Biju
Renesas Electronics Europe GmbH, Geschaeftsfuehrer/President: Carsten Jauch, Sitz der Gesellschaft/Registered office: Duesseldorf, Arcadiastrasse 10, 40472 Duesseldorf, Germany, Handelsregister/Commercial Register: Duesseldorf, HRB 3708 USt-IDNr./Tax identification no.: DE 119353406 WEEE-Reg.-Nr./WEEE reg. no.: DE 14978647