Commit Graph

8354 Commits

Author SHA1 Message Date
Scott Long
0c5aa4c57b Major update to the ahd driver to fix many bugs found in the previous
version, plus add support for the new features found in the Rev B
version of the chip.  The changelog is quite long and can be provided
on request.  Major features include vastly improved protocol violation
handling, full support for the 7902 Rev B, better parity error
handling, and better packetized overrun handling, to name a few.

Approved by:	re (blanket)
2002-12-01 08:13:37 +00:00
Scott Long
454bf1693a Implement workaround for broken busfree-rev in the A4.
HP -> CPQ

Rearrange IDs to better match which chips they use.

Convert to uniform product description strings.

Simplify 7901A setup function.

Add the NONPACKFIFO_BUG and PACED_NEGTABLE_BUG entries
for the A.

Add rev B bugs and features.

The double write workaround for CURRSCB is only required if
abort pending is set.  Remove this work around and set the
abort pending bug bit on the B at least until we have better
confirmation that the double write is always safe.

Add updated H2B identifiers

Move IOCell paramters into softc and add a hook for the
OSM to modify these as well as other settings prior to
committing them to the chip.

SLEW -> SLEWRATE

PREQDIS in DEVCONFIG1 went away after the A2.
Remove all code that references this bit.  This
is especially important since this bit was reused
in the B for a different HW fix workaround.

Properly set the AHD_NEW_IOCELL_OPTS and
AHD_NEW_DFCNTRL_OPTS features for the B.

Remove stray/random extra 7901A generic PCI
table entry.  Also switch the correct 7901A
generic entry to use ID_ALL_MASK since we
can only differentiate the 7901A from the
7902 by checking for a "type field" of 0xE.

Set AHD_INTCOLLISIONT_BUG for the Rev B.

Set the PREQDIS bit in DEVCONFIG1 for the B.  The
bit is misnamed, but seems to disable a work-around
that breaks on the B on PCI busses.

Add a routine for testing memory mapped register access.
This will hopefully detect things like buggy via chipsets
so that the OSM can fallback to using I/O mapped access
when memory mapped I/O simply will not work.

Approved by:	re (blanket)
2002-12-01 07:59:01 +00:00
Scott Long
fc2aa1d1b8 Add our controller name to the front of our
diagnostic "Setting Mode" messages.

Use a read of HCNTRL to flush our write to CLRCMDCMPLT
on the RevB.  This allows us to check to see if the sequencer
is paused and to initiate the interrupt collision workaround
without incuring an extra read.

Approved by:	re (blanket)
2002-12-01 07:54:53 +00:00
Scott Long
add6879424 Remove redundant check for chip type being PCI-X.
PCI-X only workarounds are automatically masked out
if we are operating in PCI mode.

Make use of ahd_pci_test_register_access()

Approved by:	re (blanket)
2002-12-01 07:52:35 +00:00
Scott Long
481a41742f Update to include new ahd_scb_timer_reset API
Move IOCell paramters into softc and add a hook for the
OSM to modify these as well as other settings prior to
committing them to the chip.

Approved by:	re (blanket)
2002-12-01 07:50:56 +00:00
Ian Dowse
e176446dc8 Move the check for the MD_SHUTDOWN flag to before the tsleep() call
in the per-device kthread. This ensures that synchronisation with
mddestroy() succeeds even if the kthread was not waiting in tsleep()
at the time of the wakeup(). Among other things, this fixes the
problem of mdconfig getting stuck when an attempt is made to use a
zero-length file as a vnode-type backing store.

Approved by:	re
2002-11-30 22:03:53 +00:00
Scott Long
de5305d5b6 Synchronize perforce Id tags
Approved by:	re (blanket)
2002-11-30 20:04:10 +00:00
Scott Long
4d22994e96 Bring in many bugfixes and changes obtained from formal testing:
aic7xxx.c:
        aic7xxx.h:
        aic7xxx.reg:
        aic7xxx.seq:
                Bring in the protocol violation handler from the U320
                driver and replace the NO_IDENT sequencer interrupt code
                with the PROTO_VIOLATION code.  Support for this code
                required the following changes:

                SEQ_FLAGS:
                        IDENTIFY_SEEN -> NOT_IDENTIFIED
                        Added NO_CDB_SENT

                SCB_CONTROL:
                        TARGET_SCB == STATUS_RCVD for initiator mode

                scb->flags:
                        Added SCB_TARGET_SCB since we cannot rely on
                        TARGET_SCB as a target/initiator differentiator
                        due to it being overloaded in initiator mode to
                        indicate that status has been received.

        aic7xxx.seq:
                Move data fifo CLRCHN to mesgin_rdptrs which is a safer
                location for doing this operation.  This also saves a
                sequencer instruction.

        aic7xxx.c:
        aic7xxx.h:
                Change ahc/ahd_upate_neg_request() to take a "negotiation
                type" enum that allows us to negotiate:
                        o only if the goal and current parameters differ.
                        o only if the goal is non-async
                        o always - even if the negotiation will be for async.
        aic7xxx.seq:
                Reset the FIFO whenever a short CDB transfer occurs
                so that the FIFO contents do not corrupt a future CDB
                transfer retry.

                Add support for catching the various protocol violations
                handled by ahc_handle_protocol_violation.

                Reformat some comments.

        aic7xxx.c:
        aic7xxx.h:
                Just for safety, have the aic7xxx driver probe
                the stack depth.

        aic7xxx.c:
        aic7xxx.h:
                Save and restore stack contents during diagnostics.
                Some chip variants overwrite stale entries on a
                stack "pop".

                Don't use 0 to probe the stack depth.  0 is the typical
                value used to backfill the stack if entries are overwritten
                on a "pop".

        aic7xxx.h:
                Add a missing typedef.

                Collapse SCB flag entries so they are bit contiguous.

                Add AHD_ULTRA2_XFER_PERIOD for narrow fallback calculations

        aic7xxx.c:
                Don't panic (as a diagnostic to catch bugs) if we decided to
                force the renegotiation of async even if we believe we are
                already async.  This should allow us to negotiate async instead
                of the full user goal rate during startup if bus resets are
                disabled.

                Add a space to the end of the ahc/ahd_print_devinfo routines
                so that it behaves as expected by the code that uses it.

                Only force a renegotiation on a selection timeout
                if the SCB was valid.  Doing otherwise may be dangerous
                as the connection was not valid for an unknown reason.

                Add additional diagnostic output to ahc_dump_card_state(),
                and have it use the register pretty printing functions.

                Update ahc_reg_print() to handle a NULL cur_col.

                Add a newline to ahc_dump_card_state() output.

                Bring back "use_ppr".  We need to use_ppr anytime
                doppr is true or we have non-zero protocol options.
                The later case was not handled in the recent removal
                of use_ppr.

                Move a comment and remove a useless clearing of use_ppr.

                Don't disable ENBUSFREE when single stepping on
                a DT capable controller.  We cannot re-enable unexpected
                busfree detection, so we must clear BUSFREE on each
                step instead.

                Correct the lookup of the SCB ID in ahc_handle_proto_error.

                Remove a diagnostic printf.
                Remove unecessary restoration of the STACK for older
                chips.

Approved by:	re (blanket)
2002-11-30 19:30:09 +00:00
Scott Long
dc67dad8b1 Add a routine for testing memory mapped register access.
This will hopefully detect things like buggy via chipsets
so that the OSM can fallback to using I/O mapped access
when memory mapped I/O simply will not work.

Approved by:	re (blanket)
2002-11-30 19:13:55 +00:00
Scott Long
24dd01c695 Always compile in the AHC_ALLOW_MEMIO code, but only try MEMIO if
AHC_ALLOW_MEMIO is set, or the hint hint.ahc.N.allow_memio=1 is
set in the bootloader.

Make use of ah?_pci_test_register_access().

Approved by:	re (blanket)
2002-11-30 19:11:44 +00:00
Scott Long
a3a33a2bcb Handle changes to SCB_CONTROL, scb->flags and SEQ_FLAGS
Approved by:	re (blanket)
2002-11-30 19:08:58 +00:00
Scott Long
3cb8be933d Use the new ahc_scb_timer_reset API
Remove AHC_ALLOW_MEMIO

Approved by:	re (blanket)
2002-11-30 19:06:24 +00:00
Scott Long
b8e89ffabc Add support for the Olivetti branded EISA boards.
Approved by:	re (blanket)
2002-11-30 18:00:43 +00:00
Scott Long
29dcbe8760 Revisit the printf format fixes for alpha. intmax_t doesn't exist in
RELENG_4, so cast to u_long in order to stay compatible.

Approved by: re	(blanket)
2002-11-28 04:09:29 +00:00
Noriaki Mitsunaga
3e4be4cbf1 o Changes to support NEWCARD.
o Add needed headers.
        o Add stg_products[] product data and stg_match() function.
        o Change stg_pccard_method[] to support both OLDCARD and NEWCARD.

Approved by:	re
2002-11-28 01:15:01 +00:00
Noriaki Mitsunaga
4a42958a2b o Changes to support NEWCARD.
o Add needed headers.
        o Add ncv_products[] product data and ncv_match() function.
        o Change ncv_pccard_method[] to support both OLDCARD and NEWCARD.

Suggestion for REX-5572 matching part by imp.

Approved by:	re
2002-11-28 01:13:58 +00:00
Noriaki Mitsunaga
922019c24b o Changes to support NEWCARD.
o Add needed headers.
	o Add nsp_producs[] product data and nsp_match() function.
	o Change nsp_pccard_method[] to support both OLDCARD and NEWCARD.
	o Add warning to fall back to PIO mode when it cannot use SMIT mode.
	  This is needed because memories are not allocated with NEWCARD now.

Submitted by:	takawata
Approved by:	re
2002-11-28 01:09:29 +00:00
Noriaki Mitsunaga
a11d8d7097 regen to 1.38
Reviewed by:	imp
Approved by:	re
2002-11-28 01:00:40 +00:00
Noriaki Mitsunaga
3c3dc1cf2e o Add PC-Cards' ID or CIS strings which are supported by ncv, nsp,
or stg driver. They are,

Macnica mPS110, PANASONIC(KME) KXLC004, Qlogic Fast SCSI,
Workbit Ultra Ninja-16, (ID based)

Future Domain SCSI2GO, IBM SCSI PCMCIA card, I-O DATA CBSC16,
Macnica mPS100, Newmedia BASICS-SCSI, RATOC REX-5536, RATOC REX-5536AM,
RATOC REX-5536M, RATOC REX5572, Workbit NinjaSCSI-3
(CIS based)

  Note: We need vendor IDs WORKBIT2 and IODATA3 which is -1, since some
        cards does not have IDs in the CIS and fails to be probed without
	this fake vendor IDs.

o Change the strings of RATOC REX_R280 from REX-R280 to REX-R280/REX-9530.
  This reminds us that REX-R280 and REX-R9530 have same ID (same product).

Reviewed by:	imp
Approved by:	re
Obtained from:	/etc/defaults/pccard.conf,
		List of CIS tupples by Toshihiko ARAI and PAO project:
			http://www.linkclub.or.jp/~clover/cis/
Change suggestion by:	HASEGAWA Tomoki <thasegawa@mta.biglobe.ne.jp>
			for I-O DATA CBSC16 entry
2002-11-28 00:57:47 +00:00
Mitsuru IWASAKI
21b5fd3cfd Resolve conflicts arising from the ACPI CA 20021118 import. 2002-11-27 18:09:20 +00:00
Warner Losh
3a28284461 Need more parens here.
Approved by: re (blanket)
2002-11-27 17:30:41 +00:00
Mitsuru IWASAKI
3fd2b0260e Disable debug output from acpi_pci_link.
There were no serious problem reports on this in spite of my concern.

To get debug output from acpi_pci_link, just enable bootverbose flag
in usual manner (boot -v).

Approved by:	re
2002-11-27 09:32:24 +00:00
Scott Long
7fc23fe669 Minor updates to the aicasm:
aicasm_gram.y:
	Use a direct move from allzeros to emulate a
	mvi of 0.

aicasm_insformat.h:
	sync $Id$

aicasm_symbol.c:
	Minor header change.

