[U-Boot] Microblaze and Sparc boards are broken because of common timer func

Hello, Rob, Tom, Michal, Daniel.
Commit 8dfafdde88eb (Introduce common timer functions) broke Microblaze and Sparc boards.
$ git checkout 8dfafdde88eb $ CROSS_COMPILE=microblaze-unknown-linux-gnu- ./MAKEALL -a microblaze <snipped> lib/time.c:45: undefined reference to `timer_read_counter' lib/libgeneric.o: In function `__udelay': lib/time.c:86: relocation truncated to fit: R_MICROBLAZE_32_PCREL_LO against symbol `get_ticks' defined in .text section in arch/microblaze/cpu/libmicroblaze.o lib/time.c:88: relocation truncated to fit: R_MICROBLAZE_32_PCREL_LO against symbol `get_ticks' defined in .text section in arch/microblaze/cpu/libmicroblaze.o lib/libgeneric.o: In function `udelay': lib/time.c:101: relocation truncated to fit: R_MICROBLAZE_32_PCREL_LO against symbol `__udelay' defined in .text section in arch/microblaze/cpu/libmicroblaze.o lib/libgeneric.o: In function `timer_get_us': lib/time.c:70: relocation truncated to fit: R_MICROBLAZE_32_PCREL_LO against symbol `get_ticks' defined in .text section in arch/microblaze/cpu/libmicroblaze.o lib/libgeneric.o: In function `get_timer': lib/time.c:65: relocation truncated to fit: R_MICROBLAZE_32_PCREL_LO against symbol `get_ticks' defined in .text section in arch/microblaze/cpu/libmicroblaze.o
$ CROSS_COMPILE=sparc-elf- ./MAKEALL grsim_leon2 Configuring for grsim_leon2 board... sparc-elf-size: './u-boot': No such file lib/libgeneric.o: In function `tick_to_time': /home/yamada/workspace/arm-linux-pf/u-boot/lib/time.c:56: undefined reference to `get_tbclk' lib/libgeneric.o: In function `get_ticks': /home/yamada/workspace/arm-linux-pf/u-boot/lib/time.c:45: undefined reference to `timer_read_counter' lib/libgeneric.o: In function `usec_to_tick': /home/yamada/workspace/arm-linux-pf/u-boot/lib/time.c:74: undefined reference to `get_tbclk' /home/yamada/workspace/arm-linux-pf/u-boot/lib/time.c:75: undefined reference to `get_tbclk'
(I can notice broken boards because I quite often build all boards for the test of Kbuild porting.)
Best Regards Masahiro Yamada

On 11/12/2013 03:12 AM, Masahiro Yamada wrote:
Hello, Rob, Tom, Michal, Daniel.
Commit 8dfafdde88eb (Introduce common timer functions) broke Microblaze and Sparc boards.
$ git checkout 8dfafdde88eb $ CROSS_COMPILE=microblaze-unknown-linux-gnu- ./MAKEALL -a microblaze
<snipped> lib/time.c:45: undefined reference to `timer_read_counter' lib/libgeneric.o: In function `__udelay': lib/time.c:86: relocation truncated to fit: R_MICROBLAZE_32_PCREL_LO against symbol `get_ticks' defined in .text section in arch/microblaze/cpu/libmicroblaze.o lib/time.c:88: relocation truncated to fit: R_MICROBLAZE_32_PCREL_LO against symbol `get_ticks' defined in .text section in arch/microblaze/cpu/libmicroblaze.o lib/libgeneric.o: In function `udelay': lib/time.c:101: relocation truncated to fit: R_MICROBLAZE_32_PCREL_LO against symbol `__udelay' defined in .text section in arch/microblaze/cpu/libmicroblaze.o lib/libgeneric.o: In function `timer_get_us': lib/time.c:70: relocation truncated to fit: R_MICROBLAZE_32_PCREL_LO against symbol `get_ticks' defined in .text section in arch/microblaze/cpu/libmicroblaze.o lib/libgeneric.o: In function `get_timer': lib/time.c:65: relocation truncated to fit: R_MICROBLAZE_32_PCREL_LO against symbol `get_ticks' defined in .text section in arch/microblaze/cpu/libmicroblaze.o
$ CROSS_COMPILE=sparc-elf- ./MAKEALL grsim_leon2 Configuring for grsim_leon2 board... sparc-elf-size: './u-boot': No such file lib/libgeneric.o: In function `tick_to_time': /home/yamada/workspace/arm-linux-pf/u-boot/lib/time.c:56: undefined reference to `get_tbclk' lib/libgeneric.o: In function `get_ticks': /home/yamada/workspace/arm-linux-pf/u-boot/lib/time.c:45: undefined reference to `timer_read_counter' lib/libgeneric.o: In function `usec_to_tick': /home/yamada/workspace/arm-linux-pf/u-boot/lib/time.c:74: undefined reference to `get_tbclk' /home/yamada/workspace/arm-linux-pf/u-boot/lib/time.c:75: undefined reference to `get_tbclk'
(I can notice broken boards because I quite often build all boards for the test of Kbuild porting.)
This should be fixed by this patch - at least for microblaze.
commit 65ba7add0d609bbd035b8d42fafdaf428ac24751 Author: Rob Herring rob.herring@calxeda.com Date: Fri Nov 8 08:40:43 2013 -0600
time: add weak annotation to timer_read_counter declaration
A weak annotation is needed in order to prevent link errors when get_ticks is overridden. This fixes sandbox build.
Signed-off-by: Rob Herring rob.herring@calxeda.com
Thanks, Michal

