[U-Boot-Users] MIPS cache management (and build) questions.

Paul Marciano pm940 at yahoo.com
Thu Sep 13 09:26:27 CEST 2007


Hi,

I'm working on bringing U-Boot 1.2.0 up on a MIPS 24Kc
core (MIPS32R2).  It has gone relatively smoothly -
with a couple of hiccups that I want to point out here
in case I'm missing something.

1. I needed to gdb through the code, so I turned off
-Os, and the build failed with strcmp and friends
missing.  It seems that the MIPS port in-lines them
with -Os but omits them completely without it.  Adding
'C' versions of the functions fixed that.

2. I'm using do_bootelf() to invoke my image.  The
lines:
    addr = load_elf_image(addr);
    ...
    if (dcache_status())
        dcache_disable();
    ...
    (function call through addr)

The comment embedded in the code says the dcache is
flushed already, but in cpu/mips/cpu.c, the function
flush_cache() is empty so the dcache isn't flushed.

As it's not flushed, and dcache_disable() just turns
it off, if the run address is somewhere that hasn't
naturally spilled out of the dcache during the load,
the CPU will fetch garbage.

Also, as the 'addr' variable is now on the stack (in a
non-optimized compile), that variable pops out of
existence and jumping through it shoots the processor
off into the weeds.


Perhaps I'm just very green and am missing something
here.  Does MIPS get no love, or am I missing
something fundamental?

Can someone please clue me in?

Thanks,
Paul.



       
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433




More information about the U-Boot mailing list