Commit Graph

1055 Commits

Author SHA1 Message Date
Philip Paeps
854d77bdd6 Introduce a new loader tunable "hw.ata.ata_dma_check_80pin", defaulting to 1.
This can be used to disable the 80pin cable check on systems which forget to
set the bit -- such as certain laptops and Soekris boards.

PR:		kern/114605 (somewhat reworked)
Submitted by:	marck
MFC after:	1 week
2008-08-15 10:55:11 +00:00
Remko Lodder
1d69e13d1f Detect ATA controllers in the Macbook3.
PR:		118135
Submitted by:	ed
Approved by:	imp (mentor, implicit)
MFC after:	1 week
2008-07-10 21:36:53 +00:00
Remko Lodder
05e423585f Driver failed to allocate MMIO resources. Attached patch adds a fallback path.
It uses generic IDE facilities if sii-specific allocations failed

PR:		125421
Submitted by:	Andrey V. Elsukov <bu7cher at yandex dot ru>
Approved by:	imp (mentor, implicit)
MFC after:	1 week
2008-07-09 15:10:53 +00:00
Remko Lodder
e9cb96265f Add new device id for ICH8M, which supports greater than UDMA33 mode
when it worked as generic IDE.

PR:			125422
Submitted by:		Andrey V. Elsukov <bu7cher at yandex dot ru>
Approved by:		imp (mentor, implicit)
MFC after:		1 week
2008-07-09 15:07:53 +00:00
Remko Lodder
8a282d33ec Add support for the ICH9 in non AHCI mode (RAID mode).
Submitted by:	Andrey V. Elsukov <bu7cher at yandex dot ru>
Tested by:	Vitalij L. Fadeev <fvl at mail dot ru>
Approved by:	imp (mentor, implicit)
MFC after:	1 week
2008-07-09 15:06:41 +00:00
Søren Schmidt
81b910389d Wait up to 1S for the TFD data to signal un-busy before fetching the signature.
This at least helps a few slow devices out there.

Submitted by:	Andrey V. Elsukov
2008-06-11 08:48:25 +00:00
Søren Schmidt
082b99a8b9 Rearrange how to call dma.alloc() so that we have resources alloc'd when need but also late enough to know how many to create. 2008-06-11 06:44:58 +00:00
Søren Schmidt
454f3b9249 Dont call ata_start() when ata_reinit fails in the ioctl path. 2008-05-26 08:58:48 +00:00
Peter Grehan
a384947e92 Fix panic and breakage for non-DMA ATA devices e.g. powermac macio cells.
Handle cases where dma function pointers may be NULL, and where
the max_iosize can't be derived from a DMA data structure. For
the latter, revert to the prior behaviour of using DFLTPHYS for
the max i/o size when there is no other data.

Reviewed by:		marcel
No objection by:	sos
2008-05-08 17:55:44 +00:00
Søren Schmidt
347458c95e Add HW level support for the Adaptec 1420SA controller. 2008-04-21 10:51:38 +00:00
Søren Schmidt
7963bde3d2 Unload DMA slot on device timeouts. 2008-04-21 10:35:19 +00:00
Søren Schmidt
629f08ade0 Do not enable FIS based PM switching, even if not used some controllers barf. 2008-04-21 10:34:31 +00:00
Bjoern A. Zeeb
95b02815da devclass_get_maxunit() returns n+1 with n starting at 0.
So if we have channel 0..3  devclass_get_maxunit is 4.

It's never been a problem as devclass_get_device() has
catched a possibly bad input.

