Commit Graph

35 Commits

Author SHA1 Message Date
Søren Schmidt
974f34013a Rearrange the probecode, so that 80pin cables can be identified
correctly on both master and slave.
Smash together the ata_params & atapi_params structures as they
are more or less equal anyways.
Get rid of the last SYSINIT's in here.
2000-01-18 21:02:59 +00:00
Søren Schmidt
46a37dbac0 Add support for the Intel 810 chipset (ICH type of chips)
Prober support for the VIA 82C686, I finally got the right datasheet.

Get rid of atapi_wait, merge it into ata_wait.

Avoid a couple of races by using asleep instead of tsleep.

Always use 16bit transfers on ISA systems.

Clear up the atapi_read/write functions.
2000-01-17 02:04:19 +00:00
Søren Schmidt
9687efec89 Grrrr, this time it should be right, I need sleep - badly... 2000-01-07 15:51:45 +00:00
Søren Schmidt
39412a7ece This is not my lucky day :( 2000-01-07 13:15:42 +00:00
Søren Schmidt
e960abaf96 Set PIO mode in all cases. 2000-01-07 08:28:41 +00:00
Søren Schmidt
14c2c6c8b1 New ATAPI burner utility API, replaces the wormio API. 2000-01-06 22:50:02 +00:00
Søren Schmidt
aa966b9a64 Add support for VIA 82C596 controller
Better shared irq handeling for Promise & HPT366 controllers

Setup prober PIO mode timings on Promise & HPT366 controllers

Update Copyright headers to be Y2K compliant :)
2000-01-03 10:26:59 +00:00
Søren Schmidt
3ace5ae2c8 Yet another cleanup of the VIA code, this time it should work
on all combinations (I hope)...

Add DMA support for the AMD 756 chip (K7 chipset) this is actually the
same as the VIA 82C686 chip (the ATA part that is).

Treat the intel MX chipset PIIX as a PIIX4

Allow UDMA on all disks that say they can handle it.

Cleanup probe printf's a bit

Remove alot of the old #ifdef DEBUG crap.
1999-12-21 20:18:56 +00:00
Søren Schmidt
6be090b840 Relax the requirements for doing WDMA2, this should enable DMA
on non ATA[234] compliant disks.

Move all PCI dependent stuff under #ifdef NPCI > 0
1999-12-18 20:06:30 +00:00
Søren Schmidt
dbdfe960cb Have another go at the VIA support, this time use the PCI ID form the
main component in the southbridge chip to determine which VIA chip
we are dealing with.

Try to enable DMA on generic controllers that say they has the
capability, instead of relying on the BIOS to have set it up.
1999-12-14 10:25:28 +00:00
Søren Schmidt
54ecff8b84 Add DMA support for the SiS 5591 and old PIIX chipsets.
Add a missing DELAY(1) in ata_wait.

Change the info from ad_version, so the ATA version from the disk can
be used to quantify the DAM modes valid for this drive, ie be more
selective with turning DMA on on older disks that should not support it..

Fix the probe for BIOS enabled DMA in the generic case, master/slave
was reversed in the test.

Check the return for ata_command in all cases, and print warnings if
it fails.

Call ata_dmainit with all dmamodes off when falling back to PIO mode,
that should take care of both the Promise & HPT366 controllers not
being able to handle the fallback...

Cleanup the printf's in the drivers, use the prober device name (if
possible) instead of ataN-master/slave.
1999-12-13 10:19:39 +00:00
Søren Schmidt
cb2a8dffa0 Commit the kernel part of our DVD support. Nothing much to say really,
its just a number of new ioctl's, the rest is done in userland.
1999-12-07 22:25:28 +00:00
Søren Schmidt
30f5b2a68e Fix atapi_wait_ready, it returned prematurely.
Less verbosity on non-fatal errors.
1999-11-26 19:26:04 +00:00
Søren Schmidt
3082a6dc59 Add DMA support for the VIA 82C586 & 82C686 chips, also rearrange
to fall back to slower speeds if the faster ones fails to probe.

