Commit Graph

888 Commits

Author SHA1 Message Date
thorpej
43b4486bb3 Balance calls to disk_busy() and disk_unbusy() properly to avoid
dk_busy < 0 panics.  Count seeks.
1996-01-12 00:19:29 +00:00
pk
f278cec042 Move bus_map() prototype here. 1996-01-11 21:55:57 +00:00
pk
9580abeba7 Should pass suitable arguments bus_map(); as noted by Chuck. 1996-01-11 21:54:03 +00:00
pk
7430f70694 Return `no error' after ejecting; per Jason. 1996-01-11 21:18:40 +00:00
pk
5035080586 Correct page frame calculation after mapdev() interface change. 1996-01-11 11:19:01 +00:00
pk
94bb8db5ad Add shutdownhooks(). 1996-01-10 23:00:33 +00:00
thorpej
926f925088 Re-arrange slightly the si_options special case for the `sw'. 1996-01-09 02:36:58 +00:00
thorpej
3cb556defb Disable DMA by default on the 4/100 `sw' controller. I've had a couple
of reports of data corruption, and would rather be slow and safe until
the DMA bug is fixed.
1996-01-09 02:06:50 +00:00
thorpej
5b39541e48 New generic disk framework. Highlights:
- New metrics handling.  Metrics are now kept in the new
	  `struct disk'.  Busy time is now stored as a timeval, and
	  transfer count in bytes.

	- Storage for disklabels is now dynamically allocated, so that
	  the size of the disk structure is not machine-dependent.

	- Several new functions for attaching and detaching disks, and
	  handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
1996-01-07 22:01:38 +00:00
christos
742cee29e5 Fix setcontext call and sendsig 1996-01-07 19:47:27 +00:00
pk
dd9e5c93c7 Use {U,L} suffices per Charles' recommendation. 1996-01-05 18:10:57 +00:00
jtc
2fce159ff8 Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.
1996-01-04 22:21:33 +00:00
thorpej
d35bd4bb23 Fix a typo that would bite if the interrupt level were wildcarded in the
kernel config file.
1996-01-04 00:20:19 +00:00
thorpej
0e8ffc850f "si" and "sw" actually interrupt at level 3 (which I quickly discovered
when porting the driver).
1996-01-01 22:46:08 +00:00
thorpej
33582e90e0 "si" and "sw" now have the ncr5380sbc attribute. 1996-01-01 22:44:05 +00:00
thorpej
6d6c652f18 New driver for the Sun SCSI-3 VME and 4/100-series SCSI "Weird" controllers,
utilizing David Jones' new MI NCR 5380 code.  Ported from the sun3 ncr_si.c
and "sw" DMA code written by me.

This driver contains user-configurable "options", which can be set via the
"flags" directive in the kernel configuration file.  By default, only
DMA is enabled.  DMA completion interrupts and reselection may be enabled
by setting the appropriate bits with "flags".  See si.c for details.

Note that DMA completion interrupts and reselection don't yet work on the
4/100 controller.  I don't know why, and it's unlikely that I'll have
the opportunity to find out any time soon.  DMA does work, and results
in a considerable performance increase.

