[U-Boot] can't build u-boot-2010.12-rc2 for at91rm9200ek

I download u-boot-2010.12-rc2 and make at91rm9200ek use the flowwing command
make O=../build at91rm9200ek
and get error message like this
arm-linux-gcc -D__ASSEMBLY__ -g -Os -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x10000000 -I/home/zzs/DownLoad/uboot/xx/build/include2 -I/home/zzs/DownLoad/uboot/xx/build/include -I/home/zzs/DownLoad/uboot/xx/u-boot-2010.12-rc2/include -fno-builtin -ffreestanding -nostdinc -isystem /home/zzs/work/tools/eldk4.1/usr/bin/../lib/gcc/arm-linux/4.0.0/include -pipe -DCONFIG_ARM -D__ARM__ -marm -mabi=apcs-gnu -mno-thumb-interwork -march=armv4 \ -o /home/zzs/DownLoad/uboot/xx/build/arch/arm/cpu/arm920t/start.o start.S -c start.S: Assembler messages: start.S:251: Error: bad arguments to instruction -- `add r1,r9'
It looks a illegal instruction in start.S
my toolchain is eldk4.1
anybody help me!!

Le 09/12/2010 06:56, zzs213 a écrit :
I download u-boot-2010.12-rc2 and make at91rm9200ek use the flowwing command
make O=../build at91rm9200ek
and get error message like this
arm-linux-gcc -D__ASSEMBLY__ -g -Os -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x10000000 -I/home/zzs/DownLoad/uboot/xx/build/include2 -I/home/zzs/DownLoad/uboot/xx/build/include -I/home/zzs/DownLoad/uboot/xx/u-boot-2010.12-rc2/include -fno-builtin -ffreestanding -nostdinc -isystem /home/zzs/work/tools/eldk4.1/usr/bin/../lib/gcc/arm-linux/4.0.0/include -pipe -DCONFIG_ARM -D__ARM__ -marm -mabi=apcs-gnu -mno-thumb-interwork -march=armv4 \ -o /home/zzs/DownLoad/uboot/xx/build/arch/arm/cpu/arm920t/start.o start.S -c start.S: Assembler messages: start.S:251: Error: bad arguments to instruction -- `add r1,r9'
It looks a illegal instruction in start.S
my toolchain is eldk4.1
ELDK 4.1 seems a bit old -- 4.2 has been available for some time now and does not have the issue with this instruction.
If you really cannot use 4.2, then you can rewrite the instruction in its canonical form: 'add r1,r1,r9'.
anybody help me!!
HTH.
Amicalement,

I chang 'adr r1, r9' to 'add r1, r1, r9' and then rebuild it but I gave another error. the error message is:
arm-linux-ld: -static and -shared may not be used together make[1]: *** [/home/zzs/DownLoad/uboot/xx/build/u-boot]
Is this caused by the toolchain too?
thanks!

I chang 'adr r1, r9' to 'add r1, r1, r9' and then rebuild it but I got another error. the error message is:
arm-linux-ld: -static and -shared may not be used together make[1]: *** [/home/zzs/DownLoad/uboot/xx/build/u-boot] Error 1 make[1]: Leaving directory `/home/zzs/DownLoad/uboot/xx/u-boot-2010.12-rc2' make: *** [at91rm9200ek] Error 2
Is this caused by the toolchain too?
thanks!

Hi 'zzs213',
Le 09/12/2010 08:07, zzs213 a ��crit :
I chang 'adr r1, r9' to 'add r1, r1, r9' and then rebuild it but I got another error. the error message is:
arm-linux-ld: -static and -shared may not be used together make[1]: *** [/home/zzs/DownLoad/uboot/xx/build/u-boot] Error 1 make[1]: Leaving directory `/home/zzs/DownLoad/uboot/xx/u-boot-2010.12-rc2' make: *** [at91rm9200ek] Error 2
Is this caused by the toolchain too?
Apparently it is. Building v2010.12-rc2 for at91rm9200ek with ELDK 4.2 gives:
albert@lilith:~/src/u-boot$ ./MAKEALL at91rm9200ek Configuring for at91rm9200ek board... at91rm9200_usart.c:39:2: warning: #warning Please update to use C structur SoC access ! text data bss dec hex filename 196564 5576 287296 489436 777dc ./u-boot
--------------------- SUMMARY ---------------------------- Boards compiled: 1 Boards with warnings or errors: 1 ( at91rm9200ek ) ---------------------------------------------------------- albert@lilith:~/src/u-boot$
thanks!
You're welcome.
Amicalement,

