public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Query on CONFIG_SYS_THUMB_BUILD
@ 2014-11-13 16:29 Victor Ascroft
  2014-11-13 20:53 ` Wolfgang Denk
  2014-11-14 14:01 ` Simon Glass
  0 siblings, 2 replies; 27+ messages in thread
From: Victor Ascroft @ 2014-11-13 16:29 UTC (permalink / raw)
  To: u-boot

Hello,

I am working with a Cortex A5 Freescale Vybrid Processor. Since a thumb build leads to a saving of almost 1 MB for my u-boot image and consequently to faster serial downloads I have been looking at this. Currently enabling this option leads to a hang. 

After some debugging I have narrowed the place of hang to "ldr pc, =board_init_r" in arch/arm/lib/crt0.S. My debugging procedure was to put a branch to a small function which just printed a small message with puts, just before the ldr instruction and then a printing a small message with puts just at the start of board_init_r in common/board_r.c . For a non thumb build, the two messages get printed and I can boot to the u-boot prompt. For a thumb build, only the first message before the ldr instruction gets printed. 

In crt0.S
bl debug_print
ldr pc, =board_init_r

In board_init_r
puts("In board_init_r\n"); // Right at start

void debug_print(void)
{
    // Defined in board file
    puts("Debug print\n");
}

My assembly knowledge is limited and after some consultation with a senior colleague, he told me things to check.

An object dump of the crt0.o shows a branch to an even address. For thumb, this is expected to be odd. To just try out, I did a change as below
ldr r3, =board_init_r
add r3, #1
bx r3

No change with this. My expectation was the compiler/linker/assembler would take care of the requirements, with the CONFIG_SYS_THUMB_BUILD. Frankly speaking I am not sure if this is the complete issue or only a part of it. I have seen patches with regards to OMAP send in by Aneesh V, which made changes of the form .type fn_name, %function to all the low level assembly functions, but, I couldn't dig up much more or variants thereof. Basically, from what I understand, this takes care of specifying .thumb_func for a thumb function or so to speak.

Any pointers?

Thanks & Regards,
Sanchayan Maity.  

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2014-11-21 12:22 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-13 16:29 [U-Boot] Query on CONFIG_SYS_THUMB_BUILD Victor Ascroft
2014-11-13 20:53 ` Wolfgang Denk
2014-11-14  4:30   ` Victor Ascroft
2014-11-14  5:43     ` Wolfgang Denk
2014-11-14  6:10       ` Victor Ascroft
2014-11-14 14:01 ` Simon Glass
2014-11-14 15:26   ` Albert ARIBAUD
2014-11-15  1:56     ` Simon Glass
2014-11-15  5:26       ` Victor Ascroft
2014-11-15  5:38         ` Victor Ascroft
2014-11-15 12:30       ` Albert ARIBAUD
2014-11-15 22:10         ` Simon Glass
2014-11-16  7:50           ` Albert ARIBAUD
2014-11-17  6:28             ` Simon Glass
2014-11-18  3:32               ` Victor Ascroft
2014-11-18  4:59                 ` Simon Glass
2014-11-18 12:10   ` Stefan Agner
2014-11-18 16:07   ` Stefan Agner
2014-11-18 18:37     ` Stefan Agner
2014-11-19  6:42       ` Albert ARIBAUD
2014-11-19  6:58         ` Wolfgang Denk
2014-11-19 16:31           ` Bill Pringlemeir
2014-11-19 17:48             ` Albert ARIBAUD
2014-11-19 18:34               ` Bill Pringlemeir
2014-11-20 12:04                 ` Albert ARIBAUD
2014-11-20 16:34                   ` Bill Pringlemeir
2014-11-21 12:22                     ` Albert ARIBAUD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox