Home | History | Annotate | Download | only in dev
History log of /src/sys/arch/atari/dev/ncr5380.c
RevisionDateAuthorComments
 1.79  01-Aug-2023  andvar fix various typos in comments.
 1.78  06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.77  07-Apr-2022  andvar fix various typos in comments.
 1.76  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.75  24-Apr-2021  thorpej branches: 1.75.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.74  29-Sep-2020  msaitoh branches: 1.74.4;
s/implicitely/implicitly/
 1.73  29-Jun-2019  tsutsui Make local functions static.
 1.72  18-Oct-2014  snj branches: 1.72.20;
src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.71  24-Mar-2014  christos - remove unused
- use cpu_{g,s}etmodel() (not committed yet)
 1.70  27-Oct-2012  chs branches: 1.70.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.69  05-Jun-2011  tsutsui branches: 1.69.2; 1.69.12;
Split device_t/softc. No crash on TT030.
 1.68  17-Apr-2010  tsutsui branches: 1.68.2; 1.68.6;
extern inline -> static inline
 1.67  13-Apr-2010  tsutsui Misc KNF and cosmetics.
 1.66  28-Feb-2010  snj branches: 1.66.2;
Fight the ever-increasing size of src checkouts by spelling "useful"
without an extra l.
 1.65  20-Oct-2009  snj branches: 1.65.2;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.64  19-Jul-2009  tsutsui Remove extra whitespace added by a dumb tool which replaced bcopy with memcpy.
 1.63  18-Mar-2009  cegger bcopy -> memcpy
 1.62  18-Mar-2009  cegger bzero -> memset
 1.61  18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.60  14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.59  14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.58  14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.57  15-Nov-2008  abs branches: 1.57.4;
To be safe, do not use DMA for Falcon - from Tuomo
 1.56  28-Oct-2008  abs branches: 1.56.2;
Remove unwanted 'xs->xs_status |= XS_STS_DONE' which caused scsipi_done()
to bail out early.
Found by T. Makinen, and additional confirmation by David Ross
 1.55  06-Mar-2007  tsutsui branches: 1.55.40; 1.55.44; 1.55.50; 1.55.52;
Make req_addr (char *) rather than adding an extra cast
since it's used only in this function to calculate buffer address.
 1.54  06-Mar-2007  he More fixes after the caddr_t removal.
Mostly cast to char* for pointer arithmetic,
but also one missing indirection, and one "void *v, x;" fix.
 1.53  04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.52  25-Feb-2006  wiz branches: 1.52.18; 1.52.20; 1.52.28;
Fix some typos.
 1.51  24-Dec-2005  perry branches: 1.51.2; 1.51.4; 1.51.6;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.50  11-Dec-2005  christos merge ktrace-lwp.
 1.49  04-Jun-2005  he branches: 1.49.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.48  21-Feb-2005  thorpej Part 1 of a cleanup pass over the SCSI subsystem. The aim is to name
everything "scsi_*", since we really are talking about the SCSI command
set, ATAPI transport not withstanding. Improve the names of many structures,
and prepend "SCSI_" onto all SCSI command opcodes. Place items described
by the SCSI Primary Commands document into scsi_spc.h.
 1.47  07-Dec-2004  thorpej branches: 1.47.2; 1.47.4;
- Use the cmdlen specified in the scsipi_xfer structure. Keying off
the command group ID won't necessarily work for vendor-specific commands.
- Expand the storage in the SC_REQ structure to account for 16-byte commands.
 1.46  15-Jul-2003  lukem __KERNEL_RCSID()
 1.45  03-May-2003  wiz branches: 1.45.2;
DMA, not dma nor Dma.
 1.44  01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.43  02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.42  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.41  27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.40  25-Apr-2001  bouyer branches: 1.40.2; 1.40.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.39  28-Jul-2000  tv branches: 1.39.2;
Eliminate the other %:, using vsnprintf followed by printf.
 1.38  28-Jul-2000  tv Avoid a nonstandard %: format: printf("%:", fmt, ap) -> vprintf(fmt, ap)
 1.37  30-Sep-1999  thorpej branches: 1.37.2;
