Home | History | Annotate | Download | only in dev
History log of /src/sys/arch/next68k/dev/esp.c
RevisionDateAuthorComments
 1.67  03-Feb-2023  tsutsui Make local functions static.
 1.66  03-Feb-2023  tsutsui Misc cleanup.

- use C99 designated initializer
- misc KNF
- TAB/space cleanup
 1.65  27-Jan-2023  tsutsui next68k: Fix silent stall of next68k esp(4) SCSI.

next68k esp(4) driver requires nextdma(4) interrupts at ipl 6
during ncr53c9x_intr() for esp(4) at ipl 3. It worked on netbsd-5
and prior, but on netbsd-5 splbio() was changed from ipl 3 to 6
for SMP support and on netbsd-6 ncr53c9x driver was changed to
use mutex(9) instead of simple_lock(9), so nextdma interrupts
were no longer raised during ncr53c9x interrupt handler.

For now, just call mutex_exit(9) and mutex_enter(9) during
waiting nextdma(4) interrupts in MD esp_dma_intr() handler.
This could be wrong and the interrupt handler for nextdma should
be reorganized, but it just works.

Should be pulled up to netbsd-10 and netbsd-9.
 1.64  31-Mar-2017  msaitoh branches: 1.64.18; 1.64.44;
Remove extra 0x. This bug was added when replacing bitmask_snprintf(9) with
snprintb(3) (in between NetBSD 5 and 6). Old bitmask_snprint(9) didn't add
0x" automatically for hexadecimal value, so old code used it with "0x%s".
 1.63  29-Mar-2014  christos branches: 1.63.6; 1.63.10; 1.63.14;
fix misplaced line
 1.62  27-Mar-2014  christos correct/add protection against snprintf overflow.
 1.61  25-Mar-2014  christos fix sprintf debugging mess.
 1.60  27-Oct-2012  chs branches: 1.60.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.59  23-Nov-2009  rmind branches: 1.59.12; 1.59.22;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.58  02-Sep-2009  tsutsui Some backends may use ncr53c9x_abort(), so remove static declaration from
the function and explicitly declare it in ncr53c9xvar.h. Noticed by he@.
 1.57  16-Dec-2008  christos replace bitmask_snprintf(9) with snprintb(3)
 1.56  28-Apr-2008  martin branches: 1.56.8;
Remove clause 3 and 4 from TNF licenses
 1.55  13-Apr-2008  tsutsui branches: 1.55.2; 1.55.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.54  05-Mar-2007  tsutsui branches: 1.54.40;
Fix caddr_t fallout. Well, this driver is too ugly to read...
 1.53  04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.52  08-Mar-2006  lukem branches: 1.52.16;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.51  11-Dec-2005  christos branches: 1.51.4; 1.51.6; 1.51.8; 1.51.10;
merge ktrace-lwp.
 1.50  17-May-2005  christos branches: 1.50.2;
Yes, it was a cool trick >20 years ago to use "0123456789abcdef"[a] to
implement, xtoa(), but I think defining the samestring 50 times is a bit
too much. Defined HEXDIGITS and hexdigits in subr_prf.c and use it...
 1.49  19-Jan-2005  chs de-__P, remove register, ansify.
 1.48  24-Feb-2004  wiz branches: 1.48.8;
occured -> occurred. From Peter Postma.
 1.47  04-Dec-2003  keihan netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.46  27-Sep-2003  cl make gcc3's `deprecated use of label at end of compound statement' go away
 1.45  15-Jul-2003  lukem __KERNEL_RCSID()
 1.44  03-May-2003  wiz branches: 1.44.2;
DMA, not dma nor Dma.
 1.43  02-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.42  02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.41  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.40  27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.39  21-Sep-2002  mycroft Force synchronous negotiation off even if the target initiates it, by setting
minsync to 0. It may be possible to make this work, but I don't know how.
 1.38  11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.37  11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.36  20-May-2002  jdolecek Adapt this to post thorpej-scsipi world.
Fix provided by Christian Limpach in port-next68k/16928.
 1.35  23-May-2001  chs branches: 1.35.2; 1.35.8; 1.35.16;
fix printf format strings and the call to ncr53c9x_attach() so that
this compiles again.
 1.34  17-Apr-2001  dbj increase maxsegs of esp main dma map by one to avoid error
tweak esp glue to read xfer_len from dma map
add some debugging checks for dma driver invariants
read DD_LIMIT instead of DD_SAVED_LIMIT on scsi dma shutdowns
 1.33  16-Apr-2001  dbj add receive ethernet bpf tap
keep receive ethernet crc and set M_HASFCS
change bus_dma MD fields to keep xfer_len for entire map
instead of per segment
turn off automatic dma restarts in preparation for changing
scsi driver to handle them.
add dma debugging routines to keep history of dma states
tweak checking for unusual dma limit register
 1.32  07-Apr-2001  dbj continue to tweak nextdma detection of xfer length
add check to esp driver for incomplete transfers, but still does not handle them.
 1.31  02-Apr-2001  dbj reenabled flushcount diagnostic check.
tweaked formatting on hex dump debugging routine
 1.30  31-Mar-2001  dbj comment out device register structure definitions, used for reference only.
remove unnecessary BUS_SPACE_MAP_LINEAR when mapping ethernet dma registers.
 1.29  29-Mar-2001  petrov use NCR_F_DMASELECT instead of ncr53c9x_dmaselect
 1.28  09-Aug-2000  tv branches: 1.28.2;
%b -> bitmask_snprintf()
 1.27  05-Jun-2000  nisimura Have MI ncr53c9x_attach() the 2nd and 3rd arguments for scsipi_adater
and scsipi_device respectively, with size reduction of ncr53c9x_softc.
Specifying NULL instructs the driver to use default adapter and default
device codes. Every target port has ncr53c9x_attach(sc, NULL, NULL) anyway.
 1.26  04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.25  28-Aug-1999  dbj branches: 1.25.2; 1.25.10;
discovered the purpose of another bit in the dma control register.
DMACSR_READ is now a CSR status bit which can be used to know if current transfer is
from cpu to device.
the old DMACSR_READ bit is renamed DMACSR_SETREAD. This is a control bit that tells
the dma transfer to be from cpu to device.
 1.24  23-Mar-1999  dbj more minor changes, mostly in minor tweaks to debuggin output.
tweaks to handling dmasize != dmalen correctly.
changed minimum dma segment length for tail buffer.
 1.23  14-Mar-1999  dbj changed dma start alignment from 4 to 16 so that the cache flush
functions always have cache line aligned segments.
continued experimentation with scsi driver.
 1.22  03-Mar-1999  dbj continued experimentation trying to understand why we drop
scsi write completion interrupts (the dma appears to complete ok)
Now copy read tail buffer after we bus_dma_sync it and not before.
 1.21  02-Mar-1999  dbj turn on diagnostic check in dma for controller bits at shutdown.
adjusted esp overrun to avoid diagnostic check triggering.
 1.20  14-Feb-1999  dbj Continue hacking on esp driver. Seems relatively stable in read only mode.
write operations appear to lose scsi interrupts and causes timeouts.
changes in this checkin include:
a nextdma bugfix causing a diagnostic check to erroneously trigger
Changed tail strategy to only use tail buffer for the minimal end slop
changed expected write dma overrun to 32 bytes.
turned on nextdma diagnostic check for dma end address since it
no longer gets triggerred by ethernet dma and helps debug scsi dma.
Added esp debugging printout and support.
 1.19  13-Feb-1999  dbj Continued work on esp scsi driver. Now can at least do enough i/o to create and mount
a filesystem, but is not stable enough yet for general use.
increased priority of ethernet interrupts, mostly useful to aid debugging
of scsi interrupts while using an nfs disk.
added additional debugging output in the next dma driver.
perform extranneous cache flushes/purges before dma reads/ after dma writes
to aid debugging of scsi dma.
 1.18  03-Feb-1999  dbj overhalt of scsi driver.
it still probes the disks ok, but is having trouble with 0xdeadbeef
in buffers read from the disk. Suspected problems with DMA alignment
and toggling the secret ninja dma control register
 1.17  02-Feb-1999  dbj make dma flushing more efficient and avoid stray interrupts when not using polled io.
remove check for normal chaining interrupts and add check for combined chaining interrupts
only when used with a tail chain. This allows scsi to work for short unaligned buffers
and large aligned buffers.
 1.16  02-Feb-1999  dbj Removed some already commented out test code.
added debugging printout when invoking polled dma interrupt.
 1.15  01-Feb-1999  dbj Fix return value in interrupt routine so that dma gets flushed correctly.
Turn on the esp_match since polling the scsi bus now works.
 1.14  27-Jan-1999  dbj Continue work on scsi driver. Added tail dma buffer. Still non functional.
 1.13  30-Dec-1998  dbj Continued work on esp driver. Now successfully identifies a scsi target.
Unfortunately, to get dma to work, we have to align past the end of
the buffer, which smashes other variables on the stack.
match function still disabled, as it isn't ready yet.
 1.12  27-Dec-1998  dbj After some experimentation, now allow dma start alignment to be 4.
Removed separate alignment constant for ethernet since it appears to
be unnecessary.
 1.11  26-Dec-1998  dbj Continued experimentation on SCSI driver.
Added nextdma_debug variable to control debug printouts in nextdma driver
when ND_DEBUG is defined.
 1.10  19-Dec-1998  dbj Revamped DMA interface to unify chaining and non-chaining dma sequences.
Updated ethernet driver to work with new interface.
Continue work on esp driver.
 1.9  19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.8  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.7  05-Sep-1998  pk Relinquish my copyright claims on this file.
 1.6  15-Aug-1998  mycroft Minor edit.
 1.5  15-Aug-1998  mycroft Assign copyright to TNF.
 1.4  21-Jul-1998  dbj Continued work on the esp scsi driver. Not yet working, but progress continues.
 1.3  19-Jul-1998  dbj Commented out some bus_dma code, until I can fix.
(bus_dma.c needs sync with alpha port!)
Continued progress on scsi driver.
A couple of other compiler warning level of tweaks.
 1.2  13-Jul-1998  dbj worked on adding nextdma support for scsi driver.
 1.1  05-Jul-1998  dbj Started the esp scsi driver.
Fixed bus_space_handle_t in nextdma device.
Fixed scsi interrupt define.
 1.25.10.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.25.2.3  24-Apr-2001  bouyer Convert to new ncr53c9x attachement
 1.25.2.2  21-Apr-2001  bouyer Sync with HEAD
 1.25.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.28.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.28.2.1  09-Apr-2001  nathanw Catch up with -current.
 1.35.16.2  16-Jul-2002  gehenna catch up with -current.
 1.35.16.1  30-May-2002  gehenna Catch up with -current.
 1.35.8.5  18-Oct-2002  nathanw Catch up to -current.
 1.35.8.4  17-Sep-2002  nathanw Catch up to -current.
 1.35.8.3  01-Aug-2002  nathanw Catch up to -current.
 1.35.8.2  20-Jun-2002  nathanw Catch up to -current.
 1.35.8.1  23-May-2001  nathanw file esp.c was added on branch nathanw_sa on 2002-06-20 03:40:22 +0000
 1.35.2.3  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.35.2.2  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.35.2.1  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.44.2.5  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.44.2.4  24-Jan-2005  skrll Sync with HEAD.
 1.44.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.44.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.44.2.1  03-Aug-2004  skrll Sync with HEAD
 1.48.8.1  29-Apr-2005  kent sync with -current
 1.50.2.2  03-Sep-2007  yamt sync with head.
 1.50.2.1  21-Jun-2006  yamt sync with head.
 1.51.10.1  19-Apr-2006  elad sync with head - hopefully this will work
 1.51.8.1  13-Mar-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.52.16.1  12-Mar-2007  rmind Sync with HEAD.
 1.54.40.2  17-Jan-2009  mjf Sync with HEAD.
 1.54.40.1  02-Jun-2008  mjf Sync with HEAD.
 1.55.4.4  11-Mar-2010  yamt sync with head
 1.55.4.3  16-Sep-2009  yamt sync with head
 1.55.4.2  04-May-2009  yamt sync with head.
 1.55.4.1  16-May-2008  yamt sync with head.
 1.55.2.1  18-May-2008  yamt sync with head.
 1.56.8.1  19-Jan-2009  skrll Sync with HEAD.
 1.59.22.3  03-Dec-2017  jdolecek update from HEAD
 1.59.22.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.59.22.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.59.12.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.59.12.1  30-Oct-2012  yamt sync with head
 1.60.2.1  18-May-2014  rmind sync with head
 1.63.14.1  21-Apr-2017  bouyer Sync with HEAD
 1.63.10.1  26-Apr-2017  pgoyette Sync with HEAD
 1.63.6.1  28-Aug-2017  skrll Sync with HEAD
 1.64.44.1  01-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #63):

