[U-Boot] Slow standalone routine with U-Boot

Lennart Sundberg lennartsundberg.ls at gmail.com
Fri Dec 17 18:33:33 CET 2010


Dear Sirs,


 I am trying to implement a memory and CPU demanding standalone application
on the beagleboard by hacking U-Boot.


 To my surprise, the U-Boot program is ten times slower than the same
program running under Linux on the beagleboard.


 This test loop when inserted in u-boot/common/main.c.main_loop takes 8.9 s
with caches enabled and 10.1 s with caches disabled:


 Unsigned long *p;

long i, error;

p = 0x81000000;

printf("filling:\n");

for (i = 0; i < 25000000; i++) *(p+i) = i;

printf("testing:\n");

error = 0;

for (i = 0; i < 25000000; i++)

{

if (*(p+i) != i)

{

error = i+1;

break;

}

}

printf("error=%ld\n",error);


 The same loop (with p = malloc( 25000000 * 4) takes less than a second on
Angstrom Linux on the beagleboard.


 The routine cpy_clk_code in lowlevel_init.S that copies the go_to_speed
routine to SRAM is executed at start-up but the go_to_speed code apparently
never gets executed. I have verified this by inserting hang loops in
cpy_clk_code() and go_to_speed().


 Beagleboard version = C4


 U-Boot version = u-boot-2010.09


More information about the U-Boot mailing list