DMA, DMA completion interrupts, and reslection all work on my 4/260 (VME)
system with modern SCSI-II disks.
1996-01-01 22:40:56 +00:00
mycroft
3a89082ff4 Make this work for GCC < 2.6. 1995-12-29 18:53:01 +00:00
thorpej
17eb6e2bc1 Move the old-style disk instrumentation "structures" to a central location
(sys/kern/subr_disk.c) and note that they should/will be deperecated.
1995-12-28 19:16:31 +00:00
mycroft
cd8fe86bcb Make the type of __builtin_va_list a long. 1995-12-26 01:16:24 +00:00
mycroft
0c00214737 Use __builtin_va_alist. 1995-12-26 00:19:09 +00:00
mycroft
fa887628d8 Stylistic changes. 1995-12-25 23:15:31 +00:00
mycroft
72e24c3168 Update for GCC 2.7, and fix bugs. 1995-12-25 22:24:54 +00:00
mycroft
3da4b2a160 The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
1995-12-24 02:29:35 +00:00
pk
644c68a706 Towards machine independency, per cgd: macros to access hardware registers. 1995-12-18 23:58:31 +00:00
pk
b7feb4a35e Enable interrupts; some ROM versions apparently turn them off. 1995-12-13 23:35:18 +00:00
pk
524718f597 Adapt to changed mapiodev() interface. 1995-12-11 12:45:16 +00:00
pk
d2ae46d04e Agree with prototype. 1995-12-11 12:44:39 +00:00
pk
0d1981416d Adapt to changed mapiodev() interface. 1995-12-11 12:43:14 +00:00
pk
f840d96cfe Adapt to changed mapiodev() interface.
Use new DVMA routines.
1995-12-11 12:40:20 +00:00
pk
8f162e4e25 mapdev() now takes a struct rom_reg' argument to get access to iospace'. 1995-12-11 12:34:36 +00:00
pk
2b7034a493 The return of dvma_malloc/dvma_free in a different shape. 1995-12-11 12:32:56 +00:00
pk
528ea56588 Change mapdev() and mapiodev() to take a `struct rom_reg', enabling the use
of IO spaces to construct device mappings.
1995-12-11 12:31:02 +00:00
pk
51c8280df1 Prototype dvma helper functions `dvma_malloc()/dvma_free()' 1995-12-11 12:25:17 +00:00
pk
5c50eeb245 Prevent possible race condition in ctx_alloc().
Remove some bogus casts.
1995-12-11 01:27:28 +00:00
pk
7987c7fce9 Use def_width' and def_height' as default values when getting rom properties. 1995-12-10 22:55:32 +00:00
mycroft
494a9b9eb9 Use the MI LANCE code. 1995-12-10 10:15:06 +00:00
mycroft
46366f34e7 Include vm.h, rather than guessing which files we need. 1995-12-10 06:50:58 +00:00
mycroft
292120bf63 Define __FORK_BRAINDAMAGE. 1995-12-09 04:41:41 +00:00
pk
5c482e804d Don't forget to flush the cache in vunmapbuf(). 1995-12-07 22:18:54 +00:00
pk
480398f38e dvma_malloc => malloc/dvma_mapin. (not the most elegant solution, but it'll
have to do for now).
1995-12-06 22:40:22 +00:00
pk
f6a3272e25 DVMA space is described by the variables dvma_start' and dvma_end'.
Prototype dvma_map*() routines.
1995-12-06 22:35:54 +00:00
pk
7299c7a6c0 Have v[un]mapbuf() allocate from plain kernel map instead of dvma space.
Remove dvma_malloc/dvma_free; drivers should allocate kernel memory and
use dvma_mapin/dvma_mapout to double map it in DVMA space.

Make the resource map `dvmamap' responsible for all DVMA allocation.
The VM map `physmap' only serves the role of placeholder in the VM system.
1995-12-06 22:33:49 +00:00
pk
210b4d80ec Make pmap_prefer() also return a preferred virtual address when there's no
associated physical page.
1995-12-05 23:01:39 +00:00
pk
8a1606d530 Don't return `XS_DRIVER_STUFFUP' too easily; this can hose buffer cache
writes. Say XS_TIMEOUT in stead so the scsi code will retry.
1995-12-01 01:00:55 +00:00
pk
a2a4da4874 Merge changes from sun3 port; per Gordon. 1995-11-29 23:43:42 +00:00
pk
ee08e9085b Extend the size of the "soft" FIFOs which reportedly reduces the number
of FIFO overflows on high baud rates.
However, doing so on all 4 ports would cost a whopping 64KB (at 4096 entries
per FIFO) of kernel memory. So, the FIFOs are now allocated at attach time
allowing the size for the keyboard and mouse ports to be reduced (to 128)
which should be adequate for the 1200 baud they use.
1995-11-29 23:41:31 +00:00
pk
12bfe2e68e Must change u_long' to u_int32_t' as Jason pointed out. 1995-11-29 22:03:53 +00:00
pk
6e53c6a5fd In probe[gs]et() there's no need to check against KERNBASE, as pointed
out by David Jones and Chris Torek.
1995-11-29 01:52:41 +00:00
pk
e9a919b88f Code from Jason to better configure /dev/fb. 1995-11-29 01:45:36 +00:00
pk
ce474272f1 Prevent synch negotiation on ESP100 chips 1995-11-28 22:49:31 +00:00
pk
9bf3251e46 Lots of major and minor bug fixes and changes.
- properly do MSG_IN handshaking, so we can actually receive multi-byte msgs.
- do synch negotiation (now that the above works).
- handle disconnects.
There are a few trial-and-error bits at points where the docs I have are
particularly ambiguous about the state of chip and/or SCSI bus.

Things to do:
- more cleanup
- deal with MSG_OUT phase better
- keep some "config reg 3" bits per target (ie. FASTCLK and FASTSCSI).
1995-11-28 20:49:12 +00:00
pk
def161af38 Careful with signed chars (caddr_t *!).
Merge in 1.1 changes.
1995-11-28 20:26:59 +00:00
pk
0c031adc76 Not all v2 proms understand the `mac-address' word (from Theo). 1995-11-14 15:04:01 +00:00
pk
c7d1d39b3e dk_device => device in controller structure (noted by Jason Thorpe). 1995-11-11 21:12:50 +00:00
pk
c2cd05605d UFS => FFS conversion. 1995-11-08 09:09:20 +00:00
pk
54ec9fb697 Correct test for sun4 machines (thanks Chuck).
Since uname currently does not allow to discriminate different sparc
models, we use `sysctl.hw.cpumodel' to do this somewhat heuristicly:
if the returned strings starts with "SUN4-" a sun4 architecture is
assumed. This information is used to determine whether or not to strip
the a.out header off the 1st-stage bootblocks.
1995-11-07 11:45:24 +00:00
pk
996526aa02 Make error recovery actually work, i.e. don't hang on SCSI bus resets
and re-synchronize before re-scheduling pending operations.
Things seem to be a fair bit stabler now.
1995-11-03 16:47:43 +00:00
pk
bbdb422873 Stop DMA before resetting 1995-11-03 16:34:12 +00:00
pk
c0a156c9fd Map pixels in VME32 space 1995-10-28 23:15:16 +00:00
pk
e4fcc8ab5a Move DMA chip draining to dmaintr() and drain when a (possibly partial)
transfer ends in stead of doing it before starting a new transfer.
Use a different CSR bit to wait for "chip not busy" (may be necessary to
make this conditional on chip revision).
1995-10-24 16:26:54 +00:00
pk
a3f2bf19e4 Various:
- make esp_poll() approximate the given timeout value.
	- introduce esp_abort(), and use it for timed out commands; make		  targets and driver less confused.
	- make {free,ready,nexus}-list management somewhat more coherent.
	- make sure we only proceed down the state machine in espintr()
	  if there really is an interrupt pending.
