History log of /freebsd-current/sys/dev/aic7xxx/aic7xxx_reg.h
Revision Date Author Comments
# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# d5b4569f 01-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

aic7xxx: clean up empty lines in .c and .h files


# 50b464aa 07-Jan-2014 Scott Long <scottl@FreeBSD.org>

Remove aicasm as a build dependency. It made sense when the ahc and ahd
drivers and their firmware were under active development, but those days
have passed. The firmware now exists in pre-compiled form, no longer
dependent on it's sources or on aicasm. If you wish to rebuild the
firmware from source, the glue still exists under the 'make firmware'
target in sys/modules/aic7xxx.

This also fixes the problem introduced with r257777 et al with building
kernels the old fashioned way in sys/$arch/compile/$CONFIG when the
ahc/ahd drivers were included.


# c5cb3888 16-Mar-1997 Justin T. Gibbs <gibbs@FreeBSD.org>

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.


# 9df67452 24-Feb-1997 Justin T. Gibbs <gibbs@FreeBSD.org>

Leave reselections on all the time.
If we are aborting an SCB from findSCB, don't add it back to the free list -
the kernel driver will do this for us.


# 6875d254 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.


# 51547787 18-Feb-1997 Justin T. Gibbs <gibbs@FreeBSD.org>

Enlarge the message out buffer from 6 to 8 bytes. Now that sync and wide
negotiation messages may be tagged, we were overrunning the old buffer.
The variable that was getting squashed is updated before the message goes
out, causing corrupted SDTR or WDTR messages. Depending on the phases
traversed before message out, this could cause the wrong offset to be
negotiated allowing data overruns to occur. The problem is easier to
detect with wide targets on the chain since the allowed offset is smaller.

Also removed the unnecessary clearing of SPIORDY during the message out
phase. We don't rely on SPIORDY any more.


# de1dc306 08-Feb-1997 Justin T. Gibbs <gibbs@FreeBSD.org>

Clear the channel after (re)selection instead of once we see the bus go
free.

When we clear SCSIRATE, also clear the FAST20 bit in SXFRCTL0. This also
allowed me to clean up some of the ULTRA code.

ULTRAENB->FAST20 to follow the convention in the Adaptec data books.

Fix the data-overrun code to set both stcnt and hcnt otherwise, the transfer
will just hang until we get a timeout.

Add implicit support for the NOOP message. I've never heard of the driver
issueing a reject for one, but its silly to reject NOOP and who knows how a
device might react.

In the dma routine, check SDONE before cleaing SDMAEN. The data books mention
SDONE possibly being cleared when SDMAEN is reset. Clients of dma now need
to check if SINDEX is cleared to know if a phasemis occured.

Fix some comments to be correct.


# 8ebddd1e 28-Jan-1997 Justin T. Gibbs <gibbs@FreeBSD.org>

Add 1997 to my copyright.

Expand the boundaries of a pause disabled region to close of possible race
condition.

Revert a portion of the DMA code to fix false overruns.

Add a missing "add_scb_to_free_list" so we don't leak SCBs.


# ed69a713 24-Jan-1997 Justin T. Gibbs <gibbs@FreeBSD.org>

Change the way DMA is handled during the command phase. Only test on
SDONE, not HDONE.

In the data phase dma handler, mask off just the enable bits instead of
clearing the whole register. Clearing the direction bit could be bad.
Also don't stop a DMA until MREQPEND goes false. Doing this may cause
an ABORT on the PCI bus although I have yet to see this happen.

Add definitions for MREQPEND and the BRDCTL register. The BRDCTL register
is used to handle high byte termination and automatic termination testing.


# 6d14c339 22-Jan-1997 Justin T. Gibbs <gibbs@FreeBSD.org>

Clear the SCSI channel after we go to busfree instead of after re/selection.

Only enable reselections once the channel and SCSIRATE have been cleared.

Add a pause block around the test busy code in the non-tagged case to simplify
error recovery in the corner case of aborting an SCB that just got started.

Simplify reselection processing by removing the call to initialize_scsiid.

Clear the scsiseq re/select control bits and setup for catching bogus
busfrees earlier in the re/select process.

