Subject: Re: MIPS3_FLUSH error message
To: None <port-pmax@netbsd.org>
From: Michael L. Hitch <mhitch@lightning.oscs.montana.edu>
List: port-mips
Date: 10/04/1998 11:30:33
On Oct  4,  7:51pm, Simon Burge wrote:
> I just tried to build a GENERIC kernel from the weekend -current
> tarballs and came across a problem with the new mips_L2CachePresent
> check in mips/mips/mips_machdep.c.  I got the following error when I
> booted my /240:
> 
> 	cpu0 at mainbus0: MIPS R3000 CPU Rev. 3.0 with MIPS R3010 FPC Rev. 4.0
> 		L1 cache: 64kb/0b Instruction, 64kb/0b Data. Direct mapped.
> 		No L2 cache.
> 	This kernel doesn't work without L2 cache.
> 	Please add "options MIPS3_FLUSH"to the kernel config file.
> 	halted.
> 
> The R3000 is only a MIPS1 CPU, however the check for mips_L2CachePresent
> is in a section of code that is "#ifdef MIPS3", but not checking if we
> are on a MIPS3-type CPU.  It looks like I can just add an options line
> to the kernel config, but I think the test should be changed as well.
> One thing that's not clear is if the check L2 cache check is only for
> MIPS3 CPUs or all CPUs.  If it's for all CPUs, then the option to fix
> it should not start with MIPS3_.
> 
> Whatever the correct solution is, I believe I should be able to build a
> GENERIC kernel and boot it on any machine...

  I had the same problem last night when I tried to boot a new kernel on
the 5000/25 I have at home.  Below is my solution.  [As I was heading
up to my office this morning to see why the 3100 didn't reboot when I
tried to boot a new kernel, I realized that it probably had the same
problem.  Sure enough, that's what happened!]

Michsel

*** sys/arch/mips/mips/mips_machdep.c.orig	Sat Oct  3 05:13:03 1998
--- sys/arch/mips/mips/mips_machdep.c	Sat Oct  3 23:22:15 1998
***************
*** 668,674 ****
  	 * but printf() doesn't work in it.
  	 */
  #if !defined(MIPS3_FLUSH)
! 	if (!mips_L2CachePresent) {
  		printf("This kernel doesn't work without L2 cache.\n"
  		    "Please add \"options MIPS3_FLUSH\""
  		    "to the kernel config file.\n");
--- 668,674 ----
  	 * but printf() doesn't work in it.
  	 */
  #if !defined(MIPS3_FLUSH)
! 	if (CPUISMIPS3 && !mips_L2CachePresent) {
  		printf("This kernel doesn't work without L2 cache.\n"
  		    "Please add \"options MIPS3_FLUSH\""
  		    "to the kernel config file.\n");


-- 
Michael L. Hitch			mhitch@montana.edu
Computer Consultant
Information Technology Center
Montana State University	Bozeman, MT	USA