Subject: Newbie Questions
To: None <port-mips@netbsd.org>
From: Varadarajan Narayanan <1978nv@gmail.com>
List: port-mips
Date: 02/21/2007 15:39:55
Hello All,

I've been trying to bring up NetBSD 3.1 on a MIPS 24Kc based
board, and running into issues.  I'm new to both NetBSD and
MIPS.  Kindly help with suggestions, pointers to documents
etc.  Any suggestions would be very valuable to me.

I've been able to boot NetBSD on that board along with a
ramdisk filesystem.  However, I'm not sure of the caching
mode that has to be set on the Config CP0 register.

Per the documentation, the different caching modes are
0 - Cacheable, noncoherent, write-through, no write allocate
2 - Uncached
3 - Cacheable, noncoherent, write-back, write allocate
7 - Uncached Accelerated
1,4,5,6 - reserved.

Issue 1
-------
If i set the value to mode 3, the kernel hangs before showing
the shell prompt.  Not able to figure what is going on.  I'm not
sure if it is unable to spawn init or the shell.

Issue 2
-------
If i set the value to mode 0, the kernel is able to spawn the
shell and everything seems fine.  However, when i run the
following script, it panics in a few minutes.
	________________
	while :
	do
		date
		ls -liR /
	done
	----------------
This runs for sometime and then causes the following Machine Check.
____________________________________________________
trap: mipsNN machine check in kernel mode
status=0x206003, cause=0x160, epc=0x80154f5c, vaddr=0xc0029445
pid=1034 cmd=sh usp=0x7fffd968 ksp=0xc668fd58
____________________________________________________

The exception PC always points to "tlbwi" instruction.

Issue 3
-------
By setting it to mode 2 (i.e. uncached), the kernel is not able to figure
the cpu id!!.  It panics as follows

	panic: CPU type (0xffffffff) not supported

Issue 4
-------
This processor has data cache aliasing, with 4K page size.
Is this setup supported in netbsd?

----------
Not sure if this matters.  I've defined COP0_SYNC as follows
	.set push;			\
	.set arch=mips32r2;	\
	ehb;				\
	sync;				\
	.set pop;			\


I'm clueless on how to proceed.  Kindly advice on how the cache
should be configured, and what all could I be missing?  Are there
additional routines that I have to implement.

What is the best cache mode for this MIPS processor?

Thanks.  Sorry about the long e-mail.

Sincerely
Varada