<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.17.92">
</HEAD>
<BODY>
Hi Shinya,<BR>
<BR>
I found the error... but it's not an u-boot issue. I'm using a (old) customized linux 2.6.10 (from my vendor) that also adds the 0xa0000000 offset to the pointers passed by u-boot, assuming that address is expressed in termos of physical address. I corrected the linux code masking and (after) addind the segment.<BR>
<BR>
Thanks a lot for your help.<BR>
<BR>
<BR>
luigi<BR>
<BR>
<BR>
On sab, 2008-02-16 at 18:06 +0900, Shinya Kuribayashi wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Shinya Kuribayashi wrote:
> Shinya Kuribayashi wrote:
>>> I think that on my application the UNCACHED_SDRAM should map the address
>>> on KSEG1 (how it is now) but this simply doesn't work. Instead, using
>>> the PHYSADDR(a) macro... the kernel is able to start.
>>>
>>> I suspect that there are issues on cache management. Can be?
>> IMHO it's not related to cache.
>
> How do you set ERL and EXL bits? Please try to clear them at the
> STATUS register initialization like:
>
> reset:
> <snip>
>
> /* STATUS register */
> mfc0 k0, CP0_STATUS
> - li k1, ~ST0_IE
> + li k1, ~(ST0_ERL | ST0_EXL | ST0_IE)
> and k0, k1
> mtc0 k0, CP0_STATUS
>
> ERL and EXL disable exceptions. Due to this spec, we are in danger
> of overlooking something critical. If this change brings in new
> exception(s), please fix the causes of them first. Hope this helps.
Err, sorry for confusing example. Here's the right one:
diff --git a/cpu/mips/start.S b/cpu/mips/start.S
index c92b162..02797f7 100644
--- a/cpu/mips/start.S
+++ b/cpu/mips/start.S
@@ -211,14 +211,20 @@ reset:
        mtc0        zero, CP0_WATCHLO
        mtc0        zero, CP0_WATCHHI
+        /* Inhibit deffered WATCH exception */
+        mfc0        k0, CP0_CAUSE
+        li        k1, ~(1UL << 22)        # CP0.Cause.WP = 0
+        and k0, k0, k1
+        mtc0        k0, CP0_CAUSE
+
        /* STATUS register */
#ifdef CONFIG_TB0229
        li        k0, ST0_CU0
#else
        mfc0        k0, CP0_STATUS
#endif
-        li        k1, ~ST0_IE
-        and        k0, k1
+        ori        k0, (ST0_ERL | ST0_EXL | ST0_IE)
+        xori        k0, (ST0_ERL | ST0_EXL)
        mtc0        k0, CP0_STATUS
        /* CAUSE register */
Again, it's highy recommended to make sure U-Boot works fine under
interrupts enabled (CP0.Status.IE=1), before digging into UNCACHED_
SDRAM problem.
Shinya
</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<TABLE CELLSPACING="14">
<TR>
<TD>
<A HREF="http://www.idf-hit.com"><IMG SRC="cid:1204186493.21855.0.camel@localhost" ALIGN="bottom" ALT="Industrie Dial Face S.p.A." BORDER="0"></A>
</TD>
<TD>
<B>Luigi Mantellini</B><BR>
R&D - Software<BR>
<TT>Industrie Dial Face S.p.A.</TT><BR>
<TT>Via Canzo, 4 </TT><BR>
<TT>20068 Peschiera Borromeo (MI), Italy</TT><BR>
<TT>Tel.: +39 02 5167 2813</TT><BR>
<TT>Fax: +39 02 5167 2459</TT><BR>
<TT>E-mail: <A HREF="mailto:luigi.mantellini@idf-hit.com">luigi.mantellini@idf-hit.com</A></TT><BR>
<TT>GPG fingerprint: 3DD1 7B71 FBDF 6376 1B4A</TT><BR>
<TT> B003 175F E979 907E 1650</TT>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>