Dear zzs213,
Am 09.12.2010 um 08:07 schrieb zzs213:
I chang 'adr r1, r9' to 'add r1, r1, r9' and then rebuild it but I got another error. the error message is:
arm-linux-ld: -static and -shared may not be used together make[1]: *** [/home/zzs/DownLoad/uboot/xx/build/u-boot] Error 1 make[1]: Leaving directory `/home/zzs/DownLoad/uboot/xx/u-boot-2010.12-rc2' make: *** [at91rm9200ek] Error 2
I can not remember any part defining -shared for the linker. Maybe it is implied by the linker when using -pie switch for the linker. That is what we do for current relocation implemented by Albert.
Is this caused by the toolchain too?
I guess it is your toolchain. Can you try e.g. a current codesourcery build?
regards
Andreas Bießmann
BTW: One thing to mention. The at91rm9200ek board is _not_ fully functional a.t.m! I do only boot via JTAG currently, the same may be possible via preloader, e.g. one at91loader or a selfmade one. Booting from NOR Flash is ongoing but not working a.t.m., booting from dataflash may come in the future (fully supported by u-boot, via SPL; using preloader and copy to ram should work currently).

I just clone the git repos. and build at91rm9200ek with eldk4.1,the error message is same.
I change start.S let it check whether the main osc of at91rm9200 is work, So I know need relocate the code or not. Use this method I boot u-boot in NOR flash successful

Dear zzs213,
Am 09.12.2010 09:39, schrieb zzs213:
I just clone the git repos. and build at91rm9200ek with eldk4.1,the error message is same.
Ok, so ELDK 4.1 is not working. How about ELDK 4.2, CodeSourcery 2009q{1,3}, 2010q1, 2010.09?
I change start.S let it check whether the main osc of at91rm9200 is work, So I know need relocate the code or not. Use this method I boot u-boot in NOR flash successful
So you added some at91 related stuff to arm920t/cpu/start.S to conditionally branch to lowlevel_init()? You check if the CKGR_MOR.MOSCEN is set or not and decide whether you branch to lowlevel_init() or not. I guess this is wrong.
First, if your u-boot is started from SDRAM you need correct initialised clocks (main oscillator or not, you know you can leave the main oscillator disabled and bypass it!), CS0 timing and SDRAM. In that case you need to compile your u-boot with CONFIG_SKIP_LOWLEVEL_INIT and therefore we do never branch to lowlevel_init() cause it just do not exist. If you boot from NOR flash (BMS set to low during reset) the internal ROM code is never executed and you need to switch on and configure the clocks, setup CS0 timing and SDRAM configuration. This is done in lowlevel_init() and therefore we do not set CONFIG_SKIP_LOWLEVEL_INIT in that case. That case is currently broken in head of u-boot-arm/master (not in u-boot/master currently, but will for v2010.12)!
You may use the board in some way suggested by atmel in some of their documents. In that case you do have a preloader in NOR flash followed by an u-boot blob. But that is also the first case! Your u-boot will be copied to SDRAM by preloader! -> set CONFIG_SKIP_LOWLEVEL_INIT, set another CONFIG_TEXT_BASE cause. You may use the at91rm9200ek_ram_config and set the target address of your preloader copy to 0x20100000. In that case NOR flash booting is supported! But it is _not_ the case I meant with 'NOR flash booting does not work a.t.m.'.
In any case you need to relocate if your CONFIG_TEXT_BASE is not set to the location of u-boot at the end of board_init_f()! You can not know the location in any case cause this can be influenced by some environment variables. Therefore it is completely wrong to decide on the setting of CKGR_MOR.MOSCEN if we need relocation or not.
regards
Andreas Bießmann

you are right, I use that method on u-boot-2010.09 for my own board(slightly different from at91rm9200ek)
eldk4.1 is ok for 2010.09, eldk4.2 ok too

Dear Albert ARIBAUD,
In message 4D007227.7020106@free.fr you wrote:
start.S:251: Error: bad arguments to instruction -- `add r1,r9'
It looks a illegal instruction in start.S
my toolchain is eldk4.1
ELDK 4.1 seems a bit old -- 4.2 has been available for some time now and does not have the issue with this instruction.
If you really cannot use 4.2, then you can rewrite the instruction in its canonical form: 'add r1,r1,r9'.
Well, we should actually do that.
Patch following.
Best regards,
Wolfgang Denk

Dear Wolfgang Denk, Dear Albert Aribaud,
Am 09.12.2010 11:26, schrieb Wolfgang Denk:
Dear Albert ARIBAUD,
In message 4D007227.7020106@free.fr you wrote:
start.S:251: Error: bad arguments to instruction -- `add r1,r9'
It looks a illegal instruction in start.S
my toolchain is eldk4.1
ELDK 4.1 seems a bit old -- 4.2 has been available for some time now and does not have the issue with this instruction.
If you really cannot use 4.2, then you can rewrite the instruction in its canonical form: 'add r1,r1,r9'.
Well, we should actually do that.
Patch following.
So you need to fix _all_ of the arch/arm/cpu/*/start.S cause this was copied from one relocation code to the other.
Another cause to introduce a relocate.S in near future ;)
regards
Andreas Bießmann

Dear Andreas Bießmann,
Dear Wolfgang Denk, Dear Albert Aribaud,
Am 09.12.2010 11:26, schrieb Wolfgang Denk:
Dear Albert ARIBAUD,
In message 4D007227.7020106@free.fr you wrote:
start.S:251: Error: bad arguments to instruction -- `add r1,r9'
It looks a illegal instruction in start.S
my toolchain is eldk4.1
ELDK 4.1 seems a bit old -- 4.2 has been available for some time now and does not have the issue with this instruction.
If you really cannot use 4.2, then you can rewrite the instruction in its canonical form: 'add r1,r1,r9'.
Well, we should actually do that.
Patch following.
So you need to fix _all_ of the arch/arm/cpu/*/start.S cause this was copied from one relocation code to the other.
Another cause to introduce a relocate.S in near future ;)
Certainly you are referring to relocate.c, or even better adding the "C" relocation to the arm generic board.c on the path to an u-boot generic board.c :)
We should only need a small stub in assembly for stack and pc switching.
"Patches welcome" :)
Best Regards, Reinhard
participants (5)
-
Albert ARIBAUD
-
Andreas Bießmann
-
Reinhard Meyer
-
Wolfgang Denk
-
zzs213