public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] MIPS cache management (and build) questions.
Date: Thu, 13 Sep 2007 18:54:34 +0900	[thread overview]
Message-ID: <46E908DA.4080001@necel.com> (raw)
In-Reply-To: <760873.90830.qm@web54005.mail.re2.yahoo.com>

Hi Paul,

Paul Marciano wrote:
> 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.

Nice. I'd like to see that.

> 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.

I've also fixed and the patch checked in. Please try 1.3.0-rc1.

> 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.

Hope this helps. Sorry for no description. I have to be add later...


Thanks,

    Shinya Kuribayashi

---

 common/cmd_elf.c             |    2 ++
 include/asm-mips/addrspace.h |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/common/cmd_elf.c b/common/cmd_elf.c
index 63a5593..f1057d4 100644
--- a/common/cmd_elf.c
+++ b/common/cmd_elf.c
@@ -55,12 +55,14 @@ int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 	printf ("## Starting application at 0x%08lx ...\n", addr);
 
+#if 0
 	/*
 	 * QNX images require the data cache is disabled.
 	 * Data cache is already flushed, so just turn it off.
 	 */
 	if (dcache_status ())
 		dcache_disable ();
+#endif
 
 	/*
 	 * pass address parameter as argv[0] (aka command name),
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h
index 90e8840..bfdc06f 100644
--- a/include/asm-mips/addrspace.h
+++ b/include/asm-mips/addrspace.h
@@ -49,7 +49,7 @@
    cannot access physical memory directly from core */
 #define UNCACHED_SDRAM(a) (((unsigned long)(a)) | 0x20000000)
 #else	/* !CONFIG_AU1X00 */
-#define UNCACHED_SDRAM(a) PHYSADDR(a)
+#define UNCACHED_SDRAM(a) KSEG1ADDR(a)
 #endif	/* CONFIG_AU1X00 */
 #endif	/* __ASSEMBLY__ */
 /*

      parent reply	other threads:[~2007-09-13  9:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-13  7:26 [U-Boot-Users] MIPS cache management (and build) questions Paul Marciano
2007-09-13  7:38 ` Stefan Roese
2007-09-13  9:54 ` Shinya Kuribayashi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46E908DA.4080001@necel.com \
    --to=shinya.kuribayashi@necel.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox