Commit Graph

550 Commits

Author SHA1 Message Date
Søren Schmidt
4514dcad32 #ifdef out the vague ATA disk detection code causing fake ATA disks
to be found on some systems.
Hopefully this doesn't loose any real ATA disks...
2003-09-08 08:36:46 +00:00
Søren Schmidt
08c26854a3 Handle shared channels better.
Try to avoid the spurios interrupts better.
2003-09-08 08:32:25 +00:00
Søren Schmidt
9855ae3844 Update the PIO mode gathering code.
Reported by: bde
2003-09-08 08:30:43 +00:00
Poul-Henning Kamp
bc7c831fc7 Forgotten in previous commit to atapi-cd.c: Add #ifndef BURN_BRIDGES
around cloning routines.
2003-09-05 11:08:55 +00:00
Poul-Henning Kamp
7837155fa2 Put the device cloning functions for disk-drivers under #ifndef BURN_BRIDGES.
For the floppy driver, use fdcontrol to manipulate density selection.

For the CD drivers, the 'a' and 'c' suffix is without actual effect and
any applications insisting on it can be satisfied with a symlink:
	ln -s /dev/cd0 /dev/cd0a

Ongoing discussion may result in these pieces of code being removed before
the 5-stable branch as opposed to after.
2003-09-05 10:40:16 +00:00
David E. O'Brien
debffe8383 Support the nForce3 chip found on Opteron motherboards:
atapci0: <nVidia nForce3 UDMA133 controller>

Approved by:	sos
2003-09-02 21:02:46 +00:00
Søren Schmidt
b57e5e1898 cosmetics 2003-09-02 15:53:01 +00:00
Søren Schmidt
dce3b7cc71 Adjust the max transfer size used. 2003-09-02 13:26:02 +00:00
Søren Schmidt
7c78880561 Rearrange the probe code yet again. 2003-09-01 11:13:21 +00:00
Søren Schmidt
d7e9ef77f8 Be more carefull on nulling the ATAPI magic for fake slave.
Skip polling devices that keeps returning 0xff early (ie no HW there).
2003-08-28 09:15:05 +00:00
Søren Schmidt
07844fe49c Make sure to call start when retrying. 2003-08-28 08:22:53 +00:00
Thomas Quinot
c8fb1af26c Add missing braces. Fixes boot-time kernel panic with ATAng and ATAPI/CAM.
Reviewed by:	roberto
2003-08-28 03:56:04 +00:00
Søren Schmidt
61f07fc6ca Return the translated result code from ATA/ATAPI commands. 2003-08-27 15:27:56 +00:00
Søren Schmidt
1d68703f6a Hopefully Fix problem with probing some ATAPI devices, while still
trying to avoid the "fake slave" problem.
2003-08-27 11:21:30 +00:00
Søren Schmidt
3a83be8e3b Try to get rid of the fake slave problem. 2003-08-25 13:06:13 +00:00
Søren Schmidt
6419d0b0e4 Cleanup the dma int/alloc/free code. 2003-08-25 11:13:04 +00:00
Søren Schmidt
9f06a4277f Unify prototypes.
Cosmetics.
2003-08-25 09:01:49 +00:00
Søren Schmidt
ea01d56917 Only call FLUSH_CACHE on devices that say they can.
This will get rid of the warnings issued at shutdown (that seems to
worry alot of users), but will also no flush cache on lots of
devices that can, but doesn't set the right support bits...
2003-08-25 07:59:50 +00:00
Søren Schmidt
8b0ca37153 Dont check the cable bit on ich5 when on the SATA channel. 2003-08-25 07:45:54 +00:00
Søren Schmidt
bcebaec6ce Sync with local version (cosmetics) 2003-08-24 19:58:11 +00:00
Søren Schmidt
6c48d6493d There is no detach func for PCI ATA devs. 2003-08-24 19:55:41 +00:00
Søren Schmidt
36d76a0137 Fix ad_dump top actually produce a dump.
Reported by: Tor Egge <Tor.Egge@cvsup.no.freebsd.org>
2003-08-24 19:50:22 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Søren Schmidt
5fdbb0d222 This is a major rework of the ATA driver (ATAng)
Restructure the way ATA/ATAPI commands are processed, use a common
ata_request structure for both. This centralises the way requests
are handled so locking is much easier to handle.

The driver is now layered much more cleanly to seperate the lowlevel
HW access so it can be tailored to specific controllers without touching
the upper layers. This is needed to support some of the newer
semi-intelligent ATA controllers showing up.

The top level drivers (disk, ATAPI devices) are more or less still
the same with just corrections to use the new interface.

Pull ATA out from under Gaint now that locking can be done in a sane way.

Add support for a the National Geode SC1100. Thanks to Soekris engineering
for sponsoring a Soekris 4801 to make this support.

Fixed alot of small bugs in the chipset code for various chips now
we are around in that corner anyways.
2003-08-24 09:22:26 +00:00
Warner Losh
4fbd232c86 Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.
2003-08-22 05:54:52 +00:00
Nate Lawson
1deac58179 Add a PATH_INQ flag, PIM_NO_6_BYTE, which indicates the SIM never wishes to
receive 6 byte commands.  Add a check for this flag to da(4) and cd(4) so
that they honor it.  This is a quick workaround for many devices (especially
USB) that require da(4) quirks to operate.  The more complete approach is
to finish the new transport code which will be aware of the SCSI version a
transport implements.

MFC after:	1 day
2003-07-28 06:15:59 +00:00
Søren Schmidt
e158f2b820 Update the SATA support code to work more correctly with
real SATA disks now that I can test it.

Add support for the SiI 3112 SATA chip using memory mapped I/O.
Update the support for the SiI 0680 to use the memio interface as well.

Sponsored by:	David Leimbach <leimy2k@mac.com> (3112 based controller)
Sponsored by:	FreeBSD Systems (www.FreeBSDsystems.com) (SATA disks)
2003-07-02 10:50:44 +00:00
Scott Long
f6b1c44d1f Mega busdma API commit.
Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg.
Lockfunc allows a driver to provide a function for managing its locking
semantics while using busdma.  At the moment, this is used for the
asynchronous busdma_swi and callback mechanism.  Two lockfunc implementations
are provided: busdma_lock_mutex() performs standard mutex operations on the
mutex that is specified from lockfuncarg.  dftl_lock() is a panic
implementation and is defaulted to when NULL, NULL are passed to
bus_dma_tag_create().  The only time that NULL, NULL should ever be used is
when the driver ensures that bus_dmamap_load() will not be deferred.
Drivers that do not provide their own locking can pass
busdma_lock_mutex,&Giant args in order to preserve the former behaviour.

sparc64 and powerpc do not provide real busdma_swi functions, so this is
largely a noop on those platforms.  The busdma_swi on is64 is not properly
locked yet, so warnings will be emitted on this platform when busdma
callback deferrals happen.

If anyone gets panics or warnings from dflt_lock() being called, please
let me know right away.

Reviewed by:	tmm, gibbs
2003-07-01 15:52:06 +00:00
Peter Grehan
09bf574a28 Prevent probing the secondary channel on CMD646 controllers if the
channel has been disabled by BIOS. This prevents a bus timeout
machine check on B&W G3 PowerMacs, which have a primary-only CMD646
on the motherboard.

Approved by: sos
Obtained from: NetBSD
2003-06-27 10:11:54 +00:00
Warner Losh
60c64b939b Remove check to see if the get resource for the second resource
succeeds.  There is a difference between how OLDCARD and NEWCARD deal
with their resources, and this code exposes that difference.  I'm not
sure which behavior is correct, and will need to look into that in
more detail.  However, it appears that we go ahead and allocate the
right thing in both cases that I have access to (CF cards, CDROM, and
external ata enclosures), so go ahead and ignore the failure to get
the resource for the other rid.  There's already another check to make
sure that the actual allocation works correctly, and that should be
sufficient to catch cases that don't work.

Submitted by: wpaul and iedowse
2003-06-27 03:25:43 +00:00
Søren Schmidt
d72d63c03e Add support for the HighPoint HPT302 & HPT371
HW sponsored by:	Martin Blapp <mbr@FreeBSD.ORG>
2003-06-19 15:11:04 +00:00
Warner Losh
04fd143fa8 Add FREECOM PCCARD-IDE to the mix. It doesn't have a manufacturer or
product ID, so we have to use the CIS strings to ID it.

