[U-Boot] Is there a working 2011 version of u-boot on i.MX31?

Helmut Raiger helmut.raiger at hale.at
Mon May 30 10:00:36 CEST 2011


Hello Stefano,
> As Fabio already reported, last release is working on mx31pdk.
     Yes, I thought so. Thanks to all for the fast response.
> This is ruled by CONFIG_BOARD_EARLY_INIT_F, that is set for the board
> you mention and for qong, too. This is a second MX.31 board where I am
> sure that the last u-boot release is running.
     Sure, I defined CONFIG_BOARD_EARLY_INIT_F.

>> 1) relocation is done at the end of 'board_init_f'
>> 2) all early init functions are called at the very start of 'board_init_f'
>> 3) these init functions are stored in an array of function pointers
>> 'init_sequence', which is initialized data and which is not initialized yet.
>> 4) the C-code in general is linked using -pie, but the compiler flag
>> -PIE (or -PIC) is missing, so code is not really position independent.
>> It is linked for the RAM addresses (0x87f00000), but relocation is not
>> yet done.
> It seems a problem related to your toolchain. Which gcc compiler are you
> using ? This can explain what you are reporting.

     I suspected my toolchain already, so I tested 2 different versions:

1) arm_v6_vfp_le-gcc -v:
Using built-in specs.
Target: armv6fl-montavista-linux-gnueabi
Configured with: ../configure --host=i686-pc-linux-gnu 
--build=i686-pc-linux-gnu --target=armv6fl-montavista-linux-gnueabi 
--prefix=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le 
--exec-prefix=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le 
--bindir=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/bin 
--sbindir=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/sbin 
--sysconfdir=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/etc 
--datadir=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/share 
--includedir=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/include 
--libdir=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/lib 
--libexecdir=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/libexec 
--localstatedir=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/var 
--sharedstatedir=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/share 
--mandir=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/man 
--infodir=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/info 
--build=i686-pc-linux-gnu --program-transform-name=s,^,arm_v6_vfp_le-, 
--enable-cross --enable-poison-system-directories 
--with-sysroot=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/target 
--with-build-sysroot=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/target 
--with-build-time-tools=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/bin 
--enable-shared --enable-languages=c,c++ --enable-__cxa_atexit 
--enable-c99 --enable-long-long --enable-threads=posix 
--with-gxx-include-dir=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/lib/gcc/armv6fl-montavista-linux-gnueabi/4.2.0/../../../../target/usr/include/c++/4.2.0 
--disable-libmudflap --disable-libssp --disable-libgomp --with-gnu-as 
--with-gnu-ld --enable-symvers=gnu --enable-checking=release 
--with-numa-policy=yes --disable-multilib --enable-clocale=gnu 
--with-cpu=arm1136jf-s --with-interwork --with-arch=armv6j 
--with-tune=arm1136jf-s --with-fpu=vfp --with-float=softfp 
--libexecdir=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/lib 
--with-bugurl=http://www.mvista.com/support --with-versuffix='MontaVista 
4.2.0-16.0.46.custom 2009-03-17'
Thread model: posix
gcc version 4.2.0 (MontaVista 4.2.0-16.0.46.custom 2009-03-17)

     2) arm-angstrom-linux-gnueabi-gcc -v
Using built-in specs.
Target: arm-angstrom-linux-gnueabi
Configured with: 
/home/HALE/vogc/openembedded/tmp/work/i686-armv6-sdk-angstrom-linux-gnueabi/gcc-cross-sdk-4.3.3-r20.3/gcc-4.3.3/configure 
--build=i686-linux --host=i686-linux --target=arm-angstrom-linux-gnueabi 
--prefix=/usr/local/angstrom/arm --exec_prefix=/usr/local/angstrom/arm 
--bindir=/usr/local/angstrom/arm/bin 
--sbindir=/usr/local/angstrom/arm/bin 
--libexecdir=/usr/local/angstrom/arm/libexec 
--datadir=/usr/local/angstrom/arm/share 
--sysconfdir=/usr/local/angstrom/arm/etc 
--sharedstatedir=/usr/local/angstrom/arm/share/com 
--localstatedir=/usr/local/angstrom/arm/var 
--libdir=/usr/local/angstrom/arm/lib 
--includedir=/usr/local/angstrom/arm/include 
--oldincludedir=/usr/local/angstrom/arm/include 
--infodir=/usr/local/angstrom/arm/share/info 
--mandir=/usr/local/angstrom/arm/share/man --with-gnu-ld --enable-shared 
--enable-languages=c,c++,objc,fortran --enable-threads=posix 
--disable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu 
--enable-libstdcxx-pch --program-prefix=arm-angstrom-linux-gnueabi- 
--enable-target-optspace --enable-cheaders=c_std --enable-libssp 
--disable-bootstrap --disable-libgomp --disable-libmudflap 
--with-sysroot=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi 
--with-build-time-tools=/home/HALE/vogc/openembedded/tmp/sysroots/i686-linux/usr/armv6/arm-angstrom-linux-gnueabi/bin 
--with-build-sysroot=/home/HALE/vogc/openembedded/tmp/sysroots/armv6-angstrom-linux-gnueabi 
--disable-libunwind-exceptions --disable-libssp --disable-libgomp 
--disable-libmudflap 
--with-mpfr=/home/HALE/vogc/openembedded/tmp/sysroots/i686-linux/usr 
--enable-__cxa_atexit
Thread model: posix
gcc version 4.3.3 (GCC)

     ... only to generate the same result. We even tested on different 
machines, again the same result. What toolchain are you guys using? 
Could you send me an elf binary of an u-boot built for mx31pdk. I'm 
pretty much into disassembling these days, so this could probably give 
me a hint.

> This can be another symptom that the problem is related to the
> toolchain. Take care that what you are exponing is not strictly related
> to the i.MX31, and most of ARM boards should be affected, and they are not.
>
You're right, I was mx31 blinkered.

Even if this is toolchain dependent, I think this is a bug, as it 
shouldn't. The 'init_sequence' array is initialized data and has to be 
initialized by the startup code before it is usable by C-code, which in 
fact is not done. The same holds true for the compile flag -fPIC (or 
PIE). Early C-code is XIPed (at least for NOR-flash boots) and on i.MX31 
CS0 is remapped to address 0 in this case, so it must either be linked 
for address 0 and then relocated when uboot is copied to RAM or code 
must be position indepependent. Currently boards link with TEXT_BASE 
(start of text segment) set to the RAM address when relocated.

Maybe Heiko Schocher could comment on these issues.

Regards,
Helmut



--
Scanned by MailScanner.



More information about the U-Boot mailing list