summaryrefslogtreecommitdiffstats
path: root/sys/dev/aic7xxx
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* aic7xxx.seq:gibbs1996-03-315-31/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Reset the DMA control register whenever we reset the sequencer.gibbs1996-03-102-48/+22
| | | | | | Clear LASTPHASE on busfree so the kernel driver can tell that the sequencer is idle. Fix some comments to reflect reality.
* Performance optimizations. Unroll all bcopies. Use PIO to transfer SCBsgibbs1996-01-292-194/+138
| | | | | | | 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.
* Take a different approach to the SPIORDY race condition. Simply cleargibbs1996-01-112-4/+20
| | | | | | | | 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.
* Change the inb and outb routines slightly. It seems that waiting forgibbs1996-01-091-13/+5
| | | | SPIORDY after polling REQINIT is a bad idea.
* aic7xxx.seq:gibbs1996-01-072-10/+21
| | | | | | | | 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.
* Bring back the more heavy-weight version of the mesgin inb routines. Davidg'sgibbs1996-01-051-4/+12
| | | | | testing made me think that some of the checks were superfluous, but wcarchive (and Amancio) know better.
* Null terminate execl's argument list.gibbs1996-01-053-6/+6
| | | | Submitted by: Ron Lenk <rlenk@widget.xmission.com>
* The long awaited stability patch set for the aic7xxx driver:gibbs1996-01-035-1006/+1252
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix the long dreaded Wide bug and enable WIDEODD for reads.gibbs1995-11-071-3/+4
|
* Move aic7xxx register definitions from i386/scsi/aic7xxx.c to this file.gibbs1995-11-051-0/+514
| | | | | The hope is to make the sequencer and kernel code share this file, but some work on our sequencer assembler will be needed first.
* Only or in CLRCHN in SXFRCTL0. All other bits in this register aregibbs1995-10-291-5/+3
| | | | initialized by the kernel driver now.
* Set SCSIGO generically before we determine the phase instead of doing itgibbs1995-10-261-12/+11
| | | | | | | | | | | | in each phase routine. Saves a few instructions. Be more careful in how we deal with SXFRCTL0. Or in the control bits of interest instead of using mvi. The kernel driver will set the ULTRAEN bit of SXFRCTL0 if we are using Ultra (20MHz) mode and we don't want to clobber it. In sdtr_to_rate divide by two if we are in ultra mode to get the correct setting since its a 20MHz instead of 10MHz scale.
* Clean up the mesgin code to make it easier to read with proceedure lablesgibbs1995-08-061-55/+49
| | | | | | that are based on what mesage is being processed instead of just numbers. Order the tests for incoming message type by level of occurance.
* Total rewrite of the dataphase sections of the sequencer. This was donegibbs1995-08-051-237/+171
| | | | | | | | | | | | to replace the very poor, original implementation of Scatter/Gather operations. Use a bit (that was freed up with the rewrite above) in the SCB control byte to designate commands that should allow disconnection. The kernel driver makes this decision now instead of the sequencer since the sequencer can't do the indexing very efficiently. This commit drops the sequencer from 426 instructions to 390 most likely freeing enough space to do a target mode implementation.
* Fix two race conditions.gibbs1995-08-051-9/+8
| | | | | | | | | | | | | The first could occur because the original code would continue to reset the SCSIID register while waiting for a selection. This could potentially conflict with a reconnect since a successfull reconnect will also set the SCSIID register. The fix is to use a separate wait loop after starting a selection (as was done a few revisions ago). The second probably never happens, but it was possible for a target to reconnect while there was a pending SCB on the waiting list and not get noticed. The fix was to remove a supurflous check of the scb waiting list.
* Pause the sequencer when message only requests complete. This allows thegibbs1995-07-311-2/+8
| | | | | kernel driver to know the exact state of the sequencer after a BUS DEVICE RESET or ABORT completes so it can properly clean up the request.
* Change SCB_LIST_NULL to 0xff from 0x10 to allow for 255 commands. Thisgibbs1995-07-041-7/+8
| | | | | | | | is needed for 3940 support. Have tagged commands look to see if a target is "busy" with a non tagged command before executing. This prevents overlapped tagged and non tagged commands which can happen since request sense commands are not tagged.
* Remove trailing whitespace.rgrimes1995-05-303-24/+24
|
* Fixes to the aic7xxx sequencer code and device driver from Justin Gibbs:dg1995-05-171-11/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) If a target initiated a sync negotiation with us and happened to chose a value above 15, the old code inadvertantly truncated it with an "& 0x0f". If the periferal picked something really bad like 0x32, you'd end up with an offset of 2 which would hang the drive since it didn't expect to ever get something so low. We now do a MIN(maxoffset, given_offset). 2) In the case of Wide cards, we were turning on sync transfers after a sucessfull wide negotiation. Now we leave the offset alone in the per target scratch space (which implies asyncronous transfers since we initialize it that way) until a syncronous negotation occurs. 3) We were advertizing a max offset of 15 instead of 8 for wide devices. 4) If the upper level SCSI code sent down a "SCSI_RESET", it would hang the system because we would end up sending a null command to the sequencer. Now we handle SCSI_RESET correctly by having the sequencer interrupt us when it is about to fill the message buffer so that we can fill it in ourselves. The sequencer will also "simulate" a command complete for these "message only" SCBs so that the kernel driver can finish up properly. The cdplay utility will send a "SCSI_REST" to the cdplayer if you use the reset command. 5) The code that handles SCSIINTs was broken in that if more than one type of error was true at once, we'd do outbs without the card being paused. The else clause after the busfree case was also an accident waiting to happen. I've now turned this into an if, else if, else type of thing, since in most cases when we handle one type of error, it should be okay to ignore the rest (ie if we have a SELTO, who cares if there was a parity error on the transaction?), but the section should really be rewritten after 2.0.5. This fix was the least obtrusive way to patch the problem. 6) Only tag either SDTR or WDTR negotiation on an SCB. The real problem is that I don't account for the case when an SCB that is tagged to do a particular type of negotiation completes or SELTOs (selection timeout) without the negotiation taking place, so the accounting of sdtrpending and wdtrpending gets screwed up. In the wide case, if we tag it to do both wdtr and sdtr, it only performs wdtr (since wdtr must occur first and we spread out the negotiation over two commands) so we always have sdtrpending set for that target and we never do a real SDTR. I fill properly fix the accounting after 2.0.5 goes out the door, but this works (as confirmed by Dan) on wide targets. Other stuff that is also included: 1) Don't do a bzero when recycling SCBs. The only thing that must explicitly be set to zero is the scb control byte which is done in ahc_get_scb. We also need to set the SG_list_pointer and SG_list_count to 0 for commands that do not transfer data. 2) Mask the interrupt type printout for the aic7870 case. The bit we were using to determine interrupt type is only valid for the aic7770. Submitted by: Justin Gibbs
* Restructure the arbitration loop to allow for reselections that win out overgibbs1995-04-271-95/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | the adapter's selections. Many fast periferals were getting upset when the sequencer decided to rearbitrate after the device had already won arbitration. This also forced the creation of a list threaded through the SCBs (since we don't have enough space anywhere else) of commands that are awaiting reselection. This list is run down before any new transactions from the input queue are allowed. The list is appened to whenever we begin a selection (simple case since the selecting device is always at the head) and by the kernel driver whenever a request sense occurs. In the common case, the list is only one element long, but when a reselection wins out over a selection and that reselection generates a request sense, the outstanding selection required for the retreval of the sense code grows the list. On machines with many targets, this might cause the list to grow large, so this solution, which will allow up to the maximum number of I/O requests capible of the card elements in the list, was chosen. The list manipulation is trivial and adds three sequencer instructions of overhead to the selection phase. This fixes the "target busy" errors from micropolis drives and the bursty I/O problem when performing I/O between a Quantum Grand Prix and any other device. I anticipate that this will correct many of the problems that have been reported with this driver. Reviewed by: Wcarchive and David Greenman
* John Aycock's BSD copyrighted sequencer assembler and sequencer code. Thisgibbs1995-04-155-402/+542
| | | | | | | | | | | | | | | | | | is identical to the older version, just the copyright has changed. Many thanks go to Dean Gehnert of the Linux camp who went the extra mile to make this happen. Other changes: Update assembler man page to include the -v and -D options Merge in Dean's latest changes to the assembler Have the sequencer do a MSG_REJECT when the negotiated syncronous rate is lower than the adapter supports. This forces asyncronous mode which is faster at these rates anyway. This code will be moved shortly to the non-gpld portion of the tree.
* More code optimizations. Use a slightly different approach to decidegibbs1995-04-091-76/+28
| | | | whether a reconnecting target is a tagged device or not.
* Off by one error in -MSG-START+0 was just Justin being tired -- revert togibbs1995-04-011-6/+5
| | | | | | | | | | old value. Remove unnecessary check for active messages in setup SCB. This same test would also jump to p_mesgin_done which would "ACK" an extra time possibly confusing the target. Tell the kernel driver whenever we send an ABORT_TAG message.
* Major overhaul of the aic7xxx driver:gibbs1995-03-314-90/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Report valid residual byte counts. We actually pause the sequencer when the residual is non-zero. I thought about using DMA to do this, bus sequencer program space is tight. - Fix embarassing off by one error in the computation of a 2's compliment variable. This was most likely the cause of the many problems reported with the tagged queuing code. - Handle "MAX_SYNC" as a special case (ie we are the ones starting the sync negotiation sequence). This was done so that the target scratch area can be initialed to 0 offset (asyncronous transfers) safely. The initialization to 0 (was 15) is necessary since in some cases a Wide negotiation could run into problems if SCSIRATE was set wrong and we went into data(in/out). - Trim the DMA routines a little by using some procedures. Net effect is more functionality with 3 less instructions after this update. - Toggle the WIDEODD bit of the DFCNTRL whenever this is not the last SG block. It has no effect in the 8bit bus configuration, but in the Wide configuration ensures that the overlap byte is held in the SCSI block if the transfer is odd so it will end up in the next SG (the correct behavior).
* Make the aic7xxx assembler take quoted strings as a single token.gibbs1995-03-174-17/+70
| | | | Make $Id the version variable which required the quoted string "feature".
* Be careful to maintain the bits in SBLKCTL that are reserved.gibbs1995-03-071-6/+5
|
* Add tagged queueing support to the aic7xxx sequencer code.gibbs1995-02-221-66/+96
|
* Have version number track CSV version number. No other change.gibbs1995-02-031-2/+2
|
* aic7xxx.c:gibbs1995-01-224-99/+64
| | | | | | | | | | | | | | | | Print out the length of the compiled sequencer program. aic7xxx.seq: More optimizations. Replace generic bcopy routine with bcopy_3 and bcopy_4 (ie unroll the loops) since these are the only two cases used. Initialize SIMODE1 and SXFRCTL1 from the kernel in ahc_init instead of at each selection/reselection since this is expensive and only needs to be done once. Condense function returns into previous instruction if possible. Reorder some sections to kill superflous jumps. These optimizations kill the ~150k/s penalty adding support for Twin/Wide cards was costing since the last place in the commaon path of execution where we had to do ugly, convoluted testing for the type of card in the sequencer has gone away. Next stop tagged queuing and target mode.
* At $Ids to all files. Have the sequencer use DMA to tranfer its SCBgibbs1995-01-164-109/+132
| | | | | | | | (SCSI control block) instead of having the host PIO it down. Also reimplement WDTR and SDTR optimization to remove code in the sequencer and place the responsibility of knowing when to initiate SDTR or WDTR on the kernel driver. This vastly shortens the sequencer program yet yeilds the same performance.
* Full support for 294x and Wide devices. Fixed month old bug in the SCSIgibbs1995-01-131-81/+173
| | | | | | sense retrieval code that messed up CDROM devices. This code will also responde correctly to SDTR and WDTR messages from devices that start a negotiation sequence.
* Update the sequencer code to handle both channels of Twin channel devices.gibbs1994-12-311-54/+144
| | | | | | | | | | You can now sling 14 devices off of a 274xT. In the process of adding twin channel support, I removed all evident restrictions on supporting Wide channeled devices, but I do not have a Wide controller to test them on. aic7770_seq.h, the pre-compiled header, is no longer needed since config handles this dependancy.
* Merge in latest Linux sequencer code release with my changes. This shouldgibbs1994-11-291-18/+21
| | | | | | | | | | | | make the sequencer code fully compatible with the aic7870 (ie 294x adaptors). I've also added to my local mods putting the sequencer into "FASTMODE" clock. This gives upwards of 2M/sec write preformance improvement in some scenarios. There haven't been any reports of this causing problems, and I have been reaping the benifits of it for more than a week now. This also includes a new version of the pre-generated file <ugh> Obtained from: John Aycock (aycock@cpsc.ucalgary.ca) and myself
* Previous changes to the sequencer compiler backed out. We go back togibbs1994-11-183-6/+0
| | | | generating the .h file, and a pregenerated file is included.
OpenPOWER on IntegriCloud