Log and retry request on UDMA CRC errors.

Fix a couple of warnings.
1999-11-24 21:40:05 +00:00
Søren Schmidt
6e82e8be6d Make the atapi device return sensible errno's back to userland.
Dont panic if a nonexistant device is opened.
1999-11-10 07:13:51 +00:00
Søren Schmidt
3de25e2f32 Fix IRQ allocation bug on controllers using a shared interrupt.
Fix a bug which could cause panics in ad/atapi-interrupt.

Add support for UDMA66 on Promise Ultra/Fasttrak controllers.

Get rid of ATA_IGNORE_INTR, and introduce ATA_WAIT_INTR instead.

Add a delay in the dump routine in ata-disk.c, some controllers
seem to need this. Also dont use the timeout watchdog when dumping.

Disable DMA on ATAPI devices as default, add option ATA_ENABLE_ATAPI_DMA
for those that has HW that works.

Add support for some not-up-to-spec ATAPI devices that returns data
together with completition status on data moving cmd's.
1999-11-06 16:50:21 +00:00
Søren Schmidt
31694ea9b0 Remove unused include files.
Submitted by: phk
1999-10-10 18:08:40 +00:00
Søren Schmidt
2b0a1c086d Add support for the HPT366 chip, this is used on the Abit boards and
their HotRod controller and on SIIG PCI ultra DMA controller. These
changes also made lots of the Promise code go away, its all much more
generic this way.

Get rid of atapi_immed_cmd, instead use the queue to move atapi commands
from interrupt context if nessesary, the entire atapi layer has
gotten an overhaul.

Lots of fixes to utililize the new features in subr_disk.c etc, and
get rid of the last biots of softc arrays in the drivers, the
only one left is atadevices which cannot easily go away (yet).

Use our own malloc names, its a lot easier to track memory usage this way.

General cleanup overall.
1999-10-09 19:57:13 +00:00
Nick Hibma
3e2c6ca3b9 Removal of sys/device.h
- Move intrhook stuff into kernel.h
- Remove all occurrences of #device <device.h>
- Add kernel.h were necessary (nowhere)
- delete device.h

This file contained the structures for cfdata (old style config) and is no
longer used. It was included by most drivers.

It confuses the remote debugger as the definition of 'struct device' in
device.h is found before the one in bus_private.h.
1999-10-05 21:19:41 +00:00
Søren Schmidt
27fceb7416 Fix timeout handeling and add retry counts.
Add HPT366 probe message (but no real support yet),
Add CDR support for several diffenrent blocktypes, also close
disk as a multisession CD.
1999-09-24 12:36:10 +00:00
Søren Schmidt
fbf6ea790a Support quad & max speeds in wormcontrol.
A bit more general cleanup.
1999-09-22 12:04:51 +00:00
Søren Schmidt
3427651043 Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...

The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.

An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.

The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...

The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).

The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.

Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.

As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)

But please tell me how it works for you!

Enjoy!

-Søren
1999-09-21 19:50:40 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Poul-Henning Kamp
9dcbe2404a Convert DEVFS hooks in (most) drivers to make_dev().
Diskslice/label code not yet handled.

Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers)

Add the correct hook for devfs to kern_conf.c

The net result of this excercise is that a lot less files depends on DEVFS,
and devtoname() gets more sensible output in many cases.

A few drivers had minor additional cleanups performed relating to cdevsw
registration.

A few drivers don't register a cdevsw{} anymore, but only use make_dev().
1999-08-23 20:59:21 +00:00
Søren Schmidt
f63c7e582a Support DMA on ATAPI devices (finally).
This makes my system use only ~5% CPU on reading 4.5Mbyte/sec
from a CDROM, which before was limitted to 1.8Mbyte/sec due
to 100% CPU load..
1999-08-10 21:59:58 +00:00
Søren Schmidt
c4217f94eb Nine'th update to the new ATA/ATAPI driver:
The atapi subsystem has gotten better error handeling and timeouts,
it also tries a REQUEST SENSE command when devices returns errors,
to give a little more info as to what went wrong. It might be a
little verbose for now, but I'm interested in as much feedback on
errors as possible, especially timeouts, as I'm a bit in doubt if
I've chosen resonable default values everywhere.

The disk driver has been changed a bit to prepare for tagged queing,
which is next on my list.

The disk driver has grown a dump routine, I got one implementation
from Darrell Anderson <anderson@cs.duke.edu> which also did
partial dumps (usefull on big memory machines) I left out the
partial stuff for now, and changed the rest alot to fit into the new
ad_request framework.

Some minor cleanups and rearrangements as well.

As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, again you have been warned :)
Notebook owners should be carefull that their machines dont suspend
as this might cause trouble...

But please tell me how it works for you!

Enjoy!

-Søren
1999-06-25 09:03:07 +00:00
Søren Schmidt
dc82ab74e3 Eigth update to the new ATA/ATAPI driver:
Fixed problems:

    LS120/ZIP drives still currupted data.
	Reworked once again, buffered I/O is just ignoring any sizehints
	it is given :(
	Now the atapifd driver splits up requests for devices that has
	limitted transfer size.

    ISA only configs fails on boot with interrupt timeouts.
	The new-bus integration introduced a bug where the softc ptr
	was lost during the probe.

Some minor cleanups and rearrangements as well.

As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, again you have been warned :)
Notebook owners should be carefull that their machines dont suspend
as this might cause trouble...

But please tell me how it works for you!

Enjoy!
1999-05-20 09:12:06 +00:00
Søren Schmidt
b5bb732345 Seventh update to the new ATA/ATAPI driver:
Fixed problems:

    LS120 drives currupted data.
	The workaround for drives not supporting upto 64K transfers
	has been reworked. It works now both on LS120 & ZIP drives.

    ISA only configs wont compile.
	Fixed.

    The ATA driver wont share interrupts.
	Fixed.

    The "unwanted interrupt" warning gave wrong controller.
	Another lun<>unit messup from the newbus integration.

Some minor cleanups and rearrangements as well.

As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, again you have been warned :)
Notebook owners should be carefull that their machines dont suspend
as this might cause trouble...

But please tell me how it works for you!

Enjoy!

-Søren
1999-05-17 15:58:47 +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
Søren Schmidt
775986fc09 Sixth update to the new ATA/ATAPI driver:
Fixed problems:

    Promise controllers was not always set up correctly.
        Parantheses are a good thing, fixed.

    Some older CDROM's could hang the probe.
        Proberly wait for the drive to catch its breath after IDENTIFY.

    Some CD writers fails because they dont support rezero.
        Rearranged the code to not use rezero.

    Warnings now that we use EGCS.
        Fixed.
1999-04-10 18:53:35 +00:00
Søren Schmidt
55bfaed1c0 Fourth update to the new ATA/ATAPI driver:
Well, better late than newer, but things has been hectic
around here, sorry for the long delay.

DMA support has been added to the ATA disk driver.
This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers.
The promise support works without the BIOS on the board,
and timing modes are set to support up to UDMA speed. This
solves the problems with having more than one promise controller
in the same system.
There is support for "generic" DMA, that might work on other
controllers, but now you have been warned :)
More chipset specific code will come soon, I have to find testers
with the approbiate HW, more on that when I have it ready.

The system now uses its own major numbers, please run MAKEDEV
with the devices you need (ad?, acd?, afd?, ast?).
For now the disk driver will also attach to the old wd major
so one can at least boot without this step, but be warned, this
will eventually go away. The bootblocks will have to be changed
before one can boot directly from an "ad" device though.