Update for SCSIPI changes.
 1.36  19-Feb-1999  leo Fix type lossage reported by Julian Coleman.
 1.35  05-Dec-1998  mjacob Update HBAs to incorporate the new max_lun property.
 1.34  19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.33  10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.32  06-Oct-1998  leo Only return COMPLETE when polling.
 1.31  12-Jan-1998  thorpej Update for changes to config.
 1.30  27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.29  20-Dec-1996  leo branches: 1.29.8; 1.29.10;
Get rid of BROKEN_INDIRECT_CONFIG
 1.28  10-Dec-1996  thorpej Fill in sc_link.max_target
 1.27  17-Nov-1996  leo Make splbio really splbio. All holes now seem to be plugged. At least
on the Hades & TT030.
 1.26  13-Oct-1996  christos backout previous kprintf changes
 1.25  11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.24  16-Sep-1996  leo Add support for Hades platform.
 1.23  28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.22  27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.21  05-Jul-1996  leo During a rather lengthy debug session with Markus Kilbinger (Thanks again!),
we managed to kill the following SCSI-driver bugs for the Falcon:
- The Byte_Count_zero bit of the falcon DMA controller does not always
tell the truth! This caused the SCSI-driver to choke on devices that
disconnected in the middle of a DMA-transfer (mostly removables).
- Printing debug info about the 5380 on the Falcon is *only* permitted
when DMA is not active.
- Some functions forgot to remove possibly pending sofware interrupts
- Some debug options didn't allow debugging a single target while they
could easily be made to do so. This is fixed.
 1.20  15-May-1996  leo branches: 1.20.4;
Get in sync with the mac68k version of the 5380 driver. Also increase
the maximum values of wait_req_xx() functions so some old (slow) scsi-1 drives
will work.
 1.19  26-Apr-1996  leo - Fixup the ipending function for the Falcon. This seemed to be the source
of a lot of instability problems on the Falcon. I also enabled DMA on
interrupt basis for the Falcon.
- Try to handle targets that request too much data more sanely.
- Some fixups for strict prototypes + -Wall

Thanks to Markus Kilbinger for providing the debugging support.
 1.18  30-Mar-1996  christos Change %r -> %: as for recursive printf's
 1.17  17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.16  22-Feb-1996  leo A bit of reshuffling. Also some stricter prototyping.
 1.15  10-Feb-1996  leo Various small fixes.
 1.14  06-Jan-1996  leo Keep more debugging history (Paul Goyette). Synced with mac68k version.
 1.13  18-Dec-1995  leo Fixes for devices that don't support linked commands. (Paul Goyette)
 1.12  30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.11  08-Oct-1995  leo branches: 1.11.2;
- Cleanup the arbitration
- Make sure the MON_BUSY flag is cleared after a DMA transfer. Otherwise
we might end up with a 'lost-busy' situation unexpectedly. This will
prevent the 5380 from driving the bus, which is not funny during
reselections.
 1.10  05-Oct-1995  leo Get in sync with the mac68k version to incorporate Allen Briggs' changes
- emit MSG_ABORT/MSG_REJECT at the right times:
- make MIN_PHYS machine dependent.
 1.9  16-Sep-1995  leo - Handle devices that do not support identify messages (Allen Briggs)
- Add pdma_ready() hook (Allen Briggs)
- Increase timeout to 1000 (Matthias Pfaller)
 1.8  12-Sep-1995  leo - Fix a timing bug in the loop, that was introduced in the previous version.
- Added some code to reject unsupported messages correctly.
 1.7  05-Sep-1995  leo Fix possibly endless loop (mycroft) and add fix requested by Allen Briggs.
 1.6  19-Aug-1995  leo - Add 'restbyte' handling for TT.
- Don't _ever_ do DMA for less than 512 bytes on the Falcon
- Fix bug in autosense-handling. Now asks for the correct number of bytes.
Now it won't read ghost bytes on the tape anymore.
- Add missing braces as suggested by Matthias Pfaller
- Make it possible to debug requests on a specified number of targets
- Add debug option to show only transaction with error code != 0
 1.5  12-Aug-1995  mycroft minphys() functions really should return void.
 1.4  11-Aug-1995  leo New version of NCR5380-SCSI driver. This version is far more generic than
the previous version. The machine dependent part contains the configuration
for both the TT and FALCON. The configuration files have been changed to
select SCSI-support for either TT, Falcon or both.
The configuration file for the Atari-Falcon will only get _really_ usefull
when the Falcon video part is finished.
 1.3  24-Jul-1995  cgd update SCSI minphys routines' definitions to match standard minphys()
definition and usage.
 1.2  28-Apr-1995  leo Made no_ttram_dma patchable instead of a define.
 1.1  26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1  26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.11.2.3  01-Nov-1995  leo Sync with Allen's version.
 1.11.2.2  27-Oct-1995  leo - Fix linked commands
- Fix reselection timeout procedure
 1.11.2.1  19-Oct-1995  leo '#ifdef notyet' the reselection timeout code in reselect(). This piece
of code causes problems on the mac/pc532 . Should be looked after.
 1.20.4.1  20-Jul-1996  jtc Pulled up from rev 1.21 by request from Leo Weppelman
 1.29.10.1  27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.29.8.1  01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.37.2.3  29-Mar-2001  bouyer Pass a compile test on i386
 1.37.2.2  27-Mar-2001  bouyer Convert to thorpej_scsipi (untested).
 1.37.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.39.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.40.8.2  18-Oct-2002  nathanw Catch up to -current.
 1.40.8.1  25-Apr-2001  nathanw file ncr5380.c was added on branch nathanw_sa on 2002-10-18 02:35:55 +0000
 1.40.2.1  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.45.2.6  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.45.2.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.45.2.4  18-Dec-2004  skrll Sync with HEAD.
 1.45.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.45.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.45.2.1  03-Aug-2004  skrll Sync with HEAD
 1.47.4.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.47.2.1  29-Apr-2005  kent sync with -current
 1.49.2.2  03-Sep-2007  yamt sync with head.
 1.49.2.1  21-Jun-2006  yamt sync with head.
 1.51.6.1  22-Apr-2006  simonb Sync with head.
 1.51.4.1  09-Sep-2006  rpaulo sync with head
 1.51.2.1  01-Mar-2006  yamt sync with head.
 1.52.28.1  06-Nov-2008  snj Pull up following revision(s) (requested by abs in ticket #1222):
sys/arch/atari/dev/ncr5380.c: revision 1.56
Remove unwanted 'xs->xs_status |= XS_STS_DONE' which caused scsipi_done()
to bail out early.
Found by T. Makinen, and additional confirmation by David Ross
 1.52.20.1  12-Mar-2007  rmind Sync with HEAD.
 1.52.18.2  15-Jan-2009  bouyer Pull up following revision(s) (requested by tjam in ticket #1261):
sys/arch/atari/dev/ncr5380.c: revision 1.57
To be safe, do not use DMA for Falcon - from Tuomo
 1.52.18.1  06-Nov-2008  snj Pull up following revision(s) (requested by abs in ticket #1222):
sys/arch/atari/dev/ncr5380.c: revision 1.56
Remove unwanted 'xs->xs_status |= XS_STS_DONE' which caused scsipi_done()
to bail out early.
Found by T. Makinen, and additional confirmation by David Ross
 1.55.52.2  28-Apr-2009  skrll Sync with HEAD.
 1.55.52.1  19-Jan-2009  skrll Sync with HEAD.
 1.55.50.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.55.44.4  11-Aug-2010  yamt sync with head.
 1.55.44.3  11-Mar-2010  yamt sync with head
 1.55.44.2  19-Aug-2009  yamt sync with head.
 1.55.44.1  04-May-2009  yamt sync with head.
 1.55.40.1  17-Jan-2009  mjf Sync with HEAD.
 1.56.2.1  16-Jan-2009  bouyer Pull up following revision(s) (requested by tjam in ticket #263):
sys/arch/atari/dev/ncr5380.c: revision 1.57
To be safe, do not use DMA for Falcon - from Tuomo
 1.57.4.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.65.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.66.2.2  12-Jun-2011  rmind sync with head
 1.66.2.1  30-May-2010  rmind sync with head
 1.68.6.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.68.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.69.12.3  03-Dec-2017  jdolecek update from HEAD
 1.69.12.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.69.12.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.69.2.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.69.2.1  30-Oct-2012  yamt sync with head
 1.70.2.1  18-May-2014  rmind sync with head
 1.72.20.1  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.74.4.1  21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.75.8.1  03-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed