Subject: Re: really stupid newbie needs lots of help
To: None <ur@a-r.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-arc
Date: 02/22/2001 23:32:02
In <873dde5voi.wl@alicia.a-r.org>
ur@a-r.org wrote:

> At Fri, 16 Feb 2001 08:56:02 -0800,
> bob meader wrote:
> > I am wondering could I get you tar up your source eithor the
> > full 'sys' directory or just the driver itself  ? Right now I am
> > working on a ncr700 driver but if you have one that already
> > works, it will be quicker to modify it to work on 2200.
> 
> I've put diffs to current here:
> 	http://www.a-r.org/~ur/arcdiff0216.gz

Now I've checked this and have some comments again :-)

1) I know there are a lot of work to make this really MI, but
   it is still better to split this driver into attachment and core
   like sys/arch/mvme68k/dev/{ncrsc_pcctwo,siop}.c .

2) You said it was difficult to share the script between 700 and 710,
   but is it possible to share other part? If it is, `osiop' is
   the best name for this device.

3) There are some htole32()/le32toh() macros in arcsiop.c,
   but current amiga and mvme68k siop.c have no byteswap instructions.
   It looks data bus of the devices on these 68k ports are hardwired
   in "swapped" order, or lower 2 bit of address bus are reversed.

The register offsets defined in arcsiopreg.h are:

#define	SIOP_SCNTL0	0x00	/* rw: SCSI control reg 0 */
#define	SIOP_SCNTL1	0x01	/* rw: SCSI control reg 1 */
#define	SIOP_SDID	0x02	/* rw: SCSI destination ID */
#define	SIOP_SIEN	0x03	/* rw: SCSI interrupt enable */

but in sys/arch/amiga/siopreg.h, they are:

/*00*/  volatile unsigned char  siop_sien;	/* rw: SCSI Interrupt Enable */
/*01*/  volatile unsigned char  siop_sdid;	/* rw: SCSI Destination ID */
/*02*/  volatile unsigned char  siop_scntl1;	/* rw: SCSI control reg 1 */
/*03*/  volatile unsigned char  siop_scntl0;	/* rw: SCSI control reg 0 */

Anyway, we need re-think how to handle these endianness. Umm..

Maybe amiga and mvme68k require more complecated bus_space(9)
structures in the perfect world ;-)
---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp