[U-Boot] AT91: problems master vs. next

Albert ARIBAUD albert.aribaud at free.fr
Tue Sep 21 16:00:36 CEST 2010


Le 21/09/2010 14:39, Reinhard Meyer a écrit :
> Just to report on preliminary findings I had:
>
> Rebasing my current TOP9000 port on u-boot/master compiles
> and works fine.
> Code size increased moderately from 223592 to 223976.
>
> Rebasing my current TOP9000 port on u-boot/next compiles
> after defining CONFIG_SYS_SDRAM_BASE and CONFIG_SYS_INIT_SP_ADDR.
> Code size increased heavyly from 223592 to 245544.
>
> And U-Boot crashes instantly (I know there is more to be done
> than just defining those two macros).
>
> What bothers me really here is the huge increase in code size.

I see numbers similar for orion5x based net5big, where non relocating 
build is 117252 bytes while relocating build is 127120, a 8.4% increase 
(yours is 9.8%).

This is due to the fact that each routine has to recompute the PIC 
register. As a test, I tried adding -msingle-pic-base to -fPIC (this 
computes the PIC register once for the whole code) and the code size 
falls back to 123764 bytes, 'only' 5.5% more than the non relocating 
case. Using -fPIE -pie -msingle-pic-base lowers this again to 5.2%.

Of course you cannot just turn -msingle-pic-base on; you've got to have 
the code in start.S that computes the register. Also, switching from PIC 
to PIE needs to be verified. I've got the code in my local tree, but 
it's not tested yet. I'll test it tonight and post it if it works.

> And, on almost all AT91 systems booting will be through a
> first boot loader, which sets up SDRAM, loads u-boot to the
> "correct" address and jumps to it.
> All low level init and relocation is not required in such cases.
>
> It should be always possible to #define relocation off!

On arm926ejs this is controlled by CONFIG_SKIP_LOWLEVEL_INIT and 
CONFIG_SKIP_RELOCATE_UBOOT. For instance, openrd_base, a kirkwood board, 
always skips lowlevel inits.

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list