sys/arch/next68k/next68k/machdep.c: revision 1.117
sys/arch/next68k/dev/esp.c: revision 1.65
sys/arch/next68k/include/cpu.h: revision 1.51
sys/arch/next68k/include/bus_space.h: revision 1.20
sys/arch/next68k/next68k/clock.c: revision 1.13

next68k: Fix delay_divisor value for proper delay(9) on 68040.

next68k: Specify proper constraints for bus_space_read region and multi ops.

These functions write the read data into memory at a specified pointer,
but without the "memory" constraint gcc could optimize out these ops
if the memory is allocated on local stack.

With this fix nextkbd(4) works again.
Should be pulled up to netbsd-10 and netbsd-9.

next68k: Fix silent stall of next68k esp(4) SCSI.

next68k esp(4) driver requires nextdma(4) interrupts at ipl 6
during ncr53c9x_intr() for esp(4) at ipl 3. It worked on netbsd-5
and prior, but on netbsd-5 splbio() was changed from ipl 3 to 6
for SMP support and on netbsd-6 ncr53c9x driver was changed to
use mutex(9) instead of simple_lock(9), so nextdma interrupts
were no longer raised during ncr53c9x interrupt handler.

For now, just call mutex_exit(9) and mutex_enter(9) during
waiting nextdma(4) interrupts in MD esp_dma_intr() handler.

This could be wrong and the interrupt handler for nextdma should
be reorganized, but it just works.

Should be pulled up to netbsd-10 and netbsd-9.
 1.64.18.1  01-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1581):

sys/arch/next68k/next68k/machdep.c: revision 1.117
sys/arch/next68k/dev/esp.c: revision 1.65
sys/arch/next68k/include/cpu.h: revision 1.51
sys/arch/next68k/include/bus_space.h: revision 1.20
sys/arch/next68k/next68k/clock.c: revision 1.13

next68k: Fix delay_divisor value for proper delay(9) on 68040.

next68k: Specify proper constraints for bus_space_read region and multi ops.

These functions write the read data into memory at a specified pointer,
but without the "memory" constraint gcc could optimize out these ops
if the memory is allocated on local stack.

With this fix nextkbd(4) works again.
Should be pulled up to netbsd-10 and netbsd-9.

next68k: Fix silent stall of next68k esp(4) SCSI.

next68k esp(4) driver requires nextdma(4) interrupts at ipl 6
during ncr53c9x_intr() for esp(4) at ipl 3. It worked on netbsd-5
and prior, but on netbsd-5 splbio() was changed from ipl 3 to 6
for SMP support and on netbsd-6 ncr53c9x driver was changed to
use mutex(9) instead of simple_lock(9), so nextdma interrupts
were no longer raised during ncr53c9x interrupt handler.

For now, just call mutex_exit(9) and mutex_enter(9) during
waiting nextdma(4) interrupts in MD esp_dma_intr() handler.

This could be wrong and the interrupt handler for nextdma should
be reorganized, but it just works.

Should be pulled up to netbsd-10 and netbsd-9.

RSS XML Feed