diff options
author | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 1999-07-18 21:25:22 +0000 |
---|---|---|
committer | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 1999-07-18 21:25:22 +0000 |
commit | 04dc83c968dde4a684bab6459442579548ec13e4 (patch) | |
tree | f9fb173c60cd865c8f8dc5188f07e3a1b52cc28b /sys/arch/i386 | |
parent | 1fba5b47e85fd40ec2fd8bee32d4ca4bbe0e3629 (diff) |
Import of NetBSD ATA/IDE stuff.
Introduction of home-grown
To enable this stuff in your configuration, look at the NEWATA conf file
and go through
dev/isa/files.isa
dev/pci/files.pci
conf/files
arch/i386/conf/files.i386
and follow the instructions on commenting/uncommenting stuff
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/conf/NEWATA | 297 | ||||
-rw-r--r-- | sys/arch/i386/conf/files.i386 | 10 | ||||
-rw-r--r-- | sys/arch/i386/pci/pciide_machdep.c | 75 |
3 files changed, 381 insertions, 1 deletions
diff --git a/sys/arch/i386/conf/NEWATA b/sys/arch/i386/conf/NEWATA new file mode 100644 index 00000000000..6be490c7fac --- /dev/null +++ b/sys/arch/i386/conf/NEWATA @@ -0,0 +1,297 @@ +# $OpenBSD: NEWATA,v 1.1 1999/07/18 21:25:21 csapuntz Exp $ +# +# NEWATA - Generic 07/17/99 with new ATA stuff +# + +machine i386 # architecture, used by config; REQUIRED + +include "../../../conf/GENERIC" + +option I386_CPU # CPU classes; at least one is REQUIRED +option I486_CPU +option I586_CPU +option I686_CPU +option GPL_MATH_EMULATE # floating point emulation + +#option VM86 # Virtual 8086 emulation +#option USER_LDT # user-settable LDT; used by WINE +option XSERVER # diddle with console driver +option APERTURE # in-kernel aperture driver for XFree86 + +# Some BIOSes don't get the size of extended memory right. If you +# have a broken BIOS, uncomment the following and set the value +# properly for your system. +#option EXTMEM_SIZE=... # size of extended memory +#option DUMMY_NOPS # speed hack; recommended + +option COMPAT_SVR4 # binary compatibility with SVR4 +option COMPAT_IBCS2 # binary compatibility with SCO and ISC +option COMPAT_LINUX # binary compatibility with Linux +option COMPAT_FREEBSD # binary compatibility with FreeBSD +option COMPAT_BSDOS # binary compatibility with BSD/OS + +maxusers 32 # estimated number of users + +config bsd swap generic + +mainbus0 at root + +bios0 at mainbus0 +apm0 at bios0 + +isa0 at mainbus0 +eisa0 at mainbus0 +pci* at mainbus0 bus ? + +option PCIVERBOSE +option EISAVERBOSE +option PCMCIAVERBOSE + +pchb* at pci? dev ? function ? # PCI-Host bridges +ppb* at pci? dev ? function ? # PCI-PCI bridges +pci* at ppb? bus ? +pci* at pchb? bus ? +pcib* at pci? dev ? function ? # PCI-ISA bridges (do nothing) + +# ISA PCMCIA controllers +pcic0 at isa? port 0x3e0 iomem 0xd0000 iosiz 0x4000 +pcic1 at isa? port 0x3e2 iomem 0xd4000 iosiz 0x4000 + +# PCMCIA bus support +pcmcia* at pcic? controller ? socket ? + +npx0 at isa? port 0xf0 irq 13 # math coprocessor +isadma0 at isa? +isapnp0 at isa? + +#pc0 at isa? port 0x60 irq 1 # generic PC console device +vt0 at isa? port 0x60 irq 1 + +pcppi0 at isa? +sysbeep0 at pcppi? + +pccom0 at isa? port 0x3f8 irq 4 # standard PC serial ports +pccom1 at isa? port 0x2f8 irq 3 +pccom2 at isa? port 0x3e8 irq 5 +#pccom3 at isa? port 0x2e8 irq 9 # (conflicts with some video cards) +ast0 at isa? port 0x1a0 irq 5 # AST 4-port serial card +#ast1 at isa? port 0x2a0 irq 6 # 2nd AST 4-port serial card +pccom* at ast? slave ? +#boca0 at isa? port 0x100 irq 5 # BOCA 8-port serial cards +#pccom* at boca? slave ? +#rtfps0 at isa? port 0x1230 irq 10 # RT 4-port serial cards +#pccom* at rtfps? slave ? +pccom* at pcmcia? function ? # PCMCIA modems/serial ports +pccom* at isapnp? + +# option for using CD1400 handshaking for incoming data +# requires a special cable that exchanges the RTS and DTR lines +# options CY_HW_RTS +cy0 at isa? iomem 0xd4000 irq 12 # ISA cyclom serial card +#cy* at pci? # PCI cyclom serial card + +lpt0 at isa? port 0x378 irq 7 # standard PC parallel ports +lpt1 at isa? port 0x278 +lpt2 at isa? port 0x3bc + +lms0 at isa? port 0x23c irq 5 # Logitech bus mouse +lms1 at isa? port 0x238 irq 5 +mms0 at isa? port 0x23c irq 5 # Microsoft InPort mouse +mms1 at isa? port 0x238 irq 5 +pms0 at pckbd? irq 12 # PS/2 auxiliary port mouse + +bt0 at isa? port 0x330 irq ? drq ? # BusLogic [57]4X SCSI controllers +bt1 at isa? port 0x334 irq ? drq ? # BusLogic [57]4X SCSI controllers +bt2 at isa? port ? irq ? +scsibus* at bt? +aha0 at isa? port 0x330 irq ? drq ? # Adaptec 154[02] SCSI controllers +aha1 at isa? port 0x334 irq ? drq ? # Adaptec 154[02] SCSI controllers +aha* at isapnp? +scsibus* at aha? +ahb* at eisa? slot ? # Adaptec 174[024] SCSI controllers +scsibus* at ahb? +ahc0 at isa? port ? irq ? # Adaptec 284x SCSI controllers +ahc* at eisa? slot ? # Adaptec 274x, aic7770 SCSI controllers +ahc* at pci? dev ? function ? # Adaptec 2940 SCSI controllers +scsibus* at ahc? +isp* at pci? dev ? function ? # Qlogic ISP [12]0x0 SCSI/FibreChannel +scsibus* at isp? +aic0 at isa? port 0x340 irq 11 # Adaptec 152[02] SCSI controllers +aic* at pcmcia? function ? # PCMCIA based aic SCSI controllers +scsibus* at aic? +ncr* at pci? dev ? function ? # NCR 538XX SCSI controllers +scsibus* at ncr? +adv* at pci? dev ? function ? # AdvanSys 1200A/B and ULTRA SCSI +scsibus* at adv? +adw* at pci? dev ? function ? # AdvanSys ULTRA WIDE SCSI +scsibus* at adw? +sea0 at isa? iomem 0xc8000 irq 5 # Seagate ST0[12] SCSI controllers +scsibus* at sea? +uha0 at isa? port 0x330 irq ? drq ? # UltraStor [13]4f SCSI controllers +uha1 at isa? port 0x334 irq ? drq ? # UltraStor [13]4f SCSI controllers +uha* at eisa? slot ? # UltraStor 24f SCSI controllers +scsibus* at uha? +wds0 at isa? port 0x350 irq 15 drq 6 # WD7000 and TMC-7000 controllers +#wds1 at isa? port 0x358 irq 11 drq 5 +scsibus* at wds? + +sd* at scsibus? target ? lun ? # SCSI disk drives +st* at scsibus? target ? lun ? # SCSI tape drives +cd* at scsibus? target ? lun ? # SCSI CD-ROM drives +ch* at scsibus? target ? lun ? # SCSI autochangers +ss* at scsibus? target ? lun ? # SCSI scanners +uk* at scsibus? target ? lun ? # unknown SCSI + +fdc0 at isa? port 0x3f0 irq 6 drq 2 # standard PC floppy controllers +#fdc1 at isa? port 0x370 irq ? drq ? +fd* at fdc? drive ? + +#mcd0 at isa? port 0x300 irq 10 # Mitsumi CD-ROM drives + +# IDE and related devices +# PCI IDE controllers - see pciide(4) for supported hardware. +# The 0x0001 flag force the driver to use DMA, even if the driver doesn't know +# how to set up DMA modes for this chip. This may work, or may cause +# a machine hang with some controllers. +pciide* at pci ? dev ? function ? flags 0x0000 + +# ISA ST506, ESDI, and IDE controllers +# Use flags 0x01 if you want to try to use 32bits data I/O (the driver will +# fall back to 16bits I/O if 32bits I/O are not functionnal). +# Some controllers pass the initial 32bit test, but will fail later. +wdc0 at isa? port 0x1f0 irq 14 flags 0x00 +wdc1 at isa? port 0x170 irq 15 flags 0x00 + +# IDE drives +# Flags are used only with controllers that support DMA operations +# and mode settings (e.g. some pciide controllers) +# The lowest order four bits (rightmost digit) of the flags define the PIO +# mode to use, the next set of four bits the DMA mode and the third set the +# UltraDMA mode. For each set of four bits, the 3 lower bits define the mode +# to use, and the last bit must be 1 for this setting to be used. +# For DMA and UDMA, 0xf (1111) means 'disable'. +# 0x0fac means 'use PIO mode 4, DMA mode 2, disable UltraDMA'. +# (0xc=1100, 0xa=1010, 0xf=1111) +# 0x0000 means "use whatever the drive claims to support". +wd* at wdc? channel ? drive ? flags 0x0000 +wd* at pciide? channel ? drive ? flags 0x0000 + +atapiscsi* at wdc? channel ? +atapiscsi* at pciide? channel ? +scsibus* at atapiscsi? + +#wdc0 at isa? port 0x1f0 irq 14 # ST506, ESDI, and IDE controllers +#wdc1 at isa? port 0x170 irq 15 +#wd* at wdc? drive ? + +#atapibus* at wdc? +#acd* at atapibus? drive? + +wt0 at isa? port 0x308 irq 5 drq 1 # Archive and Wangtek QIC tape drives + +we0 at isa? port 0x280 iomem 0xd0000 irq 9 # WD/SMC 80x3 ethernet +we1 at isa? port 0x300 iomem 0xcc000 irq 10 # +we* at isapnp? +ec0 at isa? port 0x250 iomem 0xd8000 irq 9 # 3C503 ethernet +ne0 at isa? port 0x240 irq 9 # NE[12]000 ethernet +ne1 at isa? port 0x300 irq 10 # NE[12]000 ethernet +ne2 at isa? port 0x280 irq 9 # NE[12]000 ethernet +ne* at isapnp? # NE[12]000 PnP ethernet +eg0 at isa? port 0x310 irq 5 # 3C505/Etherlink+ ethernet +el0 at isa? port 0x300 irq 9 # 3C501 ethernet +ep0 at isa? port ? irq ? # 3C509 ethernet +ep* at isapnp? # 3C509 PnP ethernet +ep* at isa? port ? irq ? # 3C509 ethernet +ie0 at isa? port 0x360 iomem 0xd0000 irq 7 # StarLAN and 3C507 +ie1 at isa? port 0x300 irq 10 # EtherExpress +le0 at isa? port 0x360 irq 15 drq 6 # IsoLan, NE2100, and DEPCA +ex0 at isa? port 0x320 irq 5 # Intel EtherExpress PRO/10 +ep0 at eisa? slot ? +ep* at eisa? slot ? # 3C579 ethernet +fea* at eisa? slot ? # DEC DEFEA FDDI +lmc* at pci? dev ? function ? # Lan Media Corp SSI/T3/HSSI +le* at pci? dev ? function ? # PCnet-PCI based ethernet +le* at isapnp? +de* at pci? dev ? function ? # DC21X4X-based ethernet +fxp* at pci? dev ? function ? # EtherExpress 10/100B ethernet +ne* at pci? dev ? function ? # NE2000-compat ethernet +ep0 at pci? dev ? function ? # 3C59x ethernet +ep* at pci? dev ? function ? # 3C59x ethernet +ne* at pcmcia? function ? # PCMCIA based NE2000 ethernet +ep* at pcmcia? function ? # PCMCIA based 3C5xx ethernet +sm* at pcmcia? function ? # PCMCIA based sm ethernet +xe* at pcmcia? function ? # Xircom ethernet +wi* at pcmcia? function ? # WaveLAN IEEE 802.11 +fpa* at pci? dev ? function ? # DEC DEFPA FDDI +xl* at pci? dev ? function ? # 3c9xx ethernet +rl* at pci? dev ? function ? # RealTek 81[23]9 ethernet +tx* at pci? dev ? function ? # SMC 83C170 EPIC ethernet +tl* at pci? dev ? function ? # Compaq Thunderlan ethernet +mx* at pci? dev ? function ? # Macronix PMAC ethernet +vr* at pci? dev ? function ? # VIA Rhine ethernet +pn* at pci? dev ? function ? # Lite-On PNIC ethernet +wb* at pci? dev ? function ? # Winbond W89C840F ethernet + +# Media Independent Interface (mii) drivers +#exphy* at mii? phy ? # 3Com internal PHYs +inphy* at mii? phy ? # Intel 82555 PHYs +icsphy* at mii? phy ? # ICS 1890 PHYs +#lxtphy* at mii? phy ? # Level1 LXT970 PHYs +nsphy* at mii? phy ? # NS and compatible PHYs +#qsphy* at mii? phy ? # Quality Semi QS6612 PHYs +#sqphy* at mii? phy ? # Seeq 8x220 PHYs +rlphy* at mii? phy ? # RealTek 8139 internal PHYs +#mtdphy* at mii? phy ? # Myson MTD972 PHYs +ukphy* at mii? phy ? # "unknown" PHYs + +pss0 at isa? port 0x220 irq 7 drq 6 # Personal Sound System +sp0 at pss0 port 0x530 irq 10 drq 0 # sound port driver + +eap* at pci? dev ? function ? # Ensoniq AudioPCI S5016 +sv* at pci? dev ? function ? # S3 SonicVibes (S3 617) +sb0 at isa? port 0x220 irq 7 drq 1 # SoundBlaster +sb* at isapnp? +wss0 at isa? port 0x530 irq 10 drq 0 # Windows Sound System +wss* at isapnp? +pas0 at isa? port 0x220 irq 7 drq 1 # ProAudio Spectrum +gus0 at isa? port 0x220 irq 7 drq 1 drq2 6 # Gravis UltraSound (drq2 is record drq) +ym* at isapnp? + +# OPL[23] FM syntheziers +#opl0 at isa? port 0x388 # use only if not attached to sound card +opl* at sb? + +# MIDI support +midi* at pcppi? # MIDI interface to the PC speaker +midi* at sb? # SB MPU401 port +midi* at opl? # OPL FM synth + +# The spkr driver provides a simple tone interface to the built in speaker. +#spkr0 at pcppi? # PC speaker + +#Audio Support +audio* at sb? +audio* at gus? +audio* at pas? +audio* at sp? +audio* at wss? +audio* at ym? +audio* at eap? +audio* at sv? + +bktr0 at pci? dev ? function ? + +# Joystick driver. Probe is a little strange; add only if you have one. +#joy0 at isa? port 0x201 +joy* at isapnp? + +#wdt0 at pci? dev ? function ? # Ind Computer Source PCI-WDT50x driver + +# crypto support +#aeon* at pci? dev ? function ? # Aeon crypto card + +pseudo-device pctr 1 +pseudo-device sequencer 1 +#pseudo-device raid 4 # RAIDframe disk driver + +#option DEBUG_ISAPNP diff --git a/sys/arch/i386/conf/files.i386 b/sys/arch/i386/conf/files.i386 index 07009ea332a..bafd242ad6f 100644 --- a/sys/arch/i386/conf/files.i386 +++ b/sys/arch/i386/conf/files.i386 @@ -1,4 +1,4 @@ -# $OpenBSD: files.i386,v 1.51 1999/01/21 08:26:48 niklas Exp $ +# $OpenBSD: files.i386,v 1.52 1999/07/18 21:25:21 csapuntz Exp $ # $NetBSD: files.i386,v 1.73 1996/05/07 00:58:36 thorpej Exp $ # # new style config file for i386 architecture @@ -62,8 +62,13 @@ major {rd = 17} # Machine-independent ATAPI drivers # +#Comment out this include below if you're using the new ATA stuff include "../../../dev/atapi/files.atapi" +#Start Uncomment for new ATA stuff +#include "../../../dev/atapiscsi/files.atapiscsi" +#include "../../../dev/ata/files.ata" +#End Uncomment for new ATA stuff # # System bus types @@ -84,6 +89,9 @@ file arch/i386/i386/mainbus.c mainbus include "../../../dev/pci/files.pci" file arch/i386/pci/pci_machdep.c pci +#Start Uncomment for new ATA stuff +#file arch/i386/pci/pciide_machdep.c pciide +#End Uncomment for new ATA stuff file arch/i386/pci/pci_compat.c pci # XXX compatibility # PCI-Host bridge chipsets diff --git a/sys/arch/i386/pci/pciide_machdep.c b/sys/arch/i386/pci/pciide_machdep.c new file mode 100644 index 00000000000..f65a038c0a9 --- /dev/null +++ b/sys/arch/i386/pci/pciide_machdep.c @@ -0,0 +1,75 @@ +/* $OpenBSD: pciide_machdep.c,v 1.1 1999/07/18 21:25:21 csapuntz Exp $ */ +/* $NetBSD: pciide_machdep.c,v 1.2 1999/02/19 18:01:27 mycroft Exp $ */ + +/* + * Copyright (c) 1998 Christopher G. Demetriou. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Christopher G. Demetriou + * for the NetBSD Project. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * PCI IDE controller driver (i386 machine-dependent portion). + * + * Author: Christopher G. Demetriou, March 2, 1998 (derived from NetBSD + * sys/dev/pci/ppb.c, revision 1.16). + * + * See "PCI IDE Controller Specification, Revision 1.0 3/4/94" from the + * PCI SIG. + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/device.h> + +#include <dev/pci/pcireg.h> +#include <dev/pci/pcivar.h> +#include <dev/pci/pciidereg.h> +#include <dev/pci/pciidevar.h> + +#include <dev/isa/isavar.h> + +#define PCIIDE_CHANNEL_NAME(chan) ((chan) == 0 ? "primary" : "secondary") + +void * +pciide_machdep_compat_intr_establish(dev, pa, chan, func, arg) + struct device *dev; + struct pci_attach_args *pa; + int chan; + int (*func) __P((void *)); + void *arg; +{ + int irq; + void *cookie; + + irq = PCIIDE_COMPAT_IRQ(chan); + cookie = isa_intr_establish(NULL, irq, IST_EDGE, IPL_BIO, func, arg, dev->dv_xname); + if (cookie == NULL) + return (NULL); + printf("%s: %s channel interrupting at irq %d\n", dev->dv_xname, + PCIIDE_CHANNEL_NAME(chan), irq); + return (cookie); +} |