Improve the automatic PIO code. It turns out that SPIORDY is not a reliable
hardware condition bit, so use REQINIT intstead. Don't rely on PHASEMIS
either since it can take too long to come true. Use a brute force comparison
instead.

Remove some unnecessary overhead in the command complete processing. It
should be nearly impossible to overflow the QOUTFIFO (worst case 9 command
have to complete with at least 6 of them requiring paging on an aic7850),
so don't take the additional PIO hit to guard against this condition. If we
don't see our interrupt in time, the system has bigger problems elsewhere.
If this ever does happen, the timeout handler will notice and retry the
command.


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 70f6e552 22-Nov-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

Conditionally enable the busfree interrupt to catch unexpected busfrees.
Immediate SCBs, since they always send messages that tell the target to
transition to bus free now rely on the busfree interrupt instead of the
IMMEDDONE sequencer interrupt that was generated before.

Rearrange some code in the message out loop to give ATN a little more time
to drop before we ACK the last byte.

Use SPIORDY instead of REQINIT when snooping for a tag message on a reconnect.
This is done for the same reasons we use SPIORDY in the inb functions.

When going into BITBUCKET mode, turn off HDMAEN in the DFCNTRL register so
that we can "not care" what the value of HCNT is. If HCNT is 0, BITBUCKET
mode won't transfer any data if HDMAEN is set. Seeing as we don't want the
transfer to even think about touching the host, this seems more sane anyway.
Thanks to "Dan Willis" <dan@plutotech.com> for pointing out that this was
a problem.


# bde52458 15-Nov-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

Assert that we have seen an identify or have not disconneccted since the
initial selection when entering the status phase. This is the same assertion
we use for all the other data transfer phases.

Hopefully fix the hangs in the mesgin and mesgout phases that I introduced
last week during some code cleanup. I need to get some of these 12MB/s
drives so I can reproduce these hangs here...

Add a pause disable in the SCB paging case around our manipulation of the
QOUTQCNT variable. This is simply extra sanity.

Set LASTPHASE to P_BUSFREE once we see a busfree so that the kernel driver can
differentiate this from a data out phase.


# 8220b870 10-Nov-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

Fix two problems with SCB Paging.

1) get_free_or_disc_scb was not being passed its argument correctly
in one case

2) Add protection in the form of the QOUTQCNT variable to prevent
overflowing the QOUTFIFO.

This should make SCB Paging work. Really, I mean it now. 8-)


# 85772b65 27-Oct-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

Fix problems dealing with non-tagged devices when SCB paging is enabled.
Mostly this involved changing the semantics of the findSCB routine so that
it could be used at times other than handling a reconnection.


# 971791f4 25-Oct-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

Go back to using DMA to get SCBs down to the adapter.

SCB paging is now handled almost entirely by the sequencer and also uses
DMA. This should make SCB paging at least an order of magnitude more
efficient and vastly simplifies the implementation.

Add a few space optimizations so this code still fits on aic7770 chips.

Update comments.


# 2ea87992 06-Oct-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

Bring aic7xxx driver bug fixes from 'SCSI' into current.


# 1ffa43c0 09-Jun-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

Detect and report dataphase overruns. Put the adapter into 'Bit Bucket'
mode when this occurs and allow the target to complete the transaction.
Force a retry on overruns since they are usually caused by termination or
cable problems.


# 61538c30 21-May-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

Enable/Disable Ultra mode on a per target basis. This allows the driver
to use the full range of settings from 3.6-20MHz on any target.


# 990f2168 10-May-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

One more linux -> __linux__


# c2278994 10-May-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

aic7xxx.seq:
Change #ifdef linux to #ifdef __linux__

aic7xxx_reg.h:
Remove unneeded BOFF_60BCLOCKS
define CHIPRSTACK to be the same as CHIPRST
define RESET_SCSI and CHANNEL_B_PRIMARY bits
All of these aer used during the setup of adapters.


# 0a447122 20-Apr-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

Implement SCB paging. This allows up to 255 active commands on
aic7770 >= Rev E, aic7850, aic7860, aic7870, and ai7880 based controllers.

Make findSCB safer for non-tagged commands when tagged commands are
active on the controller. The symptoms of this problem were
"Overlapped commands attempted" messages during error recovery
attempts.

