freebsd-dev/sys/dev/ata/ata-all.c

1037 lines
28 KiB
C
Raw Normal View History

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
/*-
* Copyright (c) 1998,1999,2000 S<EFBFBD>ren Schmidt
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
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer,
* without modification, immediately at the beginning of the file.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
1999-08-28 01:08:13 +00:00
* $FreeBSD$
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
*/
#include "ata.h"
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
#include "apm.h"
#include "isa.h"
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
#include "pci.h"
#include "atadisk.h"
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
#include "atapicd.h"
#include "atapifd.h"
#include "atapist.h"
#include "opt_global.h"
#include "opt_ata.h"
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
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
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
#include <sys/disk.h>
#include <sys/module.h>
#include <sys/bus.h>
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
#include <sys/buf.h>
#include <sys/malloc.h>
#include <sys/devicestat.h>
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
#include <vm/vm.h>
#include <vm/pmap.h>
#include <machine/resource.h>
#include <machine/bus.h>
#include <sys/rman.h>
#if NPCI > 0
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
#include <pci/pcivar.h>
#include <pci/pcireg.h>
#endif
#include <isa/isavar.h>
#include <isa/isareg.h>
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
#include <machine/clock.h>
#ifdef __i386__
#include <machine/smp.h>
#include <i386/isa/intr_machdep.h>
#endif
#if NAPM > 0
#include <machine/apm_bios.h>
#endif
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
#include <dev/ata/ata-all.h>
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
#include <dev/ata/ata-disk.h>
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
#include <dev/ata/atapi-all.h>
/* misc defines */
#if SMP == 0
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
#define isa_apic_irq(x) x
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
#endif
#define IOMASK 0xfffffffc
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
/* prototypes */
static int32_t ata_probe(int32_t, int32_t, int32_t, device_t, int32_t *);
static void ataintr(void *);
static int8_t *active2str(int32_t);
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
/* local vars */
static int32_t atanlun = 2;
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
struct ata_softc *atadevices[MAXATA];
static devclass_t ata_devclass;
MALLOC_DEFINE(M_ATA, "ATA generic", "ATA driver generic layer");
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
#if NISA > 0
static struct isa_pnp_id ata_ids[] = {
{0x0006d041, "Generic ESDI/IDE/ATA controller"}, /* PNP0600 */
{0x0106d041, "Plus Hardcard II"}, /* PNP0601 */
{0x0206d041, "Plus Hardcard IIXL/EZ"}, /* PNP0602 */
{0x0306d041, "Generic ATA"}, /* PNP0603 */
{0}
};
static int
ata_isaprobe(device_t dev)
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
{
struct resource *port;
int rid;
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
int32_t ctlr, res;
int32_t lun;
/* Check isapnp ids */
if (ISA_PNP_PROBE(device_get_parent(dev), dev, ata_ids) == ENXIO)
return (ENXIO);
/* Allocate the port range */
rid = 0;
port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE);
if (!port)
return (ENOMEM);
/* check if allready in use by a PCI device */
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
for (ctlr = 0; ctlr < atanlun; ctlr++) {
if (atadevices[ctlr] && atadevices[ctlr]->ioaddr==rman_get_start(port)){
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
printf("ata-isa%d: already registered as ata%d\n",
device_get_unit(dev), ctlr);
bus_release_resource(dev, SYS_RES_IOPORT, 0, port);
return ENXIO;
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
}
}
lun = 0;
res = ata_probe(rman_get_start(port), rman_get_start(port) + ATA_ALTPORT,
0, dev, &lun);
bus_release_resource(dev, SYS_RES_IOPORT, 0, port);
if (res) {
isa_set_portsize(dev, res);
*(int *)device_get_softc(dev) = lun;
atadevices[lun]->flags |= ATA_USE_16BIT;
return 0;
}
return ENXIO;
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
}
static int
ata_isaattach(device_t dev)
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
{
struct resource *port;
struct resource *irq;
void *ih;
int rid;
/* Allocate the port range and interrupt */
rid = 0;
port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE);
if (!port)
return (ENOMEM);
rid = 0;
irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_ACTIVE);
if (!irq) {
bus_release_resource(dev, SYS_RES_IOPORT, 0, port);
return (ENOMEM);
}
return bus_setup_intr(dev, irq, INTR_TYPE_BIO, ataintr,
atadevices[*(int *)device_get_softc(dev)], &ih);
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
}
static device_method_t ata_isa_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, ata_isaprobe),
DEVMETHOD(device_attach, ata_isaattach),
{ 0, 0 }
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
};
static driver_t ata_isa_driver = {
"ata",
ata_isa_methods,
sizeof(int),
};
DRIVER_MODULE(ata, isa, ata_isa_driver, ata_devclass, 0, 0);
#endif
#if NPCI > 0
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
static const char *
ata_pcimatch(device_t dev)
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
{
if (pci_get_class(dev) != PCIC_STORAGE)
return NULL;
switch (pci_get_devid(dev)) {
/* supported chipsets */
case 0x12308086:
return "Intel PIIX ATA controller";
case 0x70108086:
return "Intel PIIX3 ATA controller";
case 0x71118086:
case 0x71998086:
return "Intel PIIX4 ATA-33 controller";
case 0x24118086:
return "Intel ICH ATA-66 controller";
case 0x24218086:
return "Intel ICH0 ATA-33 controller";
case 0x522910b9:
return "AcerLabs Aladdin ATA-33 controller";
case 0x05711106: /* 82c586 & 82c686 */
if (ata_find_dev(dev, 0x05861106))
return "VIA 82C586 ATA-33 controller";
if (ata_find_dev(dev, 0x05961106))
return "VIA 82C596 ATA-33 controller";
if (ata_find_dev(dev, 0x06861106))
return "VIA 82C686 ATA-66 controller";
return "VIA Apollo ATA controller";
case 0x55131039:
return "SiS 5591 ATA-33 controller";
case 0x74091022:
return "AMD 756 ATA-66 controller";
case 0x4d33105a:
return "Promise ATA-33 controller";
case 0x4d38105a:
return "Promise ATA-66 controller";
case 0x00041103:
return "HighPoint HPT366 ATA-66 controller";
/* unsupported but known chipsets, generic DMA only */
case 0x06401095:
return "CMD 640 ATA controller (generic mode)";
case 0x06461095:
return "CMD 646 ATA controller (generic mode)";
case 0xc6931080:
return "Cypress 82C693 ATA controller (generic mode)";
case 0x01021078:
return "Cyrix 5530 ATA controller (generic mode)";
default:
if (pci_get_class(dev) == PCIC_STORAGE &&
(pci_get_subclass(dev) == PCIS_STORAGE_IDE))
return "Unknown PCI ATA controller (generic mode)";
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
}
return NULL;
}
static int
ata_pciprobe(device_t dev)
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
{
const char *desc = ata_pcimatch(dev);
if (desc) {
device_set_desc(dev, desc);
return 0;
}
else
return ENXIO;
}
static int
ata_pciattach(device_t dev)
{
int unit = device_get_unit(dev);
struct ata_softc *scp;
u_int32_t type;
u_int8_t class, subclass;
u_int32_t cmd;
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
int32_t iobase_1, iobase_2, altiobase_1, altiobase_2;
int32_t bmaddr_1 = 0, bmaddr_2 = 0, irq1, irq2;
struct resource *irq = NULL;
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
int32_t lun;
/* set up vendor-specific stuff */
type = pci_get_devid(dev);
class = pci_get_class(dev);
subclass = pci_get_subclass(dev);
cmd = pci_read_config(dev, PCIR_COMMAND, 4);
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
#ifdef ATA_DEBUG
printf("ata-pci%d: type=%08x class=%02x subclass=%02x cmd=%08x if=%02x\n",
unit, type, class, subclass, cmd, pci_get_progif(dev));
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
#endif
if (pci_get_progif(dev) & PCIP_STORAGE_IDE_MASTERDEV) {
iobase_1 = IO_WD1;
altiobase_1 = iobase_1 + ATA_ALTPORT;
irq1 = 14;
}
else {
iobase_1 = pci_read_config(dev, 0x10, 4) & IOMASK;
altiobase_1 = pci_read_config(dev, 0x14, 4) & IOMASK;
irq1 = pci_read_config(dev, PCI_INTERRUPT_REG, 4) & 0xff;
}
if (pci_get_progif(dev) & PCIP_STORAGE_IDE_MASTERDEV) {
iobase_2 = IO_WD2;
altiobase_2 = iobase_2 + ATA_ALTPORT;
irq2 = 15;
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
}
else {
iobase_2 = pci_read_config(dev, 0x18, 4) & IOMASK;
altiobase_2 = pci_read_config(dev, 0x1c, 4) & IOMASK;
irq2 = pci_read_config(dev, PCI_INTERRUPT_REG, 4) & 0xff;
}
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
/* is this controller busmaster DMA capable ? */
if (pci_get_progif(dev) & PCIP_STORAGE_IDE_MASTERDEV) {
/* is busmastering support turned on ? */
if ((pci_read_config(dev, PCI_COMMAND_STATUS_REG, 4) & 5) == 5) {
/* is there a valid port range to connect to ? */
if ((bmaddr_1 = pci_read_config(dev, 0x20, 4) & IOMASK)) {
bmaddr_2 = bmaddr_1 + ATA_BM_OFFSET1;
printf("ata-pci%d: Busmastering DMA supported\n", unit);
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
}
else
printf("ata-pci%d: Busmastering DMA not configured\n", unit);
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
}
else
printf("ata-pci%d: Busmastering DMA not enabled\n", unit);
}
else {
if (type == 0x4d33105a || type == 0x4d38105a || type == 0x00041103) {
/* Promise and HPT366 controllers support busmastering DMA */
bmaddr_1 = pci_read_config(dev, 0x20, 4) & IOMASK;
bmaddr_2 = (pci_read_config(dev, 0x20, 4) & IOMASK)+ATA_BM_OFFSET1;
printf("ata-pci%d: Busmastering DMA supported\n", unit);
}
else {
/* we dont know this controller, no busmastering DMA */
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
printf("ata-pci%d: Busmastering DMA not supported\n", unit);
}
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
}
/* do extra chipset specific setups */
switch (type) {
case 0x522910b9: /* Aladdin need to activate the ATAPI FIFO */
pci_write_config(dev, 0x53,
(pci_read_config(dev, 0x53, 1) & ~0x01) | 0x02, 1);
break;
case 0x4d33105a:
case 0x4d38105a: /* Promise's need burst mode to be turned on */
outb(bmaddr_1 + 0x1f, inb(bmaddr_1 + 0x1f) | 0x01);
break;
case 0x05711106:
case 0x74091022: /* VIA 82C586, 82C596, 82C686 & AMD 756 default setup */
/* set prefetch, postwrite */
pci_write_config(dev, 0x41, pci_read_config(dev, 0x41, 1) | 0xf0, 1);
/* set fifo configuration half'n'half */
pci_write_config(dev, 0x43,
(pci_read_config(dev, 0x43, 1) & 0x90) | 0x2a, 1);
/* set status register read retry */
pci_write_config(dev, 0x44, pci_read_config(dev, 0x44, 1) | 0x08, 1);
/* set DMA read & end-of-sector fifo flush */
pci_write_config(dev, 0x46,
(pci_read_config(dev, 0x46, 1) & 0x0c) | 0xf0, 1);
/* set sector size */
pci_write_config(dev, 0x60, DEV_BSIZE, 2);
pci_write_config(dev, 0x68, DEV_BSIZE, 2);
/* prepare for ATA-66 on the 82C686 */
if (ata_find_dev(dev, 0x06861106))
pci_write_config(dev, 0x50,
pci_read_config(dev, 0x50, 4) | 0x070f070f, 4);
break;
case 0x00041103: /* HighPoint HPT366 controller */
printf("hpt366: cache_line_size=0x%02x latency_timer=0x%02x min_grant=0x%02x max_latency=0x%02x\n",
pci_read_config(dev, 0x0c, 1), pci_read_config(dev, 0x0d, 1),
pci_read_config(dev, 0x3e, 1), pci_read_config(dev, 0x3f, 1));
}
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
/* now probe the addresse found for "real" ATA/ATAPI hardware */
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
lun = 0;
if (iobase_1 && ata_probe(iobase_1, altiobase_1, bmaddr_1, dev, &lun)) {
scp = atadevices[lun];
scp->chiptype = type;
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
if (iobase_1 == IO_WD1)
#ifdef __i386__
inthand_add(device_get_nameunit(dev), irq1, ataintr, scp,
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
&bio_imask, INTR_EXCL);
#endif
#ifdef __alpha__
alpha_platform_setup_ide_intr(0, ataintr, scp);
#endif
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
else {
int rid = 0;
void *ih;
if (!(irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
RF_SHAREABLE | RF_ACTIVE)))
printf("ata_pciattach: Unable to alloc interrupt\n");
bus_setup_intr(dev, irq, INTR_TYPE_BIO, ataintr, scp, &ih);
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
}
printf("ata%d at 0x%04x irq %d on ata-pci%d\n",
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
lun, iobase_1, isa_apic_irq(irq1), unit);
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
}
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
lun = 1;
if (iobase_2 && ata_probe(iobase_2, altiobase_2, bmaddr_2, dev, &lun)) {
scp = atadevices[lun];
scp->chiptype = type;
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
if (iobase_2 == IO_WD2)
#ifdef __i386__
inthand_add(device_get_nameunit(dev), irq2, ataintr, scp,
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
&bio_imask, INTR_EXCL);
#endif
#ifdef __alpha__
alpha_platform_setup_ide_intr(1, ataintr, scp);
#endif
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
else {
int rid = 0;
void *ih;
if (irq1 != irq2 || irq == NULL) {
if (!(irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
RF_SHAREABLE | RF_ACTIVE)))
printf("ata_pciattach: Unable to alloc interrupt\n");
}
bus_setup_intr(dev, irq, INTR_TYPE_BIO, ataintr, scp, &ih);
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
}
printf("ata%d at 0x%04x irq %d on ata-pci%d\n",
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
lun, iobase_2, isa_apic_irq(irq2), unit);
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
}
return 0;
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
}
int32_t
ata_find_dev(device_t dev, int32_t type)
{
device_t *children, child;
int nchildren, i;
if (device_get_children(device_get_parent(dev), &children, &nchildren))
return 0;
for (i = 0; i < nchildren; i++) {
child = children[i];
/* check that it's on the same silicon and the device we want */
if (pci_get_slot(dev) == pci_get_slot(child) &&
pci_get_vendor(child) == (type & 0xffff) &&
pci_get_device(child) == ((type & 0xffff0000)>>16)) {
free(children, M_TEMP);
return 1;
}
}
free(children, M_TEMP);
return 0;
}
static device_method_t ata_pci_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, ata_pciprobe),
DEVMETHOD(device_attach, ata_pciattach),
{ 0, 0 }
};
static driver_t ata_pci_driver = {
"ata-pci",
ata_pci_methods,
sizeof(int),
};
DRIVER_MODULE(ata, pci, ata_pci_driver, ata_devclass, 0, 0);
#endif
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
static int32_t
ata_probe(int32_t ioaddr, int32_t altioaddr, int32_t bmaddr,
device_t dev, int32_t *unit)
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
{
struct ata_softc *scp;
int32_t lun, mask = 0;
u_int8_t status0, status1;
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
if (atanlun > MAXATA) {
printf("ata: unit out of range(%d)\n", atanlun);
return 0;
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
}
/* check if this is located at one of the std addresses */
if (ioaddr == IO_WD1)
lun = 0;
else if (ioaddr == IO_WD2)
lun = 1;
else
lun = atanlun++;
if ((scp = atadevices[lun])) {
printf("ata%d: unit already attached\n", lun);
return 0;
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
}
scp = malloc(sizeof(struct ata_softc), M_ATA, M_NOWAIT);
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
if (scp == NULL) {
printf("ata%d: failed to allocate driver storage\n", lun);
return 0;
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
}
bzero(scp, sizeof(struct ata_softc));
scp->ioaddr = ioaddr;
scp->altioaddr = altioaddr;
scp->bmaddr = bmaddr;
scp->lun = lun;
scp->unit = *unit;
scp->active = ATA_IDLE;
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
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
if (bootverbose)
printf("ata%d: iobase=0x%04x altiobase=0x%04x bmaddr=0x%04x\n",
scp->lun, scp->ioaddr, scp->altioaddr, scp->bmaddr);
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
/* do we have any signs of ATA/ATAPI HW being present ? */
outb(scp->ioaddr + ATA_DRIVE, ATA_D_IBM | ATA_MASTER);
DELAY(1);
status0 = inb(scp->ioaddr + ATA_STATUS);
outb(scp->ioaddr + ATA_DRIVE, ATA_D_IBM | ATA_SLAVE);
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
DELAY(1);
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
status1 = inb(scp->ioaddr + ATA_STATUS);
if ((status0 & 0xf8) != 0xf8)
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
mask |= 0x01;
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
if ((status1 & 0xf8) != 0xf8)
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
mask |= 0x02;
if (bootverbose)
printf("ata%d: mask=%02x status0=%02x status1=%02x\n",
scp->lun, mask, status0, status1);
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
if (!mask) {
free(scp, M_DEVBUF);
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
return 0;
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
}
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
ata_reset(scp, &mask);
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
if (!mask) {
free(scp, M_DEVBUF);
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
return 0;
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
}
/*
* OK, we have at least one device on the chain,
* check for ATAPI signatures, if none check if its
* a good old ATA device.
*/
outb(scp->ioaddr + ATA_DRIVE, (ATA_D_IBM | ATA_MASTER));
DELAY(1);
if (inb(scp->ioaddr + ATA_CYL_LSB) == ATAPI_MAGIC_LSB &&
inb(scp->ioaddr + ATA_CYL_MSB) == ATAPI_MAGIC_MSB) {
scp->devices |= ATA_ATAPI_MASTER;
}
outb(scp->ioaddr + ATA_DRIVE, (ATA_D_IBM | ATA_SLAVE));
DELAY(1);
if (inb(scp->ioaddr + ATA_CYL_LSB) == ATAPI_MAGIC_LSB &&
inb(scp->ioaddr + ATA_CYL_MSB) == ATAPI_MAGIC_MSB) {
scp->devices |= ATA_ATAPI_SLAVE;
}
if (status0 != 0x00 && !(scp->devices & ATA_ATAPI_MASTER)) {
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
outb(scp->ioaddr + ATA_DRIVE, (ATA_D_IBM | ATA_MASTER));
DELAY(1);
outb(scp->ioaddr + ATA_ERROR, 0x58);
outb(scp->ioaddr + ATA_CYL_LSB, 0xa5);
if (inb(scp->ioaddr + ATA_ERROR) != 0x58 &&
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
inb(scp->ioaddr + ATA_CYL_LSB) == 0xa5) {
scp->devices |= ATA_ATA_MASTER;
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
}
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
}
if (status1 != 0x00 && !(scp->devices & ATA_ATAPI_SLAVE)) {
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
outb(scp->ioaddr + ATA_DRIVE, (ATA_D_IBM | ATA_SLAVE));
DELAY(1);
outb(scp->ioaddr + ATA_ERROR, 0x58);
outb(scp->ioaddr + ATA_CYL_LSB, 0xa5);
if (inb(scp->ioaddr + ATA_ERROR) != 0x58 &&
inb(scp->ioaddr + ATA_CYL_LSB) == 0xa5) {
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
scp->devices |= ATA_ATA_SLAVE;
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
}
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
}
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
if (bootverbose)
printf("ata%d: devices = 0x%x\n", scp->lun, scp->devices);
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
if (!scp->devices) {
free(scp, M_DEVBUF);
return 0;
}
TAILQ_INIT(&scp->ata_queue);
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
TAILQ_INIT(&scp->atapi_queue);
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
*unit = scp->lun;
scp->dev = dev;
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
atadevices[scp->lun] = scp;
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
#if NAPM > 0
scp->resume_hook.ah_fun = (void *)ata_reinit;
scp->resume_hook.ah_arg = scp;
scp->resume_hook.ah_name = "ATA driver";
scp->resume_hook.ah_order = APM_MID_ORDER;
apm_hook_establish(APM_HOOK_RESUME, &scp->resume_hook);
#endif
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
return ATA_IOSIZE;
}
static void
ataintr(void *data)
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
{
struct ata_softc *scp = (struct ata_softc *)data;
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
2000-01-03 20:01:18 +00:00
#if NPCI > 0
/* check if this interrupt is for us (shared PCI interrupts) */
switch (scp->chiptype) {
case 0x00041103: /* HighPoint HPT366 controller */
if (scp->active == ATA_IDLE)
return;
if (!(ata_dmastatus(scp) & ATA_BMSTAT_INTERRUPT))
return;
break;
case 0x4d33105a: /* Promise 33's */
case 0x4d38105a: /* Promise 66's */
if (!(inl((pci_read_config(scp->dev, 0x20, 4) & IOMASK) + 0x1c) &
((scp->unit) ? 0x00004000 : 0x00000400)))
return;
break;
default:
if ((scp->flags & ATA_DMA_ACTIVE) &&
!(ata_dmastatus(scp) & ATA_BMSTAT_INTERRUPT))
return;
}
2000-01-03 20:01:18 +00:00
#endif
if (((scp->status = inb(scp->ioaddr + ATA_STATUS))&ATA_S_BUSY)==ATA_S_BUSY)
return;
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
/* find & call the responsible driver to process this interrupt */
switch (scp->active) {
#if NATADISK > 0
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
case ATA_ACTIVE_ATA:
if (!scp->running)
return;
if (ad_interrupt(scp->running) == ATA_OP_CONTINUES)
return;
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
break;
#endif
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
#if NATAPICD > 0 || NATAPIFD > 0 || NATAPIST > 0
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
case ATA_ACTIVE_ATAPI:
if (!scp->running)
return;
if (atapi_interrupt(scp->running) == ATA_OP_CONTINUES)
return;
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
break;
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
#endif
case ATA_WAIT_INTR:
wakeup((caddr_t)scp);
break;
case ATA_WAIT_READY:
break;
case ATA_REINITING:
return;
default:
case ATA_IDLE:
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
#ifdef ATA_DEBUG
{
static int32_t intr_count = 0;
if (intr_count++ < 10)
printf("ata%d: unwanted interrupt %d status = %02x\n",
scp->lun, intr_count, scp->status);
}
#endif
/* return; SOS XXX */
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
}
scp->active = ATA_IDLE;
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
scp->running = NULL;
ata_start(scp);
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
}
void
ata_start(struct ata_softc *scp)
{
struct ad_request *ad_request;
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
struct atapi_request *atapi_request;
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
if (scp->active != ATA_IDLE)
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
return;
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
#if NATADISK > 0
/* find & call the responsible driver if anything on the ATA queue */
if ((ad_request = TAILQ_FIRST(&scp->ata_queue))) {
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
TAILQ_REMOVE(&scp->ata_queue, ad_request, chain);
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
scp->active = ATA_ACTIVE_ATA;
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
scp->running = ad_request;
ad_transfer(ad_request);
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
return;
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
}
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
#endif
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
#if NATAPICD > 0 || NATAPIFD > 0 || NATAPIST > 0
/*
* find & call the responsible driver if anything on the ATAPI queue.
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
* check for device busy by polling the DSC bit, if busy, check
* for requests to the other device on the channel (if any).
* if the other device is an ATA disk it already had its chance above.
* if no request can be served, timeout a call to ata_start.
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
*/
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
if ((atapi_request = TAILQ_FIRST(&scp->atapi_queue))) {
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
struct atapi_softc *atp = atapi_request->device;
static int32_t interval = 1;
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
if (atp->flags & ATAPI_F_DSC_USED) {
outb(atp->controller->ioaddr + ATA_DRIVE, ATA_D_IBM | atp->unit);
DELAY(1);
if (!(inb(atp->controller->ioaddr + ATA_STATUS) & ATA_S_DSC)) {
while ((atapi_request = TAILQ_NEXT(atapi_request, chain))) {
if (atapi_request->device->unit != atp->unit) {
struct atapi_softc *tmp = atapi_request->device;
outb(tmp->controller->ioaddr + ATA_DRIVE,
ATA_D_IBM | tmp->unit);
DELAY(1);
if (!inb(tmp->controller->ioaddr+ATA_STATUS)&ATA_S_DSC)
atapi_request = NULL;
break;
}
}
}
if (!atapi_request) {
timeout((timeout_t *)ata_start, atp->controller, interval++);
return;
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
}
else
interval = 1;
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
}
TAILQ_REMOVE(&scp->atapi_queue, atapi_request, chain);
scp->active = ATA_ACTIVE_ATAPI;
scp->running = atapi_request;
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
atapi_transfer(atapi_request);
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
return;
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
}
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
#endif
}
void
ata_reset(struct ata_softc *scp, int32_t *mask)
{
int32_t timeout;
int8_t status0, status1;
/* reset channel */
outb(scp->ioaddr + ATA_DRIVE, ATA_D_IBM | ATA_MASTER);
DELAY(1);
inb(scp->ioaddr + ATA_STATUS);
outb(scp->altioaddr, ATA_A_IDS | ATA_A_RESET);
DELAY(10000);
outb(scp->altioaddr, ATA_A_IDS);
DELAY(10000);
inb(scp->ioaddr + ATA_ERROR);
DELAY(3000);
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
/* wait for BUSY to go inactive */
for (timeout = 0; timeout < 310000; timeout++) {
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
outb(scp->ioaddr + ATA_DRIVE, ATA_D_IBM | ATA_MASTER);
DELAY(1);
status0 = inb(scp->ioaddr + ATA_STATUS);
outb(scp->ioaddr + ATA_DRIVE, ATA_D_IBM | ATA_SLAVE);
DELAY(1);
status1 = inb(scp->ioaddr + ATA_STATUS);
if (*mask == 0x01) /* wait for master only */
if (!(status0 & ATA_S_BUSY))
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
break;
if (*mask == 0x02) /* wait for slave only */
if (!(status1 & ATA_S_BUSY))
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
break;
if (*mask == 0x03) /* wait for both master & slave */
if (!(status0 & ATA_S_BUSY) && !(status1 & ATA_S_BUSY))
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
break;
DELAY(100);
}
DELAY(1);
outb(scp->altioaddr, ATA_A_4BIT);
if (status0 & ATA_S_BUSY)
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
*mask &= ~0x01;
if (status1 & ATA_S_BUSY)
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
*mask &= ~0x02;
if (bootverbose)
printf("ata%d: mask=%02x status0=%02x status1=%02x\n",
scp->lun, *mask, status0, status1);
}
int32_t
ata_reinit(struct ata_softc *scp)
{
int32_t mask = 0, omask;
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
scp->active = ATA_REINITING;
scp->running = NULL;
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
printf("ata%d: resetting devices .. ", scp->lun);
if (scp->devices & (ATA_ATA_MASTER | ATA_ATAPI_MASTER))
mask |= 0x01;
if (scp->devices & (ATA_ATA_SLAVE | ATA_ATAPI_SLAVE))
mask |= 0x02;
omask = mask;
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
ata_reset(scp, &mask);
if (omask != mask)
printf(" device dissapeared! %d ", omask & ~mask);
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
#if NATADISK > 0
if (scp->devices & (ATA_ATA_MASTER) && scp->dev_softc[0])
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
ad_reinit((struct ad_softc *)scp->dev_softc[0]);
if (scp->devices & (ATA_ATA_SLAVE) && scp->dev_softc[1])
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
ad_reinit((struct ad_softc *)scp->dev_softc[1]);
#endif
#if NATAPICD > 0 || NATAPIFD > 0 || NATAPIST > 0
if (scp->devices & (ATA_ATAPI_MASTER) && scp->dev_softc[0])
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
atapi_reinit((struct atapi_softc *)scp->dev_softc[0]);
if (scp->devices & (ATA_ATAPI_SLAVE) && scp->dev_softc[1])
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
atapi_reinit((struct atapi_softc *)scp->dev_softc[1]);
#endif
printf("done\n");
scp->active = ATA_IDLE;
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
ata_start(scp);
return 0;
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
}
int32_t
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
ata_wait(struct ata_softc *scp, int32_t device, u_int8_t mask)
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
{
u_int32_t timeout = 0;
DELAY(1);
while (timeout < 5000000) { /* timeout 5 secs */
scp->status = inb(scp->ioaddr + ATA_STATUS);
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
/* if drive fails status, reselect the drive just to be sure */
if (scp->status == 0xff) {
printf("ata%d-%s: no status, reselecting device\n",
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
scp->lun, device?"slave":"master");
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
outb(scp->ioaddr + ATA_DRIVE, ATA_D_IBM | device);
DELAY(1);
scp->status = inb(scp->ioaddr + ATA_STATUS);
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
}
/* are we done ? */
if (!(scp->status & ATA_S_BUSY))
break;
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
if (timeout > 1000) {
timeout += 1000;
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
DELAY(1000);
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
}
else {
timeout += 10;
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
DELAY(10);
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
}
}
if (scp->status & ATA_S_ERROR)
scp->error = inb(scp->ioaddr + ATA_ERROR);
if (timeout >= 5000000)
return -1;
if (!mask)
return (scp->status & ATA_S_ERROR);
/* Wait 50 msec for bits wanted. */
timeout = 5000;
while (timeout--) {
scp->status = inb(scp->ioaddr + ATA_STATUS);
if ((scp->status & mask) == mask) {
if (scp->status & ATA_S_ERROR)
scp->error = inb(scp->ioaddr + ATA_ERROR);
return (scp->status & ATA_S_ERROR);
}
DELAY (10);
}
return -1;
}
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
int32_t
ata_command(struct ata_softc *scp, int32_t device, u_int32_t command,
u_int32_t cylinder, u_int32_t head, u_int32_t sector,
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
u_int32_t count, u_int32_t feature, int32_t flags)
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
{
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
#ifdef ATA_DEBUG
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
printf("ata%d: ata_command: addr=%04x, device=%02x, cmd=%02x, "
"c=%d, h=%d, s=%d, count=%d, flags=%02x\n",
scp->lun, scp->ioaddr, device, command,
cylinder, head, sector, count, flags);
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
#endif
/* ready to issue command ? */
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
if (ata_wait(scp, device, 0) < 0) {
printf("ata%d-%s: timeout waiting to give command=%02x s=%02x e=%02x\n",
scp->lun, device ? "slave" : "master", command,
scp->status, scp->error);
return -1;
}
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
outb(scp->ioaddr + ATA_FEATURE, feature);
outb(scp->ioaddr + ATA_CYL_LSB, cylinder);
outb(scp->ioaddr + ATA_CYL_MSB, cylinder >> 8);
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
outb(scp->ioaddr + ATA_DRIVE, ATA_D_IBM | device | head);
outb(scp->ioaddr + ATA_SECTOR, sector);
outb(scp->ioaddr + ATA_COUNT, count);
switch (flags) {
case ATA_WAIT_INTR:
if (scp->active != ATA_IDLE)
printf("WARNING: WAIT_INTR active=%s\n", active2str(scp->active));
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
scp->active = ATA_WAIT_INTR;
asleep((caddr_t)scp, PRIBIO, "atacmd", 500);
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
outb(scp->ioaddr + ATA_CMD, command);
if (await(PRIBIO, 500)) {
printf("ata_command: timeout waiting for interrupt\n");
scp->active = ATA_IDLE;
return -1;
}
break;
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
case ATA_WAIT_READY:
if (scp->active != ATA_IDLE && scp->active != ATA_REINITING)
printf("WARNING: WAIT_READY active=%s\n", active2str(scp->active));
scp->active = ATA_WAIT_READY;
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
outb(scp->ioaddr + ATA_CMD, command);
if (ata_wait(scp, device, ATA_S_READY) < 0) {
printf("ata%d-%s: timeout waiting for command=%02x s=%02x e=%02x\n",
scp->lun, device ? "slave" : "master", command,
scp->status, scp->error);
scp->active = ATA_IDLE;
return -1;
}
scp->active = ATA_IDLE;
break;
case ATA_IMMEDIATE:
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
outb(scp->ioaddr + ATA_CMD, command);
break;
default:
printf("DANGER: illegal interrupt flag=%s\n", active2str(flags));
}
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
return 0;
}
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
int8_t *
ata_mode2str(int32_t mode)
{
switch (mode) {
case ATA_PIO0: return "PIO0";
case ATA_PIO1: return "PIO1";
case ATA_PIO2: return "PIO2";
case ATA_PIO3: return "PIO3";
case ATA_PIO4: return "PIO4";
case ATA_WDMA2: return "WDMA2";
case ATA_UDMA2: return "UDMA33";
case ATA_UDMA4: return "UDMA66";
default: return "???";
}
}
int8_t
ata_pio2mode(int32_t pio)
{
switch (pio) {
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
default:
case 0: return ATA_PIO0;
case 1: return ATA_PIO1;
case 2: return ATA_PIO2;
case 3: return ATA_PIO3;
case 4: return ATA_PIO4;
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
}
}
static int8_t *
active2str(int32_t active)
{
static char buf[8];
switch (active) {
case ATA_IDLE:
return("ATA_IDLE");
case ATA_WAIT_INTR:
return("ATA_WAIT_INTR");
case ATA_ACTIVE_ATA:
return("ATA_ACTIVE_ATA");
case ATA_ACTIVE_ATAPI:
return("ATA_ACTIVE_ATAPI");
case ATA_REINITING:
return("ATA_REINITING");
default:
sprintf(buf, "0x%02x", active);
return buf;
}
}
void
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
bswap(int8_t *buf, int32_t len)
{
u_int16_t *p = (u_int16_t*)(buf + len);
while (--p >= (u_int16_t*)buf)
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
*p = ntohs(*p);
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
}
void
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
btrim(int8_t *buf, int32_t len)
{
int8_t *p;
for (p = buf; p < buf+len; ++p)
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
if (!*p)
*p = ' ';
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
for (p = buf + len - 1; p >= buf && *p == ' '; --p)
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
*p = 0;
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
}
void
bpack(int8_t *src, int8_t *dst, int32_t len)
{
int32_t i, j, blank;
for (i = j = blank = 0 ; i < len-1; i++) {
if (blank && src[i] == ' ') continue;
if (blank && src[i] != ' ') {
dst[j++] = src[i];
blank = 0;
continue;
}
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
if (src[i] == ' ') {
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
blank = 1;
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
if (i == 0)
continue;
}
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
dst[j++] = src[i];
}
dst[j] = 0x00;
}