[U-Boot] OMAP3/devkit8000 division/multiplication function problems
Simon Schwarz
simonschwarzcor at googlemail.com
Wed Jun 15 10:55:51 CEST 2011
Hi Graeme,
Setting r8 to gd was the solution. I now set it right before the first
access to gd then it works like a charm:
asm("ldr r8, [%[value]]"::[value] "r" (&gd):"r8"); /* Set r8 to gd */
Thanks for your help!
Simon
2011/6/14 Simon Schwarz <simonschwarzcor at googlemail.com>:
> Ok. It seems I (or more precise a college) have a possible solution.
>
> From the assembly one can see that r8 is used with a total ridiculus
> value - and on ARM r8 is used to point to gd - tada.
>
> I will test that and report back.
>
> Regards
> Simon
>
> 2011/6/14 Simon Schwarz <simonschwarzcor at googlemail.com>:
>> Hi again,
>>
>> seems that there is a problem with gd - at least your test breaks...
>>
>> I added unsigned long temp at the end of gd.
>>
>> And added
>> unsigned long a=0;
>> a=gd->temp;
>> gd->temp = 4;
>>
>> to calc_divisor
>>
>> Here is a part of the debugging session:
>> Breakpoint 1, calc_divisor (port=<optimized out>) at serial.c:171
>> 171 a = gd->temp;
>> (gdb) p/x a
>> $1 = 0x0
>> (gdb) s
>> ^C
>> Program received signal SIGINT, Interrupt.
>> 0x00014010 in ?? ()
>>
>> had to use Strg+C to get back a gdb prompt.
>>
>> But if do: p *gd
>> The output seems to be ok (for this stage of the SPL):
>> $3 = {bd = 0x40203df0, flags = 1, baudrate = 115200, have_console = 0,
>> env_addr = 0, env_valid = 0, fb_base = 0, timer_rate_hz = 0, tbl = 0,
>> tbu = 0, timer_reset_value = 0, lastinc = 0, relocaddr = 0, ram_size =
>> 0, mon_len = 0, irq_sp = 0, start_addr_sp = 0, reloc_off = 0, tlb_addr
>> = 0, jt = 0x0, env_buf = '\000' <repeats 31 times>, temp = 0}
>>
>> Ideas? A Problem with the linker script maybe?
>>
>> Regards
>> Simon
>>
>
More information about the U-Boot
mailing list