Skip to contentSkip to conversation

can't build u-boot-2010.12-rc2 for at91rm9200ek

U-Boot zzs213 5 participants 15 messages Dec 9, 2010 1 message not in the archive

lore
Share & tools
lore

zzs213

author
#0 lore raw

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!!

#1 lore raw

Le 09/12/2010 06:56, zzs213 a ?crit :

Quoted 6 lines

I download u-boot-2010.12-rc2 and make at91rm9200ek use the flowwing command

make O=../build at91rm9200ek

and get error message like this

Quoted 8 lines

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'.

Quoted 1 line

anybody help me!!

HTH.

Amicalement,

Signature · 1 line
Albert.
author
#2 lore raw

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!

author
#3 lore raw
In reply to Albert ARIBAUD

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!

#4 lore raw

Hi 'zzs213',

Le 09/12/2010 08:07, zzs213 a ??crit :

Quoted 10 lines

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 at 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 at lilith:~/src/u-boot$

Quoted 1 line

thanks!

You're welcome.

Amicalement,

Signature · 1 line
Albert.
author
#5 lore raw

Yes. I just build it use eldk4.2. It's all right!!

#6 lore raw
In reply to zzs213

Dear zzs213,

Am 09.12.2010 um 08:07 schrieb zzs213:

Quoted 7 lines

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.

Quoted 1 line

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).

author
#7 lore raw

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

#8 lore raw

Dear zzs213,

Am 09.12.2010 09:39, schrieb zzs213:

Quoted 2 lines

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?

Quoted 1 line

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

author
#9 lore raw

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#11 lore raw

Dear zzs213,

can you please leave some context when you answering to the list?

Am 09.12.2010 10:52, schrieb zzs213:

Quoted 1 line

you are right, I use that method on u-boot-2010.09 for my own board(slightly different from at91rm9200ek)

I guess you mean you are using a preloader on your NOR flash, is that right?

Quoted 1 line

eldk4.1 is ok for 2010.09, eldk4.2 ok too

So do you have no problem left?

regards

Andreas Bie?mann

author
#12 lore raw
Quoted 9 lines

Dear zzs213,

can you please leave some context when you answering to the list?

Am 09.12.2010 10:52, schrieb zzs213:

Quoted 1 line

you are right, I use that method on u-boot-2010.09 for my own board(slightly different from at91rm9200ek)

I guess you mean you are using a preloader on your NOR flash, is that right?

yes

Quoted 4 lines
Quoted 2 lines

eldk4.1 is ok for 2010.09, eldk4.2 ok too

So do you have no problem left?

yes

Quoted 5 lines

regards

Andreas Bie?mann

#13 lore raw
In reply to Albert ARIBAUD

Dear Albert ARIBAUD,

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 5 lines

start.S:251: Error: bad arguments to instruction -- `add r1,r9'

It looks a illegal instruction in start.S

Quoted 7 lines
Quoted 1 line

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

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You see things; and you say ``Why?'' But I dream  things  that  never
were; and I say ``Why not?''
       - George Bernard Shaw _Back to Methuselah_ (1921) pt. 1, act 1
#14 lore raw

Dear Wolfgang Denk,
Dear Albert Aribaud,

Am 09.12.2010 11:26, schrieb Wolfgang Denk:

Quoted 13 lines

Dear Albert ARIBAUD,

Quoted 10 lines · In message <[email protected]> you wrote:
Quoted 6 lines

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.

Quoted 6 lines
Quoted 2 lines

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

#15 lore raw

Dear Andreas Bie?mann,

Quoted 17 lines

Dear Wolfgang Denk,
Dear Albert Aribaud,

Am 09.12.2010 11:26, schrieb Wolfgang Denk:

Quoted 13 lines

Dear Albert ARIBAUD,

Quoted 10 lines · In message <[email protected]> you wrote:
Quoted 5 lines

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'.

Quoted 8 lines
Quoted 3 lines

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