Fixed problems:

    All known hang problems should be solved
	The probe code has been sligthly changed, this should solve
	the reports I have lying around (I hope).

    Hangs when accessing ata & atapi device on the same channel simultaniously.
	A real braino in ata_start caused this, fixed.

As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, agaiin you have been warned :)

But please tell me how it works for you!

Enjoy!

-Søren
1999-03-28 18:57:20 +00:00
Søren Schmidt
989fb3947c ZIP drives should now be working, I'm not sure about LS120 drives,
reports on those most welcome!

Fixed problems:

    Hang on probe on "fantom" devices.
	The probe now use a timeout to avoid hangs if no interrupt
	is recevied.

There has also been more general code clenaups, and some reorgs.
1999-03-07 21:49:14 +00:00
Søren Schmidt
2e526e2ac0 Now all actual probing of both ATA & ATAPI devices are done after
interrupts are enabled, this kills the last "unwanted interrupts"
(and there is no ugly hacks like in the old driver to avoid them).
COmmand interrupt devices are now supported, this applies mostly
to older CDROM's and apparently also the ZIP.

Fixed problems:

    Number of total sectors wrong on some older drives.
        Fixed by not using the LBA size unless we know its valid.

There has also been more general code clenaups, some reorgs also.
1999-03-05 09:43:30 +00:00
Søren Schmidt
b9bb98b32b Added driver to support ATAPI floppies ie LS-120 & ZIP drives.
Added "options ATA_STATIC_ID" that wires ATA disks like the old wd driver.

Fixed problems:

	Dont use more sectors/intr than the drive supports.
	Fix announce of > 8.4G disks.
	Dont call ad_interrupt/ad_transfer when no disks config'd.
	Use the right page# for CDR write mode params.
	Fix breakage when no PCI support in kernel.
	Implement DEVFS stuff.

General code clenaup.
1999-03-03 21:10:29 +00:00
Søren Schmidt
8b89ef0a2d Finally!!
The much roumored replacement for our current IDE/ATA/ATAPI is
materialising in the CVS repositories around the globe.

So what does this bring us:

A new reengineered ATA/ATAPI subsystem, that tries to overcome
most of the deficiencies with the current drivers.

It supports PCI as well as ISA devices without all the hackery
in ide_pci.c to make PCI devices look like ISA counterparts.

It doesn't have the excessive wait problem on probe, in fact you
shouldn't notice any delay when your devices are getting probed.

Probing and attaching of devices are postponed until interrupts
are enabled (well almost, not finished yet for disks), making
things alot cleaner.

Improved performance, although DMA support is still WIP and not
in this pre alpha release, worldstone is faster with the new
driver compared to the old even with DMA.

So what does it take away:

There is NO support for old MFM/RLL/ESDI disks.
There is NO support for bad144, if your disk is bad, ditch it, it has
already outgrown its internal spare sectors, and is dying.

For you to try this out, you will have to modify your kernel config
file to use the "ata" controller instead of all wdc? entries.

example:

# for a PCI only system (most modern machines)
controller 	ata0
device		atadisk0	# ATA disks
device		atapicd0	# ATAPI CDROM's
device		atapist0	# ATAPI tapes

#You should add the following on ISA systems:
controller	ata1	at isa? port "IO_WD1" bio irq 14
controller	ata2	at isa? port "IO_WD2" bio irq 15

You can leave it all in there, the system knows how to manage.

For now this driver reuses the device entries from the old system
(that will probably change later), but remember that disks are
now numbered in the sequence they are found (like the SCSI system)
not as absolute positions as the old system.

Although I have tested this on all the systems I can get my hands on,
there might very well be gremlins in there, so use AT YOU OWN RISK!!
This is still WIP, so there are lots of rough edges and unfinished
things in there, and what I have in my lab might look very different
from whats in CVS at any given time. So please have all eventual
changes go through me, or chances are they just dissapears...

I would very much like to hear from you, both good and bad news
are very welcome.

Enjoy!!

-Søren
1999-03-01 21:19:19 +00:00