Commit Graph

68 Commits

Author SHA1 Message Date
Andrew Gallatin 72f21cf2c5 A quick fix to get around a problem (described below) with cia based
machines.  The patch uses an existing global variable in place of the
newbus accessor to get at use_bwx.

This is a quick fix to get miatas booting again; somebody
with more newbus skills than I can muster will have to correct it.

Matt Jacob's description of the problem from the -alpha list:

The IVAR accessor stuff for pcib is incompletely specified for CIA. There's
only one accessor defined, and that's to get the BUS instance number.
<..>
The device methods that try and get at the use_bwx get overriden because
there's only one ivar for CIA's pcib, and that's for hose #, and it's always
zero.
2000-09-02 01:05:37 +00:00
Andrew Gallatin cae70b8d4c Introduce explicit break statements in the various chipsets'
foo_pcib_[read|write]_config() functions rather than relying on
a break or return being in the CFG macro.

This fixes a panic later in the boot process on a UP1000.  From
inspection, it looks like this fixes a similar problem in the tsunami code.

Approved by: dfr
2000-08-31 16:19:27 +00:00
Andrew Gallatin 2d47df31fb fix a typo introduced by Doug's busspace changes that causes UP1000s to
crash very early in the boot process with a ksp not valid halt to the SRM.

submitted by: dfr
2000-08-31 16:11:20 +00:00
Doug Rabson 21c3015a24 * Completely rewrite the alpha busspace to hide the implementation from
the drivers.
* Remove legacy inx/outx support from chipset and replace with macros
  which call busspace.
* Rework pci config accesses to route through the pcib device instead of
  calling a MD function directly.

With these changes it is possible to cleanly support machines which have
more than one independantly numbered PCI busses. As a bonus, the new
busspace implementation should be measurably faster than the old one.
2000-08-28 21:48:13 +00:00
Matt Jacob f919331938 Do the same thing for TurboLaser that was done for Rawhide- make room
for secondary (bridged) PCI busses by making primary PCI instances
16 units apart.
2000-07-10 02:40:49 +00:00
Matt Jacob bc08581099 Don't let the infrastructure assign the 'next' PCI bus for us.
Instead, for now (until we get a pci infrastructure cleanup),
assign the PCI bus number to be mcpcia bus instance << 4. This
is to allow secondary bridges some room to be recongnized on
4100 systems.
2000-07-10 00:32:02 +00:00
John Baldwin 9701cd40b4 Support for unsigned integer and long sysctl variables. Update the
SYSCTL_LONG macro to be consistent with other integer sysctl variables
and require an initial value instead of assuming 0.  Update several
sysctl variables to use the unsigned types.

PR:		15251
Submitted by:	Kelly Yancey <kbyanc@posi.net>
2000-07-05 07:46:41 +00:00
Andrew Gallatin 72e9d2e8a2 Add support for the Alpha Processor, Inc. UP1000 system.
Reviewed by: dfr
Thanks to:  Alpha Processor Inc. for supplying the hardware.
2000-06-19 21:15:45 +00:00
Matt Jacob 79a4bee867 Sometimes there isn't an ISA bus configured. 2000-06-12 17:07:57 +00:00
Andrew Gallatin 4e5adf5f4a Part of AS2100 support that I neglected to commit last night
pointed out by: dfr
2000-05-28 17:52:08 +00:00
Andrew Gallatin 6ab09a6376 Add AlphaServer 2000 (demi-sable), 2100 (sable), and 2100A (lynx) support.
Only PCI and on-board ISA peripherials are supported at this time.

This support has been only lightly tested due to a lack of response to my
call for testers on the freebsd-alpha mailing list.  It works quite well
on the one AS2100 on which it has been tested, but it may not work on
an AS2100A and should therefore be regarded as experimental.
2000-05-28 02:52:54 +00:00
John Baldwin 7b7f33c4c3 Handle PCI devices that actually use an ISA IRQ for the cia and tsunami
chipsets.  An example of this is the USB controller on these chipsets.
With this, I can now use USB devices on the test Alpha I am borrowing at
the moment.