Compact scratch ram usage. This leaves 8 bytes free for future use.

Clean up some comments.

aic7xxx_reg.h:
Update my copyright.


# c2c5fd34 30-Mar-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

aic7xxx.seq:
Fix support for the aic7850 by looking only at the relavent bits of the
QINCNT. The 7850 puts random garbage in the high bits and all my attempts
to determine the cause of this failed. This approach does seem to work
around the problem.

Don't trust SCSIPERR to tell us when there is a parity error. On
some revs of the 7870 and the 7880, this bit follows the parity of
the current byte. Instead of using a SEQINT to tell the kernel,
re-enable the standard parity error interrupt since it seems to pause
the sequencer right at the time of the error which is the effect we were
looking for anyway.

aic7xxx_reg.h:
Remove PARITY_ERROR seqeuncer interrupt type, its no longer used.

Define QCOUNTMASK as the SRAM location for the mask to use on the
QINCNT register. QCOUNTMASK is determined by the number of SCBs
supported by the device we're working on.

aic7xxx_asm.c
Properly check the return value of fopen, and define the arg list
in getopt correctly.
Submitted by: Pete Bentley <pete@demon.net>


# 75f0b9d0 10-Mar-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

Reset the DMA control register whenever we reset the sequencer.
Clear LASTPHASE on busfree so the kernel driver can tell that the
sequencer is idle.
Fix some comments to reflect reality.


# 5327d595 28-Jan-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

Performance optimizations. Unroll all bcopies. Use PIO to transfer SCBs
since setting up the DMA is too costly. Restructure for efficiency.

Pause the sequencer when a parity error occurs so that the kernel driver
knows during which phase the error was encountered.


# d2c8692a 10-Jan-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

Take a different approach to the SPIORDY race condition. Simply clear
SPIORDY just before we ack on the bus so that there is no chance to
see SPIORDY for the same byte twice.

Make some small modifications so that the Linux aic7xxx driver can use
our sequencer and register definition files verbatum.


# 78aeaf61 07-Jan-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

aic7xxx.seq:
Add the same type of safeguards we use in the mesg_in phase to the mesg_out
phase.

aic7xxx_reg.h:
Add definitions for the DSCommand register for PCI adapters.


# adf51647 02-Jan-1996 Justin T. Gibbs <gibbs@FreeBSD.org>

The long awaited stability patch set for the aic7xxx driver:

1) Use cpp to preprocess the sequencer code.

2) Convert all "magic numbers" to #defines shared by the sequencer and
kernel driver via the aic7xxx_reg.h file. (The assembler still needs
to be re-written in lex/yacc to allow ~|& type constructions).

3) Raise ATN on parity errors for "in" phases and send an initiator detected
error or message-in parity error message as appropriate.

4) Turn off the reselection hardware from the time or a (re)connection to
busfree. It seems that some fast targets were able to reconnect before
the sequencer was able to see busfree.

5) The message buffer is considered "in-use" when there is a positive length
count. The ACTIVE_MSG flag was unnecesary.

6) Properly set SCB_NEXT_WAITING to SCB_LIST_HEAD in scbs being added to
the waiting scb list. This is a change in how the list code works to
facilitate some planned work in the reset code.

7) The fields in the SCB have be re-arranged to be quad-word aligned.

8) The inb code has been rewritten to catch phasemisses and be more efficient.

9) Go back to "snooping the bus" to determine if the incomming identify
message will be followed by a simple queue message. Its much faster than
doing a search through the SCBs.

10) Implement better tag range checking for incomming tags.

11) Make sdtr_to_rate more accurate (use 25 instead of 24 in calculations -
must have been asleep that night).

12) Rearrange some routines to reduce code complexity and size.

13) Update comments and formatting.

14) Fixed bugs I've forgotten about??

Reviewed by: David Greenman <davidg@FreeBSD.org>


# 3e4756a1 04-Nov-1995 Justin T. Gibbs <gibbs@FreeBSD.org>

Move aic7xxx register definitions from i386/scsi/aic7xxx.c to this file.
The hope is to make the sequencer and kernel code share this file, but
some work on our sequencer assembler will be needed first.