Subject: SCSI address and chipset
To: None <port-macppc@netbsd.org>
From: Grant Stockly <gussie@stockly.com>
List: port-macppc
Date: 07/15/1999 17:12:49
Is there a way to find the base address of a SCSI controller by using the
MacToolbox?

When sending or receiving SCSI data from MacToolbox, can you accomplish low
level access?

Is there a list somewhere that lists all ppc machines, the SCSI controller
used, and the base addresses it resides at?

I'm building the beginning of a NetBSD driver and have started to collect
information about all NetBSD compatible computers that have SCSI ports.


I'll have to look at the scsi source in the kernel to see if I need to
issue low level SCSI commands.  Some newer cards don't like doing that.  If
the card is NCR 5380 compatible, then it will support Target mode (the mode
required by the serial port controller).

This code will open a 'connection' with the NCR5380 on 68k macs with A0
being the base address, D1 containing the ID of the serial device, and DO
containing the exit status.

I'd like to do this on ppc macs too.

scsi_select:
	move.b	#0x0,WrTargCmd(A0)
	move.b	#0x40,WrMode(A0)
	btst.b	#6,RdStatus(A0)
	beq	@busfree
	move.w	#1,D0
 	bra	@restore_scsi
busfree:
	move.b	#0x0,WrTargCmd(A0)
	move.b	#0x1,WrInitCmd(A0)
	move.b	D1,WrData(A0)
	move.b	#0x5,WrInitCmd(A0)
	move.w	#10,D0
select_lp:
	btst.b	#6,RdStatus(A0)
	bne	@selected
	dbra	D0,@select_lp
timeout:
	move.w	#2,D0
	bra	@restore_scsi
selected:
	move.b	#0x0,WrInitCmd(A0)
	rts
restore_scsi:
	move.b	#0x0,WrInitCmd(A0)
	move.b	#0x0,WrMode(A0)
	move.b	#0x7,WrTargCmd(A0)
	move.b	#0x0,WrData(A0)
	rts


Thanks,
Grant
48656C6C6F21