Approved by:	re (blanket)
2002-11-27 07:06:43 +00:00
Warner Losh
e7b01d0727 Xircom cards store the MAC address in the CIS, so get it from the new
pci_get_ether accesor, which gets it from the CIS for cardbus cards
(and from other pci-like buses via whatever mechanism is used there).

Submitted by: sam
Approved by: re (blanket)
2002-11-27 07:04:10 +00:00
Warner Losh
fbe9cff112 Implement PCI_IVAR_ETHADDR. Cardbus has the MAC addr in the CIS,
sometimes, so return it when requested and it does.  Also a little
more infrastructure for a few other things.

Submitted by: sam
Approved by: re (blanket for NEWCARD)
2002-11-27 06:56:29 +00:00
Warner Losh
ba5fc4eed2 Add a new cardbus specific ivar: PCI_IVAR_ETHADDR. Some pci-like
buses support querying the MAC address in a standard-for-that-bus way.
The base pci bus returns NULL for this IVAR always.

Submitted by: sam
Approved by: re (blanket for NEWCARD)
2002-11-27 06:41:28 +00:00
Cameron Grant
00acb1337e (hopefully) fix build breakage some people are seeing
Approved by:	re
2002-11-26 18:16:27 +00:00
John Baldwin
8745ec57d0 - Assume a bus number of zero if evaluating _BBN fails, not if it succeeds.
This was effectively rendering _BBN useless.
- Cleanup handling of the busok variable a bit.

Submitted by:	marcel (1)
Approved by:	re (rwatson)
2002-11-25 21:55:04 +00:00
John Baldwin
1bbf246462 Fix a couple of bugs in host_pcib_get_busno():
- If a PCI device is not present, then a 32-bit read_config() is going to
  return 0xffffffff not 0xffff.
- For the 82454NX chipset, the MIOC that we read the bus numbers of the
  various host-PCI bridges from is at function (slot) 0x10 not 0x0.

Approved by:	re (rwatson)
2002-11-25 21:53:14 +00:00
Luigi Rizzo
1efbdcd10f Fix IFF_ALLMULTI handling.
Reviewed by: pdeuskar (maintainer)
Approved by: re
2002-11-25 20:00:13 +00:00
Luigi Rizzo
d535facffe Add polling support to the "em" driver.
Reviewed by: pdeuskar (maintainer)
Approved by: re
2002-11-25 19:56:16 +00:00
Luigi Rizzo
5d6dfbbb5e Fix handling of IFF_ALLMULTI. The same bug in various forms affects
the following drivers:

    dc mn sf sk ste ti tl xl an bge em gem gx ie lge sr aue cue kue wi xe

Approved by: re
2002-11-25 19:28:01 +00:00
Cameron Grant
67beb5a5c8 various fixes to eliminate locking warnings
Approved by:	re
Reviewed by:	orion
2002-11-25 17:17:43 +00:00
Cameron Grant
68f4e7f1d3 various fixes to eliminate locking warnings
Approved by:	re
Reviewed by:	orion
2002-11-25 17:07:33 +00:00
Cameron Grant
0586ff0d84 if the list of supported formats is empty, fail the attach instead of
panicing later.  this is a band-aid pending further investigation.

MFC After:	7 days
Approved by:	re
2002-11-25 17:03:39 +00:00
Mike Silbersack
c7c3f58e12 Import some relevant changes from Via's if_fet driver:
1.  Detect the revision of the Rhine chip we're using.
2.  Use the force reset command on revisions which support
    it whenever the normal reset command fails.

This should solve a wide range of "my vr0 locks up with reset
failed messages" problems.  (Although the root causes should
be eventually tracked down.)

