Subject: Re: Do we need new MACHINE_ARCH for Dreamcast?
To: None <bsh@grotto.iijnet.or.jp>
From: SAITOH Masanobu <masanobu@iij.ad.jp>
List: port-sh3
Date: 09/18/2000 18:23:59
 > + MACHINE_ARCH=sh3 is for big endian since evbsh3 and mmeye are big
 >   endian platform, while dreamcast is little endian.  We need new
 >   MACHINE_ARCH, say sh3el.  I don't fully understand how much work
 >   will be necessary for this, but at least we need to modify some
 >   makefiles in the tree.
 > 
 > + Do we want sh3eb when we have sh3el?

We have to split MACHNE_ARCH=sh3 into sh3eb and sh3el.
But, there is no problem so far (currently, it doesn't need to
modify MACHINE_ARCH to compile userland).

The reason of why I don't split it is:

	1) the difference of "eb" and "el" in evbsh3 is
	   include/endian_machdep.h only.

	2) I don't want to modify many Makefiles like:

		SUBDIR= ${MACHINE:C/evbsh3e[bl]/evbsh3/} (see below)
		.if ${MACHINE} != ${MACHINE_ARCH}
		ARCHSUBDIR= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/sh3e[bl]/sh3/}

And more, MACHINE (not MACHINE_ARCH) can split into evbsh3eb and evbsh3el,
too. Most evaluation board can select the byte order by DIP switch. We can
regard this difference as the same MACHINE because there is no physical
difference. But, there is some apropriate situation to distinct these boards
as differnt MACHINE (i.e. check MACHINE instead of MACHINE_ARCH).

To split MACHNE into evbsh3eb and evbsh3el


	Plan A)		split evbsh3 "directory" into evbsh3eb and evbsh3el.
			

			sh3/sh3
			   /conf
			   /include
			evbsh3eb/evbsh3eb
				/conf
				/include
			evbsh3el/evbsh3el	null
				/conf		config file for little
				/include	refer evbsh3eb/include* except
						endian_machdep.h

	Plan B)		use "SUBDIR= ${MACHINE:C/evbsh3e[bl]/evbsh3/}"

			sh3/sh3
			   /conf
			   /include
			evbsh3/evbsh3
				/conf
				/include	how to solve endian_machdep.h?


	Plan C)		I don't know.

Current endian_machdep.h contains:

	#if 1
	#define _BYTE_ORDER _BIG_ENDIAN
	#else
	#define _BYTE_ORDER _LITTLE_ENDIAN
	#endif
	#include <sh3/endian_machdep.h>

For little endian we have to edit this #ifdef by hand before
compilng kernel AND "make includes". Plan A solves this problem.

I prefer Plan B to Plan A. I want to choice Plan B if we can generate
endian_machdep.h by:

		config(8) or make depend under compile/*/

		make includes


 > + Is it OK to set MACHINE_ARCH=sh3el and MACHINE=evbsh3 for dreamcast,
 >   and MACHINE_ARCH=sh3 MACHINE=evbsh3 for evbsh3? It looks bad.
 >   We need MACHINE=dreamcast.

By the way, we are planning re-integrate arch/mmeye into arch/evbsh3
to reduce maintenance work and for mmEye2(SH4)
(the arch/mmeye directory will be retained).


 > saitoh-san already showed us).  My next step will be to put ram disk
 > image into kernel and try some userland programs from serial console.

 Please refer distrib/evbsh3/rom/ramdisk*/
 (This is example)


 If you enounted may "Abort trap" in usermode, disable cache (this is a bug).

--------- locore.S -----------------
#ifdef SH4
#if 1
XL_CCRVAL:      .long   0x0909 /* Operand cache ON */
#else
XL_CCRVAL:      .long   0x0000 /* cache OFF */
#endif
--------- locore.S -----------------


----------------------------------------------------------
		SAITOH Masanobu (masanobu@iij.ad.jp
				  msaitoh@netbsd.org)