Hello Michal
This should be fixed by this patch - at least for microblaze.
commit 65ba7add0d609bbd035b8d42fafdaf428ac24751 Author: Rob Herring rob.herring@calxeda.com Date: Fri Nov 8 08:40:43 2013 -0600
time: add weak annotation to timer_read_counter declaration A weak annotation is needed in order to prevent link errors when get_ticks is overridden. This fixes sandbox build. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
No. I tried both the current u-boot/master and commit 65ba7add0d, but Microblaze board failed with the same error message.
Best Regards Masahiro Yamada

Hi Masahiro,
On 11/12/2013 10:04 AM, Masahiro Yamada wrote:
Hello Michal
This should be fixed by this patch - at least for microblaze.
commit 65ba7add0d609bbd035b8d42fafdaf428ac24751 Author: Rob Herring rob.herring@calxeda.com Date: Fri Nov 8 08:40:43 2013 -0600
time: add weak annotation to timer_read_counter declaration A weak annotation is needed in order to prevent link errors when get_ticks is overridden. This fixes sandbox build. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
No. I tried both the current u-boot/master and commit 65ba7add0d, but Microblaze board failed with the same error message.
Look at this log - uboot section. http://www.monstr.eu/wiki/doku.php?id=log:2013-11-12_13_29_22
Which toolchain do you use?
Thanks, Michal

On 11/12/2013 06:32 AM, Michal Simek wrote:
Hi Masahiro,
On 11/12/2013 10:04 AM, Masahiro Yamada wrote:
Hello Michal
This should be fixed by this patch - at least for microblaze.
commit 65ba7add0d609bbd035b8d42fafdaf428ac24751 Author: Rob Herring rob.herring@calxeda.com Date: Fri Nov 8 08:40:43 2013 -0600
time: add weak annotation to timer_read_counter declaration
A weak annotation is needed in order to prevent link errors when get_ticks is overridden. This fixes sandbox build.
Signed-off-by: Rob Herring rob.herring@calxeda.com
No. I tried both the current u-boot/master and commit 65ba7add0d, but Microblaze board failed with the same error message.
Look at this log - uboot section. http://www.monstr.eu/wiki/doku.php?id=log:2013-11-12_13_29_22
Which toolchain do you use?
It builds for me with 4.8.0 from kernel.org, but I had to disable systemace driver otherwise I get this error:
/opt/gcc-4.8.0-nolibc/microblaze-linux/bin/microblaze-linux-gcc -g -Os -D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x29000000 -I/home/rob/proj/git/u-boot-arm/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/gcc-4.8.0-nolibc/microblaze-linux/bin/../lib/gcc/microblaze-linux/4.8.0/include -pipe -ffixed-r31 -D__microblaze__ -mno-xl-soft-mul -mno-xl-soft-div -mxl-barrel-shift -Wall -Wstrict-prototypes -fno-stack-protector -Wno-format-nonliteral -Wno-format-security -fstack-usage -o systemace.o systemace.c -c systemace.c: In function 'ace_readw': systemace.c:70:1: warning: stack usage computation not supported for this target [enabled by default] } ^ {standard input}: Assembler messages: {standard input}:2499: Error: operation combines symbols in different segments {standard input}:2500: Error: operation combines symbols in different segments {standard input}:2503: Error: operation combines symbols in different segments {standard input}:2504: Error: operation combines symbols in different segments {standard input}:2509: Error: operation combines symbols in different segments {standard input}:2510: Error: operation combines symbols in different segments {standard input}:2519: Error: operation combines symbols in different segments {standard input}:2520: Error: operation combines symbols in different segments {standard input}:2523: Error: operation combines symbols in different segments {standard input}:2524: Error: operation combines symbols in different segments {standard input}:2533: Error: operation combines symbols in different segments {standard input}:2534: Error: operation combines symbols in different segments {standard input}:2537: Error: operation combines symbols in different segments {standard input}:2538: Error: operation combines symbols in different segments {standard input}:2543: Error: operation combines symbols in different segments {standard input}:2544: Error: operation combines symbols in different segments {standard input}:2553: Error: operation combines symbols in different segments {standard input}:2554: Error: operation combines symbols in different segments make[3]: *** [systemace.o] Error 1
Rob

