Commit Graph

137 Commits

Author SHA1 Message Date
KATO Takenori
1ae7243298 Convert the type of bus_space_handle_t of pc98 from structure into
pointer to structure.

Reviewed by:	nyan
2000-10-20 02:42:06 +00:00
Yoshihiro Takahashi
f69dfaede1 Don't assume that address of I/O address table increase (PC-98 only).
Pointed out by:	Tomokazu HARADA <tkhara@osk4.3web.ne.jp>
2000-09-07 14:43:00 +00:00
Peter Wemm
e60463deed Redo the isa compat driver shim so that each driver is self contained
and does not require that evil list of drivers in isa_compat.h.
It uses the same strategy that pci drivers use, namely a
COMPAT_ISA_DRIVER() macro that creates the glue on the fly.
Theoretically old-style isa drivers should be preloadable now.
2000-05-28 13:30:44 +00:00
KATO Takenori
91cb959ddb Added indirect pio into the bus space stuff for the NEC PC-98. bus.h
includes one of bus_at386.h and bus_pc98.h. Becuase only bus_pc98.h
supports indirect pio and bus_at386.h is identical to old bus.h, there
is no functional change in PC-AT's kernels.  That is, it cannot cause
performance loss.

Submitted by:	nyan
Reviewed by:	imp
bde and luoqi provided useful comments for earlier version.
2000-03-29 03:15:22 +00:00
Peter Wemm
80060e8897 Connect the ISA and PCI compatability shims to an option. In this case
it's options COMPAT_OLDISA and COMPAT_OLDPCI.  This is meant to be a
fairly strong incentive to update the older drivers to newbus, but doesn't
(quite) leave anybody hanging with no hardware support.  I was talking with
a few folks and I was encouraged to simply break or disable the shims but
that was a bit too drastic for my liking.
2000-03-19 13:07:12 +00:00
Doug Rabson
25afb89b1c * Add struct resource_list* argument to resource_list_alloc and
resource_list_release. This removes the dependancy on the
  layout of ivars.

* Move set_resource, get_resource and delete_resource from
  isa_if.m to bus_if.m.

* Simplify driver code by providing wrappers to those methods:

     bus_set_resource(dev, type, rid, start, count);
     bus_get_resource(dev, type, rid, startp, countp);
     bus_get_resource_start(dev, type, rid);
     bus_get_resource_count(dev, type, rid);
     bus_delete_resource(dev, type, rid);

* Delete isa_get_rsrc and use bus_get_resource_start instead.

* Fix a stupid typo in isa_alloc_resource reported by Takahashi
  Yoshihiro <nyan@FreeBSD.org>.

* Print a diagnostic message if we can't assign resources to a PnP
  device.

* Change device_print_prettyname() so that it doesn't print
  "(no driver assigned)-1" for anonymous devices.
1999-10-12 21:35:51 +00:00
Peter Wemm
3b8f07bbc3 Trim some unused #includes
Submitted by:	phk
1999-10-11 15:00:09 +00:00
Peter Wemm
1be9d26e4a Eliminate some magic numbers. 1999-09-01 06:34:24 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Doug Rabson
8b05278ca1 Allow up to 8 ports, 4 memory regions and two irqs and drqs. 1999-05-30 11:05:39 +00:00
Doug Rabson
a3be63b3ce * Factor out the common code between the isa bus drivers for i386 and alpha.
* Re-work the resource allocation code to use helper functions in subr_bus.c.
* Add simple isa interface for manipulating the resource ranges which can be
  allocated and remove the code from isa_write_ivar() which was previously
  used for this purpose.
1999-05-22 15:18:28 +00:00
Doug Rabson
6c2e3dde8c * Define a new static method DEVICE_IDENTIFY which is called to add device
instances to a parent bus.
* Define a new method BUS_ADD_CHILD which can be called from DEVICE_IDENTIFY
  to add new instances.
* Add a generic implementation of DEVICE_PROBE which calls DEVICE_IDENTIFY
  for each driver attached to the parent's devclass.
* Move the hint-based isa probe from the isa driver to a new isahint driver
  which can be shared between i386 and alpha.
1999-05-14 11:22:47 +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
14d3b6b80c GC some #if 0 junk 1999-05-08 21:28:39 +00:00
Peter Wemm
1a738e4be7 Look up the sensitive flag better, allowing interoperation between old and
new isa drivers with sensitive flags.  If the resource_find() code
is meant to "find" the wildcard sensitive flag for a driver even though
a unit is supplied, this can be simplified.
1999-05-08 18:15:49 +00:00
KATO Takenori
424af31b45 Changed the type of id_port from short into int to avoid wrong
conversion from short to unsigned long which is an argument of
bus_alloc_resource.  Since the value -1 is used to indicate no port
reousece, id_port need to be signed (suggested by Doug Rabson and
Peter Wemm.)
1999-04-24 18:24:43 +00:00
Peter Wemm
d70a04d62d Don't clear the hints on release, just the resource containers. 1999-04-24 06:47:24 +00:00
Peter Wemm
c2c75d780e As a temporary anti-foot-shooting measure, don't let the user attach
the atkbd device to isa, as was in the old (and 3.x) GENERIC config.
1999-04-16 23:39:15 +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
Peter Wemm
b4718cedf6 Move initialization of SWI's in the tty|net|bio masks from isa.c into
the static initializers in ipl.s.
1999-04-11 15:51:15 +00:00
Poul-Henning Kamp
5986967ee2 don't print '?' for ioaddr the device may legitimately not have an
ioaddr.
1998-11-29 15:42:40 +00:00
Bruce Evans
fe310de802 Initialize isa_devtab entries for interrupt handlers in individual
device drivers, not in ioconf.c.  Use a different hack in isa_device.h
so that a new config(8) is not required yet.

pc98 parts approved by: kato
1998-10-22 05:58:45 +00:00
David Greenman
6cde7a165f Fixed two potentially serious classes of bugs:
1) The vnode pager wasn't properly tracking the file size due to
   "size" being page rounded in some cases and not in others.
   This sometimes resulted in corrupted files. First noticed by
   Terry Lambert.
   Fixed by changing the "size" pager_alloc parameter to be a 64bit
   byte value (as opposed to a 32bit page index) and changing the
   pagers and their callers to deal with this properly.
2) Fixed a bogus type cast in round_page() and trunc_page() that
   caused some 64bit offsets and sizes to be scrambled. Removing
   the cast required adding casts at a few dozen callers.
   There may be problems with other bogus casts in close-by
   macros. A quick check seemed to indicate that those were okay,
   however.
1998-10-13 08:24:45 +00:00
Bruce Evans
a4e195e166 Don't print conflict messages in haveseen_isadev() if CC_QUIET is
specified.  This makes haveseen_isadev() useful for searching for a
free resource.  This increases the bitrot in the pci RESOURCE_CHECK
code.

Fixed the pre-attach conflict message.  The flag for distinguishing
pre-attach conflict checks from pre-probe ones was never set.
1998-10-12 13:12:45 +00:00
Bruce Evans
f2bd332e7c Stop physical DMA for the non-auto case in isa_dmadone(). This fixes a
small part of a bug suite beginning in the SLICE probes but mostly in the
floppy driver.  This is a quick fix: the auto case shouldn't be special;
DMA should also be stopped in isa_dma_release(); isa_dmastop() probably
shouldn't exist; common DMA registers should not be accessed without
locking.
1998-07-19 04:22:55 +00:00
Dag-Erling Smørgrav
dc73342347 Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108. 1998-04-17 22:37:19 +00:00
Eivind Eklund
0b08f5f737 Back out DIAGNOSTIC changes. 1998-02-06 12:14:30 +00:00
Eivind Eklund
47cfdb166d Turn DIAGNOSTIC into a new-style option. 1998-02-04 22:34:03 +00:00
Eivind Eklund
828084926f Skip probing devices which have already probed true. 1998-01-31 03:29:00 +00:00
John-Mark Gurney
857c08d17c fix a few style nites...
make isa_dmacascade, isa_dmastart, isa_dmadone, and find_isadev MUCH
easier to be found by starting them at the beginging of the line...