1995-10-24 16:03:57 +00:00
pk
dc3c0d7db7 Define VIDEO enable bit (per Jason Thorpe; PR#1672). 1995-10-23 23:36:28 +00:00
pk
7a9ddaff33 On-board bwtwo diddles a system enable register bit for video, per Jason
Thorpe (PR#1672).
1995-10-23 23:35:03 +00:00
pk
5e55f88874 Remove `-fno-builtin'. 1995-10-22 17:36:33 +00:00
pk
bbfd54d128 Merge from netbsd-1-1 branch: kgdb_debug_panic decl; PR1633 1995-10-18 21:54:34 +00:00
pk
ce2afd8d64 Sync filesystem before running installboot. 1995-10-11 13:32:57 +00:00
pk
64a90cd0b0 Check input channel in gettick(); for `L1-A' processing. 1995-10-10 20:11:33 +00:00
pk
ebe37d8041 We don't need `rem.o'. 1995-10-10 20:07:54 +00:00
pk
4dcb5917b8 Brr.. libkern.o is way too big for our bootxx.. 1995-10-09 23:25:54 +00:00
pk
be2f4294bf Add `fd' to list of possible boot devices. 1995-10-09 22:34:03 +00:00
pk
c4dc969b09 Point `bootdv' at the disk device instead of the controller (from Jason Thorpe). 1995-10-09 22:33:07 +00:00
pk
53eb8f8175 RASTERCONS now works on sun4's too. 1995-10-09 15:39:34 +00:00
pk
1ad1d128e3 Fill in `ascent' values correctly. 1995-10-08 19:31:44 +00:00
pk
ecf1cf893d Add forgotten `eeprom' configuration. 1995-10-08 11:45:39 +00:00
pk
21a594651a eeprom_match: account for differing physical addresses (per Jason Thorpe). 1995-10-08 11:44:59 +00:00
pk
87a0c55d23 Patch from Jason to factor out a common framebuffer size determination
routine from the individual drivers.
1995-10-08 01:39:13 +00:00
mycroft
c078d7a9f4 Remove __builtin_saveregs(). 1995-10-07 22:27:31 +00:00
mycroft
6287d3d7b2 Remove bzero(). 1995-10-07 22:24:50 +00:00
mycroft
245f292fed Prefix names of system call implementation functions with `sys_'. 1995-10-07 06:25:19 +00:00
pk
48849279bf Script to assist installing second-stage boot programs. 1995-10-05 21:03:12 +00:00
pk
aea329df61 rcons: rc_maxcol and rc_maxrow were swapped. 1995-10-05 13:16:57 +00:00
pk
c8f10b184c Do not set `ra_len' in bwtwomatch(); we only need the pixels for CONSOLE,
but if so, we need the lot.
1995-10-05 00:33:23 +00:00
pk
de0c6a97bd RCONSOLE => RASTERCONSOLE. 1995-10-05 00:26:07 +00:00
pk
c1e313b122 include `files.rcons'. 1995-10-05 00:21:35 +00:00
pk
b79dc038d5 Machine dependent RASTERCONSOLE font definition to be passed to rcons_init(). 1995-10-05 00:02:54 +00:00
pk
859b799130 RCONSOLE => RASTERCONSOLE 1995-10-04 23:44:33 +00:00
pk
d19cacbb03 RCONSOLE => RASTERCONSOLE. 1995-10-04 23:35:13 +00:00
pk
dad96c6619 Add a few constants used for mapping bit and pieces in the kernel driver. 1995-10-04 00:21:27 +00:00
pk
32c023995c Bring reset logic into interrupt state machine. 1995-10-03 17:32:12 +00:00
pk
fcc53878ca Make fbrcons_init() resistant against SUN4s. 1995-10-02 21:48:21 +00:00
pk
cfbe993b9b Update to use <machine/cgtworeg.h> 1995-10-02 21:44:51 +00:00
pk
38d1101ad3 Silly me.. there's already a <machine/cgtworeg.h> 1995-10-02 21:44:22 +00:00
pk
fb58a99a8f Fix some bogus calls to {read/write}disklabel(). 1995-10-02 21:04:45 +00:00
pk
82434458cc Get some of the bugs out. Thanks to David Gilbert for testing. 1995-10-02 09:07:03 +00:00
pk
13dcbfbb29 Make this work with OBJ dirs. 1995-09-30 21:43:35 +00:00
pk
160b38697c Refer to installboot(8) 1995-09-30 21:33:30 +00:00
pk
a029979ad3 Manual page for installboot(8). 1995-09-30 21:32:14 +00:00
pk
691b9f2bfa Avoid reading the filesystem superblock in bootxx; all info now prepared
by installboot (per Gordon Ross).
1995-09-27 09:03:13 +00:00
chuck
b3ecc4c310 make sure devopen() sets pd->devtype properly when BOOTXX is defined
(should be DT_BLOCK).  otherwise the bootxx boot block will fail if
you are on a system with a v2 openprom [because it will not do the
v2_seek in obp_strategy()].    fixes the problem recently noted on
the port-sparc list by matthew green <mrg@eterna.com.au>.   i tested
fix on a ss2 with a v2 prom.
1995-09-26 20:07:53 +00:00
pk
f33cf7c909 Correct cgtwo address. 1995-09-25 22:33:37 +00:00
chuck
b47de9fb69 new "xy" disk device driver from me.
the "xy" driver runs Xylogics 450/451 SMD disk controllers.
1995-09-25 20:35:14 +00:00
chuck
25563b1f82 add config info for "xy" xylogics 450/451 driver 1995-09-25 20:27:30 +00:00
chuck
8d19642cd6 add "xy" xylogics 450/451 config stuff 1995-09-25 20:20:27 +00:00
chuck
1779adf6be minor cleanups:
- don't let pcyl go unassigned if we have a non-sunos disklabel.
		if nothing else, guess pcyl = ncyl + acyl.
	- don't use bogus disklabel data if disk label is invalid
		(xdgetdisklabel() now returns if label was ok or not).
	- move xddriver decl. before start of actual code (cleanup).
1995-09-25 20:12:44 +00:00
chuck
2aff99a206 bug fix: xddummystrat() was clearing all but B_BUSY when it should
have been clearing just B_BUSY (s/B_BUSY/~B_BUSY/).    this
	fixes hard hang when reading disklabel when booting system.
minor clean up: added a few prototypes and only fool with bootpath
	if booting the system (in xdattach).
1995-09-25 16:02:09 +00:00
pk
825bd034de Move pseudo swap block device to major 4 to make way for `xy'. 1995-09-24 20:45:27 +00:00
chuck
4408ec71bf init bad144 table before we actually try and read anything from the
disk, rather than init'ing after reading block 0 [in case we get an
error reading block zero].
1995-09-24 00:27:59 +00:00
thorpej
b903d705da Compile the kernel with -Werror and -fno-builtin. 1995-09-19 23:26:58 +00:00
thorpej
7d7396c414 Make system calls conform to a standard prototype and bring those
prototypes into scope.
1995-09-19 22:53:47 +00:00
pk
c030fa6ef2 Install in /usr/mdec 1995-09-18 23:33:42 +00:00
pk
aa41c30406 Don't strip bootxx on installation. 1995-09-18 23:32:41 +00:00
pk
4025edc861 Make this compile again by calling readdisklabel() with a dummy strategy routine.
XXX - need some reorganization to this from xdopen().
1995-09-18 23:26:39 +00:00
pk
371dd67d56 sync filesystems just prior to writing the bootblocks to the raw device. 1995-09-18 22:36:19 +00:00
pk
974115eb54 Adapt to libsa changes & some other minor nits. 1995-09-18 21:31:44 +00:00
chuck
05f929580f read superblock into &sblock rather than LOADADDR. we can't read
into LOADADDR because it can't be mapped into DVMA space.   this fixes
a dvma panic on a sun4 boot from an xd disk.
1995-09-18 20:24:53 +00:00
chuck
24ba08adca Fixed RELOC's to be hex numbers (as expected) rather than decimal.
(e.g. s/340000/0x340000/).   Fixes DVMA panic on my sun-4/280 when
booted diskless.
1995-09-18 19:52:15 +00:00
pk
f447526366 vmes => vmes0 1995-09-17 21:11:13 +00:00
pk
11f1ea06af These files have moved to sys/dev/rcons. 1995-09-17 21:08:25 +00:00
pk
2c523b5941 Remove rcons lines.
Add cgtwo.
1995-09-17 21:03:36 +00:00
pk
30150218f5 Add cgtwo0. 1995-09-17 21:02:56 +00:00
pk
c5bc107461 cgtwo framebuffer, cloned from cgthree.c and sun3's cg2.c.
Note: untested, shall be considered a framework to get things started..
1995-09-17 20:53:43 +00:00
pk
c92d076f5b Change interface to th `fb' pseudo device to not need the major device
number (a la sun3).
Put in new glue for rcons.
1995-09-17 20:43:39 +00:00
pk
b89096d14f Remove all rcons related stuff from `fbdevice'; this is now defined in
dev/rcons/rcons.h.
1995-09-17 20:41:30 +00:00
pk
a32163f292 Correct some prototypes. 1995-09-17 00:50:54 +00:00
pk
f97c30e5fe Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
1995-09-16 23:20:22 +00:00
pk
db43cabe32 Re-instate configuration print routines, following Chris' suggestion.
Only prints something if there's no scsi bus to attach.
1995-09-14 20:38:53 +00:00
chuck
851669ceab cleaned up bootpath code:
- v2 openprom disk boot generates "/sbus/esp/sd@3,0" which we translated
	into "/sbus@0,0/esp@0,0/sd@3,0"... this caused esp.c to reject
	the bootpath because it was looking for sbus slot/offset 0,0.
	changed the code to generate "/sbus0/esp0/sd@3,0" to fix this
	panic.
 - when generating fake boot paths, generate them with unit numbers
	rather than slot/offsets (thus, /obio@0,0 becomes /obio0, as
	does vmel and vmes).
 - fixed up comments to reflect these changes
tested new code on: 4/280 (diskless), 4/360 (diskless), 4/360 ("xd" disk),
	4/370 (scsi disk), ss1 w/v1 openprom (diskless),
	ss1 w/v1 openprom (scsi disk), ss2 w/v2 openprom (diskless),
	ss2 w/v2 openprom (scsi disk).
1995-09-12 22:03:02 +00:00
pk
9d7c17bfcb We have no need for esp_print()'; the only child we expect is a scsibus',
and there's nothing to say if it isn't there. Returning -1 is an error
anyway as noted by Chuck Cranor.
1995-09-11 19:41:21 +00:00
pk
0a5ab32e3d We have no need for si_print()'; the only child we expect is a scsibus',
and there's nothing to say if it isn't there.
1995-09-11 19:35:06 +00:00
pk
5bf0d8e4fa si' and sw' are scsibusses. 1995-09-11 19:20:12 +00:00
pk
bac2393fb0 Probe config registers correctly. 1995-09-06 12:35:38 +00:00
pk
896097d846 Fix `le' faked bootpath (PR#1438, Rolf Grossmann). 1995-09-05 21:46:04 +00:00
pk
60a7c4c394 Add `sw' scsi adapter on obio (per Jason Thorpe, PR#1422). 1995-09-05 21:43:09 +00:00
pk
b04e172458 Rename a `xxx' function. 1995-09-04 09:53:53 +00:00
pk
003751356c Patches from Jason Thorpe to deal with 4/110 scsi (PR#1422). Also includes
bootpath glue (PR#1414) (this needs finishing off in disksubr.c).
1995-09-03 22:21:27 +00:00
pk
8bdbf4be70 Update from Jason: eeprom device needs 8-bit access. 1995-09-03 21:55:36 +00:00
pk
af6e3d03cf Add data structures used to interface to the monitor-resident drivers. 1995-09-03 21:36:06 +00:00
mycroft
29053c58b2 SA_ONSTACK --> SS_ONSTACK 1995-09-01 20:05:59 +00:00
pk
9b3308eeec Enable writing of disklabels (Many thanks to Jason Thorpe, Gordon Ross
and Matthew Green).
1995-09-01 17:19:50 +00:00
pk
b1ae3d7339 Garbage collect. 1995-08-29 23:09:29 +00:00
pk
7a84d590e0 Add bwtwo@obio specs (from Jason Thorpe). 1995-08-29 22:50:36 +00:00
pk
bc5b188714 Define bwtwo at obio & vme (from Jason Thorpe). 1995-08-29 22:28:07 +00:00
pk
a4e214aef0 If we're the console, say so in attach message. 1995-08-29 22:26:37 +00:00
pk
a159e45699 Support for sun4 (from Jason Thorpe). 1995-08-29 22:20:01 +00:00
pk
15c28bc39a Sun4s must set baud rate on the mouse port (from Jason Thorpe). 1995-08-29 22:15:35 +00:00
pk
f9777fe9ef Export `eeprom_va' (from Jason Thorpe). 1995-08-29 22:13:19 +00:00
pk
6f1f25d6ed Export `eeprom_va' so drivers can peek at the configuration (from Jason Thorpe). 1995-08-29 22:11:58 +00:00
pk
4bdcdaa4e3 define reserved bits in cfg2 & cfg3 registers correctly. 1995-08-29 20:05:22 +00:00
pk
7e13adf019 Check for absent boot device where it matters. 1995-08-29 19:59:49 +00:00
pk
bd12f97e97 Avoid NULL dereference 1995-08-29 19:53:59 +00:00