1997-06-27 19:38:56 +00:00
|
|
|
/*
|
|
|
|
* Adaptec 274x/284x/294x device driver firmware for Linux and FreeBSD.
|
1996-01-03 06:25:32 +00:00
|
|
|
*
|
2000-01-07 23:08:20 +00:00
|
|
|
* Copyright (c) 1994-2000 Justin Gibbs.
|
1997-06-27 19:38:56 +00:00
|
|
|
* All rights reserved.
|
1996-01-03 06:25:32 +00:00
|
|
|
*
|
1997-06-27 19:38:56 +00:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions, and the following disclaimer,
|
1999-12-06 18:23:31 +00:00
|
|
|
* without modification.
|
1998-09-15 07:24:17 +00:00
|
|
|
* 2. The name of the author may not be used to endorse or promote products
|
1997-06-27 19:38:56 +00:00
|
|
|
* derived from this software without specific prior written permission.
|
1996-01-03 06:25:32 +00:00
|
|
|
*
|
1999-12-06 18:23:31 +00:00
|
|
|
* Alternatively, this software may be distributed under the terms of the
|
2000-07-18 20:12:14 +00:00
|
|
|
* GNU Public License ("GPL").
|
1996-01-03 06:25:32 +00:00
|
|
|
*
|
1997-06-27 19:38:56 +00:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
|
|
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
1997-04-04 19:35:30 +00:00
|
|
|
*
|
1999-08-28 01:08:13 +00:00
|
|
|
* $FreeBSD$
|
1997-06-27 19:38:56 +00:00
|
|
|
*/
|
1996-01-03 06:25:32 +00:00
|
|
|
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
#include <dev/aic7xxx/aic7xxx.reg>
|
1998-09-15 07:24:17 +00:00
|
|
|
#include <cam/scsi/scsi_message.h>
|
1996-01-03 06:25:32 +00:00
|
|
|
|
1996-10-25 06:34:59 +00:00
|
|
|
/*
|
|
|
|
* A few words on the waiting SCB list:
|
|
|
|
* After starting the selection hardware, we check for reconnecting targets
|
1996-01-29 03:12:06 +00:00
|
|
|
* as well as for our selection to complete just in case the reselection wins
|
|
|
|
* bus arbitration. The problem with this is that we must keep track of the
|
|
|
|
* SCB that we've already pulled from the QINFIFO and started the selection
|
|
|
|
* on just in case the reselection wins so that we can retry the selection at
|
|
|
|
* a later time. This problem cannot be resolved by holding a single entry
|
|
|
|
* in scratch ram since a reconnecting target can request sense and this will
|
|
|
|
* create yet another SCB waiting for selection. The solution used here is to
|
|
|
|
* use byte 27 of the SCB as a psuedo-next pointer and to thread a list
|
1996-10-25 06:34:59 +00:00
|
|
|
* of SCBs that are awaiting selection. Since 0-0xfe are valid SCB indexes,
|
|
|
|
* SCB_LIST_NULL is 0xff which is out of range. An entry is also added to
|
|
|
|
* this list everytime a request sense occurs or after completing a non-tagged
|
|
|
|
* command for which a second SCB has been queued. The sequencer will
|
|
|
|
* automatically consume the entries.
|
1996-01-03 06:25:32 +00:00
|
|
|
*/
|
|
|
|
|
1996-03-10 07:02:32 +00:00
|
|
|
reset:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
clr SCSISIGO; /* De-assert BSY */
|
2000-02-09 21:25:00 +00:00
|
|
|
mvi MSG_OUT, MSG_NOOP; /* No message to send */
|
1998-12-10 04:14:50 +00:00
|
|
|
and SXFRCTL1, ~BITBUCKET;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
/* Always allow reselection */
|
1998-12-15 08:22:42 +00:00
|
|
|
and SCSISEQ, ENSELI|ENRSELI|ENAUTOATNP, SCSISEQ_TEMPLATE;
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
/* Ensure that no DMA operations are in progress */
|
|
|
|
clr CCSGCTL;
|
|
|
|
clr CCSCBCTL;
|
|
|
|
}
|
|
|
|
|
1995-04-27 17:44:27 +00:00
|
|
|
poll_for_work:
|
1999-03-05 23:35:48 +00:00
|
|
|
call clear_target_state;
|
1998-09-15 07:24:17 +00:00
|
|
|
and SXFRCTL0, ~SPIOEN;
|
|
|
|
if ((ahc->features & AHC_QUEUE_REGS) == 0) {
|
|
|
|
mov A, QINPOS;
|
|
|
|
}
|
|
|
|
poll_for_work_loop:
|
|
|
|
test SSTAT0, SELDO|SELDI jnz selection;
|
2000-03-18 22:28:20 +00:00
|
|
|
test SCSISEQ, ENSELO jnz poll_for_work_loop;
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->features & AHC_TWIN) != 0) {
|
|
|
|
/*
|
|
|
|
* Twin channel devices cannot handle things like SELTO
|
|
|
|
* interrupts on the "background" channel. So, if we
|
|
|
|
* are selecting, keep polling the current channel util
|
|
|
|
* either a selection or reselection occurs.
|
|
|
|
*/
|
|
|
|
xor SBLKCTL,SELBUSB; /* Toggle to the other bus */
|
|
|
|
test SSTAT0, SELDO|SELDI jnz selection;
|
2000-07-18 20:12:14 +00:00
|
|
|
test SCSISEQ, ENSELO jnz poll_for_work_loop;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
cmp WAITING_SCBH,SCB_LIST_NULL jne start_waiting;
|
1996-10-25 06:34:59 +00:00
|
|
|
test_queue:
|
|
|
|
/* Has the driver posted any work for us? */
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->features & AHC_QUEUE_REGS) != 0) {
|
|
|
|
test QOFF_CTLSTA, SCB_AVAIL jz poll_for_work_loop;
|
|
|
|
mov NONE, SNSCB_QOFF;
|
|
|
|
inc QINPOS;
|
|
|
|
} else {
|
|
|
|
cmp KERNEL_QINPOS, A je poll_for_work_loop;
|
|
|
|
inc QINPOS;
|
|
|
|
}
|
1996-01-03 06:25:32 +00:00
|
|
|
|
2000-07-18 20:12:14 +00:00
|
|
|
/*
|
|
|
|
* We have at least one queued SCB now and we don't have any
|
|
|
|
* SCBs in the list of SCBs awaiting selection. Pull the tag
|
|
|
|
* from the QINFIFO and get to work on it.
|
|
|
|
*/
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->flags & AHC_PAGESCBS) != 0) {
|
|
|
|
mov ALLZEROS call get_free_or_disc_scb;
|
|
|
|
}
|
|
|
|
|
1996-10-25 06:34:59 +00:00
|
|
|
dequeue_scb:
|
1998-09-15 07:24:17 +00:00
|
|
|
add A, -1, QINPOS;
|
|
|
|
mvi QINFIFO_OFFSET call fetch_byte;
|
|
|
|
|
|
|
|
if ((ahc->flags & AHC_PAGESCBS) == 0) {
|
|
|
|
/* In the non-paging case, the SCBID == hardware SCB index */
|
|
|
|
mov SCBPTR, RETURN_2;
|
|
|
|
}
|
1996-10-25 06:34:59 +00:00
|
|
|
dma_queued_scb:
|
2000-07-18 20:12:14 +00:00
|
|
|
/*
|
|
|
|
* DMA the SCB from host ram into the current SCB location.
|
|
|
|
*/
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mvi DMAPARAMS, HDMAEN|DIRECTION|FIFORESET;
|
1998-09-15 07:24:17 +00:00
|
|
|
mov RETURN_2 call dma_scb;
|
1994-11-17 20:19:10 +00:00
|
|
|
|
1994-12-31 19:26:54 +00:00
|
|
|
start_scb:
|
1996-10-25 06:34:59 +00:00
|
|
|
/*
|
|
|
|
* Place us on the waiting list in case our selection
|
|
|
|
* doesn't win during bus arbitration.
|
|
|
|
*/
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov SCB_NEXT,WAITING_SCBH;
|
|
|
|
mov WAITING_SCBH, SCBPTR;
|
|
|
|
start_waiting:
|
|
|
|
/*
|
2000-07-18 20:12:14 +00:00
|
|
|
* Start the first entry on the waiting SCB list.
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
*/
|
|
|
|
mov SCBPTR, WAITING_SCBH;
|
|
|
|
call start_selection;
|
|
|
|
jmp poll_for_work;
|
1996-01-03 06:25:32 +00:00
|
|
|
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
start_selection:
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->features & AHC_TWIN) != 0) {
|
|
|
|
and SINDEX,~SELBUSB,SBLKCTL;/* Clear channel select bit */
|
2000-07-18 20:12:14 +00:00
|
|
|
test SCB_SCSIID, TWIN_CHNLB jz . + 2;
|
|
|
|
or SINDEX, SELBUSB;
|
1998-09-15 07:24:17 +00:00
|
|
|
mov SBLKCTL,SINDEX; /* select channel */
|
|
|
|
}
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
initialize_scsiid:
|
2000-07-18 20:12:14 +00:00
|
|
|
if ((ahc->features & AHC_ULTRA2) != 0) {
|
|
|
|
mov SCSIID_ULTRA2, SCB_SCSIID;
|
|
|
|
} else if ((ahc->features & AHC_TWIN) != 0) {
|
|
|
|
and SCSIID, TWIN_TID|OID, SCB_SCSIID;
|
|
|
|
} else {
|
|
|
|
mov SCSIID, SCB_SCSIID;
|
|
|
|
}
|
1999-03-05 23:35:48 +00:00
|
|
|
if ((ahc->flags & AHC_TARGETMODE) != 0) {
|
2000-07-18 20:12:14 +00:00
|
|
|
mov SINDEX, SCSISEQ_TEMPLATE;
|
|
|
|
test SCB_CONTROL, TARGET_SCB jz . + 2;
|
1999-03-05 23:35:48 +00:00
|
|
|
or SINDEX, TEMODE;
|
2000-07-18 20:12:14 +00:00
|
|
|
mov SCSISEQ, SINDEX ret;
|
1998-09-15 07:24:17 +00:00
|
|
|
} else {
|
2000-07-18 20:12:14 +00:00
|
|
|
mov SCSISEQ, SCSISEQ_TEMPLATE ret;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialize transfer settings and clear the SCSI channel.
|
|
|
|
* SINDEX should contain any additional bit's the client wants
|
|
|
|
* set in SXFRCTL0. We also assume that the current SCB is
|
|
|
|
* a valid SCB for the target we wish to talk to.
|
|
|
|
*/
|
|
|
|
initialize_channel:
|
|
|
|
or SXFRCTL0, CLRSTCNT|CLRCHN, SINDEX;
|
|
|
|
set_transfer_settings:
|
|
|
|
if ((ahc->features & AHC_ULTRA) != 0) {
|
|
|
|
test SCB_CONTROL, ULTRAENB jz . + 2;
|
|
|
|
or SXFRCTL0, FAST20;
|
|
|
|
}
|
2000-07-18 20:12:14 +00:00
|
|
|
/*
|
|
|
|
* Initialize SCSIRATE with the appropriate value for this target.
|
|
|
|
*/
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->features & AHC_ULTRA2) != 0) {
|
|
|
|
bmov SCSIRATE, SCB_SCSIRATE, 2 ret;
|
|
|
|
} else {
|
|
|
|
mov SCSIRATE, SCB_SCSIRATE ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
selection:
|
2000-07-18 20:12:14 +00:00
|
|
|
/*
|
|
|
|
* We aren't expecting a bus free, so interrupt
|
|
|
|
* the kernel driver if it happens.
|
|
|
|
*/
|
|
|
|
mvi CLRSINT1,CLRBUSFREE;
|
|
|
|
or SIMODE1, ENBUSFREE;
|
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
test SSTAT0,SELDO jnz select_out;
|
|
|
|
mvi CLRSINT0, CLRSELDI;
|
|
|
|
select_in:
|
|
|
|
if ((ahc->flags & AHC_TARGETMODE) != 0) {
|
1998-12-10 04:14:50 +00:00
|
|
|
if ((ahc->flags & AHC_INITIATORMODE) != 0) {
|
|
|
|
test SSTAT0, TARGET jz initiator_reselect;
|
|
|
|
}
|
1999-01-14 06:14:15 +00:00
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
/*
|
|
|
|
* We've just been selected. Assert BSY and
|
|
|
|
* setup the phase for receiving messages
|
|
|
|
* from the target.
|
|
|
|
*/
|
|
|
|
mvi SCSISIGO, P_MESGOUT|BSYO;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Setup the DMA for sending the identify and
|
1998-11-23 01:33:47 +00:00
|
|
|
* command information.
|
1998-09-15 07:24:17 +00:00
|
|
|
*/
|
|
|
|
or SEQ_FLAGS, CMDPHASE_PENDING;
|
1998-11-23 01:33:47 +00:00
|
|
|
|
|
|
|
mov A, TQINPOS;
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
mvi DINDEX, CCHADDR;
|
2000-07-18 20:12:14 +00:00
|
|
|
mvi SHARED_DATA_ADDR call set_32byte_addr;
|
1998-09-15 07:24:17 +00:00
|
|
|
mvi CCSCBCTL, CCSCBRESET;
|
|
|
|
} else {
|
|
|
|
mvi DINDEX, HADDR;
|
2000-07-18 20:12:14 +00:00
|
|
|
mvi SHARED_DATA_ADDR call set_32byte_addr;
|
1998-09-15 07:24:17 +00:00
|
|
|
mvi DFCNTRL, FIFORESET;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Initiator that selected us */
|
2000-07-18 20:12:14 +00:00
|
|
|
and SAVED_SCSIID, SELID_MASK, SELID;
|
|
|
|
/* The Target ID we were selected at */
|
|
|
|
if ((ahc->features & AHC_MULTI_TID) != 0) {
|
|
|
|
and A, OID, TARGIDIN;
|
|
|
|
} else if ((ahc->features & AHC_ULTRA2) != 0) {
|
|
|
|
and A, OID, SCSIID_ULTRA2;
|
1998-09-15 07:24:17 +00:00
|
|
|
} else {
|
2000-07-18 20:12:14 +00:00
|
|
|
and A, OID, SCSIID;
|
|
|
|
}
|
|
|
|
or SAVED_SCSIID, A;
|
|
|
|
if ((ahc->features & AHC_TWIN) != 0) {
|
|
|
|
test SBLKCTL, SELBUSB jz . + 2;
|
|
|
|
or SAVED_SCSIID, TWIN_CHNLB;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
1999-03-05 23:35:48 +00:00
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
2000-07-18 20:12:14 +00:00
|
|
|
mov CCSCBRAM, SAVED_SCSIID;
|
1998-09-15 07:24:17 +00:00
|
|
|
} else {
|
2000-07-18 20:12:14 +00:00
|
|
|
mov DFDAT, SAVED_SCSIID;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If ATN isn't asserted, the target isn't interested
|
|
|
|
* in talking to us. Go directly to bus free.
|
2000-07-18 20:12:14 +00:00
|
|
|
* XXX SCSI-1 may require us to assume lun 0 if
|
|
|
|
* ATN is false.
|
1998-09-15 07:24:17 +00:00
|
|
|
*/
|
|
|
|
test SCSISIGI, ATNI jz target_busfree;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Watch ATN closely now as we pull in messages from the
|
|
|
|
* initiator. We follow the guidlines from section 6.5
|
|
|
|
* of the SCSI-2 spec for what messages are allowed when.
|
|
|
|
*/
|
1998-12-10 04:14:50 +00:00
|
|
|
call target_inb;
|
1998-09-15 07:24:17 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Our first message must be one of IDENTIFY, ABORT, or
|
|
|
|
* BUS_DEVICE_RESET.
|
|
|
|
*/
|
1999-01-14 06:14:15 +00:00
|
|
|
test DINDEX, MSG_IDENTIFYFLAG jz host_target_message_loop;
|
1998-09-15 07:24:17 +00:00
|
|
|
/* Store for host */
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
mov CCSCBRAM, DINDEX;
|
|
|
|
} else {
|
|
|
|
mov DFDAT, DINDEX;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Remember for disconnection decision */
|
|
|
|
test DINDEX, MSG_IDENTIFY_DISCFLAG jnz . + 2;
|
|
|
|
/* XXX Honor per target settings too */
|
|
|
|
or SEQ_FLAGS, NO_DISCONNECT;
|
|
|
|
|
|
|
|
test SCSISIGI, ATNI jz ident_messages_done;
|
1998-12-10 04:14:50 +00:00
|
|
|
call target_inb;
|
1998-09-15 07:24:17 +00:00
|
|
|
/*
|
|
|
|
* If this is a tagged request, the tagged message must
|
|
|
|
* immediately follow the identify. We test for a valid
|
|
|
|
* tag message by seeing if it is >= MSG_SIMPLE_Q_TAG and
|
|
|
|
* < MSG_IGN_WIDE_RESIDUE.
|
|
|
|
*/
|
|
|
|
add A, -MSG_SIMPLE_Q_TAG, DINDEX;
|
|
|
|
jnc ident_messages_done;
|
|
|
|
add A, -MSG_IGN_WIDE_RESIDUE, DINDEX;
|
|
|
|
jc ident_messages_done;
|
|
|
|
/* Store for host */
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
mov CCSCBRAM, DINDEX;
|
|
|
|
} else {
|
|
|
|
mov DFDAT, DINDEX;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If the initiator doesn't feel like providing a tag number,
|
|
|
|
* we've got a failed selection and must transition to bus
|
|
|
|
* free.
|
|
|
|
*/
|
|
|
|
test SCSISIGI, ATNI jz target_busfree;
|
1999-01-14 06:14:15 +00:00
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
/*
|
|
|
|
* Store the tag for the host.
|
|
|
|
*/
|
1998-12-10 04:14:50 +00:00
|
|
|
call target_inb;
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
mov CCSCBRAM, DINDEX;
|
|
|
|
} else {
|
|
|
|
mov DFDAT, DINDEX;
|
|
|
|
}
|
1999-01-14 06:14:15 +00:00
|
|
|
mov INITIATOR_TAG, DINDEX;
|
2000-07-18 20:12:14 +00:00
|
|
|
or SEQ_FLAGS, TARGET_CMD_IS_TAGGED;
|
|
|
|
test SCSISIGI, ATNI jz . + 2;
|
|
|
|
/* Initiator still wants to give us messages */
|
|
|
|
call target_inb;
|
1998-09-15 07:24:17 +00:00
|
|
|
jmp ident_messages_done;
|
|
|
|
|
1998-12-10 04:14:50 +00:00
|
|
|
/*
|
|
|
|
* Pushed message loop to allow the kernel to
|
1999-01-14 06:14:15 +00:00
|
|
|
* run it's own target mode message state engine.
|
1998-12-10 04:14:50 +00:00
|
|
|
*/
|
|
|
|
host_target_message_loop:
|
|
|
|
mvi INTSTAT, HOST_MSG_LOOP;
|
|
|
|
nop;
|
|
|
|
cmp RETURN_1, EXIT_MSG_LOOP je target_ITloop;
|
|
|
|
test SSTAT0, SPIORDY jz .;
|
|
|
|
jmp host_target_message_loop;
|
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
ident_messages_done:
|
1999-03-05 23:35:48 +00:00
|
|
|
/* If ring buffer is full, return busy or queue full */
|
2000-03-18 22:28:20 +00:00
|
|
|
if ((ahc->features & AHC_HS_MAILBOX) != 0) {
|
|
|
|
and A, HOST_TQINPOS, HS_MAILBOX;
|
|
|
|
} else {
|
|
|
|
mov A, KERNEL_TQINPOS;
|
|
|
|
}
|
1999-03-05 23:35:48 +00:00
|
|
|
cmp TQINPOS, A jne tqinfifo_has_space;
|
|
|
|
mvi P_STATUS|BSYO call change_phase;
|
2000-07-18 20:12:14 +00:00
|
|
|
test SEQ_FLAGS, TARGET_CMD_IS_TAGGED jnz . + 3;
|
1999-03-05 23:35:48 +00:00
|
|
|
mvi STATUS_QUEUE_FULL call target_outb;
|
|
|
|
jmp target_busfree_wait;
|
|
|
|
mvi STATUS_BUSY call target_outb;
|
|
|
|
jmp target_busfree_wait;
|
|
|
|
tqinfifo_has_space:
|
1998-09-15 07:24:17 +00:00
|
|
|
/* Terminate the ident list */
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
mvi CCSCBRAM, SCB_LIST_NULL;
|
|
|
|
} else {
|
|
|
|
mvi DFDAT, SCB_LIST_NULL;
|
|
|
|
}
|
1999-01-14 06:14:15 +00:00
|
|
|
or SEQ_FLAGS, TARG_CMD_PENDING|IDENTIFY_SEEN;
|
2000-07-18 20:12:14 +00:00
|
|
|
test SCSISIGI, ATNI jnz target_mesgout_pending;
|
1998-09-15 07:24:17 +00:00
|
|
|
jmp target_ITloop;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* We carefully toggle SPIOEN to allow us to return the
|
|
|
|
* message byte we receive so it can be checked prior to
|
|
|
|
* driving REQ on the bus for the next byte.
|
|
|
|
*/
|
1998-12-10 04:14:50 +00:00
|
|
|
target_inb:
|
|
|
|
/*
|
|
|
|
* Drive REQ on the bus by enabling SCSI PIO.
|
|
|
|
*/
|
1998-09-15 07:24:17 +00:00
|
|
|
or SXFRCTL0, SPIOEN;
|
|
|
|
/* Wait for the byte */
|
|
|
|
test SSTAT0, SPIORDY jz .;
|
|
|
|
/* Prevent our read from triggering another REQ */
|
|
|
|
and SXFRCTL0, ~SPIOEN;
|
1998-12-10 04:14:50 +00:00
|
|
|
/* Save latched contents */
|
1998-09-15 07:24:17 +00:00
|
|
|
mov DINDEX, SCSIDATL ret;
|
|
|
|
}
|
|
|
|
|
1998-12-10 04:14:50 +00:00
|
|
|
if ((ahc->flags & AHC_INITIATORMODE) != 0) {
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
* Reselection has been initiated by a target. Make a note that we've been
|
|
|
|
* reselected, but haven't seen an IDENTIFY message from the target yet.
|
1996-01-03 06:25:32 +00:00
|
|
|
*/
|
1998-09-15 07:24:17 +00:00
|
|
|
initiator_reselect:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
/* XXX test for and handle ONE BIT condition */
|
2000-07-18 20:12:14 +00:00
|
|
|
and SAVED_SCSIID, SELID_MASK, SELID;
|
|
|
|
if ((ahc->features & AHC_ULTRA2) != 0) {
|
|
|
|
and A, OID, SCSIID_ULTRA2;
|
|
|
|
} else {
|
|
|
|
and A, OID, SCSIID;
|
|
|
|
}
|
|
|
|
or SAVED_SCSIID, A;
|
1998-09-21 16:46:13 +00:00
|
|
|
if ((ahc->features & AHC_TWIN) != 0) {
|
|
|
|
test SBLKCTL, SELBUSB jz . + 2;
|
2000-07-18 20:12:14 +00:00
|
|
|
or SAVED_SCSIID, TWIN_CHNLB;
|
1998-09-21 16:46:13 +00:00
|
|
|
}
|
1998-12-10 04:14:50 +00:00
|
|
|
or SXFRCTL0, SPIOEN|CLRSTCNT|CLRCHN;
|
1998-09-15 07:24:17 +00:00
|
|
|
jmp ITloop;
|
1998-12-10 04:14:50 +00:00
|
|
|
}
|
1996-01-03 06:25:32 +00:00
|
|
|
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
/*
|
|
|
|
* After the selection, remove this SCB from the "waiting SCB"
|
|
|
|
* list. This is achieved by simply moving our "next" pointer into
|
|
|
|
* WAITING_SCBH. Our next pointer will be set to null the next time this
|
|
|
|
* SCB is used, so don't bother with it now.
|
|
|
|
*/
|
1998-09-15 07:24:17 +00:00
|
|
|
select_out:
|
1997-04-18 16:31:55 +00:00
|
|
|
/* Turn off the selection hardware */
|
2000-03-18 22:28:20 +00:00
|
|
|
and SCSISEQ, TEMODE|ENSELI|ENRSELI|ENAUTOATNP, SCSISEQ;
|
1997-04-14 02:26:59 +00:00
|
|
|
mvi CLRSINT0, CLRSELDO;
|
1997-04-18 16:31:55 +00:00
|
|
|
mov SCBPTR, WAITING_SCBH;
|
|
|
|
mov WAITING_SCBH,SCB_NEXT;
|
2000-07-18 20:12:14 +00:00
|
|
|
mov SAVED_SCSIID, SCB_SCSIID;
|
|
|
|
mov SAVED_LUN, SCB_LUN;
|
|
|
|
mvi SPIOEN call initialize_channel;
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->flags & AHC_TARGETMODE) != 0) {
|
|
|
|
test SSTAT0, TARGET jz initiator_select;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* We've just re-selected an initiator.
|
|
|
|
* Assert BSY and setup the phase for
|
|
|
|
* sending our identify messages.
|
|
|
|
*/
|
1998-12-10 04:14:50 +00:00
|
|
|
mvi P_MESGIN|BSYO call change_phase;
|
1998-09-15 07:24:17 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Start out with a simple identify message.
|
|
|
|
*/
|
2000-07-18 20:12:14 +00:00
|
|
|
or SCB_LUN, MSG_IDENTIFYFLAG call target_outb;
|
1998-09-15 07:24:17 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* If we are the result of a tagged command, send
|
|
|
|
* a simple Q tag and the tag id.
|
|
|
|
*/
|
|
|
|
test SCB_CONTROL, TAG_ENB jz . + 3;
|
|
|
|
mvi MSG_SIMPLE_Q_TAG call target_outb;
|
2000-07-18 20:12:14 +00:00
|
|
|
mov SCB_TARGET_INFO[SCB_INITIATOR_TAG] call target_outb;
|
1998-09-15 07:24:17 +00:00
|
|
|
target_synccmd:
|
|
|
|
/*
|
|
|
|
* Now determine what phases the host wants us
|
|
|
|
* to go through.
|
|
|
|
*/
|
2000-07-18 20:12:14 +00:00
|
|
|
mov SEQ_FLAGS, SCB_TARGET_INFO[SCB_TARGET_PHASES];
|
1999-01-14 06:14:15 +00:00
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
target_ITloop:
|
|
|
|
/*
|
1998-12-10 04:14:50 +00:00
|
|
|
* Start honoring ATN signals now that
|
1999-03-05 23:35:48 +00:00
|
|
|
* we properly identified ourselves.
|
1998-09-15 07:24:17 +00:00
|
|
|
*/
|
1998-12-10 04:14:50 +00:00
|
|
|
test SCSISIGI, ATNI jnz target_mesgout;
|
1998-09-15 07:24:17 +00:00
|
|
|
test SEQ_FLAGS, CMDPHASE_PENDING jnz target_cmdphase;
|
|
|
|
test SEQ_FLAGS, DPHASE_PENDING jnz target_dphase;
|
|
|
|
test SEQ_FLAGS, SPHASE_PENDING jnz target_sphase;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* No more work to do. Either disconnect or not depending
|
|
|
|
* on the state of NO_DISCONNECT.
|
|
|
|
*/
|
|
|
|
test SEQ_FLAGS, NO_DISCONNECT jz target_disconnect;
|
|
|
|
if ((ahc->flags & AHC_PAGESCBS) != 0) {
|
|
|
|
mov ALLZEROS call get_free_or_disc_scb;
|
|
|
|
}
|
1998-12-10 04:14:50 +00:00
|
|
|
mov RETURN_1, ALLZEROS;
|
1998-09-15 07:24:17 +00:00
|
|
|
call complete_target_cmd;
|
1998-12-10 04:14:50 +00:00
|
|
|
cmp RETURN_1, CONT_MSG_LOOP jne .;
|
1998-09-15 07:24:17 +00:00
|
|
|
mvi DMAPARAMS, HDMAEN|DIRECTION|FIFORESET;
|
|
|
|
mov SCB_TAG call dma_scb;
|
|
|
|
jmp target_synccmd;
|
|
|
|
|
1998-12-10 04:14:50 +00:00
|
|
|
target_mesgout:
|
|
|
|
mvi SCSISIGO, P_MESGOUT|BSYO;
|
2000-07-18 20:12:14 +00:00
|
|
|
target_mesgout_continue:
|
1998-12-10 04:14:50 +00:00
|
|
|
call target_inb;
|
2000-07-18 20:12:14 +00:00
|
|
|
target_mesgout_pending:
|
1998-12-10 04:14:50 +00:00
|
|
|
/* Local Processing goes here... */
|
|
|
|
jmp host_target_message_loop;
|
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
target_disconnect:
|
1998-12-10 04:14:50 +00:00
|
|
|
mvi P_MESGIN|BSYO call change_phase;
|
1998-12-15 08:22:42 +00:00
|
|
|
test SEQ_FLAGS, DPHASE jz . + 2;
|
|
|
|
mvi MSG_SAVEDATAPOINTER call target_outb;
|
1998-09-15 07:24:17 +00:00
|
|
|
mvi MSG_DISCONNECT call target_outb;
|
|
|
|
|
1999-02-11 07:10:20 +00:00
|
|
|
target_busfree_wait:
|
|
|
|
/* Wait for preceeding I/O session to complete. */
|
|
|
|
test SCSISIGI, ACKI jnz .;
|
1998-09-15 07:24:17 +00:00
|
|
|
target_busfree:
|
2000-07-18 20:12:14 +00:00
|
|
|
and SIMODE1, ~ENBUSFREE;
|
1998-09-15 07:24:17 +00:00
|
|
|
clr SCSISIGO;
|
2000-02-09 21:25:00 +00:00
|
|
|
mvi LASTPHASE, P_BUSFREE;
|
1998-09-15 07:24:17 +00:00
|
|
|
call complete_target_cmd;
|
|
|
|
jmp poll_for_work;
|
|
|
|
|
|
|
|
target_cmdphase:
|
1998-12-10 04:14:50 +00:00
|
|
|
mvi P_COMMAND|BSYO call change_phase;
|
|
|
|
call target_inb;
|
1998-09-15 07:24:17 +00:00
|
|
|
mov A, DINDEX;
|
|
|
|
/* Store for host */
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
mov CCSCBRAM, A;
|
|
|
|
} else {
|
|
|
|
mov DFDAT, A;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Determine the number of bytes to read
|
1998-11-23 01:33:47 +00:00
|
|
|
* based on the command group code via table lookup.
|
|
|
|
* We reuse the first 8 bytes of the TARG_SCSIRATE
|
|
|
|
* BIOS array for this table. Count is one less than
|
|
|
|
* the total for the command since we've already fetched
|
|
|
|
* the first byte.
|
1998-09-15 07:24:17 +00:00
|
|
|
*/
|
|
|
|
shr A, CMD_GROUP_CODE_SHIFT;
|
|
|
|
add SINDEX, TARG_SCSIRATE, A;
|
|
|
|
mov A, SINDIR;
|
|
|
|
|
|
|
|
test A, 0xFF jz command_phase_done;
|
|
|
|
command_loop:
|
|
|
|
or SXFRCTL0, SPIOEN;
|
|
|
|
test SSTAT0, SPIORDY jz .;
|
|
|
|
cmp A, 1 jne . + 2;
|
|
|
|
and SXFRCTL0, ~SPIOEN; /* Last Byte */
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
mov CCSCBRAM, SCSIDATL;
|
|
|
|
} else {
|
|
|
|
mov DFDAT, SCSIDATL;
|
|
|
|
}
|
|
|
|
dec A;
|
|
|
|
test A, 0xFF jnz command_loop;
|
|
|
|
|
|
|
|
command_phase_done:
|
|
|
|
and SEQ_FLAGS, ~CMDPHASE_PENDING;
|
|
|
|
jmp target_ITloop;
|
|
|
|
|
|
|
|
target_dphase:
|
|
|
|
/*
|
2000-07-18 20:12:14 +00:00
|
|
|
* Data phases on the bus are from the
|
|
|
|
* perspective of the initiator. The dma
|
|
|
|
* code looks at LASTPHASE to determine the
|
|
|
|
* data direction of the DMA. Toggle it for
|
|
|
|
* target transfers.
|
1998-09-15 07:24:17 +00:00
|
|
|
*/
|
2000-07-18 20:12:14 +00:00
|
|
|
xor LASTPHASE, IOI, SCB_TARGET_INFO[SCB_TARGET_DATA_DIR];
|
|
|
|
or SCB_TARGET_INFO[SCB_TARGET_DATA_DIR], BSYO
|
|
|
|
call change_phase;
|
1998-09-15 07:24:17 +00:00
|
|
|
jmp p_data;
|
|
|
|
|
|
|
|
target_sphase:
|
1998-12-10 04:14:50 +00:00
|
|
|
mvi P_STATUS|BSYO call change_phase;
|
|
|
|
mvi LASTPHASE, P_STATUS;
|
2000-07-18 20:12:14 +00:00
|
|
|
mov SCB_TARGET_INFO[SCB_TARGET_STATUS] call target_outb;
|
1998-12-10 04:14:50 +00:00
|
|
|
/* XXX Watch for ATN or parity errors??? */
|
1998-09-15 07:24:17 +00:00
|
|
|
mvi SCSISIGO, P_MESGIN|BSYO;
|
|
|
|
/* MSG_CMDCMPLT is 0, but we can't do an immediate of 0 */
|
|
|
|
mov ALLZEROS call target_outb;
|
1999-02-11 07:10:20 +00:00
|
|
|
jmp target_busfree_wait;
|
1998-09-15 07:24:17 +00:00
|
|
|
|
|
|
|
complete_target_cmd:
|
|
|
|
test SEQ_FLAGS, TARG_CMD_PENDING jnz . + 2;
|
|
|
|
mov SCB_TAG jmp complete_post;
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
1998-11-23 01:33:47 +00:00
|
|
|
/* Set the valid byte */
|
|
|
|
mvi CCSCBADDR, 24;
|
|
|
|
mov CCSCBRAM, ALLONES;
|
|
|
|
mvi CCHCNT, 28;
|
1998-09-15 07:24:17 +00:00
|
|
|
or CCSCBCTL, CCSCBEN|CCSCBRESET;
|
|
|
|
test CCSCBCTL, CCSCBDONE jz .;
|
|
|
|
clr CCSCBCTL;
|
|
|
|
} else {
|
1998-11-23 01:33:47 +00:00
|
|
|
/* Set the valid byte */
|
|
|
|
or DFCNTRL, FIFORESET;
|
|
|
|
mvi DFWADDR, 3; /* Third 64bit word or byte 24 */
|
|
|
|
mov DFDAT, ALLONES;
|
2000-07-18 20:12:14 +00:00
|
|
|
mvi 28 call set_hcnt;
|
1998-09-15 07:24:17 +00:00
|
|
|
or DFCNTRL, HDMAEN|FIFOFLUSH;
|
|
|
|
call dma_finish;
|
|
|
|
}
|
1998-11-23 01:33:47 +00:00
|
|
|
inc TQINPOS;
|
|
|
|
mvi INTSTAT,CMDCMPLT ret;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
1998-12-10 04:14:50 +00:00
|
|
|
|
|
|
|
if ((ahc->flags & AHC_INITIATORMODE) != 0) {
|
1998-09-15 07:24:17 +00:00
|
|
|
initiator_select:
|
1998-12-10 04:14:50 +00:00
|
|
|
/*
|
|
|
|
* As soon as we get a successful selection, the target
|
|
|
|
* should go into the message out phase since we have ATN
|
|
|
|
* asserted.
|
|
|
|
*/
|
1998-09-15 07:24:17 +00:00
|
|
|
mvi MSG_OUT, MSG_IDENTIFYFLAG;
|
|
|
|
or SEQ_FLAGS, IDENTIFY_SEEN;
|
1996-05-21 18:32:23 +00:00
|
|
|
|
1998-12-10 04:14:50 +00:00
|
|
|
/*
|
|
|
|
* Main loop for information transfer phases. Wait for the
|
|
|
|
* target to assert REQ before checking MSG, C/D and I/O for
|
|
|
|
* the bus phase.
|
|
|
|
*/
|
2000-07-18 20:12:14 +00:00
|
|
|
mesgin_phasemis:
|
1994-11-17 20:19:10 +00:00
|
|
|
ITloop:
|
1998-09-15 07:24:17 +00:00
|
|
|
call phase_lock;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
mov A, LASTPHASE;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
test A, ~P_DATAIN jz p_data;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
cmp A,P_COMMAND je p_command;
|
|
|
|
cmp A,P_MESGOUT je p_mesgout;
|
|
|
|
cmp A,P_STATUS je p_status;
|
|
|
|
cmp A,P_MESGIN je p_mesgin;
|
|
|
|
|
1998-12-10 04:14:50 +00:00
|
|
|
mvi INTSTAT,BAD_PHASE;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
jmp ITloop; /* Try reading the bus again. */
|
|
|
|
|
|
|
|
await_busfree:
|
|
|
|
and SIMODE1, ~ENBUSFREE;
|
1997-04-10 19:13:07 +00:00
|
|
|
mov NONE, SCSIDATL; /* Ack the last byte */
|
1998-09-15 07:24:17 +00:00
|
|
|
and SXFRCTL0, ~SPIOEN;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
test SSTAT1,REQINIT|BUSFREE jz .;
|
|
|
|
test SSTAT1, BUSFREE jnz poll_for_work;
|
|
|
|
mvi INTSTAT, BAD_PHASE;
|
1998-12-10 04:14:50 +00:00
|
|
|
}
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
|
|
|
|
clear_target_state:
|
1998-12-10 04:14:50 +00:00
|
|
|
/*
|
|
|
|
* We assume that the kernel driver may reset us
|
|
|
|
* at any time, even in the middle of a DMA, so
|
|
|
|
* clear DFCNTRL too.
|
|
|
|
*/
|
|
|
|
clr DFCNTRL;
|
2000-07-18 20:12:14 +00:00
|
|
|
mvi SXFRCTL0, CLRSTCNT|CLRCHN;
|
1998-12-10 04:14:50 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* We don't know the target we will connect to,
|
|
|
|
* so default to narrow transfers to avoid
|
|
|
|
* parity problems.
|
|
|
|
*/
|
|
|
|
if ((ahc->features & AHC_ULTRA2) != 0) {
|
|
|
|
bmov SCSIRATE, ALLZEROS, 2;
|
|
|
|
} else {
|
|
|
|
clr SCSIRATE;
|
2000-07-18 20:12:14 +00:00
|
|
|
if ((ahc->features & AHC_ULTRA) != 0) {
|
|
|
|
and SXFRCTL0, ~(FAST20);
|
|
|
|
}
|
1998-12-10 04:14:50 +00:00
|
|
|
}
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mvi LASTPHASE, P_BUSFREE;
|
|
|
|
/* clear target specific flags */
|
1998-09-15 07:24:17 +00:00
|
|
|
clr SEQ_FLAGS ret;
|
1994-11-17 20:19:10 +00:00
|
|
|
|
2000-07-18 20:12:14 +00:00
|
|
|
sg_advance:
|
|
|
|
clr A; /* add sizeof(struct scatter) */
|
|
|
|
add SCB_RESIDUAL_SGPTR[0],SG_SIZEOF;
|
|
|
|
adc SCB_RESIDUAL_SGPTR[1],A;
|
|
|
|
adc SCB_RESIDUAL_SGPTR[2],A;
|
|
|
|
adc SCB_RESIDUAL_SGPTR[3],A ret;
|
|
|
|
|
|
|
|
idle_loop:
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
/* Did we just finish fetching segs? */
|
|
|
|
cmp CCSGCTL, CCSGEN|CCSGDONE je idle_sgfetch_complete;
|
|
|
|
|
|
|
|
/* Are we actively fetching segments? */
|
|
|
|
test CCSGCTL, CCSGEN jnz return;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Do we need any more segments?
|
|
|
|
*/
|
|
|
|
test SCB_RESIDUAL_DATACNT[3], SG_LAST_SEG jnz return;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Do we have any prefetch left???
|
|
|
|
*/
|
|
|
|
cmp CCSGADDR, CCSGADDR_MAX jne idle_sg_avail;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Need to fetch segments, but we can only do that
|
|
|
|
* if the command channel is completely idle. Make
|
|
|
|
* sure we don't have an SCB prefetch going on.
|
|
|
|
*/
|
|
|
|
test CCSCBCTL, CCSCBEN jnz return;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The kernel allocates S/G space so that it is 128 byte
|
|
|
|
* aligned and ends on a 128 byte boundary. We fetch
|
|
|
|
* up to the next 128 byte boundary so we don't attempt
|
|
|
|
* to read a non-existent page.
|
|
|
|
*/
|
|
|
|
mvi CCHCNT, CCSGADDR_MAX;
|
|
|
|
and CCHADDR[0], ~(CCSGADDR_MAX - 1), SCB_RESIDUAL_SGPTR;
|
|
|
|
bmov CCHADDR[1], SCB_RESIDUAL_SGPTR[1], 3;
|
|
|
|
mvi CCSGCTL, CCSGEN|CCSGRESET ret;
|
|
|
|
idle_sgfetch_complete:
|
|
|
|
mvi CCSGCTL, CCSGRESET;
|
|
|
|
and CCSGADDR, (CCSGADDR_MAX - 1), SCB_RESIDUAL_SGPTR;
|
|
|
|
idle_sg_avail:
|
|
|
|
if ((ahc->features & AHC_ULTRA2) != 0) {
|
|
|
|
/* Does the hardware have space for another SG entry? */
|
|
|
|
test DFSTATUS, PRELOAD_AVAIL jz return;
|
|
|
|
bmov HADDR, CCSGRAM, 4;
|
|
|
|
bmov SINDEX, CCSGRAM, 1;
|
|
|
|
test SINDEX, 0x1 jz . + 2;
|
|
|
|
xor DATA_COUNT_ODD, 0x1;
|
|
|
|
bmov HCNT[0], SINDEX, 1;
|
|
|
|
bmov HCNT[1], CCSGRAM, 2;
|
|
|
|
bmov SCB_RESIDUAL_DATACNT[3], CCSGRAM, 1;
|
|
|
|
call sg_advance;
|
|
|
|
mov SINDEX, SCB_RESIDUAL_SGPTR[0];
|
|
|
|
test DATA_COUNT_ODD, 0x1 jz . + 2;
|
|
|
|
or SINDEX, ODD_SEG;
|
|
|
|
test SCB_RESIDUAL_DATACNT[3], SG_LAST_SEG jz . + 2;
|
|
|
|
or SINDEX, LAST_SEG;
|
|
|
|
mov SG_CACHE_PRE, SINDEX;
|
|
|
|
/* Load the segment by writing DFCNTRL again */
|
|
|
|
mov DFCNTRL, DMAPARAMS;
|
|
|
|
}
|
|
|
|
ret;
|
|
|
|
}
|
|
|
|
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
|
|
|
* If we re-enter the data phase after going through another phase, the
|
|
|
|
* STCNT may have been cleared, so restore it from the residual field.
|
|
|
|
*/
|
1995-08-05 17:31:39 +00:00
|
|
|
data_phase_reinit:
|
1999-09-20 18:57:04 +00:00
|
|
|
if ((ahc->features & AHC_ULTRA2) != 0) {
|
|
|
|
/*
|
|
|
|
* The preload circuitry requires us to
|
|
|
|
* reload the address too, so pull it from
|
|
|
|
* the shaddow address.
|
|
|
|
*/
|
|
|
|
bmov HADDR, SHADDR, 4;
|
2000-07-18 20:12:14 +00:00
|
|
|
bmov HCNT, SCB_RESIDUAL_DATACNT, 3;
|
1999-09-20 18:57:04 +00:00
|
|
|
} else if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
2000-07-18 20:12:14 +00:00
|
|
|
bmov STCNT, SCB_RESIDUAL_DATACNT, 3;
|
1998-09-15 07:24:17 +00:00
|
|
|
} else {
|
|
|
|
mvi DINDEX, STCNT;
|
2000-07-18 20:12:14 +00:00
|
|
|
mvi SCB_RESIDUAL_DATACNT call bcopy_3;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
2000-07-18 20:12:14 +00:00
|
|
|
and DATA_COUNT_ODD, 0x1, SCB_RESIDUAL_DATACNT[0];
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
jmp data_phase_loop;
|
1994-11-17 20:19:10 +00:00
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
p_data:
|
|
|
|
if ((ahc->features & AHC_ULTRA2) != 0) {
|
|
|
|
mvi DMAPARAMS, PRELOADEN|SCSIEN|HDMAEN;
|
|
|
|
} else {
|
|
|
|
mvi DMAPARAMS, WIDEODD|SCSIEN|SDMAEN|HDMAEN|FIFORESET;
|
|
|
|
}
|
|
|
|
test LASTPHASE, IOI jnz . + 2;
|
|
|
|
or DMAPARAMS, DIRECTION;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
call assert; /*
|
1996-10-25 06:34:59 +00:00
|
|
|
* Ensure entering a data
|
|
|
|
* phase is okay - seen identify, etc.
|
|
|
|
*/
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
2000-07-18 20:12:14 +00:00
|
|
|
/* We don't have any valid S/G elements */
|
1998-09-15 07:24:17 +00:00
|
|
|
mvi CCSGADDR, CCSGADDR_MAX;
|
|
|
|
}
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
test SEQ_FLAGS, DPHASE jnz data_phase_reinit;
|
1996-10-25 06:34:59 +00:00
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
/* We have seen a data phase */
|
|
|
|
or SEQ_FLAGS, DPHASE;
|
|
|
|
|
1996-10-25 06:34:59 +00:00
|
|
|
/*
|
|
|
|
* Initialize the DMA address and counter from the SCB.
|
2000-07-18 20:12:14 +00:00
|
|
|
* Also set SCB_RESIDUAL_SGPTR, including the LAST_SEG
|
|
|
|
* flag in the highest byte of the data count. We cannot
|
|
|
|
* modify the saved values in the SCB until we see a save
|
|
|
|
* data pointers message.
|
1996-10-25 06:34:59 +00:00
|
|
|
*/
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
bmov HADDR, SCB_DATAPTR, 7;
|
2000-07-18 20:12:14 +00:00
|
|
|
bmov SCB_RESIDUAL_DATACNT[3], SCB_DATACNT[3], 5;
|
1998-09-15 07:24:17 +00:00
|
|
|
} else {
|
|
|
|
mvi DINDEX, HADDR;
|
|
|
|
mvi SCB_DATAPTR call bcopy_7;
|
2000-07-18 20:12:14 +00:00
|
|
|
mvi DINDEX, SCB_RESIDUAL_DATACNT + 3;
|
|
|
|
mvi SCB_DATACNT + 3 call bcopy_5;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
2000-07-18 20:12:14 +00:00
|
|
|
and SCB_RESIDUAL_SGPTR[0], ~SG_FULL_RESID;
|
1999-01-14 06:14:15 +00:00
|
|
|
and DATA_COUNT_ODD, 0x1, SCB_DATACNT[0];
|
1998-09-15 07:24:17 +00:00
|
|
|
|
|
|
|
if ((ahc->features & AHC_ULTRA2) == 0) {
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
bmov STCNT, HCNT, 3;
|
|
|
|
} else {
|
|
|
|
call set_stcnt_from_hcnt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1995-08-05 17:31:39 +00:00
|
|
|
data_phase_loop:
|
2000-07-18 20:12:14 +00:00
|
|
|
/* Guard against overruns */
|
|
|
|
test SCB_RESIDUAL_SGPTR[0], SG_LIST_NULL jz data_phase_inbounds;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Turn on 'Bit Bucket' mode, set the transfer count to
|
|
|
|
* 16meg and let the target run until it changes phase.
|
|
|
|
* When the transfer completes, notify the host that we
|
|
|
|
* had an overrun.
|
|
|
|
*/
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
or SXFRCTL1,BITBUCKET;
|
1998-09-15 07:24:17 +00:00
|
|
|
and DMAPARAMS, ~(HDMAEN|SDMAEN);
|
2000-07-18 20:12:14 +00:00
|
|
|
/* Keep our idle loop from mucking with SG segments */
|
|
|
|
or SCB_RESIDUAL_DATACNT[0], SG_LAST_SEG;
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->features & AHC_ULTRA2) != 0) {
|
|
|
|
bmov HCNT, ALLONES, 3;
|
|
|
|
} else if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
bmov STCNT, ALLONES, 3;
|
|
|
|
} else {
|
2000-07-18 20:12:14 +00:00
|
|
|
/* XXX Use bcopy? */
|
1998-09-15 07:24:17 +00:00
|
|
|
mvi STCNT[0], 0xFF;
|
|
|
|
mvi STCNT[1], 0xFF;
|
|
|
|
mvi STCNT[2], 0xFF;
|
|
|
|
}
|
1996-06-09 17:33:18 +00:00
|
|
|
data_phase_inbounds:
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->features & AHC_ULTRA2) != 0) {
|
2000-07-18 20:12:14 +00:00
|
|
|
mov SINDEX, SCB_RESIDUAL_SGPTR[0];
|
|
|
|
test SCB_RESIDUAL_DATACNT[3], SG_LAST_SEG jz . + 2;
|
|
|
|
or SINDEX, LAST_SEG;
|
|
|
|
test DATA_COUNT_ODD, 0x1 jz . + 2;
|
|
|
|
or SINDEX, ODD_SEG;
|
|
|
|
mov SG_CACHE_PRE, SINDEX;
|
|
|
|
mov DFCNTRL, DMAPARAMS;
|
|
|
|
ultra2_dma_loop:
|
|
|
|
call idle_loop;
|
|
|
|
/*
|
|
|
|
* The transfer is complete if either the last segment
|
|
|
|
* completes or the target changes phase.
|
|
|
|
*/
|
|
|
|
test SG_CACHE_SHADOW, LAST_SEG_DONE jnz ultra2_dmafinish;
|
|
|
|
test SSTAT1,PHASEMIS jz ultra2_dma_loop;
|
|
|
|
|
|
|
|
ultra2_dmafinish:
|
|
|
|
test DFCNTRL, DIRECTION jnz ultra2_dmafifoempty;
|
|
|
|
and DFCNTRL, ~SCSIEN;
|
|
|
|
test DFCNTRL, SCSIEN jnz .;
|
|
|
|
ultra2_dmafifoflush:
|
|
|
|
if ((ahc->bugs & AHC_AUTOFLUSH_BUG) != 0) {
|
|
|
|
/*
|
|
|
|
* On Rev A of the aic7890, the autoflush
|
|
|
|
* features doesn't function correctly.
|
|
|
|
* Perform an explicit manual flush. During
|
|
|
|
* a manual flush, the FIFOEMP bit becomes
|
|
|
|
* true every time the PCI FIFO empties
|
|
|
|
* regardless of the state of the SCSI FIFO.
|
|
|
|
* It can take up to 4 clock cycles for the
|
|
|
|
* SCSI FIFO to get data into the PCI FIFO
|
|
|
|
* and for FIFOEMP to de-assert. Here we
|
|
|
|
* guard against this condition by making
|
|
|
|
* sure the FIFOEMP bit stays on for 5 full
|
|
|
|
* clock cycles.
|
|
|
|
*/
|
|
|
|
or DFCNTRL, FIFOFLUSH;
|
|
|
|
test DFSTATUS, FIFOEMP jz ultra2_dmafifoflush;
|
|
|
|
test DFSTATUS, FIFOEMP jz ultra2_dmafifoflush;
|
|
|
|
test DFSTATUS, FIFOEMP jz ultra2_dmafifoflush;
|
|
|
|
test DFSTATUS, FIFOEMP jz ultra2_dmafifoflush;
|
|
|
|
}
|
|
|
|
test DFSTATUS, FIFOEMP jz ultra2_dmafifoflush;
|
|
|
|
ultra2_dmafifoempty:
|
|
|
|
/* Don't clobber an inprogress host data transfer */
|
|
|
|
test DFSTATUS, MREQPEND jnz ultra2_dmafifoempty;
|
|
|
|
ultra2_dmahalt:
|
|
|
|
and DFCNTRL, ~(SCSIEN|HDMAEN);
|
|
|
|
test DFCNTRL, HDMAEN jnz .;
|
|
|
|
|
|
|
|
test SXFRCTL1,BITBUCKET jnz data_phase_finish;
|
|
|
|
/*
|
|
|
|
* Fixup the residual next S/G pointer. The S/G preload
|
|
|
|
* feature of the chip allows us to load two elements
|
|
|
|
* in addition to the currently active element. We
|
|
|
|
* store the bottom byte of the next S/G pointer in
|
|
|
|
* the SG_CACEPTR register so we can restore the
|
|
|
|
* correct value when the DMA completes. If the next
|
|
|
|
* sg ptr value has advanced to the point where higher
|
|
|
|
* bytes in the address have been affected, fix them
|
|
|
|
* too.
|
|
|
|
*/
|
|
|
|
test SG_CACHE_SHADOW, 0x80 jz sgptr_fixup_done;
|
|
|
|
test SCB_RESIDUAL_SGPTR[0], 0x80 jnz sgptr_fixup_done;
|
|
|
|
add SCB_RESIDUAL_SGPTR[1], -1;
|
|
|
|
adc SCB_RESIDUAL_SGPTR[2], -1;
|
|
|
|
adc SCB_RESIDUAL_SGPTR[3], -1;
|
|
|
|
sgptr_fixup_done:
|
|
|
|
and SCB_RESIDUAL_SGPTR[0], SG_ADDR_MASK, SG_CACHE_SHADOW;
|
|
|
|
clr DATA_COUNT_ODD;
|
|
|
|
test SG_CACHE_SHADOW, ODD_SEG jz . + 2;
|
|
|
|
or DATA_COUNT_ODD, 0x1;
|
|
|
|
clr SCB_RESIDUAL_DATACNT[3];
|
|
|
|
test SG_CACHE_SHADOW, LAST_SEG jz data_phase_finish;
|
|
|
|
or SCB_RESIDUAL_DATACNT[3], SG_LAST_SEG;
|
|
|
|
/* Record if we've consumed all S/G entries */
|
|
|
|
test SG_CACHE_SHADOW, LAST_SEG_DONE jz . + 2;
|
|
|
|
or SCB_RESIDUAL_SGPTR[0], SG_LIST_NULL;
|
1998-09-15 07:24:17 +00:00
|
|
|
} else {
|
2000-07-18 20:12:14 +00:00
|
|
|
/* If we are the last SG block, tell the hardware. */
|
|
|
|
test SCB_RESIDUAL_DATACNT[3], SG_LAST_SEG jz dma_mid_sg;
|
2000-02-09 21:25:00 +00:00
|
|
|
if ((ahc->flags & AHC_TARGETMODE) != 0) {
|
|
|
|
test SSTAT0, TARGET jz . + 2;
|
2000-07-18 20:12:14 +00:00
|
|
|
test DMAPARAMS, DIRECTION jz dma_mid_sg;
|
2000-02-09 21:25:00 +00:00
|
|
|
}
|
1998-09-15 07:24:17 +00:00
|
|
|
and DMAPARAMS, ~WIDEODD;
|
2000-07-18 20:12:14 +00:00
|
|
|
dma_mid_sg:
|
|
|
|
/* Start DMA data transfer. */
|
1998-09-15 07:24:17 +00:00
|
|
|
mov DFCNTRL, DMAPARAMS;
|
2000-07-18 20:12:14 +00:00
|
|
|
dma_loop:
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
call idle_loop;
|
|
|
|
}
|
|
|
|
test SSTAT0,DMADONE jnz dma_dmadone;
|
|
|
|
test SSTAT1,PHASEMIS jz dma_loop; /* ie. underrun */
|
|
|
|
dma_phasemis:
|
1998-09-15 07:24:17 +00:00
|
|
|
/*
|
2000-07-18 20:12:14 +00:00
|
|
|
* We will be "done" DMAing when the transfer count goes to
|
|
|
|
* zero, or the target changes the phase (in light of this,
|
|
|
|
* it makes sense that the DMA circuitry doesn't ACK when
|
|
|
|
* PHASEMIS is active). If we are doing a SCSI->Host transfer,
|
|
|
|
* the data FIFO should be flushed auto-magically on STCNT=0
|
|
|
|
* or a phase change, so just wait for FIFO empty status.
|
1998-09-15 07:24:17 +00:00
|
|
|
*/
|
2000-07-18 20:12:14 +00:00
|
|
|
dma_checkfifo:
|
|
|
|
test DFCNTRL,DIRECTION jnz dma_fifoempty;
|
|
|
|
dma_fifoflush:
|
|
|
|
test DFSTATUS,FIFOEMP jz dma_fifoflush;
|
|
|
|
dma_fifoempty:
|
|
|
|
/* Don't clobber an inprogress host data transfer */
|
|
|
|
test DFSTATUS, MREQPEND jnz dma_fifoempty;
|
1998-09-15 07:24:17 +00:00
|
|
|
|
|
|
|
/*
|
2000-07-18 20:12:14 +00:00
|
|
|
* Now shut off the DMA and make sure that the DMA
|
|
|
|
* hardware has actually stopped. Touching the DMA
|
|
|
|
* counters, etc. while a DMA is active will result
|
|
|
|
* in an ILLSADDR exception.
|
1998-09-15 07:24:17 +00:00
|
|
|
*/
|
2000-07-18 20:12:14 +00:00
|
|
|
dma_dmadone:
|
|
|
|
and DFCNTRL, ~(SCSIEN|SDMAEN|HDMAEN);
|
|
|
|
dma_halt:
|
1998-09-15 07:24:17 +00:00
|
|
|
/*
|
2000-07-18 20:12:14 +00:00
|
|
|
* Some revisions of the aic7880 have a problem where, if the
|
|
|
|
* data fifo is full, but the PCI input latch is not empty,
|
|
|
|
* HDMAEN cannot be cleared. The fix used here is to drain
|
|
|
|
* the prefetched but unused data from the data fifo until
|
|
|
|
* there is space for the input latch to drain.
|
1998-09-15 07:24:17 +00:00
|
|
|
*/
|
2000-07-18 20:12:14 +00:00
|
|
|
mov NONE, DFDAT;
|
|
|
|
test DFCNTRL, (SCSIEN|SDMAEN|HDMAEN) jnz dma_halt;
|
1998-09-15 07:24:17 +00:00
|
|
|
|
2000-07-18 20:12:14 +00:00
|
|
|
/* See if we have completed this last segment */
|
|
|
|
test STCNT[0], 0xff jnz data_phase_finish;
|
|
|
|
test STCNT[1], 0xff jnz data_phase_finish;
|
|
|
|
test STCNT[2], 0xff jnz data_phase_finish;
|
1999-01-14 06:14:15 +00:00
|
|
|
|
2000-07-18 20:12:14 +00:00
|
|
|
/*
|
|
|
|
* Advance the scatter-gather pointers if needed
|
|
|
|
*/
|
|
|
|
test SCB_RESIDUAL_DATACNT[3], SG_LAST_SEG jz sg_load;
|
|
|
|
or SCB_RESIDUAL_SGPTR[0], SG_LIST_NULL;
|
|
|
|
jmp data_phase_finish;
|
|
|
|
sg_load:
|
|
|
|
/*
|
|
|
|
* Load the next SG element's data address and length
|
|
|
|
* into the DMA engine. If we don't have hardware
|
|
|
|
* to perform a prefetch, we'll have to fetch the
|
|
|
|
* segment from host memory first.
|
|
|
|
*/
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
2000-07-18 20:12:14 +00:00
|
|
|
/* Wait for the idle loop to complete */
|
|
|
|
test CCSGCTL, CCSGEN jz . + 3;
|
|
|
|
call idle_loop;
|
|
|
|
test CCSGCTL, CCSGEN jnz . - 1;
|
|
|
|
bmov HADDR, CCSGRAM, 7;
|
|
|
|
bmov SCB_RESIDUAL_DATACNT[3], CCSGRAM, 1;
|
1998-09-15 07:24:17 +00:00
|
|
|
bmov STCNT, HCNT, 3;
|
|
|
|
} else {
|
2000-07-18 20:12:14 +00:00
|
|
|
mvi DINDEX, HADDR;
|
|
|
|
mvi SCB_RESIDUAL_SGPTR call bcopy_4;
|
|
|
|
|
|
|
|
mvi SG_SIZEOF call set_hcnt;
|
|
|
|
|
|
|
|
or DFCNTRL, HDMAEN|DIRECTION|FIFORESET;
|
|
|
|
|
|
|
|
call dma_finish;
|
|
|
|
|
|
|
|
mvi HADDR call dfdat_in_7;
|
|
|
|
mov SCB_RESIDUAL_DATACNT[3], DFDAT;
|
1998-09-15 07:24:17 +00:00
|
|
|
call set_stcnt_from_hcnt;
|
|
|
|
}
|
|
|
|
|
2000-07-18 20:12:14 +00:00
|
|
|
/* Track odd'ness */
|
|
|
|
test HCNT[0], 0x1 jz . + 2;
|
|
|
|
xor DATA_COUNT_ODD, 0x1;
|
1994-11-17 20:19:10 +00:00
|
|
|
|
2000-07-18 20:12:14 +00:00
|
|
|
/* Point to the new next sg in memory */
|
|
|
|
call sg_advance;
|
|
|
|
|
|
|
|
if ((ahc->flags & AHC_TARGETMODE) != 0) {
|
|
|
|
test SSTAT0, TARGET jnz data_phase_loop;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
data_phase_finish:
|
|
|
|
/*
|
|
|
|
* If the target has left us in data phase, loop through
|
|
|
|
* the dma code again. In the case of ULTRA2 adapters,
|
|
|
|
* we should only loop if there is a data overrun. For
|
|
|
|
* all other adapters, we'll loop after each S/G element
|
|
|
|
* is loaded as well as if there is an overrun.
|
|
|
|
*/
|
1998-12-10 04:14:50 +00:00
|
|
|
if ((ahc->flags & AHC_TARGETMODE) != 0) {
|
2000-07-18 20:12:14 +00:00
|
|
|
test SSTAT0, TARGET jnz data_phase_done;
|
1998-12-10 04:14:50 +00:00
|
|
|
}
|
2000-07-18 20:12:14 +00:00
|
|
|
if ((ahc->flags & AHC_INITIATORMODE) != 0) {
|
|
|
|
test SSTAT1, REQINIT jz .;
|
|
|
|
test SSTAT1,PHASEMIS jz data_phase_loop;
|
|
|
|
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
/* Kill off any pending prefetch */
|
|
|
|
clr CCSGCTL;
|
|
|
|
test CCSGCTL, CCSGEN jnz .;
|
|
|
|
}
|
1998-12-10 04:14:50 +00:00
|
|
|
|
2000-07-18 20:12:14 +00:00
|
|
|
/*
|
|
|
|
* Turn off BITBUCKET mode and notify the host
|
|
|
|
* in the event of an overrun.
|
|
|
|
*/
|
|
|
|
test SXFRCTL1,BITBUCKET jz data_phase_done;
|
|
|
|
and SXFRCTL1, ~BITBUCKET;
|
|
|
|
mvi INTSTAT,DATA_OVERRUN;
|
|
|
|
jmp ITloop;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
1995-08-05 17:31:39 +00:00
|
|
|
|
2000-07-18 20:12:14 +00:00
|
|
|
data_phase_done:
|
|
|
|
/*
|
|
|
|
* After a DMA finishes, save the SG and STCNT residuals back into
|
|
|
|
* the SCB. We use STCNT instead of HCNT, since it's a reflection
|
|
|
|
* of how many bytes were transferred on the SCSI (as opposed to the
|
|
|
|
* host) bus.
|
|
|
|
*/
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
2000-07-18 20:12:14 +00:00
|
|
|
/* Kill off any pending prefetch */
|
|
|
|
clr CCSGCTL;
|
|
|
|
test CCSGCTL, CCSGEN jnz .;
|
|
|
|
|
|
|
|
bmov SCB_RESIDUAL_DATACNT, STCNT, 3;
|
1998-09-15 07:24:17 +00:00
|
|
|
} else {
|
2000-07-18 20:12:14 +00:00
|
|
|
mov SCB_RESIDUAL_DATACNT[0],STCNT[0];
|
|
|
|
mov SCB_RESIDUAL_DATACNT[1],STCNT[1];
|
|
|
|
mov SCB_RESIDUAL_DATACNT[2],STCNT[2];
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
2000-07-18 20:12:14 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Since we've been through a data phase, the SCB_RESID* fields
|
|
|
|
* are now initialized. Clear the full residual flag.
|
|
|
|
*/
|
|
|
|
and SCB_SGPTR[0], ~SG_FULL_RESID;
|
1997-02-11 17:07:54 +00:00
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->features & AHC_ULTRA2) != 0) {
|
2000-07-18 20:12:14 +00:00
|
|
|
/* Clear the channel in case we return to data phase later */
|
1998-09-15 07:24:17 +00:00
|
|
|
or SXFRCTL0, CLRSTCNT|CLRCHN;
|
|
|
|
}
|
1997-02-11 17:07:54 +00:00
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->flags & AHC_TARGETMODE) != 0) {
|
1998-12-10 04:14:50 +00:00
|
|
|
test SEQ_FLAGS, DPHASE_PENDING jz ITloop;
|
1998-09-15 07:24:17 +00:00
|
|
|
and SEQ_FLAGS, ~DPHASE_PENDING;
|
1999-01-14 06:14:15 +00:00
|
|
|
/*
|
|
|
|
* For data-in phases, wait for any pending acks from the
|
|
|
|
* initiator before changing phase.
|
|
|
|
*/
|
|
|
|
test DFCNTRL, DIRECTION jz target_ITloop;
|
|
|
|
test SSTAT1, REQINIT jnz .;
|
1998-09-15 07:24:17 +00:00
|
|
|
jmp target_ITloop;
|
2000-07-18 20:12:14 +00:00
|
|
|
} else {
|
|
|
|
jmp ITloop;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
|
|
|
|
1998-12-10 04:14:50 +00:00
|
|
|
if ((ahc->flags & AHC_INITIATORMODE) != 0) {
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
1996-04-20 21:20:31 +00:00
|
|
|
* Command phase. Set up the DMA registers and let 'er rip.
|
1996-01-03 06:25:32 +00:00
|
|
|
*/
|
1994-11-17 20:19:10 +00:00
|
|
|
p_command:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
call assert;
|
1994-11-17 20:19:10 +00:00
|
|
|
|
2000-07-18 20:12:14 +00:00
|
|
|
if ((ahc->features & AHC_ULTRA2) != 0) {
|
|
|
|
bmov HCNT[0], SCB_CDB_LEN, 1;
|
1998-09-15 07:24:17 +00:00
|
|
|
bmov HCNT[1], ALLZEROS, 2;
|
2000-07-18 20:12:14 +00:00
|
|
|
} else if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
bmov STCNT[0], SCB_CDB_LEN, 1;
|
|
|
|
bmov STCNT[1], ALLZEROS, 2;
|
1998-09-15 07:24:17 +00:00
|
|
|
} else {
|
2000-07-18 20:12:14 +00:00
|
|
|
mov STCNT[0], SCB_CDB_LEN;
|
|
|
|
clr STCNT[1];
|
|
|
|
clr STCNT[2];
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
2000-07-18 20:12:14 +00:00
|
|
|
add NONE, -13, SCB_CDB_LEN;
|
|
|
|
mvi SCB_CDB_STORE jnc p_command_embedded;
|
|
|
|
p_command_from_host:
|
|
|
|
if ((ahc->features & AHC_ULTRA2) != 0) {
|
|
|
|
bmov HADDR[0], SCB_CDB_PTR, 4;
|
|
|
|
mvi DFCNTRL, (PRELOADEN|SCSIEN|HDMAEN|DIRECTION);
|
|
|
|
} else {
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
bmov HADDR[0], SCB_CDB_PTR, 4;
|
|
|
|
bmov HCNT[0], STCNT[0], 3;
|
|
|
|
} else {
|
|
|
|
mvi DINDEX, HADDR;
|
|
|
|
mvi SCB_CDB_PTR call bcopy_5;
|
|
|
|
call clear_hcnt;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
|
|
|
mvi DFCNTRL, (SCSIEN|SDMAEN|HDMAEN|DIRECTION|FIFORESET);
|
2000-07-18 20:12:14 +00:00
|
|
|
}
|
|
|
|
jmp p_command_loop;
|
|
|
|
p_command_embedded:
|
|
|
|
/*
|
|
|
|
* The data fifo seems to require 4 byte alligned
|
|
|
|
* transfers from the sequencer. Force this to
|
|
|
|
* be the case by clearing HADDR[0] even though
|
|
|
|
* we aren't going to touch host memeory.
|
|
|
|
*/
|
|
|
|
clr HADDR[0];
|
|
|
|
if ((ahc->features & AHC_ULTRA2) != 0) {
|
|
|
|
mvi DFCNTRL, (PRELOADEN|SCSIEN|DIRECTION);
|
1998-09-15 07:24:17 +00:00
|
|
|
} else {
|
2000-07-18 20:12:14 +00:00
|
|
|
mvi DFCNTRL, (SCSIEN|SDMAEN|DIRECTION|FIFORESET);
|
|
|
|
}
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
bmov DFDAT, SCB_CDB_STORE, 12;
|
|
|
|
} else {
|
|
|
|
/*
|
|
|
|
* At most 12 bytes, but we copy 16 to fill
|
|
|
|
* the 64bit words in the FIFO
|
|
|
|
*/
|
|
|
|
call copy_to_fifo_8;
|
|
|
|
call copy_to_fifo_8;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
2000-07-18 20:12:14 +00:00
|
|
|
p_command_loop:
|
1998-09-15 07:24:17 +00:00
|
|
|
test SSTAT0, SDONE jnz . + 2;
|
2000-07-18 20:12:14 +00:00
|
|
|
test SSTAT1, PHASEMIS jz p_command_loop;
|
2000-01-07 23:08:20 +00:00
|
|
|
/*
|
|
|
|
* Wait for our ACK to go-away on it's own
|
|
|
|
* instead of being killed by SCSIEN getting cleared.
|
|
|
|
*/
|
|
|
|
test SCSISIGI, ACKI jnz .;
|
|
|
|
and DFCNTRL, ~(SCSIEN|SDMAEN|HDMAEN);
|
1998-09-15 07:24:17 +00:00
|
|
|
test DFCNTRL, (SCSIEN|SDMAEN|HDMAEN) jnz .;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
jmp ITloop;
|
1994-11-17 20:19:10 +00:00
|
|
|
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
|
|
|
* Status phase. Wait for the data byte to appear, then read it
|
|
|
|
* and store it into the SCB.
|
|
|
|
*/
|
1994-11-17 20:19:10 +00:00
|
|
|
p_status:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
call assert;
|
1996-11-16 01:07:35 +00:00
|
|
|
|
2000-07-18 20:12:14 +00:00
|
|
|
mov SCB_SCSI_STATUS, SCSIDATL;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
jmp ITloop;
|
1994-11-17 20:19:10 +00:00
|
|
|
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
1998-12-10 04:14:50 +00:00
|
|
|
* Message out phase. If MSG_OUT is MSG_IDENTIFYFLAG, build a full
|
|
|
|
* indentify message sequence and send it to the target. The host may
|
|
|
|
* override this behavior by setting the MK_MESSAGE bit in the SCB
|
|
|
|
* control byte. This will cause us to interrupt the host and allow
|
|
|
|
* it to handle the message phase completely on its own. If the bit
|
|
|
|
* associated with this target is set, we will also interrupt the host,
|
|
|
|
* thereby allowing it to send a message on the next selection regardless
|
|
|
|
* of the transaction being sent.
|
1998-09-15 07:24:17 +00:00
|
|
|
*
|
|
|
|
* If MSG_OUT is == HOST_MSG, also interrupt the host and take a message.
|
1998-12-10 04:14:50 +00:00
|
|
|
* This is done to allow the host to send messages outside of an identify
|
1998-09-15 07:24:17 +00:00
|
|
|
* sequence while protecting the seqencer from testing the MK_MESSAGE bit
|
|
|
|
* on an SCB that might not be for the current nexus. (For example, a
|
|
|
|
* BDR message in responce to a bad reselection would leave us pointed to
|
|
|
|
* an SCB that doesn't have anything to do with the current target).
|
1998-12-10 04:14:50 +00:00
|
|
|
*
|
1998-09-15 07:24:17 +00:00
|
|
|
* Otherwise, treat MSG_OUT as a 1 byte message to send (abort, abort tag,
|
|
|
|
* bus device reset).
|
|
|
|
*
|
|
|
|
* When there are no messages to send, MSG_OUT should be set to MSG_NOOP,
|
|
|
|
* in case the target decides to put us in this phase for some strange
|
|
|
|
* reason.
|
1996-01-03 06:25:32 +00:00
|
|
|
*/
|
1998-12-10 04:14:50 +00:00
|
|
|
p_mesgout_retry:
|
|
|
|
or SCSISIGO,ATNO,LASTPHASE;/* turn on ATN for the retry */
|
1994-11-17 20:19:10 +00:00
|
|
|
p_mesgout:
|
1998-09-15 07:24:17 +00:00
|
|
|
mov SINDEX, MSG_OUT;
|
|
|
|
cmp SINDEX, MSG_IDENTIFYFLAG jne p_mesgout_from_host;
|
1998-12-10 04:14:50 +00:00
|
|
|
test SCB_CONTROL,MK_MESSAGE jnz host_message_loop;
|
2000-07-18 20:12:14 +00:00
|
|
|
mov FUNCTION1, SCB_SCSIID;
|
1998-12-10 04:14:50 +00:00
|
|
|
mov A, FUNCTION1;
|
1999-05-22 22:04:11 +00:00
|
|
|
mov SINDEX, TARGET_MSG_REQUEST[0];
|
1998-12-10 04:14:50 +00:00
|
|
|
if ((ahc->features & AHC_TWIN) != 0) {
|
|
|
|
/* Second Channel uses high byte bits */
|
2000-07-18 20:12:14 +00:00
|
|
|
test SCB_SCSIID, TWIN_CHNLB jz . + 2;
|
1998-12-10 04:14:50 +00:00
|
|
|
mov SINDEX, TARGET_MSG_REQUEST[1];
|
|
|
|
} else if ((ahc->features & AHC_WIDE) != 0) {
|
2000-07-18 20:12:14 +00:00
|
|
|
test SCB_SCSIID, 0x80 jz . + 2; /* target > 7 */
|
1998-12-10 04:14:50 +00:00
|
|
|
mov SINDEX, TARGET_MSG_REQUEST[1];
|
|
|
|
}
|
|
|
|
test SINDEX, A jnz host_message_loop;
|
1998-09-15 07:24:17 +00:00
|
|
|
p_mesgout_identify:
|
2000-07-18 20:12:14 +00:00
|
|
|
or SINDEX, MSG_IDENTIFYFLAG|DISCENB, SCB_LUN;
|
|
|
|
test SCB_CONTROL, DISCENB jnz . + 2;
|
|
|
|
and SINDEX, ~DISCENB;
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
1998-09-15 07:24:17 +00:00
|
|
|
* Send a tag message if TAG_ENB is set in the SCB control block.
|
|
|
|
* Use SCB_TAG (the position in the kernel's SCB array) as the tag value.
|
1996-01-03 06:25:32 +00:00
|
|
|
*/
|
1998-09-15 07:24:17 +00:00
|
|
|
p_mesgout_tag:
|
|
|
|
test SCB_CONTROL,TAG_ENB jz p_mesgout_onebyte;
|
|
|
|
mov SCSIDATL, SINDEX; /* Send the identify message */
|
|
|
|
call phase_lock;
|
|
|
|
cmp LASTPHASE, P_MESGOUT jne p_mesgout_done;
|
|
|
|
and SCSIDATL,TAG_ENB|SCB_TAG_TYPE,SCB_CONTROL;
|
|
|
|
call phase_lock;
|
|
|
|
cmp LASTPHASE, P_MESGOUT jne p_mesgout_done;
|
|
|
|
mov SCB_TAG jmp p_mesgout_onebyte;
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
1998-12-10 04:14:50 +00:00
|
|
|
* Interrupt the driver, and allow it to handle this message
|
|
|
|
* phase and any required retries.
|
1996-01-03 06:25:32 +00:00
|
|
|
*/
|
1998-09-15 07:24:17 +00:00
|
|
|
p_mesgout_from_host:
|
|
|
|
cmp SINDEX, HOST_MSG jne p_mesgout_onebyte;
|
1998-12-10 04:14:50 +00:00
|
|
|
jmp host_message_loop;
|
1998-09-15 07:24:17 +00:00
|
|
|
|
|
|
|
p_mesgout_onebyte:
|
|
|
|
mvi CLRSINT1, CLRATNO;
|
|
|
|
mov SCSIDATL, SINDEX;
|
|
|
|
|
1997-04-18 16:31:55 +00:00
|
|
|
/*
|
1998-12-10 04:14:50 +00:00
|
|
|
* If the next bus phase after ATN drops is message out, it means
|
1997-04-18 16:31:55 +00:00
|
|
|
* that the target is requesting that the last message(s) be resent.
|
|
|
|
*/
|
1998-09-15 07:24:17 +00:00
|
|
|
call phase_lock;
|
1998-12-10 04:14:50 +00:00
|
|
|
cmp LASTPHASE, P_MESGOUT je p_mesgout_retry;
|
1994-11-17 20:19:10 +00:00
|
|
|
|
1996-01-03 06:25:32 +00:00
|
|
|
p_mesgout_done:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mvi CLRSINT1,CLRATNO; /* Be sure to turn ATNO off */
|
1998-09-15 07:24:17 +00:00
|
|
|
mov LAST_MSG, MSG_OUT;
|
|
|
|
mvi MSG_OUT, MSG_NOOP; /* No message left */
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
jmp ITloop;
|
1994-11-17 20:19:10 +00:00
|
|
|
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
|
|
|
* Message in phase. Bytes are read using Automatic PIO mode.
|
|
|
|
*/
|
1994-11-17 20:19:10 +00:00
|
|
|
p_mesgin:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mvi ACCUM call inb_first; /* read the 1st message byte */
|
|
|
|
|
|
|
|
test A,MSG_IDENTIFYFLAG jnz mesgin_identify;
|
|
|
|
cmp A,MSG_DISCONNECT je mesgin_disconnect;
|
|
|
|
cmp A,MSG_SAVEDATAPOINTER je mesgin_sdptrs;
|
|
|
|
cmp ALLZEROS,A je mesgin_complete;
|
|
|
|
cmp A,MSG_RESTOREPOINTERS je mesgin_rdptrs;
|
2000-07-18 20:12:14 +00:00
|
|
|
cmp A,MSG_IGN_WIDE_RESIDUE je mesgin_ign_wide_residue;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
cmp A,MSG_NOOP je mesgin_done;
|
1994-11-17 20:19:10 +00:00
|
|
|
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
1998-12-17 00:06:52 +00:00
|
|
|
* Pushed message loop to allow the kernel to
|
2000-02-09 21:25:00 +00:00
|
|
|
* run it's own message state engine. To avoid an
|
1998-12-17 00:06:52 +00:00
|
|
|
* extra nop instruction after signaling the kernel,
|
|
|
|
* we perform the phase_lock before checking to see
|
|
|
|
* if we should exit the loop and skip the phase_lock
|
|
|
|
* in the ITloop. Performing back to back phase_locks
|
|
|
|
* shouldn't hurt, but why do it twice...
|
1996-01-03 06:25:32 +00:00
|
|
|
*/
|
1998-12-17 00:06:52 +00:00
|
|
|
host_message_loop:
|
2000-07-18 20:12:14 +00:00
|
|
|
nop;
|
1998-12-17 00:06:52 +00:00
|
|
|
mvi INTSTAT, HOST_MSG_LOOP;
|
|
|
|
call phase_lock;
|
|
|
|
cmp RETURN_1, EXIT_MSG_LOOP je ITloop + 1;
|
|
|
|
jmp host_message_loop;
|
1995-08-06 05:15:45 +00:00
|
|
|
|
2000-07-18 20:12:14 +00:00
|
|
|
mesgin_ign_wide_residue:
|
|
|
|
if ((ahc->features & AHC_WIDE) != 0) {
|
|
|
|
test SCSIRATE, WIDEXFER jz mesgin_reject;
|
|
|
|
/* Pull the residue byte */
|
|
|
|
mvi ARG_1 call inb_next;
|
|
|
|
cmp ARG_1, 0x01 jne mesgin_reject;
|
|
|
|
test SCB_RESIDUAL_SGPTR[0], SG_LIST_NULL jz . + 2;
|
|
|
|
test DATA_COUNT_ODD, 0x1 jz mesgin_done;
|
|
|
|
mvi INTSTAT, IGN_WIDE_RES;
|
|
|
|
jmp mesgin_done;
|
|
|
|
}
|
|
|
|
|
|
|
|
mesgin_reject:
|
|
|
|
mvi MSG_MESSAGE_REJECT call mk_mesg;
|
1995-08-06 05:15:45 +00:00
|
|
|
mesgin_done:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov NONE,SCSIDATL; /*dummy read from latch to ACK*/
|
|
|
|
jmp ITloop;
|
1995-08-06 05:15:45 +00:00
|
|
|
|
|
|
|
mesgin_complete:
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
2000-07-18 20:12:14 +00:00
|
|
|
* We received a "command complete" message. Put the SCB_TAG into the QOUTFIFO,
|
1996-10-25 06:34:59 +00:00
|
|
|
* and trigger a completion interrupt. Before doing so, check to see if there
|
1998-09-15 07:24:17 +00:00
|
|
|
* is a residual or the status byte is something other than STATUS_GOOD (0).
|
|
|
|
* In either of these conditions, we upload the SCB back to the host so it can
|
1996-10-25 06:34:59 +00:00
|
|
|
* process this information. In the case of a non zero status byte, we
|
|
|
|
* additionally interrupt the kernel driver synchronously, allowing it to
|
|
|
|
* decide if sense should be retrieved. If the kernel driver wishes to request
|
|
|
|
* sense, it will fill the kernel SCB with a request sense command and set
|
|
|
|
* RETURN_1 to SEND_SENSE. If RETURN_1 is set to SEND_SENSE we redownload
|
|
|
|
* the SCB, and process it as the next command by adding it to the waiting list.
|
|
|
|
* If the kernel driver does not wish to request sense, it need only clear
|
|
|
|
* RETURN_1, and the command is allowed to complete normally. We don't bother
|
|
|
|
* to post to the QOUTFIFO in the error cases since it would require extra
|
|
|
|
* work in the kernel driver to ensure that the entry was removed before the
|
|
|
|
* command complete code tried processing it.
|
1996-01-03 06:25:32 +00:00
|
|
|
*/
|
1996-10-25 06:34:59 +00:00
|
|
|
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
1996-10-25 06:34:59 +00:00
|
|
|
* First check for residuals
|
1996-01-03 06:25:32 +00:00
|
|
|
*/
|
2000-07-18 20:12:14 +00:00
|
|
|
test SCB_SGPTR, SG_LIST_NULL jnz check_status;/* No xfer */
|
|
|
|
test SCB_SGPTR, SG_FULL_RESID jnz upload_scb;/* Never xfered */
|
|
|
|
test SCB_RESIDUAL_SGPTR, SG_LIST_NULL jz upload_scb;
|
|
|
|
check_status:
|
|
|
|
test SCB_SCSI_STATUS,0xff jz complete; /* Good Status? */
|
1996-10-25 06:34:59 +00:00
|
|
|
upload_scb:
|
2000-07-18 20:12:14 +00:00
|
|
|
or SCB_SGPTR, SG_RESID_VALID;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mvi DMAPARAMS, FIFORESET;
|
|
|
|
mov SCB_TAG call dma_scb;
|
2000-07-18 20:12:14 +00:00
|
|
|
test SCB_SCSI_STATUS, 0xff jz complete; /* Just a residual? */
|
|
|
|
mvi INTSTAT, BAD_STATUS; /* let driver know */
|
|
|
|
/*
|
|
|
|
* Prepare to DMA this SCB in case we are told to retrieve sense.
|
|
|
|
* Fills a delay slot after the INTSTAT as well.
|
|
|
|
*/
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mvi DMAPARAMS, HDMAEN|DIRECTION|FIFORESET;
|
2000-07-18 20:12:14 +00:00
|
|
|
cmp RETURN_1, SEND_SENSE jne complete;
|
1998-09-15 07:24:17 +00:00
|
|
|
mov SCB_TAG call dma_scb;
|
1996-10-25 06:34:59 +00:00
|
|
|
add_to_waiting_list:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov SCB_NEXT,WAITING_SCBH;
|
|
|
|
mov WAITING_SCBH, SCBPTR;
|
|
|
|
/*
|
|
|
|
* Prepare our selection hardware before the busfree so we have a
|
|
|
|
* high probability of winning arbitration.
|
|
|
|
*/
|
|
|
|
call start_selection;
|
|
|
|
jmp await_busfree;
|
1998-09-15 07:24:17 +00:00
|
|
|
|
|
|
|
complete:
|
|
|
|
mov SCB_TAG call complete_post;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
jmp await_busfree;
|
1998-12-10 04:14:50 +00:00
|
|
|
}
|
1995-03-31 14:06:02 +00:00
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
complete_post:
|
|
|
|
/* Post the SCBID in SINDEX and issue an interrupt */
|
1999-03-05 23:35:48 +00:00
|
|
|
call add_scb_to_free_list;
|
1998-09-15 07:24:17 +00:00
|
|
|
mov ARG_1, SINDEX;
|
|
|
|
if ((ahc->features & AHC_QUEUE_REGS) != 0) {
|
|
|
|
mov A, SDSCB_QOFF;
|
|
|
|
} else {
|
|
|
|
mov A, QOUTPOS;
|
|
|
|
}
|
|
|
|
mvi QOUTFIFO_OFFSET call post_byte_setup;
|
|
|
|
mov ARG_1 call post_byte;
|
|
|
|
if ((ahc->features & AHC_QUEUE_REGS) == 0) {
|
|
|
|
inc QOUTPOS;
|
|
|
|
}
|
|
|
|
mvi INTSTAT,CMDCMPLT ret;
|
|
|
|
|
1998-12-10 04:14:50 +00:00
|
|
|
if ((ahc->flags & AHC_INITIATORMODE) != 0) {
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
|
|
|
* Is it a disconnect message? Set a flag in the SCB to remind us
|
2000-07-18 20:12:14 +00:00
|
|
|
* and await the bus going free. If this is an untagged transaction
|
|
|
|
* store the SCB id for it in our untagged target table for lookup on
|
|
|
|
* a reselction.
|
1996-01-03 06:25:32 +00:00
|
|
|
*/
|
1995-08-06 05:15:45 +00:00
|
|
|
mesgin_disconnect:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
or SCB_CONTROL,DISCONNECTED;
|
2000-07-18 20:12:14 +00:00
|
|
|
if ((ahc->flags & AHC_PAGESCBS) != 0) {
|
|
|
|
call add_scb_to_disc_list;
|
|
|
|
}
|
|
|
|
test SCB_CONTROL, TAG_ENB jnz await_busfree;
|
|
|
|
mov ARG_1, SCB_TAG;
|
|
|
|
mov SAVED_LUN, SCB_LUN;
|
|
|
|
mov SCB_SCSIID call index_busy_target;
|
|
|
|
mov DINDIR, ARG_1;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
jmp await_busfree;
|
1994-11-17 20:19:10 +00:00
|
|
|
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
1996-10-25 06:34:59 +00:00
|
|
|
* Save data pointers message:
|
|
|
|
* Copying RAM values back to SCB, for Save Data Pointers message, but
|
|
|
|
* only if we've actually been into a data phase to change them. This
|
|
|
|
* protects against bogus data in scratch ram and the residual counts
|
|
|
|
* since they are only initialized when we go into data_in or data_out.
|
1996-01-03 06:25:32 +00:00
|
|
|
*/
|
1995-08-06 05:15:45 +00:00
|
|
|
mesgin_sdptrs:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
test SEQ_FLAGS, DPHASE jz mesgin_done;
|
1996-10-25 06:34:59 +00:00
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
/*
|
2000-07-18 20:12:14 +00:00
|
|
|
* The SCB_SGPTR becomes the next one we'll download,
|
|
|
|
* and the SCB_DATAPTR becomes the current SHADDR.
|
1998-09-15 07:24:17 +00:00
|
|
|
* Use the residual number since STCNT is corrupted by
|
|
|
|
* any message transfer.
|
|
|
|
*/
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
bmov SCB_DATAPTR, SHADDR, 4;
|
2000-07-18 20:12:14 +00:00
|
|
|
bmov SCB_DATACNT, SCB_RESIDUAL_DATACNT, 8;
|
1998-09-15 07:24:17 +00:00
|
|
|
} else {
|
|
|
|
mvi DINDEX, SCB_DATAPTR;
|
2000-07-18 20:12:14 +00:00
|
|
|
mvi SHADDR call bcopy_4;
|
|
|
|
mvi SCB_RESIDUAL_DATACNT call bcopy_8;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
jmp mesgin_done;
|
1994-11-17 20:19:10 +00:00
|
|
|
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
|
|
|
* Restore pointers message? Data pointers are recopied from the
|
|
|
|
* SCB anytime we enter a data phase for the first time, so all
|
|
|
|
* we need to do is clear the DPHASE flag and let the data phase
|
|
|
|
* code do the rest.
|
|
|
|
*/
|
1995-08-06 05:15:45 +00:00
|
|
|
mesgin_rdptrs:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
and SEQ_FLAGS, ~DPHASE; /*
|
|
|
|
* We'll reload them
|
1996-01-03 06:25:32 +00:00
|
|
|
* the next time through
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
* the dataphase.
|
1996-01-03 06:25:32 +00:00
|
|
|
*/
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
jmp mesgin_done;
|
1994-11-17 20:19:10 +00:00
|
|
|
|
2000-07-18 20:12:14 +00:00
|
|
|
/*
|
|
|
|
* Index into our Busy Target table. SINDEX and DINDEX are modified
|
|
|
|
* upon return. SCBPTR may be modified by this action.
|
|
|
|
*/
|
|
|
|
index_busy_target:
|
|
|
|
if ((ahc->features & AHC_SCB_BTT) != 0) {
|
|
|
|
mov SCBPTR, SAVED_LUN;
|
|
|
|
add SINDEX, SCB_64_BTT;
|
|
|
|
} else {
|
|
|
|
shr SINDEX, 4;
|
|
|
|
add SINDEX, BUSY_TARGETS;
|
|
|
|
}
|
|
|
|
mov DINDEX, SINDEX ret;
|
|
|
|
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
|
|
|
* Identify message? For a reconnecting target, this tells us the lun
|
|
|
|
* that the reconnection is for - find the correct SCB and switch to it,
|
|
|
|
* clearing the "disconnected" bit so we don't "find" it by accident later.
|
|
|
|
*/
|
1995-08-06 05:15:45 +00:00
|
|
|
mesgin_identify:
|
2000-07-18 20:12:14 +00:00
|
|
|
and SAVED_LUN, MSG_IDENTIFY_LUNMASK, A;
|
|
|
|
/*
|
|
|
|
* Determine whether a target is using tagged or non-tagged
|
|
|
|
* transactions by first looking at the transaction stored in
|
|
|
|
* the busy target array. If there is no untagged transaction
|
|
|
|
* for this target or the transaction is for a different lun, then
|
|
|
|
* this must be an untagged transaction.
|
|
|
|
*/
|
|
|
|
mov SAVED_SCSIID call index_busy_target;
|
|
|
|
mov A, SINDIR;
|
|
|
|
cmp A, SCB_LIST_NULL je snoop_tag;
|
|
|
|
if ((ahc->flags & AHC_PAGESCBS) != 0) {
|
|
|
|
mov A call findSCB;
|
1998-09-15 07:24:17 +00:00
|
|
|
} else {
|
2000-07-18 20:12:14 +00:00
|
|
|
mov SCBPTR, A;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
2000-07-18 20:12:14 +00:00
|
|
|
if ((ahc->features & AHC_SCB_BTT) != 0) {
|
|
|
|
jmp setup_SCB_id_lun_okay;
|
|
|
|
} else {
|
|
|
|
mov A, SCB_LUN;
|
|
|
|
cmp SAVED_LUN, A je setup_SCB_id_lun_okay;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
2000-07-18 20:12:14 +00:00
|
|
|
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
|
|
|
* Here we "snoop" the bus looking for a SIMPLE QUEUE TAG message.
|
1997-02-28 03:51:00 +00:00
|
|
|
* If we get one, we use the tag returned to find the proper
|
2000-07-18 20:12:14 +00:00
|
|
|
* SCB. With SCB paging, we must search for non-tagged
|
|
|
|
* transactions since the SCB may exist in any slot. If we're not
|
|
|
|
* using SCB paging, we can use the tag as the direct index to the
|
|
|
|
* SCB.
|
1996-01-03 06:25:32 +00:00
|
|
|
*/
|
1997-04-04 04:09:29 +00:00
|
|
|
snoop_tag:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov NONE,SCSIDATL; /* ACK Identify MSG */
|
1996-01-03 06:25:32 +00:00
|
|
|
snoop_tag_loop:
|
1998-09-15 07:24:17 +00:00
|
|
|
call phase_lock;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
cmp LASTPHASE, P_MESGIN jne not_found;
|
|
|
|
cmp SCSIBUSL,MSG_SIMPLE_Q_TAG jne not_found;
|
1995-02-22 01:37:52 +00:00
|
|
|
get_tag:
|
2000-07-18 20:12:14 +00:00
|
|
|
if ((ahc->flags & AHC_PAGESCBS) != 0) {
|
|
|
|
mvi ARG_1 call inb_next; /* tag value */
|
|
|
|
mov ARG_1 call findSCB;
|
|
|
|
} else {
|
|
|
|
mvi SCBPTR call inb_next; /* tag value */
|
|
|
|
}
|
1996-01-03 06:25:32 +00:00
|
|
|
|
2000-07-18 20:12:14 +00:00
|
|
|
/*
|
|
|
|
* Ensure that the SCB the tag points to is for
|
|
|
|
* an SCB transaction to the reconnecting target.
|
|
|
|
*/
|
1996-04-20 21:20:31 +00:00
|
|
|
setup_SCB:
|
2000-07-18 20:12:14 +00:00
|
|
|
mov A, SAVED_SCSIID;
|
|
|
|
cmp SCB_SCSIID, A jne not_found;
|
|
|
|
mov A, SAVED_LUN;
|
|
|
|
cmp SCB_LUN, A jne not_found;
|
|
|
|
setup_SCB_id_lun_okay:
|
|
|
|
test SCB_CONTROL,DISCONNECTED jz not_found;
|
|
|
|
if ((ahc->flags & AHC_PAGESCBS) != 0) {
|
|
|
|
mov SCBPTR call rem_scb_from_disc_list;
|
|
|
|
}
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
and SCB_CONTROL,~DISCONNECTED;
|
2000-01-07 23:08:20 +00:00
|
|
|
or SEQ_FLAGS,IDENTIFY_SEEN; /* make note of IDENTIFY */
|
2000-07-18 20:12:14 +00:00
|
|
|
test SCB_CONTROL, TAG_ENB jnz setup_SCB_tagged;
|
|
|
|
mov A, SCBPTR;
|
|
|
|
mov SAVED_SCSIID call index_busy_target;
|
|
|
|
mvi DINDIR, SCB_LIST_NULL;
|
|
|
|
mov SCBPTR, A;
|
|
|
|
setup_SCB_tagged:
|
1998-09-15 07:24:17 +00:00
|
|
|
call set_transfer_settings;
|
|
|
|
/* See if the host wants to send a message upon reconnection */
|
|
|
|
test SCB_CONTROL, MK_MESSAGE jz mesgin_done;
|
|
|
|
and SCB_CONTROL, ~MK_MESSAGE;
|
|
|
|
mvi HOST_MSG call mk_mesg;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
jmp mesgin_done;
|
1996-04-20 21:20:31 +00:00
|
|
|
|
1996-10-28 06:01:08 +00:00
|
|
|
not_found:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mvi INTSTAT, NO_MATCH;
|
|
|
|
jmp mesgin_done;
|
1994-11-17 20:19:10 +00:00
|
|
|
|
|
|
|
mk_mesg:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
or SCSISIGO,ATNO,LASTPHASE;/* turn on ATNO */
|
1998-09-15 07:24:17 +00:00
|
|
|
mov MSG_OUT,SINDEX ret;
|
1996-01-03 06:25:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Functions to read data in Automatic PIO mode.
|
|
|
|
*
|
|
|
|
* According to Adaptec's documentation, an ACK is not sent on input from
|
|
|
|
* the target until SCSIDATL is read from. So we wait until SCSIDATL is
|
|
|
|
* latched (the usual way), then read the data byte directly off the bus
|
|
|
|
* using SCSIBUSL. When we have pulled the ATN line, or we just want to
|
|
|
|
* acknowledge the byte, then we do a dummy read from SCISDATL. The SCSI
|
|
|
|
* spec guarantees that the target will hold the data byte on the bus until
|
|
|
|
* we send our ACK.
|
|
|
|
*
|
|
|
|
* The assumption here is that these are called in a particular sequence,
|
|
|
|
* and that REQ is already set when inb_first is called. inb_{first,next}
|
|
|
|
* use the same calling convention as inb.
|
|
|
|
*/
|
2000-02-09 21:25:00 +00:00
|
|
|
inb_next_wait_perr:
|
|
|
|
mvi INTSTAT, PERR_DETECTED;
|
|
|
|
jmp inb_next_wait;
|
1994-11-17 20:19:10 +00:00
|
|
|
inb_next:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov NONE,SCSIDATL; /*dummy read from latch to ACK*/
|
1996-01-09 16:14:03 +00:00
|
|
|
inb_next_wait:
|
1997-01-22 18:01:07 +00:00
|
|
|
/*
|
|
|
|
* If there is a parity error, wait for the kernel to
|
|
|
|
* see the interrupt and prepare our message response
|
|
|
|
* before continuing.
|
|
|
|
*/
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
test SSTAT1, REQINIT jz inb_next_wait;
|
2000-02-09 21:25:00 +00:00
|
|
|
test SSTAT1, SCSIPERR jnz inb_next_wait_perr;
|
|
|
|
inb_next_check_phase:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
and LASTPHASE, PHASE_MASK, SCSISIGI;
|
|
|
|
cmp LASTPHASE, P_MESGIN jne mesgin_phasemis;
|
1996-11-16 01:07:35 +00:00
|
|
|
inb_first:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov DINDEX,SINDEX;
|
|
|
|
mov DINDIR,SCSIBUSL ret; /*read byte directly from bus*/
|
1996-01-03 06:25:32 +00:00
|
|
|
inb_last:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov NONE,SCSIDATL ret; /*dummy read from latch to ACK*/
|
1998-12-10 04:14:50 +00:00
|
|
|
}
|
1996-01-05 16:11:49 +00:00
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->flags & AHC_TARGETMODE) != 0) {
|
1998-12-10 04:14:50 +00:00
|
|
|
/*
|
|
|
|
* Change to a new phase. If we are changing the state of the I/O signal,
|
|
|
|
* from out to in, wait an additional data release delay before continuing.
|
|
|
|
*/
|
|
|
|
change_phase:
|
1999-02-11 07:10:20 +00:00
|
|
|
/* Wait for preceeding I/O session to complete. */
|
|
|
|
test SCSISIGI, ACKI jnz .;
|
|
|
|
|
|
|
|
/* Change the phase */
|
1998-12-10 04:14:50 +00:00
|
|
|
and DINDEX, IOI, SCSISIGI;
|
|
|
|
mov SCSISIGO, SINDEX;
|
|
|
|
and A, IOI, SINDEX;
|
1999-02-11 07:10:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* If the data direction has changed, from
|
|
|
|
* out (initiator driving) to in (target driving),
|
2000-07-18 20:12:14 +00:00
|
|
|
* we must wait at least a data release delay plus
|
1999-02-11 07:10:20 +00:00
|
|
|
* the normal bus settle delay. [SCSI III SPI 10.11.0]
|
|
|
|
*/
|
1998-12-10 04:14:50 +00:00
|
|
|
cmp DINDEX, A je change_phase_wait;
|
|
|
|
test SINDEX, IOI jz change_phase_wait;
|
|
|
|
call change_phase_wait;
|
|
|
|
change_phase_wait:
|
|
|
|
nop;
|
|
|
|
nop;
|
|
|
|
nop;
|
|
|
|
nop ret;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Send a byte to an initiator in Automatic PIO mode.
|
|
|
|
*/
|
1998-09-15 07:24:17 +00:00
|
|
|
target_outb:
|
|
|
|
or SXFRCTL0, SPIOEN;
|
|
|
|
test SSTAT0, SPIORDY jz .;
|
|
|
|
mov SCSIDATL, SINDEX;
|
|
|
|
test SSTAT0, SPIORDY jz .;
|
1998-12-10 04:14:50 +00:00
|
|
|
and SXFRCTL0, ~SPIOEN ret;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
|
|
|
|
1994-11-17 20:19:10 +00:00
|
|
|
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
|
|
|
* Assert that if we've been reselected, then we've seen an IDENTIFY
|
|
|
|
* message.
|
|
|
|
*/
|
1994-11-17 20:19:10 +00:00
|
|
|
assert:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
test SEQ_FLAGS,IDENTIFY_SEEN jnz return; /* seen IDENTIFY? */
|
1994-11-17 20:19:10 +00:00
|
|
|
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mvi INTSTAT,NO_IDENT ret; /* no - tell the kernel */
|
1994-11-17 20:19:10 +00:00
|
|
|
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
2000-07-18 20:12:14 +00:00
|
|
|
* Locate a disconnected SCB by SCBID. Upon return, SCBPTR and SINDEX will
|
|
|
|
* be set to the position of the SCB. If the SCB cannot be found locally,
|
|
|
|
* it will be paged in from host memory. RETURN_2 stores the address of the
|
|
|
|
* preceding SCB in the disconnected list which can be used to speed up
|
|
|
|
* removal of the found SCB from the disconnected list.
|
1996-01-03 06:25:32 +00:00
|
|
|
*/
|
1994-11-17 20:19:10 +00:00
|
|
|
findSCB:
|
2000-07-18 20:12:14 +00:00
|
|
|
mov SCBPTR, DISCONNECTED_SCBH; /* Initialize SCBPTR */
|
|
|
|
mov A, SINDEX; /* Tag passed in SINDEX */
|
|
|
|
mvi RETURN_2, SCB_LIST_NULL; /* Head of list */
|
|
|
|
jmp findSCB_loop;
|
1998-09-15 07:24:17 +00:00
|
|
|
findSCB_next:
|
2000-07-18 20:12:14 +00:00
|
|
|
mov RETURN_2, SCBPTR;
|
|
|
|
cmp SCB_NEXT, SCB_LIST_NULL je findSCB_notFound;
|
1998-09-15 07:24:17 +00:00
|
|
|
mov SCBPTR,SCB_NEXT;
|
1997-02-28 03:51:00 +00:00
|
|
|
findSCB_loop:
|
2000-07-18 20:12:14 +00:00
|
|
|
cmp SCB_TAG, A jne findSCB_next;
|
1998-09-15 07:24:17 +00:00
|
|
|
mov SINDEX, SCBPTR ret;
|
2000-07-18 20:12:14 +00:00
|
|
|
findSCB_notFound:
|
|
|
|
/*
|
|
|
|
* We didn't find it. Page in the SCB and make it look
|
|
|
|
* like it was at the head of the appropriate scb list.
|
|
|
|
*/
|
|
|
|
mov ARG_1, A; /* Save tag */
|
|
|
|
mov ALLZEROS call get_free_or_disc_scb;
|
|
|
|
mvi DMAPARAMS, HDMAEN|DIRECTION|FIFORESET;
|
|
|
|
mov ARG_1 call dma_scb;
|
|
|
|
mvi RETURN_2, SCB_LIST_NULL; /* Head of list */
|
|
|
|
/* Jump instead of call as we want to return anyway */
|
|
|
|
test SCB_CONTROL, DISCONNECTED jnz add_scb_to_disc_list;
|
|
|
|
jmp add_scb_to_free_list;
|
1998-09-15 07:24:17 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This routine expects SINDEX to contain the index of the SCB to be
|
|
|
|
* removed, SCBPTR to be pointing to that SCB, and ARG_2 to be the
|
|
|
|
* SCBID of the SCB just previous to this one in the list or SCB_LIST_NULL
|
|
|
|
* if it is at the head.
|
1996-10-25 06:34:59 +00:00
|
|
|
*/
|
|
|
|
rem_scb_from_disc_list:
|
1996-04-20 21:20:31 +00:00
|
|
|
/* Remove this SCB from the disconnection list */
|
1998-09-15 07:24:17 +00:00
|
|
|
cmp ARG_2, SCB_LIST_NULL je rHead;
|
|
|
|
mov DINDEX, SCB_NEXT;
|
|
|
|
mov SCBPTR, ARG_2;
|
|
|
|
mov SCB_NEXT, DINDEX;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov SCBPTR, SINDEX ret;
|
1996-04-20 21:20:31 +00:00
|
|
|
rHead:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov DISCONNECTED_SCBH,SCB_NEXT ret;
|
1994-11-17 20:19:10 +00:00
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
/*
|
|
|
|
* Fetch a byte from host memory given an index of (A + (256 * SINDEX))
|
2000-07-18 20:12:14 +00:00
|
|
|
* and a base address of SHARED_DATA_ADDR. The byte is returned in RETURN_2.
|
1998-09-15 07:24:17 +00:00
|
|
|
*/
|
|
|
|
fetch_byte:
|
|
|
|
mov ARG_2, SINDEX;
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
mvi DINDEX, CCHADDR;
|
2000-07-18 20:12:14 +00:00
|
|
|
mvi SHARED_DATA_ADDR call set_1byte_addr;
|
1998-09-15 07:24:17 +00:00
|
|
|
mvi CCHCNT, 1;
|
|
|
|
mvi CCSGCTL, CCSGEN|CCSGRESET;
|
|
|
|
test CCSGCTL, CCSGDONE jz .;
|
|
|
|
mvi CCSGCTL, CCSGRESET;
|
|
|
|
bmov RETURN_2, CCSGRAM, 1 ret;
|
|
|
|
} else {
|
|
|
|
mvi DINDEX, HADDR;
|
2000-07-18 20:12:14 +00:00
|
|
|
mvi SHARED_DATA_ADDR call set_1byte_addr;
|
|
|
|
mvi 1 call set_hcnt;
|
1998-09-15 07:24:17 +00:00
|
|
|
mvi DFCNTRL, HDMAEN|DIRECTION|FIFORESET;
|
|
|
|
call dma_finish;
|
|
|
|
mov RETURN_2, DFDAT ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Prepare the hardware to post a byte to host memory given an
|
2000-07-18 20:12:14 +00:00
|
|
|
* index of (A + (256 * SINDEX)) and a base address of SHARED_DATA_ADDR.
|
1998-09-15 07:24:17 +00:00
|
|
|
*/
|
|
|
|
post_byte_setup:
|
|
|
|
mov ARG_2, SINDEX;
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
mvi DINDEX, CCHADDR;
|
2000-07-18 20:12:14 +00:00
|
|
|
mvi SHARED_DATA_ADDR call set_1byte_addr;
|
1998-09-15 07:24:17 +00:00
|
|
|
mvi CCHCNT, 1;
|
|
|
|
mvi CCSCBCTL, CCSCBRESET ret;
|
|
|
|
} else {
|
|
|
|
mvi DINDEX, HADDR;
|
2000-07-18 20:12:14 +00:00
|
|
|
mvi SHARED_DATA_ADDR call set_1byte_addr;
|
|
|
|
mvi 1 call set_hcnt;
|
1998-09-15 07:24:17 +00:00
|
|
|
mvi DFCNTRL, FIFORESET ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
post_byte:
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
bmov CCSCBRAM, SINDEX, 1;
|
|
|
|
or CCSCBCTL, CCSCBEN|CCSCBRESET;
|
|
|
|
test CCSCBCTL, CCSCBDONE jz .;
|
|
|
|
clr CCSCBCTL ret;
|
|
|
|
} else {
|
|
|
|
mov DFDAT, SINDEX;
|
|
|
|
or DFCNTRL, HDMAEN|FIFOFLUSH;
|
|
|
|
jmp dma_finish;
|
|
|
|
}
|
|
|
|
|
|
|
|
get_SCBID_from_host:
|
2000-07-18 20:12:14 +00:00
|
|
|
mov A, SAVED_LUN;
|
|
|
|
shr SINDEX, 4, SAVED_SCSIID;
|
|
|
|
call fetch_byte;
|
1998-09-15 07:24:17 +00:00
|
|
|
mov RETURN_1, RETURN_2 ret;
|
|
|
|
|
2000-02-09 21:25:00 +00:00
|
|
|
phase_lock_perr:
|
|
|
|
mvi INTSTAT, PERR_DETECTED;
|
1998-09-15 07:24:17 +00:00
|
|
|
phase_lock:
|
2000-02-09 21:25:00 +00:00
|
|
|
/*
|
|
|
|
* If there is a parity error, wait for the kernel to
|
|
|
|
* see the interrupt and prepare our message response
|
|
|
|
* before continuing.
|
|
|
|
*/
|
1998-09-15 07:24:17 +00:00
|
|
|
test SSTAT1, REQINIT jz phase_lock;
|
2000-02-09 21:25:00 +00:00
|
|
|
test SSTAT1, SCSIPERR jnz phase_lock_perr;
|
|
|
|
phase_lock_latch_phase:
|
1998-12-10 04:14:50 +00:00
|
|
|
and SCSISIGO, PHASE_MASK, SCSISIGI;
|
|
|
|
and LASTPHASE, PHASE_MASK, SCSISIGI ret;
|
1998-09-15 07:24:17 +00:00
|
|
|
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) == 0) {
|
2000-07-18 20:12:14 +00:00
|
|
|
set_hcnt:
|
|
|
|
mov HCNT[0], SINDEX;
|
|
|
|
clear_hcnt:
|
|
|
|
clr HCNT[1];
|
|
|
|
clr HCNT[2] ret;
|
|
|
|
|
1996-10-25 06:34:59 +00:00
|
|
|
set_stcnt_from_hcnt:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov STCNT[0], HCNT[0];
|
|
|
|
mov STCNT[1], HCNT[1];
|
|
|
|
mov STCNT[2], HCNT[2] ret;
|
1996-10-25 06:34:59 +00:00
|
|
|
|
2000-07-18 20:12:14 +00:00
|
|
|
bcopy_8:
|
|
|
|
mov DINDIR, SINDIR;
|
1996-10-25 06:34:59 +00:00
|
|
|
bcopy_7:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov DINDIR, SINDIR;
|
|
|
|
mov DINDIR, SINDIR;
|
1996-10-25 06:34:59 +00:00
|
|
|
bcopy_5:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov DINDIR, SINDIR;
|
1996-10-25 06:34:59 +00:00
|
|
|
bcopy_4:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov DINDIR, SINDIR;
|
1996-10-25 06:34:59 +00:00
|
|
|
bcopy_3:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov DINDIR, SINDIR;
|
|
|
|
mov DINDIR, SINDIR;
|
|
|
|
mov DINDIR, SINDIR ret;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
1996-10-25 06:34:59 +00:00
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->flags & AHC_TARGETMODE) != 0) {
|
|
|
|
/*
|
|
|
|
* Setup addr assuming that A is an index into
|
|
|
|
* an array of 32byte objects, SINDEX contains
|
|
|
|
* the base address of that array, and DINDEX
|
|
|
|
* contains the base address of the location
|
|
|
|
* to store the indexed address.
|
|
|
|
*/
|
|
|
|
set_32byte_addr:
|
|
|
|
shr ARG_2, 3, A;
|
|
|
|
shl A, 5;
|
|
|
|
jmp set_1byte_addr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Setup addr assuming that A is an index into
|
|
|
|
* an array of 64byte objects, SINDEX contains
|
|
|
|
* the base address of that array, and DINDEX
|
|
|
|
* contains the base address of the location
|
|
|
|
* to store the indexed address.
|
|
|
|
*/
|
|
|
|
set_64byte_addr:
|
|
|
|
shr ARG_2, 2, A;
|
|
|
|
shl A, 6;
|
|
|
|
|
|
|
|
/*
|
2000-07-18 20:12:14 +00:00
|
|
|
* Setup addr assuming that A + (ARG_2 * 256) is an
|
1998-09-15 07:24:17 +00:00
|
|
|
* index into an array of 1byte objects, SINDEX contains
|
|
|
|
* the base address of that array, and DINDEX contains
|
|
|
|
* the base address of the location to store the computed
|
|
|
|
* address.
|
|
|
|
*/
|
|
|
|
set_1byte_addr:
|
|
|
|
add DINDIR, A, SINDIR;
|
|
|
|
mov A, ARG_2;
|
|
|
|
adc DINDIR, A, SINDIR;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
clr A;
|
1998-09-15 07:24:17 +00:00
|
|
|
adc DINDIR, A, SINDIR;
|
|
|
|
adc DINDIR, A, SINDIR ret;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Either post or fetch and SCB from host memory based on the
|
|
|
|
* DIRECTION bit in DMAPARAMS. The host SCB index is in SINDEX.
|
|
|
|
*/
|
|
|
|
dma_scb:
|
|
|
|
mov A, SINDEX;
|
|
|
|
if ((ahc->features & AHC_CMD_CHAN) != 0) {
|
|
|
|
mvi DINDEX, CCHADDR;
|
|
|
|
mvi HSCB_ADDR call set_64byte_addr;
|
|
|
|
mov CCSCBPTR, SCBPTR;
|
|
|
|
test DMAPARAMS, DIRECTION jz dma_scb_tohost;
|
|
|
|
mvi CCHCNT, SCB_64BYTE_SIZE;
|
|
|
|
mvi CCSCBCTL, CCARREN|CCSCBEN|CCSCBDIR|CCSCBRESET;
|
|
|
|
cmp CCSCBCTL, CCSCBDONE|ARRDONE|CCARREN|CCSCBEN|CCSCBDIR jne .;
|
|
|
|
jmp dma_scb_finish;
|
|
|
|
dma_scb_tohost:
|
|
|
|
mvi CCHCNT, SCB_32BYTE_SIZE;
|
|
|
|
if ((ahc->chip & AHC_CHIPID_MASK) == AHC_AIC7895) {
|
|
|
|
mvi CCSCBCTL, CCSCBRESET;
|
|
|
|
bmov CCSCBRAM, SCB_CONTROL, SCB_32BYTE_SIZE;
|
|
|
|
or CCSCBCTL, CCSCBEN|CCSCBRESET;
|
|
|
|
test CCSCBCTL, CCSCBDONE jz .;
|
|
|
|
} else {
|
|
|
|
mvi CCSCBCTL, CCARREN|CCSCBEN|CCSCBRESET;
|
|
|
|
cmp CCSCBCTL, CCSCBDONE|ARRDONE|CCARREN|CCSCBEN jne .;
|
|
|
|
}
|
|
|
|
dma_scb_finish:
|
|
|
|
clr CCSCBCTL;
|
|
|
|
test CCSCBCTL, CCARREN|CCSCBEN jnz .;
|
|
|
|
ret;
|
|
|
|
} else {
|
|
|
|
mvi DINDEX, HADDR;
|
|
|
|
mvi HSCB_ADDR call set_64byte_addr;
|
2000-07-18 20:12:14 +00:00
|
|
|
mvi SCB_32BYTE_SIZE call set_hcnt;
|
1998-09-15 07:24:17 +00:00
|
|
|
mov DFCNTRL, DMAPARAMS;
|
|
|
|
test DMAPARAMS, DIRECTION jnz dma_scb_fromhost;
|
|
|
|
/* Fill it with the SCB data */
|
1997-03-24 05:02:55 +00:00
|
|
|
copy_scb_tofifo:
|
1998-09-15 07:24:17 +00:00
|
|
|
mvi SINDEX, SCB_CONTROL;
|
|
|
|
add A, SCB_32BYTE_SIZE, SINDEX;
|
1997-03-24 05:02:55 +00:00
|
|
|
copy_scb_tofifo_loop:
|
2000-07-18 20:12:14 +00:00
|
|
|
call copy_to_fifo_6;
|
1998-09-15 07:24:17 +00:00
|
|
|
cmp SINDEX, A jne copy_scb_tofifo_loop;
|
|
|
|
or DFCNTRL, HDMAEN|FIFOFLUSH;
|
1996-10-25 06:34:59 +00:00
|
|
|
dma_scb_fromhost:
|
1998-09-15 07:24:17 +00:00
|
|
|
call dma_finish;
|
|
|
|
/* If we were putting the SCB, we are done */
|
|
|
|
test DMAPARAMS, DIRECTION jz return;
|
|
|
|
mvi SCB_CONTROL call dfdat_in_7;
|
|
|
|
call dfdat_in_7_continued;
|
|
|
|
call dfdat_in_7_continued;
|
2000-07-18 20:12:14 +00:00
|
|
|
call dfdat_in_7_continued;
|
|
|
|
jmp dfdat_in_2_continued;
|
1996-10-25 06:34:59 +00:00
|
|
|
dfdat_in_7:
|
1998-09-15 07:24:17 +00:00
|
|
|
mov DINDEX,SINDEX;
|
1996-10-25 06:34:59 +00:00
|
|
|
dfdat_in_7_continued:
|
1998-09-15 07:24:17 +00:00
|
|
|
mov DINDIR,DFDAT;
|
|
|
|
mov DINDIR,DFDAT;
|
|
|
|
mov DINDIR,DFDAT;
|
|
|
|
mov DINDIR,DFDAT;
|
|
|
|
mov DINDIR,DFDAT;
|
2000-07-18 20:12:14 +00:00
|
|
|
dfdat_in_2_continued:
|
1998-09-15 07:24:17 +00:00
|
|
|
mov DINDIR,DFDAT;
|
|
|
|
mov DINDIR,DFDAT ret;
|
|
|
|
}
|
|
|
|
|
2000-07-18 20:12:14 +00:00
|
|
|
copy_to_fifo_8:
|
|
|
|
mov DFDAT,SINDIR;
|
|
|
|
copy_to_fifo_7:
|
|
|
|
mov DFDAT,SINDIR;
|
|
|
|
copy_to_fifo_6:
|
|
|
|
mov DFDAT,SINDIR;
|
|
|
|
copy_to_fifo_5:
|
|
|
|
mov DFDAT,SINDIR;
|
|
|
|
copy_to_fifo_4:
|
|
|
|
mov DFDAT,SINDIR;
|
|
|
|
mov DFDAT,SINDIR;
|
|
|
|
mov DFDAT,SINDIR;
|
|
|
|
mov DFDAT,SINDIR ret;
|
1996-10-25 06:34:59 +00:00
|
|
|
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
1996-10-25 06:34:59 +00:00
|
|
|
* Wait for DMA from host memory to data FIFO to complete, then disable
|
|
|
|
* DMA and wait for it to acknowledge that it's off.
|
1996-01-03 06:25:32 +00:00
|
|
|
*/
|
1996-10-25 06:34:59 +00:00
|
|
|
dma_finish:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
test DFSTATUS,HDONE jz dma_finish;
|
1997-02-03 02:02:04 +00:00
|
|
|
/* Turn off DMA */
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
and DFCNTRL, ~HDMAEN;
|
|
|
|
test DFCNTRL, HDMAEN jnz .;
|
|
|
|
ret;
|
1995-08-05 17:31:39 +00:00
|
|
|
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
add_scb_to_free_list:
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->flags & AHC_PAGESCBS) != 0) {
|
|
|
|
mov SCB_NEXT, FREE_SCBH;
|
2000-02-09 21:25:00 +00:00
|
|
|
mvi SCB_TAG, SCB_LIST_NULL;
|
|
|
|
mov FREE_SCBH, SCBPTR ret;
|
|
|
|
} else {
|
|
|
|
mvi SCB_TAG, SCB_LIST_NULL ret;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
1994-11-17 20:19:10 +00:00
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
if ((ahc->flags & AHC_PAGESCBS) != 0) {
|
1996-10-25 06:34:59 +00:00
|
|
|
get_free_or_disc_scb:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
cmp FREE_SCBH, SCB_LIST_NULL jne dequeue_free_scb;
|
|
|
|
cmp DISCONNECTED_SCBH, SCB_LIST_NULL jne dequeue_disc_scb;
|
1996-11-11 05:16:41 +00:00
|
|
|
return_error:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mvi SINDEX, SCB_LIST_NULL ret;
|
1996-10-25 06:34:59 +00:00
|
|
|
dequeue_disc_scb:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov SCBPTR, DISCONNECTED_SCBH;
|
|
|
|
dma_up_scb:
|
|
|
|
mvi DMAPARAMS, FIFORESET;
|
|
|
|
mov SCB_TAG call dma_scb;
|
1996-10-25 06:34:59 +00:00
|
|
|
unlink_disc_scb:
|
1998-09-15 07:24:17 +00:00
|
|
|
mov DISCONNECTED_SCBH, SCB_NEXT ret;
|
1996-10-25 06:34:59 +00:00
|
|
|
dequeue_free_scb:
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov SCBPTR, FREE_SCBH;
|
|
|
|
mov FREE_SCBH, SCB_NEXT ret;
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
1994-11-17 20:19:10 +00:00
|
|
|
|
1996-10-25 06:34:59 +00:00
|
|
|
add_scb_to_disc_list:
|
1996-01-03 06:25:32 +00:00
|
|
|
/*
|
1996-10-25 06:34:59 +00:00
|
|
|
* Link this SCB into the DISCONNECTED list. This list holds the
|
|
|
|
* candidates for paging out an SCB if one is needed for a new command.
|
|
|
|
* Modifying the disconnected list is a critical(pause dissabled) section.
|
1996-01-03 06:25:32 +00:00
|
|
|
*/
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mov SCB_NEXT, DISCONNECTED_SCBH;
|
1998-09-15 07:24:17 +00:00
|
|
|
mov DISCONNECTED_SCBH, SCBPTR ret;
|
2000-07-18 20:12:14 +00:00
|
|
|
return:
|
|
|
|
ret;
|