Subject: Re: [PATCH] MIPS: Allocate exception vector on 64 KiB boundary

From: Maxime Bizon <[email-masked]>
Date: Fri, 13 Feb 2009 14:44:00 +0100

On Fri, 2009-01-30 at 13:43 -0500, David VomLehn (dvomlehn) wrote:

> Fix problem with code that incorrectly modifies ebase.
> 
> Commit 566f74f6b2f8b85d5b8d6caaf97e5672cecd3e3e had a change that
> incorrectly
> modified ebase. This backs out the lines that modified ebase and then
> modified

I confirm this commit prevents my 4kec board from booting.

My c0_ebase is set to 0x90000000.

In trap_init() ebase is first set to CAC_BASE => 0x80000000, then
0x90000000 after adding c0_ebase offset.

set_uncached_handler() starts with uncached_ebase sets to
KSEG1ADDR(ebase) => 0xb0000000, which is already the correct value, but
it then add the c0_ebase offset again => 0xc0000000 => boom.

-- 
Maxime

---

From: "David VomLehn (dvomlehn)" <[email-masked]>
Date: Fri, 13 Feb 2009 13:41:52 -0500

> From: Maxime Bizon [mailto:[email-masked]] 
> Sent: Friday, February 13, 2009 5:44 AM
> To: David VomLehn (dvomlehn)
> Cc: [email-masked]; [email-masked]; David Daney
> Subject: Re: [PATCH] MIPS: Allocate exception vector on 64 
> KiB boundary
> 
> 

Can you confirm that the patch fixes your problem?

---

From: Maxime Bizon <[email-masked]>
Date: Fri, 13 Feb 2009 20:49:47 +0100

> Can you confirm that the patch fixes your problem?

Your patch does not apply anymore, this patch has been merged since:

@@ -1593,7 +1597,7 @@ void __cpuinit set_uncached_handler(unsigned long offset, void *addr,
 	unsigned long uncached_ebase = TO_UNCAC(ebase);
 #endif
 	if (cpu_has_mips_r2)
-		ebase += (read_c0_ebase() & 0x3ffff000);
+		uncached_ebase += (read_c0_ebase() & 0x3ffff000);
 
 	if (!addr)
 		panic(panic_null_cerr);

I just removed the whole test to fix my problem.

-- 
Maxime