Discussed with:	scottl
2008-04-20 17:45:32 +00:00
Søren Schmidt
3d970c5c0e Fix the breakage that caused AHCI devices to vanish. Editor droppings :(
Put the ATAPI device numbering back to the old ways.
2008-04-18 15:15:04 +00:00
Søren Schmidt
1b164f3101 Alloc two DMA slots pr default, silly me forgot that slaves still exists. 2008-04-17 18:11:47 +00:00
Søren Schmidt
104c094e06 Go back to preallocating everything possible on init.
This avoids calling busdma in the request processing path which caused a traumatic performance degradation.
Allocation has be postponed to after we know how many devices we possible can have on portmulitpliers to save some space.
2008-04-17 12:29:35 +00:00
Søren Schmidt
d90a6aaeb2 Fix problem with slave devices.
Fix or rather bring ENOMEM problems back to the state it was before.
Temporarily disable PortMultipliers on AHCI devices.
2008-04-14 18:34:24 +00:00
Søren Schmidt
1a796873ca Fix identify of slave devices. 2008-04-13 16:05:34 +00:00
Søren Schmidt
a7c33e78bf Dont call hw.status recursively.
Spotted by: Marcel Moolenaar
2008-04-12 17:21:22 +00:00
Søren Schmidt
31d745f2ed Fix badly placed '{'
Dont leak requests on busdma failure (not that we'd get anywhere anyhow).

Reported by: antoine@
2008-04-11 22:56:27 +00:00
Søren Schmidt
dca5e1abd5 Fix the brokenness in the former commit, sorry for the mess.
The problem is that the PM support is part of a much larger WIP here, but due to popular demand I decided to get some of it imported.

Also I forgot the mention:

HW sponsored by: Vitsch Electronics / VEHosting
2008-04-11 11:30:27 +00:00
Søren Schmidt
350d133a64 Fix clearing of nVidia interrupts. 2008-04-10 20:40:25 +00:00
Søren Schmidt
9f82379c24 Add experimental support for SATA Port Multipliers
Support is working on the Silicon Image SiI3124/3132.
Support is working on some AHCI chips but far from all.

Remember this is WIP, so test reports and (constructive) suggestions are welcome!
2008-04-10 13:05:05 +00:00
Søren Schmidt
471798c310 Unbreak the last commit.
Changes from the PM WIP sneaked in and caused compile errors.
2008-03-20 21:21:31 +00:00
Søren Schmidt
8ab1ead1c0 Fix Problem with Intel Matrix RAID.
Fix from PR/121899.
2008-03-20 11:54:26 +00:00
Poul-Henning Kamp
72d945abcc Add a "spindown" facility to ata-disks: If no requests have been received
for a configurable number of seconds, spin the disk down.  Spin it back
up on the next request.

Notice that the timeout is only armed by a request, so to spin down a
disk you may have to do:

	atacontrol spindown ad10 5
	dd if=/dev/ad10 of=/dev/null count=1

To disable spindown, set timeout to zero:

	atacontrol spindown ad10 0

In order to debug any trouble caused, this code is somewhat noisy on the
console.

Enabling spindown on a disk containing / or /var/log/messages is not
going to do anything sensible.

Spinning a disk up and down all the time will wear it out, use sensibly.

Approved by:	sos
2008-03-17 10:33:23 +00:00
Søren Schmidt
0ef0323800 Add proper support for the SATA/AHCI part of IXP[67]00 2008-03-07 09:29:19 +00:00
Poul-Henning Kamp
24ecb0cb15 If the disk reports that it support the Compact Flash Association command
set, announce BIO_DELETE capability and issue ATA_CFA_ERASE when we get one.

Once we issue more BIO_DELETE, this will improve lifetime, and
possibly write speed of Flash based devices which have usable flash
adaptation layers.

For now, about the only usage is the newfs(1) -E flag.

Approved by:	sos
2008-01-02 20:33:54 +00:00
Poul-Henning Kamp
08d2425f6f Follow the current fashion of gratuitously stomping into other
peoples code with irrelevant changes[1]:

Use bus_{read|write_*() instead of bus_space_{read|write}_*() for
purely stylistic reasons.

Due to compiler optimizations and inlining, this is for all practical
purposes without effect in the compiled code.

[1] NB: Approved by:	sos
2008-01-02 20:31:14 +00:00
Søren Schmidt
4c088dcd6c Implement a workaround of the datacorruption problem on serverworks HT1000 chipsets.
The HT1000 DMA engine seems to not always like 64K transfers and sometimes barfs data all over memory leading to instant chrash and burn.
Also fix 48bit adressing issues, apparently newer chips needs 16bit writes and not the usual fifo thing.

HW donated by: Travis Mikalson at TerraNovaNet
2007-12-13 11:47:36 +00:00
Søren Schmidt
02d76bfa1b Fix speed report on Intel SATA chips in compat mode.
Fix broken detect of JMicron 368.
2007-12-07 13:14:31 +00:00
Søren Schmidt
91b4ff52c7 Use device_set_desc_copy in the generic ident as its used on a temp buffer. 2007-11-26 19:08:08 +00:00
Søren Schmidt
506310cd36 Add preliminary SATA ATAPI support for sii 3132/3124 chips. 2007-11-23 08:17:14 +00:00
Kevin Lo
2f3ad9ba29 Fix KASSERT messages. 2007-11-20 04:52:19 +00:00
Søren Schmidt
2d9f60ca25 Dont fumble the ivars on reinit, avoids panic on suspend/resume om some systems that looses thier devices.
Patch by: jhb@
2007-11-19 21:11:26 +00:00
Søren Schmidt
34cf71f7ef Try to workaound silicon bugs in Promise gen2 (ie TX4) chips
Initial patch by Alexander Sabourenkov who found it in Promise's own driver.

Further fixes and sanity checks by yours truely.
2007-11-19 20:47:31 +00:00
Søren Schmidt
6b899f5077 Fix the problem with certain ATAPI commands on AHCI devices.
Revert the probe in atapi-cd.c to the old usage now its fixed on AHCI.
THis change also fixes using virtual CD's om fx parallels.

Still leaves the GEOM problem of telling media vs device access apart in the access function.
2007-11-19 18:05:48 +00:00
Søren Schmidt
200c7605c8 Add generic support for chipsets that say they support AHCI. This should catch new chipsets that we dont know but that we should support.
Add a few new PCI id's.
Misc cleanups.
2007-11-18 14:44:52 +00:00
Søren Schmidt
53a8035b0f Fix the signature matching code on AHCI controllers.
Add SATA ATAPI support for AHCI controllers.
2007-10-26 09:01:06 +00:00
Søren Schmidt
13a0de8755 Update the way we get the mode pages on probe. 2007-10-26 08:59:23 +00:00
Søren Schmidt
f31e86f556 Fix treating some modern chips (mem mapped) as legacy devices. 2007-10-26 08:57:08 +00:00
Xin LI
8846f7d296 Add PCI ID for ICH9 AHCI w/ two adapters.
Tested by:	Abdullah Ibn Hamad Al-Marri <almarrie gmail com>
Approved by:	sos
Approved by:	re (kensmith)
2007-10-09 20:15:09 +00:00
Søren Schmidt
358904bf9d Add support for the VIA 8237S
Fix the LBA28/LBA48 crossover bug.

Approved by: re@
2007-10-04 19:17:16 +00:00
Poul-Henning Kamp
13a3fdf1fe Recognize the CS5536 support chip for the AMD Geode LX CPU to enable
UDMA modes.

Please notice that Soekris NET5501 bios versions before 1.32f has a bug
that prevents this from working.

Approved by:	re (gnn)
MFC:		2 weeks
2007-10-04 06:21:54 +00:00
Simon L. B. Nielsen
18928d0deb Add PCI IDs for Intel ICH9.
PR:		kern/114473
Submitted by:	Michael Fuckner <michael@fuckner.net>
MFC after:	2 weeks
OK'ed by:	sos
Approved by:	re (bmah)
2007-09-10 19:16:39 +00:00
John Baldwin
14657ee81f Expand the data structure returned by the ATA RAID status ioctl to include
detailed status on each of the backing subdisks.  This allows userland
to see which subdisks are online, failed, missing, or a hot spare.

MFC after:	1 week
Approved by:	re (bmah)
Reviewed by:	sos
2007-08-13 18:46:31 +00:00
Remko Lodder
266d3a7a09 Add Viking Interworks 256MB as an ata device; this might give
some false positives but at this moment it is better to add
support then to dont have it at all (comment from Soren).

PR:		kern/111516
Submitted by:	Thomas Nystrom <thn at saeab dot se>
Approved by:	re (kensmith)
Approved by:	imp (mentor)
OK'ed by:	sos (With the comment noted above about false
		positives).
2007-06-26 22:13:43 +00:00
Søren Schmidt
27568384f3 Add support for the nVidia MCP61 series chipset.
Approved by: re (mux@)
2007-06-25 08:21:21 +00:00
Warner Losh
d98db3b7b2 Include usb_port.h
Approved by: re@ (blanket and/or cleanup commit approval)
2007-06-23 21:52:05 +00:00
Scott Long
b50569b71d Prepare for future integration between CAM and newbus. xpt_bus_register
now takes a device_t to be the parent of the bus that is being created.
Most SIMs have been updated with a reasonable argument, but a few exceptions
just pass NULL for now.  This argument isn't used yet and the newbus
integration likely won't be ready until after 7.0-RELEASE.
2007-06-17 05:55:54 +00:00