Tested by:	grenville armitage <garmitage@swin.edu.au>
Obtained from:	Via's if_fet driver
MFC after:	3 days
Approved by:	re
2002-11-25 05:15:27 +00:00
Scott Long
bde9cfc2b0 Fix make_dev() to use 0644 instead of 0x644 for default permissions
Spotted by: 	kris
Approved by:	re
2002-11-25 04:55:09 +00:00
Scott Long
cec762959b Fix printf format problems that were stopping LINT on alpha
Submitted by:	jmallett, many others
Approved by:	re
2002-11-25 04:53:12 +00:00
Mitsuru IWASAKI
87b45ed576 Add `if (!cold)' checkings for functions which is called via SYSINIT.
Loading acpi.ko with kldload is disallowed, however some
functions were executed unexpectedly.

Approved by:	re
2002-11-24 02:27:07 +00:00
Warner Losh
e961d904ac Remove a comple of bogus debug printfs that snuck in during some
debugging I was doing 3 months ago :-(.

Noticed by: scottl
Aproved by: the re blanket (different than the security blanket).
2002-11-23 23:09:45 +00:00
Nate Lawson
c3bf92aa58 Allow acd(4) and cd(4) to support old behavior for CDRIOC*SPEED ioctls.
If the value from the user is less than 177, assume it is a multiple of
a single speed CDROM and convert to KB/sec.

No complaints from:	sos
Reviewed by:	ken
Approved by:	re
MFC after:	1 day
2002-11-23 22:51:50 +00:00
John Baldwin
9debb53220 According to the ACPI spec, the bus number of the child PCI bus of a host
to PCI bridge can be read be evaluating the _BBN method of the host to PCI
device.  Unfortunately, there appear to be some lazy/ignorant/moronic/
whatever BIOS writers that return 0 for _BBN for all host to PCI bridges in
the system.  On a system with a single host to PCI bridge this is not a
problem as the child bus of that single bridge will be bus 0 anyway.
However, on systems with multiple host to PCI bridges and l/i/m/w BIOS
writers this is a major problem resulting in all but the first host to
PCI bridge failing to attach.  So, this adds a workaround.

If the _BBN of a host to PCI bridge is zero and pcib0 already exists
and is not us, the we use _ADR to look up our PCI function and slot
(we currently assume we are on bus 0) and use that to call
host_pcib_get_busno() to try and extract our bus number from config
registers on the host to PCI bridge device.  If that fails, then we make
an evil assumption that ACPI's _SB_ namespace lays out the host to PCI
bridges in ascending order and use our pcib unit number as our bus
number.

Approved by:	re
2002-11-22 18:11:13 +00:00
John Baldwin
b173edafc7 Add a function host_pcib_get_bnsno() that attempts to determine the bus
number of the child bus of a host to PCI bridge by reading from proprietary
configuration registers in the host to PCI bridge devices.

Approved by:	re
2002-11-22 17:50:47 +00:00
Eric Moore
ca4722f57e Added support for DELL Perc4/DI.
Reviewed by: ps
Approved by: jhb
MFC after: 5 days
2002-11-21 16:06:10 +00:00
Jake Burkholder
a121cb6a7f Create the ofwcons device at SI_SUB_CONFIGURE instead of SI_SUB_DRIVERS,
after configure() has run.  Only create the device if ofwcons is the
highest priority console.  Make a dev alias with the same name as the
firmware output-device property.
2002-11-18 06:19:12 +00:00
Jake Burkholder
e2815d20d9 Setup a default tty mode even if the device is not the console. Don't
reset the chip on open if we're not the console.

This fixes running a getty on ttya or ttyb if console input and output
devices are screen.
2002-11-18 05:56:43 +00:00
Jake Burkholder
4ce7e0f43a Remove some unnecessary code. Make the device description nicer. Add a
delay in the right place to flush output before switching consoles.
2002-11-18 04:02:42 +00:00
Jake Burkholder
810c82e6c2 - Add support for ALT_BREAK_TO_DEBUGGER; this is the only reliable way to
trigger a breakpoint with this chip.
- Fiddle the right bits in the cn input and output routines to disable port
  interrupts and enable visibility of the masked interrupt status bits.
- Register a shutdown final event handler to put the chip back in the mode
  that the prom expects.
2002-11-17 16:00:51 +00:00
Josef Karthauser
11f314d4cb Apply some fixups in the driver_t's.
Submitted by:	akiyama
MFC after:	3 days
2002-11-17 14:22:37 +00:00
Josef Karthauser
97764f126a Use a sysctl for controlling the debugging output.
Submitted by:	akiyama
2002-11-17 14:08:48 +00:00