Reviewed by:	dfr, obrien
2000-05-10 18:54:28 +00:00
Matt Jacob a9b64eeadb add in stubbie mcpcia_pci that will parent PCI busses 2000-05-07 04:59:30 +00:00
Peter Wemm 365c5db0a7 Add $FreeBSD$ 2000-05-01 20:32:07 +00:00
Matt Jacob 6499b39e60 Alpha 8200: Add in a dummy child of dwlpx so that we can make the leap
from DWLPX to PCI space. Just a methods holder such that we have a parent
which is a "pcib" and we create a child which is a "pci". Add the appropriate
ivar code (which is for a hose #).
2000-03-18 08:00:13 +00:00
Matt Jacob 9ca20275e0 Alpha 8200: Do some compilation cleanup. Conditionalize some IDE stuff
based upon presence/absence of ISA (there is no ISA bus on an 8200- okay,
well, there *could* be one in a DWLPX tray, but we don't support it)).

Most importantly change the interrupt resource map to cover a whole 16
bits. The 8200 uses 16 bit interrupt vectors which we construct that
contain the I/O-board, hose, an pci slot in them, and then we write these
vectors into the appropriate DWLPX registers. At any rate, a flat array
of 64 'IRQs' isn't enough.
2000-03-18 07:57:58 +00:00
Søren Schmidt 47351d2774 Update the ata driver to take more advantage of newbus, this
was needed to make attach/detach of devices work, which is
needed for the PCCARD support.
(PCCARD support is still not working though, more to come on that)

Support the CMD646 chip which is used on many alphas, sadly only
in WDMA2 mode, as the silicon is broken beyond belief for UDMA modes.

Lots of cosmetic fixes here and there.

Sorry for the size of this megapatchfromhell but it was not
possible otherwise...

newbus patches based on work from: dfr (Doug Rabson)
2000-02-18 20:57:33 +00:00
Andrew Gallatin e1364adbae Make devices behind PPBs work on DS10s (and any other single pchip tsunamis)
I was wagering on DEC being elegant & numbering PCI buses normally on
machines with one pchip.  It looks like they went with consistent -- buses
behind ppbs begin with bus 2.
2000-01-20 16:49:18 +00:00
Andrew Gallatin 7c79b9ff14 Improve the mapping between the hardware PCI bus numbering on multi-hose
tsunami systems and the PCI bus-numbering system of FreeBSD.  Eg, the former
allows for 2 PCI bus 2's (one each on hoses 0 and 1) while the latter
needs to give each PCI bus a unique monotonically increasing number.

It has been fairly well tested and correctly maps machines with a ppb on
hose 1 as well as machines with ppbs on both hoses.

DS10s remain untested, as I do not have a pci card with a ppb which will
pass POST in a tsunami.

This is a house of cards.
1999-12-14 17:35:08 +00:00
Matthew N. Dodd fe0d408987 Remove the 'ivars' arguement to device_add_child() and
device_add_child_ordered().  'ivars' may now be set using the
device_set_ivars() function.

This makes it easier for us to change how arbitrary data structures are
associated with a device_t.  Eventually we won't be modifying device_t
to add additional pointers for ivars, softc data etc.

Despite my best efforts I've probably forgotten something so let me know
if this breaks anything.  I've been running with this change for months
and its been quite involved actually isolating all the changes from
the rest of the local changes in my tree.

Reviewed by:	peter, dfr
1999-12-03 08:41:24 +00:00
Andrew Gallatin 6cf898c767 Mchines whose interrupts are not routed through the ISA pic were still
registering their interrupts with rman as though they were going through
the ISA pic.  This prevents a conflict between isa & pci for irqs on such
machines.

Also hookup the chipset struct before calling platform.pci_intr_init().
This allows me to call inw/outw down in the platform code.

Add interrupt printfs to match the CIA chipset.

Reviewed by: dfr
Tested by: wilko
1999-11-16 14:01:12 +00:00
Andrew Gallatin 160dd8eb7b Add a second direct map window to increase the maximum RAM this platform
can deal with from 1GB to 2GB.   I have no way to test with >1GB because I
don't have high enough density memory to get any one box over 1GB.  However, I
have tested it on xp1000 & ds10 with < 1GB of memory & have verified that it
does no harm.
1999-11-03 01:16:11 +00:00
Poul-Henning Kamp 923502ff91 useracc() the prequel:
Merge the contents (less some trivial bordering the silly comments)
of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>.  This puts
the #defines for the vm_inherit_t and vm_prot_t types next to their
typedefs.

This paves the road for the commit to follow shortly: change
useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE}
as argument.
1999-10-29 18:09:36 +00:00
Doug Rabson 45f0aa1f0e * Implement bus_set/get/delete_resource for pci.
* Change the hack used on the alpha for mapping devices into DENSE or
  BWX memory spaces to a simpler one. Its still a hack and should be
  a seperate api to explicitly map the resource.
* Add $FreeBSD$ as necessary.
1999-10-14 21:38:33 +00:00
Andrew Gallatin da7ca2d9bd allow pci_ioctl to work with multi-hose alphas.
Rather than teaching pci_ioctl about hoses, we just pass down a magic number
& let the platform code figure out what the hose is based on what the bus
number is.

concept approved by dfr
1999-10-12 22:10:53 +00:00
Andrew Gallatin a76245d21d This fix allows cards inserted in one of the bottem-most slots on an xp1000
(behind the built-in ppb on hose 1) to be found:

When testing the adaptec controller on alpha, I realized I misread the xp1000
documentation and the way I'm calculating the bus number for PCI
config space accesses on the tsunami is wrong.  I had thought that a bus
behind a ppb should be numbered as the nth bus in that hose, but it
actually needs to be the nth global bus within the system.  The bus number
for the primary bus on a hose must always remain 0 when calculating config
space addresses.
1999-09-30 19:09:22 +00:00
Peter Wemm ee15718941 $Id$ -> $FreeBSD$ (some mangled and/or hidden ones) 1999-08-28 02:21:15 +00:00
Peter Wemm c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Doug Rabson 6afde6e247 Some very minor changes to the ISA dma code. 1999-08-25 08:25:58 +00:00
Andrew Gallatin 7f146cdf3d Enable S/G IO. Based on Doug's changes to cia.c 1999-08-11 22:31:01 +00:00
Andrew Gallatin cf54c5ff42 - detect the number of pchips actually present; don't just assume 2
- support S/G DMA for ISA devices
1999-08-10 13:54:50 +00:00
Andrew Gallatin d9be205559 Support S/G DMA so that ISA devices (like the floppy disk) work.
Based on Doug's changes to cia.c

tested by: Matthew Jacob <mjacob@feral.com>
1999-08-10 13:30:25 +00:00
Andrew Gallatin 3a1b3a3fa7 On an AS 600 5/266 (and possibly others), accessing the configuration
space of PCI devices that don't exist cause PCI master & target aborts
rather than returning ~0 or giving a machine check.  Bring in some code
from NetBSD to handle this properly.

obtained from:	NetBSD
reviewed by:	dfr
1999-07-29 16:44:22 +00:00
Doug Rabson aa595accc9 Add support for SYS_RES_DENSE and SYS_RES_BWX resource types. These are
equivalent to SYS_RES_MEMORY for x86 but for alpha, the rman_get_virtual()
address of the resource is initialised to point into either dense-mapped
or bwx-mapped space respectively, allowing direct memory pointers to be
used to device memory.

Reviewed by: Andrew Gallatin <gallatin@cs.duke.edu>
1999-07-28 07:57:48 +00:00
Peter Wemm 3ee1f12806 Pull some prototypes into scope 1999-07-01 22:48:31 +00:00
Peter Wemm 20628ddeee Get prototype for isa_init_intr(). 1999-07-01 20:25:39 +00:00
Peter Wemm abab09a80a Fix a warning, and pull prototypes into scope for ide/isa interrupt setup. 1999-07-01 20:23:01 +00:00
Doug Rabson 37b094f876 * Implement ISA dma (only for CIA now but more chipsets to follow).
* Port the fd driver to alpha.
1999-06-05 13:30:13 +00:00
Andrew Gallatin 7ae6cdbca2 Add support for the DEC_ST6600 family of alphas. This includes the
Compaq XP1000, AlphaServer DS20, AlphaServer DS10, and DP264

This has been tested *only* on XP1000's.  I'll be interested to hear from
owners of other types of DEC_ST6600 alphas.

I'd like to thank Don Rice of Compaq for providing the documentation required
to support this platform on FreeBSD.  I'd also like to thank Doug Rabson for newbus,
and for helping me get a multiple hoses working with newbus.

Reviewed by:	Doug Rabson <dfr@nlsystems.com>
1999-05-26 23:22:14 +00:00
Andrew Gallatin aa6de8e012 Add support for multiple PCI "hoses" used on various alpha platforms.
The specific intent of this commit is to pave the way for importing
Compaq XP1000 support.  These changes should not affect the i386 port.

Reviewed by: Doug Rabson <dfr@nlsystems.com>
(actually, he walked me through most of it & deserves more than reviewd-by
credit )
1999-05-20 15:33:33 +00:00
Peter Wemm b2143c99d8 Nearly forgot, remove pci_cfgopen() - it's unused on the alpha and is no
longer exported on the i386.
1999-05-18 23:20:14 +00:00
Peter Wemm 2c649d3327 Unused variable 1999-05-10 15:46:38 +00:00
Doug Rabson 566643e39e Move the declaration of the interrupt type from the driver structure
to the BUS_SETUP_INTR call.
1999-05-08 21:59:43 +00:00
Peter Wemm 54a8c69347 Stage 1 of a cleanup of the i386 interrupt registration mechanism.
Interrupts under the new scheme are managed by the i386 nexus with the
awareness of the resource manager.  There is further room for optimizing
the interfaces still.  All the users of register_intr()/intr_create()
should be gone, with the exception of pcic and i386/isa/clock.c.
1999-04-21 07:26:30 +00:00
Doug Rabson a7aeb17acc Add seatbelts. 1999-04-19 08:55:11 +00:00
Peter Wemm 6182fdbda8 Bring the 'new-bus' to the i386. This extensively changes the way the
i386 platform boots, it is no longer ISA-centric, and is fully dynamic.
Most old drivers compile and run without modification via 'compatability
shims' to enable a smoother transition.  eisa, isapnp and pccard* are
not yet using the new resource manager.  Once fully converted, all drivers
will be loadable, including PCI and ISA.

(Some other changes appear to have snuck in, including a port of Soren's
 ATA driver to the Alpha.  Soren, back this out if you need to.)

This is a checkpoint of work-in-progress, but is quite functional.

The bulk of the work was done over the last few years by Doug Rabson and
Garrett Wollman.

Approved by:	core
1999-04-16 21:22:55 +00:00
Doug Rabson f1f1b5e0c1 Fix some warnings. 1999-03-28 17:52:17 +00:00
Andrew Gallatin 2c478084d6 Added support for the DEC EB64PLUS systype. (part I)
The new file pci_eb64plus_intr.s deals with the interrupt hardware
on the EB64PLUS and was obtained from NetBSD with the NetBSD
copyright intact

The apecs chipset support code was altered to allow routing interrupts
through pci if we're not running on an avanti.  Avanti's route all
interrupts through isa.

Tested by: Wilko Bulte <wilko@yedi.iaf.nl>
Partially reviewed by: dfr
1999-01-18 20:15:07 +00:00
Doug Rabson 486bddb033 Fix some 64bit truncation problems which crept into SYSCTL_LONG() with the
last cleanup.  Since the oid_arg2 field of struct sysctl_oid is not wide
enough to hold a long, the SYSCTL_LONG() macro has been modified to only
support exporting long variables by pointer instead of by value.

Reviewed by: bde
1998-12-27 18:03:29 +00:00
Archie Cobbs 2127f26023 Examine all occurrences of sprintf(), strcat(), and str[n]cpy()
for possible buffer overflow problems. Replaced most sprintf()'s
with snprintf(); for others cases, added terminating NUL bytes where
appropriate, replaced constants like "16" with sizeof(), etc.

These changes include several bug fixes, but most changes are for
maintainability's sake. Any instance where it wasn't "immediately
obvious" that a buffer overflow could not occur was made safer.

Reviewed by:	Bruce Evans <bde@zeta.org.au>
Reviewed by:	Matthew Dillon <dillon@apollo.backplane.com>
Reviewed by:	Mike Spengler <mks@networkcs.com>
1998-12-04 22:54:57 +00:00