remove braces inside of ifdef RESOURCE_CHECK... found by % in vi...
1997-11-30 09:44:28 +00:00
Bruce Evans
cc8ae84672 Moved splhigh()/spl0() calls from isa_configure() to configure() so that
there is a natural place to initialize `safepri' in a future commit.
Spinoffs:
- spl0() gets called in the unlikely event that isa is not configured.
- configure() has better control over enabling interrupts.
- it is now less unclear that interrupts aren't actually enabled early.
  Rev.1.48 of autoconf.c seems to have done the opposite of what was
  intended - moving the isa_configure() call delayed the spl0() side
  effect.
Added some comments about the bogons.  Removed the splhigh() call since
it is a no-op.
1997-11-21 18:14:02 +00:00
Jordan K. Hubbard
02630e3d73 Allow "foo0: disabled, not probed" message to stay, but make it conditional
on bootverbose so that those who _really wanna know_ still can.
Compromise suggested by:	joerg
1997-10-12 08:31:41 +00:00
Justin T. Gibbs
02a199102d aha1542.c aic6360.c cy.c fd.c ft.c
if_ie.c if_wl.c if_zp.c isa.c isa_device.h
labpc.c mcd.c ncr5380.c scd.c seagate.c si.c
sio.c tw.c ultra14f.c wcd.c wd.c:

	Update for changes in the callout interface.

apic_vector.s icu_vector.s ipl.s ipl_funcs.c:

	Add CAM software/hardware interrupt support.
1997-09-21 21:41:49 +00:00
John-Mark Gurney
77509afdf3 teach pnp to keep isa_device structs around, and teach isa.c how to scan
these structs for conflics...

it still exist that two PnP cards can colide, but this is up to the user
to make sure it doesn't happen...

other modifications to pnp.c to format output properly, and hide more
output behind bootverbose flag...

fix some bugons in pnp.h that would of made it difficult for inclusion
in external programs (for import of pnpinfo)
1997-09-19 15:20:25 +00:00
Mike Smith
67fb1e6a0c Here is a patch to alleviate the current problem with the dma interface
and the sound driver which uses auto dma.

The  dma interface functionality remains however it now checks
to see if a dma is operating in auto dma mode and if so it bypasses
the busy flag check . I have modified the sound driver 3.5  to
adjust for this new behavior and tested it under FreeBSD 3.0 -current

This patch also includes the new function isa_dmastop.

Submitted by:	Amancio Hasty <hasty@rah.star-gate.com>
1997-08-28 03:36:40 +00:00
Bruce Evans
ccea0a158a Check for irq conflicts even if conflicts are allowed. Conflicting
irqs can't work (at best, the first one attached wins).  It used to
be necessary to skip this check because of bogus irqs in the sound
drivers, but the sound drivers have been fixed, except possibly the
OSS ones.
1997-08-25 22:52:59 +00:00
Steve Passe
4a73d99f7e Made PEND_INTS default.
Made NEW_STRATEGY default.
Removed misc. old cruft.

Centralized simple locks into mp_machdep.c
Centralized simple lock macros into param.h

More cleanup in the direction of making splxx()/cpl MP-safe.
1997-08-21 05:08:25 +00:00
Steve Price
1393383a2e Add parentheses because == has higher precedence than &.
PR:		i386/4225
Submitted by:	Frank MacLachlan <fpm@n2.net>
1997-08-13 02:40:06 +00:00
Mike Smith
84685adb57 Return to using disable/enable_intr() for guarding DMA register access.
Mask the read value from the count register in order to return zero correctly
after TC, as per intel datasheet : "If it is not autoinitialised, this
register will have a count of FFFFH after TC"
1997-07-29 05:24:36 +00:00
Mike Smith
f5f607a03e Pedant attack! Use variable names consistent with discourse in
comments.  Remove reduntant extra addition that was unncessary, and
unneeded mask (asuming inb works correctly).

Submitted by:	Stephen McKay <syssgm@dtir.qld.gov.au>
1997-07-28 09:13:11 +00:00
Mike Smith
53f83ec34c Use disable_intr() / read/write_eflags() to ensure that interrupt
handlers don't skew the results of isa_dmastatus.  The function can be
safely called with interrupts disabled.

Submitted by:	Stephen McKay <syssgm@dtir.qld.gov.au>
1997-07-28 07:49:40 +00:00
Mike Smith
a4453045b0 Add isa_dmastatus() for reading the current ISA DMA counter for a
given channel.

Submitted by:	luigi@labinfo.iet.unipi.it (Luigi Rizzo)
1997-07-24 05:27:40 +00:00
Bruce Evans
f71d35e402 Removed unused #includes. 1997-07-20 14:10:18 +00:00
Andrey A. Chernov
d80e841377 Back out my changes with 'conflicts' keyword for IRQs,
sounddriver fixed now.
1997-07-09 17:58:16 +00:00
Steve Passe
293f18dbbf Modified to use merged/renamed functions:
- get_isa_apic_mask() -> isa_apic_mask()
 - get_isa_apic_irq() && get_eisa_apic_irq() -> isa_apic_pin()
1997-06-25 21:00:00 +00:00
Andrey A. Chernov
833bdc932c While deciding to install irq with unneded "conflicts" keyword,
additionly check that intr vector is non-NULL
1997-06-09 00:53:48 +00:00
Andrey A. Chernov
7f533ff73f Add safety check in case "conflicts" keyword specified more times than
needed
1997-06-08 17:15:31 +00:00
Andrey A. Chernov
1886f4968c Make "conflicts" keyword work again 1997-06-08 16:43:37 +00:00
Doug Rabson
683523378c Move interrupt handling code from isa.c to a new file. This should make
isa.c (slightly) more portable and will make my life developing the really
portable version much easier.

Reviewed by:	peter, fsmp
1997-06-02 08:19:06 +00:00
Peter Wemm
5400ed3b2f Include file updates.. <machine/spl.h> -> <machine/ipl.h>, add
<machine/ipl.h> to those files that were depending on getting SWI_*
implicitly via <machine/cpufunc.h>
1997-05-31 09:27:31 +00:00