On 11/12/2013 02:46 PM, Rob Herring wrote:
On 11/12/2013 06:32 AM, Michal Simek wrote:
Hi Masahiro,
On 11/12/2013 10:04 AM, Masahiro Yamada wrote:
Hello Michal
This should be fixed by this patch - at least for microblaze.
commit 65ba7add0d609bbd035b8d42fafdaf428ac24751 Author: Rob Herring rob.herring@calxeda.com Date: Fri Nov 8 08:40:43 2013 -0600
time: add weak annotation to timer_read_counter declaration
A weak annotation is needed in order to prevent link errors when get_ticks is overridden. This fixes sandbox build.
Signed-off-by: Rob Herring rob.herring@calxeda.com
No. I tried both the current u-boot/master and commit 65ba7add0d, but Microblaze board failed with the same error message.
Look at this log - uboot section. http://www.monstr.eu/wiki/doku.php?id=log:2013-11-12_13_29_22
Which toolchain do you use?
It builds for me with 4.8.0 from kernel.org, but I had to disable systemace driver otherwise I get this error:
yes. That's my behaviour too when I use this toolchain. I have to ping toolchain people to find out status of stack support in mainline gcc.
Thanks, Michal

On Tue, Nov 12, 2013 at 04:37:34PM +0100, Michal Simek wrote:
On 11/12/2013 02:46 PM, Rob Herring wrote:
On 11/12/2013 06:32 AM, Michal Simek wrote:
Hi Masahiro,
On 11/12/2013 10:04 AM, Masahiro Yamada wrote:
Hello Michal
This should be fixed by this patch - at least for microblaze.
commit 65ba7add0d609bbd035b8d42fafdaf428ac24751 Author: Rob Herring rob.herring@calxeda.com Date: Fri Nov 8 08:40:43 2013 -0600
time: add weak annotation to timer_read_counter declaration
A weak annotation is needed in order to prevent link errors when get_ticks is overridden. This fixes sandbox build.
Signed-off-by: Rob Herring rob.herring@calxeda.com
No. I tried both the current u-boot/master and commit 65ba7add0d, but Microblaze board failed with the same error message.
Look at this log - uboot section. http://www.monstr.eu/wiki/doku.php?id=log:2013-11-12_13_29_22
Which toolchain do you use?
It builds for me with 4.8.0 from kernel.org, but I had to disable systemace driver otherwise I get this error:
yes. That's my behaviour too when I use this toolchain. I have to ping toolchain people to find out status of stack support in mainline gcc.
Well, why is the assembler part failing? And what is the toolchain people should use here?

On 11/18/2013 02:24 PM, Tom Rini wrote:
On Tue, Nov 12, 2013 at 04:37:34PM +0100, Michal Simek wrote:
On 11/12/2013 02:46 PM, Rob Herring wrote:
On 11/12/2013 06:32 AM, Michal Simek wrote:
Hi Masahiro,
On 11/12/2013 10:04 AM, Masahiro Yamada wrote:
Hello Michal
This should be fixed by this patch - at least for microblaze.
commit 65ba7add0d609bbd035b8d42fafdaf428ac24751 Author: Rob Herring rob.herring@calxeda.com Date: Fri Nov 8 08:40:43 2013 -0600
time: add weak annotation to timer_read_counter declaration
A weak annotation is needed in order to prevent link errors when get_ticks is overridden. This fixes sandbox build.
Signed-off-by: Rob Herring rob.herring@calxeda.com
No. I tried both the current u-boot/master and commit 65ba7add0d, but Microblaze board failed with the same error message.
Look at this log - uboot section. http://www.monstr.eu/wiki/doku.php?id=log:2013-11-12_13_29_22
Which toolchain do you use?
It builds for me with 4.8.0 from kernel.org, but I had to disable systemace driver otherwise I get this error:
yes. That's my behaviour too when I use this toolchain. I have to ping toolchain people to find out status of stack support in mainline gcc.
Well, why is the assembler part failing? And what is the toolchain people should use here?
That's not question to me but to our toolchain guys what it is missing in the mainline gcc. I have sent them an email. Will see what I get.
I do use these two toolchains[1] depends if you want to compile little or big endian targets. Mainline u-boot, because of ll_temac driver, must be compiled by big endian toolchains.
[1] http://www.monstr.eu/20131118-microblaze-toolchains.tar.gz md5sum 20131118-microblaze-toolchains.tar.gz 940b8464154d3f1b58fe977156203b2a 20131118-microblaze-toolchains.tar.gz
Thanks, Michal

