summaryrefslogtreecommitdiffstats
path: root/sys/dev/aic7xxx
Commit message (Collapse)AuthorAgeFilesLines
* Some revisions of the aic7880 have a problem where, if thegibbs1998-06-281-2/+10
| | | | | | | | | | data fifo is full, but the PCI input latch is not empty, HDMAEN cannot be cleared. The fix used here is to attempt to drain the data fifo until there is space for the input latch to drain and HDMAEN de-asserts. This is a 1 instruction fix, so it should have no performance impact.
* Add support to aicasm for "downloaded constants". These are immediategibbs1997-09-2713-62/+211
| | | | | | | | | | | | | | | | | | | | | | | | operands that are set during seqeuncer program download instead of at assembly time. Convert the sequencer code to use" downloaded constants" for four run time constants that vary depending on the board type. This frees up 4 bytes of sequencer scratch ram space where these constants used to be stored and also removes the additional instructions required to load their values into the accumulator prior to using them. Remove the REJBYTE sram variable. The host driver can just as easly read the accumulator to get this value. The scratch ram savings is important as the old code used to clober the SCSICONF register on 274X cards which sits near the top of scratch ram space. The SCSICONF register controls bus termination, and clobbering it is not a good thing. Now we have 4 bytes to spare. This should fix the reported problems with cards that don't have devices attached to them failing with a stream of "Somone reset bus X" messages. Doug Ledford determined the cause of the problem, fixes by me.
* Make the aic7xxx sequencer assembler compile in the kernel's objectgibbs1997-09-0316-2763/+50
| | | | | | | directory. Rename (via repository copy) some files so that the potential for future conflicts is minimized. PR: conf/4363
* Add a spin lock that prevents the sequencer from attempting to add angibbs1997-08-132-2/+26
| | | | | | | | | | | | | entry to the QOUTFIFO when it is full. This should eliminate the "Timed out while idle" problems that many have reported. In truth, this is somewhat of a hack. Although are interrupt latency is low enough that we should be able to always service the queue in time, since each entry must be passed up to the higher SCSI layer for what can be a large amount of processing (perhaps even resulting in a new command being queued) with interrupts disabled, we need this mechanism to avoid overflow. In the future, these additional tasks will be offloaded to a software interrupt handler which should make this hack unnecessary.
* Modify my copyright notice to allow the sequencer to be used with GPLedgibbs1997-06-2721-140/+235
| | | | | | | | software (aka Linux). Fix a few bugs in the sequencer assembler. Make it easy to compiler the assembler with debugging turned on.
* The following scenario would result in a bogus residual being reportedgibbs1997-04-242-3/+8
| | | | | | | | | | | | | | | | | | if SCB Paging was enabled: disconnect with more data to transfer disconnected SCB gets paged out target reconnects so we page SCB back in target completes transfer so residual is 0 target disconnects SCB gets reused but not paged out since the residual is 0 (optimization) target reconnects so we page the SCB back in we report a residual because of stale residual information. The fix for this is to set a flag that forces the SCB to be paged back up to the host if we page in an SCB with a residual Pointed out by: Doug Ledford <dledford@dialnet.net>
* Revert some changes to the selection and reselection code that were thoughtgibbs1997-04-181-41/+19
| | | | | | | | | | | | to fix a selection timeout problem. If we can't find an SCB for the reconnecting target, issue a bus device reset as the SCSI2 spec suggests. Add a missing call to "add_scb_to_free_list" in the non paging case. In the non-paging case, the SCBs don't really need to be on the free list, but putting them there clears the tag field which is something the recovery code depends on.
* Re-arange the selection and reselection code to hopefully kill thegibbs1997-04-142-16/+31
| | | | spurious selection timeouts that have been reported.
* aic7xxx.seq:gibbs1997-04-104-13/+16
| | | | | | | | | | | | Be consistant about testing for parity errors after waiting for a REQ on the bus. Don't ack the last byte in a transaction until after we've cleared all target state. aic7xxx_asm.c: Test the return value of getopt against -1 not EOF. (Yet another shameless victum of the style guide being wrong).
* Instead of testing for both SELDI and SELDO in SSTAT0 in the poll for workgibbs1997-04-051-5/+5
| | | | | | | | loop, test for them separately. The bug report from David Malone showed that even though we had been reselected (SELDI was true), we sat in the poll for work loop until the selection timeout timer expired. It may be that the SSTAT0 register doesn't like to have more than one bit tested at a time. I've seen stranger things than this on these parts.
* Add missing Id that was lost when the sequencer file format changed.gibbs1997-04-041-0/+2
|
* When not using SCB paging, we can always directly index the SCB of interestgibbs1997-04-041-13/+18
| | | | | | | | either by looking it up in the array of pending, per target, untagged transactions, or by using the tag value passed in during the identify. The old code only direct indexed for tagged transactions. This makes the "findSCB" routine only necessary when SCB paging is enabled, so appropriately conditionalize it. This greatly simplifies the non SCB paging code flow.
* CFLAGS += -I. so that building in an obj directory works.gibbs1997-04-032-2/+6
|
* Re-arrange the code to upload an SCB to ensure that there is at leastgibbs1997-03-241-14/+12
| | | | | on instruction between the last load into the DFIFO and enabling the DMA. During back to back SCB DMA, it was possible to hang the card.
* aic7xxx.seq:gibbs1997-03-184-36/+263
| | | | | | | | | | | Stick 4 more, twin channel only, instructions behind .if ( TWIN_CHANNEL) aic7xxx_asm.c: Add the -O options which allows the specification of which options to include in a program listing. This makes it possible to easily determine the address of any instruction in the program across different hardware/option configurations. Updated usage() as well.
* Don't depend on <sys/types.h> being (bogusly) included by <stdio.h>.bde1997-03-163-3/+9
|
* Missed one.gibbs1997-03-163-0/+204
|
* Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:gibbs1997-03-1622-3239/+9185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* No longer clear all interrupt status when the sequencer is reset. The onlygibbs1997-02-281-40/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | time that we really want to do this is when a bus reset causes the sequencer to be reset and the kernel driver now handles this case. Remove some reordering in the select2 routine that wasn't necessary. It was an experimental fix for a race condition I fixed elsewhere, and confused the code flow. Don't bother looping on a parity error in the mesgout loop since we can't see parity errors on out phases. Clean up the mesgin_identify code. In the old days, we "snooped" for tag messages and used this as an indicator of whether or not the target was using tagged transactions. This forced the sequencer to ack the identify before determining if a valid SCB matched the target meaning that an abort message to handle this case might not be seen before the target entered a data phase. Since we can determin the "tagged-ness" of a target by looking it up in the array of busy targets (recently introduced), we can determine this up front simplifying the search code as well as ensuring we can follow the SCSI specs method for rejecting a reselection. When an SCB is placed on the free list, set its SCB_TAG to SCB_LIST_NULL. This makes it much easier for the kernel driver to find active SCBs on the card during error recovery.
* Leave reselections on all the time.gibbs1997-02-252-10/+21
| | | | | 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.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-225-5/+5
| | | | ready for it yet.
* Enlarge the message out buffer from 6 to 8 bytes. Now that sync and widegibbs1997-02-182-18/+11
| | | | | | | | | | | | 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.
* Clear the DFCNTRL register after every busfree.gibbs1997-02-111-23/+26
| | | | | | | | | | | | | | | | | When setting the HCNT registers, do so in ascending order. When performing tagged queueing in non-paging mode, also check the disconnected bit in the SCB as extra sanity during a reconection. Make the labels in the DMA routine more sane. When doing a DMA, if we see the DMADONE condition come true, we can simply turn of the DMA enable bits in DFCNTRL without testing the FIFO state as HDONE is true when DMADONE is true and this emplies the FIFO is empty. These changes clear up the data overrun error messages and seem to prevent the "timed out in data-in phase" problems.
* Clear the channel after (re)selection instead of once we see the bus gogibbs1997-02-092-30/+31
| | | | | | | | | | | | | | | | | | | | | | 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.
* In dma_finish, don't disturb the direction bit in DFCNTRL when turning offgibbs1997-02-031-6/+3
| | | | | | | host DMAs. The additional test to ensure that the DMA has stopped is also unnecessary since we've already waited for the DMA to complete. Update my copyright for the new year.
* Add 1997 to my copyright.gibbs1997-01-292-16/+7
| | | | | | | | | 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.
* Change the way DMA is handled during the command phase. Only test ongibbs1997-01-242-7/+30
| | | | | | | | | | | | 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.
* Clear the SCSI channel after we go to busfree instead of after re/selection.gibbs1997-01-222-46/+53
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-145-5/+5
| | | | | | | | 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.
* Re-enable reselections as the first thing after we see a bus free. We seemgibbs1996-12-031-10/+8
| | | | | | to miss reselections from some devices and since the reselection response timeout is only 200ns, enabling reselections too late may be the cause of our problem.
* Conditionally enable the busfree interrupt to catch unexpected busfrees.gibbs1996-11-222-56/+29
| | | | | | | | | | | | | | | | | | | 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.
* Change the way Automatic PIO is performed in the mesgin and mesgout phases.gibbs1996-11-211-27/+18
| | | | | | | | | | | SPIORDY should go active on any REQ of the bus, so testing for REQINIT is not necessary. It also seems that testing for SPIORDY is more robust then REQINIT since SPIORDY comes active after REQINIT and PHASEMIS seems to take some time to come true after REQ is asserted if the phase has changed. Of course, none of this is documented. This should give the code savings of my original changes, without breaking the driver on fast peripherals.
* Assert that we have seen an identify or have not disconneccted since thegibbs1996-11-162-12/+17
| | | | | | | | | | | | | | | 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.
* Fix two problems with SCB Paging.gibbs1996-11-112-36/+29
| | | | | | | | | | 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-)
* index_untagged_scb should rely solely on the argument passed in SINDEX andgibbs1996-11-051-3/+3
| | | | | | | not access SCB_TCL directly. This could have caused problems on twin channel adapters. 2.2 Candidate.
* In data_phase_reinit when I converted the code to use bcopy, I should havegibbs1996-10-281-3/+3
| | | | | | used mvi instead of mov. Luckily this code is most likely never executed since it is only there for sanity should a target goes into the data phase twice during a single selection or reselection.
* Fix problems dealing with non-tagged devices when SCB paging is enabled.gibbs1996-10-282-48/+53
| | | | | Mostly this involved changing the semantics of the findSCB routine so that it could be used at times other than handling a reconnection.
* Go back to using DMA to get SCBs down to the adapter.gibbs1996-10-252-356/+485
| | | | | | | | | | 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.
* Bring aic7xxx driver bug fixes from 'SCSI' into current.gibbs1996-10-062-164/+71
|
* Detect and report dataphase overruns. Put the adapter into 'Bit Bucket'gibbs1996-06-092-2/+32
| | | | | | 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.
* Hopefully fix the parity problem and the hang on message reject for good.gibbs1996-06-081-5/+12
|
* Don't use the auto ATN on parity error feature. It may be the sourcegibbs1996-05-311-4/+4
| | | | of our parity handling problems.
* Fix regression. It seems that you need at least one instruction betweengibbs1996-05-301-3/+3
| | | | | | | | seeing SPIORDY and checking for PHASEMIS. My last change turned out to be less cosmetic then I thought. Pointed out by: Satoshi Asami <asami@cs.berkeley.edu>, Faried Nawaz <fn@pain.csrv.uidaho.edu
* Merge in changes for NetBSD/OpenBSD.gibbs1996-05-301-2/+6
| | | | | | | | | Cosmetic change to p_mesgout code so that it "looks" the same as what is done in the inb* routines. NetBSD/OpenBSD support Submitted by:Noriyuki Soda <soda@sra.co.jp>, Pete Bentley <pete@demon.net>, Charles M. Hannum <mycroft@mit.edu>, Theo de Raadt <deraadt@theos.com>
* Fix a race condition in p_mesgout* and inb* code that could allow agibbs1996-05-271-3/+3
| | | | | | phasemiss to sneak by without detection. This should fix the Wide/Narrow boot problems that have been reported since this bug caused the driver ignore a narrow target rejecting wide negotiation.
* Correct a botched commit from yesturday. It helps to bring over thegibbs1996-05-231-3/+4
| | | | right patch file.<sigh>
* Enable/Disable Ultra mode on a per target basis. This allows the drivergibbs1996-05-212-3/+21
| | | | to use the full range of settings from 3.6-20MHz on any target.
* One more linux -> __linux__gibbs1996-05-101-2/+2
|
* aic7xxx.seq:gibbs1996-05-102-4/+7
| | | | | | | | | | 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.
* Implement SCB paging. This allows up to 255 active commands ongibbs1996-04-202-100/+181
| | | | | | | | | | | | | | | | 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.
OpenPOWER on IntegriCloud