U-Boot v1: Change to use arm-linux toolchain with march=armv5 necessary

While preparing OMAP3 U-Boot v1 patches for upstream submission using Steve's git [1] we found that currently we use CodeSourcery toolchain and -march=armv7a configuration.

As this is incompatible to upstream configuration, discussion at U-Boot list

http://lists.denx.de/pipermail/u-boot/2008-August/039492.html

showed that we have to change this to use standard toolchain and more common -march option.

As example, looking at ARM11 configuration for OMAP2 in cpu/arm1136/config.mk there is a comment

# Make ARMv5 to allow more compilers to work, even though its v6.
PLATFORM_CPPFLAGS += -march=armv5

I propose to go the same way for OMAP3, too. If somebody later wants something else, he can overwrite CROSS_COMPILE at command line.

Trying to compile recent OMAP3 U-Boot git with my arm-linux-gcc and march=armv4 configuration (didn't try armv5) yet, I get

- a lot of warnings "warning: target CPU does not support interworking"

- start.S compilation in our patch fails:

start.S: Assembler messages:
start.S:466: Error: selected processor does not support `isb'
start.S:475: Error: selected processor does not support `clz r5,r4'
start.S:500: Error: selected processor does not support `isb'

Any proposals how to change this? (Patch??)

Thanks

Dirk

[1] http://www.sakoman.net/cgi-bin/gitweb.cgi?p=u-boot-omap3.git;a=shortlog;h=refs/heads/common

Dirk,

Dirk Behme schreef:

While preparing OMAP3 U-Boot v1 patches for upstream submission using
Steve's git [1] we found that currently we use CodeSourcery toolchain
and -march=armv7a configuration.

So you need something like
http://dominion.thruhere.net/git/?p=openembedded.git;a=blob;f=packages/linux/linux-omap2-git/beagleboard/no-harry-potter.diff;h=2bb20ab9c025312fcf0434de5bcb88aeceb4f87f;hb=HEAD
to work with vanilla gcc (4.3.2 includes the neon bugfix)

As this is incompatible to upstream configuration, discussion at
U-Boot list

http://lists.denx.de/pipermail/u-boot/2008-August/039492.html

showed that we have to change this to use standard toolchain and more
common -march option.

As example, looking at ARM11 configuration for OMAP2 in
cpu/arm1136/config.mk there is a comment

# Make ARMv5 to allow more compilers to work, even though its v6.
PLATFORM_CPPFLAGS += -march=armv5

I propose to go the same way for OMAP3, too. If somebody later wants
something else, he can overwrite CROSS_COMPILE at command line.

Trying to compile recent OMAP3 U-Boot git with my arm-linux-gcc and
march=armv4 configuration (didn't try armv5) yet, I get

- a lot of warnings "warning: target CPU does not support interworking"

try -march=armv4t, I'm not aware of any omaps using something older
than arm920t cores.

- start.S compilation in our patch fails:

start.S: Assembler messages:
start.S:466: Error: selected processor does not support `isb'
start.S:475: Error: selected processor does not support `clz r5,r4'
start.S:500: Error: selected processor does not support `isb'

Any proposals how to change this? (Patch??)

clz (count leading zeroes) is part of the armv5te instruction set, so
try -march=armv5te.

regards,

Koen

Adding to what Koen said, for pre ARMv7 cores, ISB is called
flush prefetch buffer and is a cp15 operation:

   mcr p15,0,r0,c7,c5,4

Can't say for sure if it's available on all cores u-boot supports.

HTH,

Laurent