Hello Michal.
This should be fixed by this patch - at least for microblaze.
commit 65ba7add0d609bbd035b8d42fafdaf428ac24751 Author: Rob Herring rob.herring@calxeda.com Date: Fri Nov 8 08:40:43 2013 -0600
time: add weak annotation to timer_read_counter declaration A weak annotation is needed in order to prevent link errors when get_ticks is overridden. This fixes sandbox build. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
No. I tried both the current u-boot/master and commit 65ba7add0d, but Microblaze board failed with the same error message.
Look at this log - uboot section. http://www.monstr.eu/wiki/doku.php?id=log:2013-11-12_13_29_22
Which toolchain do you use?
Microblaze crosstools I use is available at: http://dev.gentoo.org/~vapier/u-boot/microblaze.tar.xz
Before commit 8dfafdde88eb, I could build the microblaze-generic board with it. But I can't build for the current u-boot/master.
Best Regards Masahiro Yamada

On 11/14/2013 01:37 AM, Masahiro Yamada wrote:
Hello Michal.
This should be fixed by this patch - at least for microblaze.
commit 65ba7add0d609bbd035b8d42fafdaf428ac24751 Author: Rob Herring rob.herring@calxeda.com Date: Fri Nov 8 08:40:43 2013 -0600
time: add weak annotation to timer_read_counter declaration A weak annotation is needed in order to prevent link errors when get_ticks is overridden. This fixes sandbox build. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
No. I tried both the current u-boot/master and commit 65ba7add0d, but Microblaze board failed with the same error message.
Look at this log - uboot section. http://www.monstr.eu/wiki/doku.php?id=log:2013-11-12_13_29_22
Which toolchain do you use?
Microblaze crosstools I use is available at: http://dev.gentoo.org/~vapier/u-boot/microblaze.tar.xz
Not sure if Mike maintains this toolchain.
Before commit 8dfafdde88eb, I could build the microblaze-generic board with it. But I can't build for the current u-boot/master.
You can use this one and follow Rob's comments. https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.8.0/
Thanks, Michal

Hello Michal
Which toolchain do you use?
Microblaze crosstools I use is available at: http://dev.gentoo.org/~vapier/u-boot/microblaze.tar.xz
Not sure if Mike maintains this toolchain.
Stefan Roses told me about this pre-built cross tool in a thread: http://u-boot.10912.n7.nabble.com/Suggestion-for-building-all-boards-td16528...
Accoding to this thread, it was built by Mike Frysinger.
Before commit 8dfafdde88eb, I could build the microblaze-generic board with it. But I can't build for the current u-boot/master.
You can use this one and follow Rob's comments. https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.8.0/
Worked for me. OK. Going forward I will use this. Thanks!
Best Regards Masahiro Yamada

On 11/18/2013 11:50 AM, Masahiro Yamada wrote:
Hello Michal
Which toolchain do you use?
Microblaze crosstools I use is available at: http://dev.gentoo.org/~vapier/u-boot/microblaze.tar.xz
Not sure if Mike maintains this toolchain.
Stefan Roses told me about this pre-built cross tool in a thread: http://u-boot.10912.n7.nabble.com/Suggestion-for-building-all-boards-td16528...
Accoding to this thread, it was built by Mike Frysinger.
Before commit 8dfafdde88eb, I could build the microblaze-generic board with it. But I can't build for the current u-boot/master.
You can use this one and follow Rob's comments. https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.8.0/
Worked for me. OK. Going forward I will use this. Thanks!
Great.
Thanks, Michal
participants (4)
-
Masahiro Yamada
-
Michal Simek
-
Rob Herring
-
Tom Rini