[PATCH] mpc85xx: relocate code in non-SPL build

Tom Rini trini at konsulko.com
Sat Oct 28 16:23:56 CEST 2023


On Sat, Oct 28, 2023 at 04:21:18PM +0200, Martin Fäcknitz wrote:
> Works now. I used T1042D4RDB_SDCARD_defconfig.
> 
> relocate_code in arch/powerpc/cpu/mpc85xx/start.o before patch (non-SPL build):
> 
> 00000dc0 <relocate_code>:
>  dc0:   7c 61 1b 78     mr      r1,r3
>  dc4:   7c 89 23 78     mr      r9,r4
>  dc8:   7c aa 2b 78     mr      r10,r5
>  dcc:   48 00 00 05     bl      dd0 <relocate_code+0x10>
>  dd0:   7d 88 02 a6     mflr    r12
>  dd4:   80 0c 01 fc     lwz     r0,508(r12)
>  dd8:   7d 80 62 14     add     r12,r0,r12
> 
> 00000ddc <in_ram>:
>  ...
> 
> After Patch:
> 00000dc0 <relocate_code>:
>   dc0:       7c 61 1b 78     mr      r1,r3
>   dc4:       7c 89 23 78     mr      r9,r4
>   dc8:       7c aa 2b 78     mr      r10,r5
>   dcc:       48 00 00 05     bl      dd0 <relocate_code+0x10>
>   dd0:       7d 88 02 a6     mflr    r12
>   dd4:       80 0c 02 c8     lwz     r0,712(r12)
>   dd8:       7d 80 62 14     add     r12,r0,r12
>   ...
>   ea0:       7c 08 03 a6     mtlr    r0
>   ea4:       4e 80 00 20     blr
> 
> 00000ea8 <in_ram>:
>  ...
> 
> In SPL build, relocate_code is same in both builds (because of
> CONFIG_SPL_SKIP_RELOCATE).

Thanks for confirming!

> 
> 
> On 28.10.2023 15:26, Tom Rini wrote:
> > On Fri, Oct 20, 2023 at 01:06:55AM +0200, Martin Fäcknitz wrote:
> > 
> >> When building a non-SPL image, relocation is needed. This patch restores
> >> the old behaviour before commit b35316fb67: CONFIG_SPL_SKIP_RELOCATE was
> >> only defined if CONFIG_SPL_BUILD was defined.
> >>
> >> Fixes: b35316fb67cb ("Convert CONFIG_SPL_INIT_MINIMAL et al to Kconfig")
> >> Signed-off-by: Martin Fäcknitz <faecknitz at hotsplots.de>
> > 
> > This is now applied to u-boot/master, thanks!  But also, can you please
> > confirm that top of tree now works for you, and which defconfig that is?
> > As part of my testing I check for size changes before/after and this
> > doesn't change any platform, which would lead to how I had missed the
> > problem during the conversion.
> > 
> 

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20231028/670d52d5/attachment.sig>


More information about the U-Boot mailing list