dmesg by: Christian Laursen
2003-06-17 12:33:53 +00:00
Nate Lawson
2813692cc2 Merge common XPT_CALC_GEOMETRY functions into a single convenience function.
Devices below may experience a change in geometry.

* Due to a bug, aic(4) never used extended geometry.  Changes all drives
  >1G to now use extended translation.
* sbp(4) drives exactly 1 GB in size now no longer use extended geometry.
* umass(4) drives exactly 1 GB in size now no longer use extended geometry.

For all other controllers in this commit, this should be a no-op.

Looked over by:	scottl
2003-06-14 22:17:41 +00:00
Søren Schmidt
c283397793 Fix the setup of old Promise controllers, clocks was not setup right
causing way too low transfer rates.

Enable interrupts on old CMD64[89] chips, apparently some bogus BIOS's
doesn't get this right.
2003-06-07 15:19:16 +00:00
Warner Losh
49d5015da8 Add support for generic PMCICA ATA CARD 2003-06-03 01:30:55 +00:00
Søren Schmidt
e1750fb855 Print the right position on disk errors
Approved by: re@
2003-05-19 13:43:12 +00:00
Søren Schmidt
c9f5649b3e Unbork the chip locating code.
Approved by: re@
2003-05-19 13:42:23 +00:00
Søren Schmidt
05688ceccc Support the ICH5 SATA part.
Fix HPT374 UDMA133 timing.
Fix Promise ID.
Cosmetics on probe print for Promise & HPT.

Approved by: re
2003-05-18 16:45:48 +00:00
Søren Schmidt
27409aa046 Add string for SATA150
Approved by: re
2003-05-18 16:43:08 +00:00
Thomas Quinot
b3c957133a In atapi_cam_reinit_bus, only call reinit_bus if the ATAPI channel
has already been registered with ATAPI/CAM (else there is nothing
to do). atapi_cam_reinit_bus may be called before the bus is
registered if an ATAPI command times out during the boot sequence.

PR:		i386/51421
Reviewed by:	roberto
Approved by:	re (rwatson)
MFC after:	1 week
2003-05-14 14:20:22 +00:00
Søren Schmidt
69d691371a Fix typo (that even got cut/pasted 2 times)
Found by:	phk
Approved by:	re@
2003-05-12 16:43:13 +00:00
Poul-Henning Kamp
df1970aa55 Fix an off-by-1 error.
Found by:	FlexeLint
Reviewed by:	sos
Approved by:	re/rwatson
2003-05-12 15:26:05 +00:00
Søren Schmidt
60ad94dea4 Add a couble new Intel PCI id's
Approved by: re@
2003-05-10 14:49:19 +00:00
John Baldwin
258dbbab69 Acquire Giant at the start of the raid rebuild kthreads.
Reported by:	Masachika ISHIZUKA <ishizuka@ish.org>
Reviewed by:	sos
Approved by:	re (bmah)
2003-05-08 16:38:14 +00:00
John Baldwin
6e52134c70 Add PCI ID's for the Intel ICH5 (82801EB) chipset.
Approved by:	re (murray)
Sponsored by:	The Weather Channel
2003-05-06 19:31:56 +00:00
Søren Schmidt
b4074fb04d Add a missing ~ when clearing flags in close.
PR: 35392
2003-05-05 10:11:17 +00:00
Søren Schmidt
64ff745cf5 Change the way loadbalancing works on RAID1's.
Based on code partially by me and by <Tor.Egge@cvsup.no.freebsd.org>.
2003-05-04 16:17:54 +00:00
Søren Schmidt
cf764e45ae Implement dump function for ATA RAID's. Minor fixes by me...
Submitted by: Tor Egge <Tor.Egge@cvsup.no.freebsd.org>
2003-05-04 12:16:47 +00:00
Søren Schmidt
9c51ecf436 Grap the ATA lock on all channels before suspend, this makes certain
that we have no outstanding ops in transit, which would cause problems
on resume.
2003-05-04 09:34:14 +00:00
Søren Schmidt
7af89aab59 Fix locking on reinit. 2003-05-03 18:28:43 +00:00