diff options
| author | Martin Dalecki <dalecki@evision-ventures.com> | 2002-05-05 20:54:03 -0700 |
|---|---|---|
| committer | Jens Axboe <axboe@suse.de> | 2002-05-05 20:54:03 -0700 |
| commit | fb0bbfdafe47104437b7e3c238f2d5d7e2b596dc (patch) | |
| tree | bceb40657ac84c45b6a50d71bcf0c484cb6fa4b4 /drivers/ide | |
| parent | 45bfe840f66e37f585eb173bb6a52cc296b0dd01 (diff) | |
[PATCH] 2.5.14 IDE 55
- Update HPT374 driver carried over from 2.4.xx series by Andrew Morton.
Resync it with the recent host chip driver changes, or better the
introduction of an API at all.
- Consolidate the handling of device ID byte order in one place.
This was spotted and patched by Bartomiej onierkiewicz.
- Eliminate CONFIG_BLK_DEV_IDEPCI - it's duplicating the functionality of the
already present and fine CONFIG_PCI flag and if we are a PCI host, we are
indeed very likely to need host chip support anyway.
- Remove some redundant info about the model and channel number from
/proc/ide. Remove the binary entries not helpful to the user, and not used
by any program and redundant to corresponding ioctls.
- Properly return udma_read and udma_write values in taskfile.
- Only initialize XXX_udma to the default handlers if it has not been
initialized by the host chip initialization.
I have enabled spin lock debugging and can see that on device
flush the spin locks get wrong counts... no problems elsewher ethus
far. I will re check them next time around.
Diffstat (limited to 'drivers/ide')
| -rw-r--r-- | drivers/ide/Config.help | 5 | ||||
| -rw-r--r-- | drivers/ide/Config.in | 96 | ||||
| -rw-r--r-- | drivers/ide/Makefile | 2 | ||||
| -rw-r--r-- | drivers/ide/hpt366.c | 469 | ||||
| -rw-r--r-- | drivers/ide/ide-disk.c | 108 | ||||
| -rw-r--r-- | drivers/ide/ide-dma.c | 3 | ||||
| -rw-r--r-- | drivers/ide/ide-features.c | 100 | ||||
| -rw-r--r-- | drivers/ide/ide-floppy.c | 21 | ||||
| -rw-r--r-- | drivers/ide/ide-pci.c | 57 | ||||
| -rw-r--r-- | drivers/ide/ide-probe.c | 2 | ||||
| -rw-r--r-- | drivers/ide/ide-proc.c | 159 | ||||
| -rw-r--r-- | drivers/ide/ide-tape.c | 6 | ||||
| -rw-r--r-- | drivers/ide/ide-taskfile.c | 4 | ||||
| -rw-r--r-- | drivers/ide/ide.c | 16 | ||||
| -rw-r--r-- | drivers/ide/rz1000.c | 6 |
15 files changed, 611 insertions, 443 deletions
diff --git a/drivers/ide/Config.help b/drivers/ide/Config.help index 3256deb948ba..411cb6ac097e 100644 --- a/drivers/ide/Config.help +++ b/drivers/ide/Config.help @@ -216,11 +216,6 @@ CONFIG_BLK_DEV_RZ1000 Linux. This may slow disk throughput by a few percent, but at least things will operate 100% reliably. -CONFIG_BLK_DEV_IDEPCI - Say Y here for PCI systems which use IDE drive(s). - This option helps the IDE driver to automatically detect and - configure all PCI-based IDE interfaces in your system. - CONFIG_IDEPCI_SHARE_IRQ Some ATA/IDE chipsets have hardware support which allows for sharing a single IRQ with other cards. To enable support for diff --git a/drivers/ide/Config.in b/drivers/ide/Config.in index 261bde462542..affceb308340 100644 --- a/drivers/ide/Config.in +++ b/drivers/ide/Config.in @@ -33,58 +33,55 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then dep_tristate ' Include IDE/ATAPI FLOPPY support' CONFIG_BLK_DEV_IDEFLOPPY $CONFIG_BLK_DEV_IDE dep_tristate ' SCSI emulation support' CONFIG_BLK_DEV_IDESCSI $CONFIG_BLK_DEV_IDE $CONFIG_SCSI - comment 'ATA host chipset support' - dep_bool ' CMD640 chipset bugfix/support' CONFIG_BLK_DEV_CMD640 $CONFIG_X86 + comment 'ATA host chip set support' + dep_bool ' CMD640 chip set bugfix/support' CONFIG_BLK_DEV_CMD640 $CONFIG_X86 dep_bool ' CMD640 enhanced support' CONFIG_BLK_DEV_CMD640_ENHANCED $CONFIG_BLK_DEV_CMD640 dep_bool ' ISA-PNP support' CONFIG_BLK_DEV_ISAPNP $CONFIG_ISAPNP if [ "$CONFIG_PCI" = "y" ]; then - dep_bool ' RZ1000 chipset bugfix/support' CONFIG_BLK_DEV_RZ1000 $CONFIG_X86 - bool ' PCI host chipset support' CONFIG_BLK_DEV_IDEPCI - if [ "$CONFIG_BLK_DEV_IDEPCI" = "y" ]; then - bool ' Boot off-board chipsets first support' CONFIG_BLK_DEV_OFFBOARD - bool ' Sharing PCI ATA interrupts support' CONFIG_IDEPCI_SHARE_IRQ - bool ' Generic PCI bus-master DMA support' CONFIG_BLK_DEV_IDEDMA_PCI - dep_bool ' Use PCI DMA by default when available' CONFIG_IDEDMA_PCI_AUTO $CONFIG_BLK_DEV_IDEDMA_PCI - dep_bool ' Enable DMA only for disks ' CONFIG_IDEDMA_ONLYDISK $CONFIG_IDEDMA_PCI_AUTO - define_bool CONFIG_BLK_DEV_IDEDMA $CONFIG_BLK_DEV_IDEDMA_PCI - dep_bool ' ATA tagged command queueing (EXPERIMENTAL)' CONFIG_BLK_DEV_IDE_TCQ $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_EXPERIMENTAL - dep_bool ' TCQ on by default' CONFIG_BLK_DEV_IDE_TCQ_DEFAULT $CONFIG_BLK_DEV_IDE_TCQ - if [ "$CONFIG_BLK_DEV_IDE_TCQ" != "n" ]; then - int ' Default queue depth' CONFIG_BLK_DEV_IDE_TCQ_DEPTH 32 - fi - dep_bool ' Good-Bad DMA Model-Firmware (EXPERIMENTAL)' CONFIG_IDEDMA_NEW_DRIVE_LISTINGS $CONFIG_EXPERIMENTAL - dep_bool ' AEC62XX chipset support' CONFIG_BLK_DEV_AEC62XX $CONFIG_BLK_DEV_IDEDMA_PCI - dep_mbool ' AEC62XX Tuning support' CONFIG_AEC62XX_TUNING $CONFIG_BLK_DEV_AEC62XX - dep_bool ' ALI M15x3 chipset support' CONFIG_BLK_DEV_ALI15X3 $CONFIG_BLK_DEV_IDEDMA_PCI - dep_mbool ' ALI M15x3 WDC support (DANGEROUS)' CONFIG_WDC_ALI15X3 $CONFIG_BLK_DEV_ALI15X3 $CONFIG_EXPERIMENTAL - dep_bool ' AMD and nVidia chipset support' CONFIG_BLK_DEV_AMD74XX $CONFIG_BLK_DEV_IDEDMA_PCI - dep_bool ' CMD64X chipset support' CONFIG_BLK_DEV_CMD64X $CONFIG_BLK_DEV_IDEDMA_PCI - dep_bool ' CY82C693 chipset support' CONFIG_BLK_DEV_CY82C693 $CONFIG_BLK_DEV_IDEDMA_PCI - dep_bool ' Cyrix CS5530 MediaGX chipset support' CONFIG_BLK_DEV_CS5530 $CONFIG_BLK_DEV_IDEDMA_PCI - dep_bool ' HPT34X chipset support' CONFIG_BLK_DEV_HPT34X $CONFIG_BLK_DEV_IDEDMA_PCI - dep_mbool ' HPT34X AUTODMA support (EXPERMENTAL)' CONFIG_HPT34X_AUTODMA $CONFIG_BLK_DEV_HPT34X $CONFIG_EXPERIMENTAL - dep_bool ' HPT366 chipset support' CONFIG_BLK_DEV_HPT366 $CONFIG_BLK_DEV_IDEDMA_PCI - dep_bool ' Intel and Efar (SMsC) chipset support' CONFIG_BLK_DEV_PIIX $CONFIG_BLK_DEV_IDEDMA_PCI - if [ "$CONFIG_BLK_DEV_PIIX" = "y" ]; then - dep_bool ' Use UDMA133 even on ICH2, ICH3 and CICH chips (EXPERIMENTAL)' CONFIG_BLK_DEV_PIIX_TRY133 $CONFIG_EXPERIMENTAL - fi - if [ "$CONFIG_MIPS_ITE8172" = "y" -o "$CONFIG_MIPS_IVR" = "y" ]; then - dep_mbool ' IT8172 IDE support' CONFIG_BLK_DEV_IT8172 $CONFIG_BLK_DEV_IDEDMA_PCI - dep_mbool ' IT8172 IDE Tuning support' CONFIG_IT8172_TUNING $CONFIG_BLK_DEV_IT8172 $CONFIG_IDEDMA_PCI_AUTO - fi - dep_bool ' NS87415 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_NS87415 $CONFIG_BLK_DEV_IDEDMA_PCI - dep_bool ' OPTi 82C621 chipset enhanced support (EXPERIMENTAL)' CONFIG_BLK_DEV_OPTI621 $CONFIG_EXPERIMENTAL - dep_mbool ' Pacific Digital A-DMA support (EXPERIMENTAL)' CONFIG_BLK_DEV_PDC_ADMA $CONFIG_EXPERIMENTAL - dep_bool ' PROMISE PDC202{46|62|65|67|68|69|70} support' CONFIG_BLK_DEV_PDC202XX $CONFIG_BLK_DEV_IDEDMA_PCI - dep_bool ' Special UDMA Feature' CONFIG_PDC202XX_BURST $CONFIG_BLK_DEV_PDC202XX - dep_bool ' Special FastTrak Feature' CONFIG_PDC202XX_FORCE $CONFIG_BLK_DEV_PDC202XX - dep_bool ' ServerWorks OSB4/CSB5 chipsets support' CONFIG_BLK_DEV_SVWKS $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_X86 - dep_bool ' SiS5513 chipset support' CONFIG_BLK_DEV_SIS5513 $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_X86 - dep_bool ' Tekram TRM290 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_TRM290 $CONFIG_BLK_DEV_IDEDMA_PCI - dep_bool ' VIA chipset support' CONFIG_BLK_DEV_VIA82CXXX $CONFIG_BLK_DEV_IDEDMA_PCI - dep_bool ' Winbond SL82c105 support' CONFIG_BLK_DEV_SL82C105 $CONFIG_BLK_DEV_IDEDMA_PCI + dep_bool ' RZ1000 chip set bugfix/support' CONFIG_BLK_DEV_RZ1000 $CONFIG_X86 + comment ' PCI host chip set support' + dep_bool ' Boot off-board chip sets first support' CONFIG_BLK_DEV_OFFBOARD $CONFIG_PCI + dep_bool ' Sharing PCI ATA interrupts support' CONFIG_IDEPCI_SHARE_IRQ $CONFIG_PCI + dep_bool ' Generic PCI bus-master DMA support' CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_PCI + dep_bool ' Use PCI DMA by default when available' CONFIG_IDEDMA_PCI_AUTO $CONFIG_BLK_DEV_IDEDMA_PCI + dep_bool ' Enable DMA only for disks ' CONFIG_IDEDMA_ONLYDISK $CONFIG_IDEDMA_PCI_AUTO + define_bool CONFIG_BLK_DEV_IDEDMA $CONFIG_BLK_DEV_IDEDMA_PCI + dep_bool ' ATA tagged command queueing (EXPERIMENTAL)' CONFIG_BLK_DEV_IDE_TCQ $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_EXPERIMENTAL + dep_bool ' TCQ on by default' CONFIG_BLK_DEV_IDE_TCQ_DEFAULT $CONFIG_BLK_DEV_IDE_TCQ + if [ "$CONFIG_BLK_DEV_IDE_TCQ" != "n" ]; then + int ' Default queue depth' CONFIG_BLK_DEV_IDE_TCQ_DEPTH 32 fi - + dep_bool ' Good-Bad DMA Model-Firmware (EXPERIMENTAL)' CONFIG_IDEDMA_NEW_DRIVE_LISTINGS $CONFIG_EXPERIMENTAL + dep_bool ' AEC62XX chip set support' CONFIG_BLK_DEV_AEC62XX $CONFIG_BLK_DEV_IDEDMA_PCI + dep_mbool ' AEC62XX Tuning support' CONFIG_AEC62XX_TUNING $CONFIG_BLK_DEV_AEC62XX + dep_bool ' ALI M15x3 chipset support' CONFIG_BLK_DEV_ALI15X3 $CONFIG_BLK_DEV_IDEDMA_PCI + dep_mbool ' ALI M15x3 WDC support (DANGEROUS)' CONFIG_WDC_ALI15X3 $CONFIG_BLK_DEV_ALI15X3 $CONFIG_EXPERIMENTAL + dep_bool ' AMD and nVidia chipset support' CONFIG_BLK_DEV_AMD74XX $CONFIG_BLK_DEV_IDEDMA_PCI + dep_bool ' CMD64X chipset support' CONFIG_BLK_DEV_CMD64X $CONFIG_BLK_DEV_IDEDMA_PCI + dep_bool ' CY82C693 chipset support' CONFIG_BLK_DEV_CY82C693 $CONFIG_BLK_DEV_IDEDMA_PCI + dep_bool ' Cyrix CS5530 MediaGX chipset support' CONFIG_BLK_DEV_CS5530 $CONFIG_BLK_DEV_IDEDMA_PCI + dep_bool ' HPT34X chipset support' CONFIG_BLK_DEV_HPT34X $CONFIG_BLK_DEV_IDEDMA_PCI + dep_mbool ' HPT34X AUTODMA support (EXPERMENTAL)' CONFIG_HPT34X_AUTODMA $CONFIG_BLK_DEV_HPT34X $CONFIG_EXPERIMENTAL + dep_bool ' HPT366 chipset support' CONFIG_BLK_DEV_HPT366 $CONFIG_BLK_DEV_IDEDMA_PCI + dep_bool ' Intel and Efar (SMsC) chipset support' CONFIG_BLK_DEV_PIIX $CONFIG_BLK_DEV_IDEDMA_PCI + if [ "$CONFIG_BLK_DEV_PIIX" = "y" ]; then + dep_bool ' Use UDMA133 even on ICH2, ICH3 and CICH chips (EXPERIMENTAL)' CONFIG_BLK_DEV_PIIX_TRY133 $CONFIG_EXPERIMENTAL + fi + if [ "$CONFIG_MIPS_ITE8172" = "y" -o "$CONFIG_MIPS_IVR" = "y" ]; then + dep_mbool ' IT8172 IDE support' CONFIG_BLK_DEV_IT8172 $CONFIG_BLK_DEV_IDEDMA_PCI + dep_mbool ' IT8172 IDE Tuning support' CONFIG_IT8172_TUNING $CONFIG_BLK_DEV_IT8172 $CONFIG_IDEDMA_PCI_AUTO + fi + dep_bool ' NS87415 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_NS87415 $CONFIG_BLK_DEV_IDEDMA_PCI + dep_mbool ' OPTi 82C621 chipset enhanced support (EXPERIMENTAL)' CONFIG_BLK_DEV_OPTI621 $CONFIG_PCI $CONFIG_EXPERIMENTAL + dep_mbool ' Pacific Digital A-DMA support (EXPERIMENTAL)' CONFIG_BLK_DEV_PDC_ADMA $CONFIG_EXPERIMENTAL + dep_bool ' PROMISE PDC202{46|62|65|67|68|69|70} support' CONFIG_BLK_DEV_PDC202XX $CONFIG_BLK_DEV_IDEDMA_PCI + dep_bool ' Special UDMA Feature' CONFIG_PDC202XX_BURST $CONFIG_BLK_DEV_PDC202XX + dep_bool ' Special FastTrak Feature' CONFIG_PDC202XX_FORCE $CONFIG_BLK_DEV_PDC202XX + dep_bool ' ServerWorks OSB4/CSB5 chipsets support' CONFIG_BLK_DEV_SVWKS $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_X86 + dep_bool ' SiS5513 chipset support' CONFIG_BLK_DEV_SIS5513 $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_X86 + dep_bool ' Tekram TRM290 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_TRM290 $CONFIG_BLK_DEV_IDEDMA_PCI + dep_bool ' VIA chipset support' CONFIG_BLK_DEV_VIA82CXXX $CONFIG_BLK_DEV_IDEDMA_PCI + dep_bool ' Winbond SL82c105 support' CONFIG_BLK_DEV_SL82C105 $CONFIG_BLK_DEV_IDEDMA_PCI fi if [ "$CONFIG_ALL_PPC" = "y" ]; then bool ' Builtin PowerMac IDE support' CONFIG_BLK_DEV_IDE_PMAC @@ -93,9 +90,6 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then if [ "$CONFIG_BLK_DEV_IDE_PMAC" = "y" ]; then define_bool CONFIG_BLK_DEV_IDEDMA $CONFIG_BLK_DEV_IDEDMA_PMAC fi - if [ "$CONFIG_BLK_DEV_IDEDMA_PMAC" = "y" ]; then - define_bool CONFIG_BLK_DEV_IDEPCI $CONFIG_BLK_DEV_IDEDMA_PMAC - fi fi if [ "$CONFIG_ARCH_ACORN" = "y" ]; then dep_bool ' ICS IDE interface support' CONFIG_BLK_DEV_IDE_ICSIDE $CONFIG_ARCH_ACORN diff --git a/drivers/ide/Makefile b/drivers/ide/Makefile index b0835efa282a..69c1706fe1d0 100644 --- a/drivers/ide/Makefile +++ b/drivers/ide/Makefile @@ -45,7 +45,7 @@ ide-obj-$(CONFIG_BLK_DEV_HT6560B) += ht6560b.o ide-obj-$(CONFIG_BLK_DEV_IDE_ICSIDE) += icside.o ide-obj-$(CONFIG_BLK_DEV_IDEDMA_PCI) += ide-dma.o ide-obj-$(CONFIG_BLK_DEV_IDE_TCQ) += tcq.o -ide-obj-$(CONFIG_BLK_DEV_IDEPCI) += ide-pci.o +ide-obj-$(CONFIG_PCI) += ide-pci.o ide-obj-$(CONFIG_BLK_DEV_ISAPNP) += ide-pnp.o ide-obj-$(CONFIG_BLK_DEV_IDE_PMAC) += ide-pmac.o ide-obj-$(CONFIG_BLK_DEV_MAC_IDE) += macide.o diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c index 372c89a49f5c..f373a6928054 100644 --- a/drivers/ide/hpt366.c +++ b/drivers/ide/hpt366.c @@ -40,6 +40,8 @@ * Reset the hpt366 on error, reset on dma * Fix disabling Fast Interrupt hpt366. * Mike Waychison <crlf@sun.com> + * + * 02 May 2002 - HPT374 support (Andre Hedrick <andre@linux-ide.org>) */ #include <linux/config.h> @@ -164,9 +166,8 @@ struct chipset_bus_clock_list_entry { * PIO. * 31 FIFO enable. */ -struct chipset_bus_clock_list_entry forty_base [] = { - - { XFER_UDMA_4, 0x900fd943 }, +struct chipset_bus_clock_list_entry forty_base_hpt366[] = { + { XFER_UDMA_4, 0x900fd943 }, { XFER_UDMA_3, 0x900ad943 }, { XFER_UDMA_2, 0x900bd943 }, { XFER_UDMA_1, 0x9008d943 }, @@ -184,8 +185,7 @@ struct chipset_bus_clock_list_entry forty_base [] = { { 0, 0x0120d9d9 } }; -struct chipset_bus_clock_list_entry thirty_three_base [] = { - +struct chipset_bus_clock_list_entry thirty_three_base_hpt366[] = { { XFER_UDMA_4, 0x90c9a731 }, { XFER_UDMA_3, 0x90cfa731 }, { XFER_UDMA_2, 0x90caa731 }, @@ -204,7 +204,7 @@ struct chipset_bus_clock_list_entry thirty_three_base [] = { { 0, 0x0120a7a7 } }; -struct chipset_bus_clock_list_entry twenty_five_base [] = { +struct chipset_bus_clock_list_entry twenty_five_base_hpt366[] = { { XFER_UDMA_4, 0x90c98521 }, { XFER_UDMA_3, 0x90cf8521 }, @@ -329,6 +329,144 @@ struct chipset_bus_clock_list_entry fifty_base_hpt370[] = { { 0, 0x0ac1f48a } }; +struct chipset_bus_clock_list_entry thirty_three_base_hpt372[] = { + { XFER_UDMA_6, 0x1c81dc62 }, + { XFER_UDMA_5, 0x1c6ddc62 }, + { XFER_UDMA_4, 0x1c8ddc62 }, + { XFER_UDMA_3, 0x1c8edc62 }, /* checkme */ + { XFER_UDMA_2, 0x1c91dc62 }, + { XFER_UDMA_1, 0x1c9adc62 }, /* checkme */ + { XFER_UDMA_0, 0x1c82dc62 }, /* checkme */ + + { XFER_MW_DMA_2, 0x2c829262 }, + { XFER_MW_DMA_1, 0x2c829266 }, /* checkme */ + { XFER_MW_DMA_0, 0x2c82922e }, /* checkme */ + + { XFER_PIO_4, 0x0c829c62 }, + { XFER_PIO_3, 0x0c829c84 }, + { XFER_PIO_2, 0x0c829ca6 }, + { XFER_PIO_1, 0x0d029d26 }, + { XFER_PIO_0, 0x0d029d5e }, + { 0, 0x0d029d5e } +}; + +struct chipset_bus_clock_list_entry fifty_base_hpt372[] = { + { XFER_UDMA_5, 0x12848242 }, + { XFER_UDMA_4, 0x12ac8242 }, + { XFER_UDMA_3, 0x128c8242 }, + { XFER_UDMA_2, 0x120c8242 }, + { XFER_UDMA_1, 0x12148254 }, + { XFER_UDMA_0, 0x121882ea }, + + { XFER_MW_DMA_2, 0x22808242 }, + { XFER_MW_DMA_1, 0x22808254 }, + { XFER_MW_DMA_0, 0x228082ea }, + + { XFER_PIO_4, 0x0a81f442 }, + { XFER_PIO_3, 0x0a81f443 }, + { XFER_PIO_2, 0x0a81f454 }, + { XFER_PIO_1, 0x0ac1f465 }, + { XFER_PIO_0, 0x0ac1f48a }, + { 0, 0x0a81f443 } +}; + +struct chipset_bus_clock_list_entry sixty_six_base_hpt372[] = { + { XFER_UDMA_6, 0x1c869c62 }, + { XFER_UDMA_5, 0x1cae9c62 }, + { XFER_UDMA_4, 0x1c8a9c62 }, + { XFER_UDMA_3, 0x1c8e9c62 }, + { XFER_UDMA_2, 0x1c929c62 }, + { XFER_UDMA_1, 0x1c9a9c62 }, + { XFER_UDMA_0, 0x1c829c62 }, + + { XFER_MW_DMA_2, 0x2c829c62 }, + { XFER_MW_DMA_1, 0x2c829c66 }, + { XFER_MW_DMA_0, 0x2c829d2e }, + + { XFER_PIO_4, 0x0c829c62 }, + { XFER_PIO_3, 0x0c829c84 }, + { XFER_PIO_2, 0x0c829ca6 }, + { XFER_PIO_1, 0x0d029d26 }, + { XFER_PIO_0, 0x0d029d5e }, + { 0, 0x0d029d26 } +}; + +struct chipset_bus_clock_list_entry thirty_three_base_hpt374[] = { + { XFER_UDMA_6, 0x12808242 }, + { XFER_UDMA_5, 0x12848242 }, + { XFER_UDMA_4, 0x12ac8242 }, + { XFER_UDMA_3, 0x128c8242 }, + { XFER_UDMA_2, 0x120c8242 }, + { XFER_UDMA_1, 0x12148254 }, + { XFER_UDMA_0, 0x121882ea }, + + { XFER_MW_DMA_2, 0x22808242 }, + { XFER_MW_DMA_1, 0x22808254 }, + { XFER_MW_DMA_0, 0x228082ea }, + + { XFER_PIO_4, 0x0a81f442 }, + { XFER_PIO_3, 0x0a81f443 }, + { XFER_PIO_2, 0x0a81f454 }, + { XFER_PIO_1, 0x0ac1f465 }, + { XFER_PIO_0, 0x0ac1f48a }, + { 0, 0x06814e93 } +}; + +#if 0 +struct chipset_bus_clock_list_entry fifty_base_hpt374[] = { + { XFER_UDMA_6, }, + { XFER_UDMA_5, }, + { XFER_UDMA_4, }, + { XFER_UDMA_3, }, + { XFER_UDMA_2, }, + { XFER_UDMA_1, }, + { XFER_UDMA_0, }, + { XFER_MW_DMA_2, }, + { XFER_MW_DMA_1, }, + { XFER_MW_DMA_0, }, + { XFER_PIO_4, }, + { XFER_PIO_3, }, + { XFER_PIO_2, }, + { XFER_PIO_1, }, + { XFER_PIO_0, }, + { 0, } +}; +#endif +#if 0 +struct chipset_bus_clock_list_entry sixty_six_base_hpt374[] = { + { XFER_UDMA_6, 0x12406231 }, /* checkme */ + { XFER_UDMA_5, 0x12446231 }, + 0x14846231 + { XFER_UDMA_4, 0x16814ea7 }, + 0x14886231 + { XFER_UDMA_3, 0x16814ea7 }, + 0x148c6231 + { XFER_UDMA_2, 0x16814ea7 }, + 0x148c6231 + { XFER_UDMA_1, 0x16814ea7 }, + 0x14906231 + { XFER_UDMA_0, 0x16814ea7 }, + 0x14986231 + { XFER_MW_DMA_2, 0x16814ea7 }, + 0x26514e21 + { XFER_MW_DMA_1, 0x16814ea7 }, + 0x26514e97 + { XFER_MW_DMA_0, 0x16814ea7 }, + 0x26514e97 + { XFER_PIO_4, 0x06814ea7 }, + 0x06514e21 + { XFER_PIO_3, 0x06814ea7 }, + 0x06514e22 + { XFER_PIO_2, 0x06814ea7 }, + 0x06514e33 + { XFER_PIO_1, 0x06814ea7 }, + 0x06914e43 + { XFER_PIO_0, 0x06814ea7 }, + 0x06914e57 + { 0, 0x06814ea7 } +}; +#endif + #define HPT366_DEBUG_DRIVE_INFO 0 #define HPT370_ALLOW_ATA100_5 1 #define HPT366_ALLOW_ATA66_4 1 @@ -345,6 +483,10 @@ static int n_hpt_devs; static unsigned int pci_rev_check_hpt3xx(struct pci_dev *dev); static unsigned int pci_rev2_check_hpt3xx(struct pci_dev *dev); +static unsigned int pci_rev3_check_hpt3xx(struct pci_dev *dev); +static unsigned int pci_rev5_check_hpt3xx(struct pci_dev *dev); +static unsigned int pci_rev7_check_hpt3xx(struct pci_dev *dev); + byte hpt366_proc = 0; extern char *ide_xfer_verbose (byte xfer_rate); @@ -355,11 +497,13 @@ extern int (*hpt366_display_info)(char *, char **, off_t, int); /* ide-proc.c */ static int hpt366_get_info (char *buffer, char **addr, off_t offset, int count) { char *p = buffer; - char *chipset_nums[] = {"366", "366", "368", "370", "370A"}; + char *chipset_nums[] = {"366", "366", "368", + "370", "370A", "372", + "??", "374" }; int i; p += sprintf(p, "\n " - "HighPoint HPT366/368/370\n"); + "HighPoint HPT366/368/370/372/374\n"); for (i = 0; i < n_hpt_devs; i++) { struct pci_dev *dev = hpt_devs[i]; unsigned short iobase = dev->resource[4].start; @@ -384,7 +528,7 @@ static int hpt366_get_info (char *buffer, char **addr, off_t offset, int count) (c0 & 0x80) ? "no" : "yes", (c1 & 0x80) ? "no" : "yes"); - if (pci_rev_check_hpt3xx(dev)) { + if (pci_rev3_check_hpt3xx(dev)) { u8 cbl; cbl = inb_p(iobase + 0x7b); outb_p(cbl | 1, iobase + 0x7b); @@ -433,6 +577,10 @@ static int hpt366_get_info (char *buffer, char **addr, off_t offset, int count) } #endif /* defined(DISPLAY_HPT366_TIMINGS) && defined(CONFIG_PROC_FS) */ +/* + * fixme: it really needs to be a switch. + */ + static unsigned int pci_rev_check_hpt3xx (struct pci_dev *dev) { unsigned int class_rev; @@ -449,6 +597,30 @@ static unsigned int pci_rev2_check_hpt3xx (struct pci_dev *dev) return ((int) (class_rev > 0x01) ? 1 : 0); } +static unsigned int pci_rev3_check_hpt3xx (struct pci_dev *dev) +{ + unsigned int class_rev; + pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); + class_rev &= 0xff; + return ((int) (class_rev > 0x02) ? 1 : 0); +} + +static unsigned int pci_rev5_check_hpt3xx (struct pci_dev *dev) +{ + unsigned int class_rev; + pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); + class_rev &= 0xff; + return ((int) (class_rev > 0x04) ? 1 : 0); +} + +static unsigned int pci_rev7_check_hpt3xx (struct pci_dev *dev) +{ + unsigned int class_rev; + pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); + class_rev &= 0xff; + return ((int) (class_rev > 0x06) ? 1 : 0); +} + static int check_in_drive_lists (ide_drive_t *drive, const char **list) { struct hd_driveid *id = drive->id; @@ -480,6 +652,7 @@ static unsigned int pci_bus_clock_list (byte speed, struct chipset_bus_clock_lis static void hpt366_tune_chipset (ide_drive_t *drive, byte speed) { + struct pci_dev *dev = drive->channel->pci_dev; byte regtime = (drive->select.b.unit & 0x01) ? 0x44 : 0x40; byte regfast = (drive->channel->unit) ? 0x55 : 0x51; /* @@ -493,30 +666,13 @@ static void hpt366_tune_chipset (ide_drive_t *drive, byte speed) /* * Disable the "fast interrupt" prediction. */ - pci_read_config_byte(drive->channel->pci_dev, regfast, &drive_fast); + pci_read_config_byte(dev, regfast, &drive_fast); if (drive_fast & 0x02) - pci_write_config_byte(drive->channel->pci_dev, regfast, drive_fast & ~0x20); + pci_write_config_byte(dev, regfast, drive_fast & ~0x20); - pci_read_config_dword(drive->channel->pci_dev, regtime, ®1); - /* detect bus speed by looking at control reg timing: */ - switch((reg1 >> 8) & 7) { - case 5: - reg2 = pci_bus_clock_list(speed, forty_base); - break; - case 9: - reg2 = pci_bus_clock_list(speed, twenty_five_base); - break; - default: - case 7: - reg2 = pci_bus_clock_list(speed, thirty_three_base); - break; - } -#if 0 - /* this is a nice idea ... */ - list_conf = pci_bus_clock_list(speed, - (struct chipset_bus_clock_list_entry *) - dev->sysdata); -#endif + pci_read_config_dword(dev, regtime, ®1); + reg2 = pci_bus_clock_list(speed, + (struct chipset_bus_clock_list_entry *) dev->sysdata); /* * Disable on-chip PIO FIFO/buffer (to avoid problems handling I/O errors later) */ @@ -527,7 +683,12 @@ static void hpt366_tune_chipset (ide_drive_t *drive, byte speed) } reg2 &= ~0x80000000; - pci_write_config_dword(drive->channel->pci_dev, regtime, reg2); + pci_write_config_dword(dev, regtime, reg2); +} + +static void hpt368_tune_chipset (ide_drive_t *drive, byte speed) +{ + hpt366_tune_chipset(drive, speed); } static void hpt370_tune_chipset (ide_drive_t *drive, byte speed) @@ -573,6 +734,39 @@ static void hpt370_tune_chipset (ide_drive_t *drive, byte speed) pci_write_config_dword(dev, drive_pci, list_conf); } +static void hpt372_tune_chipset (ide_drive_t *drive, byte speed) +{ + byte regfast = (drive->channel->unit) ? 0x55 : 0x51; + unsigned int list_conf = 0; + unsigned int drive_conf = 0; + unsigned int conf_mask = (speed >= XFER_MW_DMA_0) ? 0xc0000000 : 0x30070000; + byte drive_pci = 0x40 + (drive->dn * 4); + byte drive_fast = 0; + struct pci_dev *dev = drive->channel->pci_dev; + + /* + * Disable the "fast interrupt" prediction. + * don't holdoff on interrupts. (== 0x01 despite what the docs say) + */ + pci_read_config_byte(dev, regfast, &drive_fast); + drive_fast &= ~0x07; + pci_write_config_byte(drive->channel->pci_dev, regfast, drive_fast); + + list_conf = pci_bus_clock_list(speed, + (struct chipset_bus_clock_list_entry *) + dev->sysdata); + pci_read_config_dword(dev, drive_pci, &drive_conf); + list_conf = (list_conf & ~conf_mask) | (drive_conf & conf_mask); + if (speed < XFER_MW_DMA_0) + list_conf &= ~0x80000000; /* Disable on-chip PIO FIFO/buffer */ + pci_write_config_dword(dev, drive_pci, list_conf); +} + +static void hpt374_tune_chipset (ide_drive_t *drive, byte speed) +{ + hpt372_tune_chipset(drive, speed); +} + static int hpt3xx_tune_chipset (ide_drive_t *drive, byte speed) { if ((drive->type != ATA_DISK) && (speed < XFER_SW_DMA_0)) @@ -581,9 +775,15 @@ static int hpt3xx_tune_chipset (ide_drive_t *drive, byte speed) if (!drive->init_speed) drive->init_speed = speed; - if (pci_rev_check_hpt3xx(drive->channel->pci_dev)) { + if (pci_rev7_check_hpt3xx(drive->channel->pci_dev)) { + hpt374_tune_chipset(drive, speed); + } else if (pci_rev5_check_hpt3xx(drive->channel->pci_dev)) { + hpt372_tune_chipset(drive, speed); + } else if (pci_rev3_check_hpt3xx(drive->channel->pci_dev)) { hpt370_tune_chipset(drive, speed); - } else { + } else if (pci_rev2_check_hpt3xx(drive->channel->pci_dev)) { + hpt368_tune_chipset(drive, speed); + } else { hpt366_tune_chipset(drive, speed); } drive->current_speed = speed; @@ -660,13 +860,21 @@ static int config_chipset_for_dma (ide_drive_t *drive) byte ultra66 = eighty_ninty_three(drive); int rval; + config_chipset_for_pio(drive); + drive->init_speed = 0; + if ((drive->type != ATA_DISK) && (speed < XFER_SW_DMA_0)) return 0; - if ((id->dma_ultra & 0x0020) && + if ((id->dma_ultra & 0x0040) && + (pci_rev5_check_hpt3xx(drive->channel->pci_dev)) && + (ultra66)) { + speed = XFER_UDMA_6; + } else if ((id->dma_ultra & 0x0020) && (!check_in_drive_lists(drive, bad_ata100_5)) && (HPT370_ALLOW_ATA100_5) && (pci_rev_check_hpt3xx(drive->channel->pci_dev)) && + (pci_rev3_check_hpt3xx(drive->channel->pci_dev)) && (ultra66)) { speed = XFER_UDMA_5; } else if ((id->dma_ultra & 0x0010) && @@ -699,7 +907,8 @@ static int config_chipset_for_dma (ide_drive_t *drive) (void) hpt3xx_tune_chipset(drive, speed); - rval = (int)( ((id->dma_ultra >> 11) & 7) ? 1 : + rval = (int)( ((id->dma_ultra >> 14) & 3) ? 1 : + ((id->dma_ultra >> 11) & 7) ? 1 : ((id->dma_ultra >> 8) & 7) ? 1 : ((id->dma_mword >> 8) & 7) ? 1 : 0); @@ -722,12 +931,14 @@ void hpt3xx_intrproc (ide_drive_t *drive) void hpt3xx_maskproc (ide_drive_t *drive, int mask) { + struct pci_dev *dev = drive->channel->pci_dev; + if (drive->quirk_list) { - if (pci_rev_check_hpt3xx(drive->channel->pci_dev)) { + if (pci_rev3_check_hpt3xx(dev)) { byte reg5a = 0; - pci_read_config_byte(drive->channel->pci_dev, 0x5a, ®5a); + pci_read_config_byte(dev, 0x5a, ®5a); if (((reg5a & 0x10) >> 4) != mask) - pci_write_config_byte(drive->channel->pci_dev, 0x5a, mask ? (reg5a | 0x10) : (reg5a & ~0x10)); + pci_write_config_byte(dev, 0x5a, mask ? (reg5a | 0x10) : (reg5a & ~0x10)); } else { if (mask) { disable_irq(drive->channel->irq); @@ -756,7 +967,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive) on = 0; verbose = 0; if (id->field_valid & 4) { - if (id->dma_ultra & 0x002F) { + if (id->dma_ultra & 0x007F) { /* Force if Capable UltraDMA */ on = config_chipset_for_dma(drive); if ((id->field_valid & 2) && @@ -897,11 +1108,38 @@ static int hpt370_udma_stop(struct ata_device *drive) return (dma_stat & 7) != 4 ? (0x10 | dma_stat) : 0; /* verify good DMA status */ } - static int hpt370_dmaproc(struct ata_device *drive) { return config_drive_xfer_rate(drive); } + +static int hpt374_udma_stop(struct ata_device *drive) +{ + struct ata_channel *ch = drive->channel; + struct pci_dev *dev = drive->channel->pci_dev; + unsigned long dma_base = ch->dma_base; + u8 mscreg = ch->unit ? 0x54 : 0x50; + u8 dma_stat; + u8 bwsr_mask = ch->unit ? 0x02 : 0x01; + u8 bwsr_stat, msc_stat; + pci_read_config_byte(dev, 0x6a, &bwsr_stat); + pci_read_config_byte(dev, mscreg, &msc_stat); + if ((bwsr_stat & bwsr_mask) == bwsr_mask) + pci_write_config_byte(dev, mscreg, msc_stat|0x30); + + drive->waiting_for_dma = 0; + outb(inb(dma_base)&~1, dma_base); /* stop DMA */ + dma_stat = inb(dma_base+2); /* get DMA status */ + outb(dma_stat|6, dma_base+2); /* clear the INTR & ERROR bits */ + udma_destroy_table(ch); /* purge DMA mappings */ + + return (dma_stat & 7) != 4 ? (0x10 | dma_stat) : 0; /* verify good DMA status */ +} + +static int hpt374_dmaproc(struct ata_device *drive) +{ + return config_drive_xfer_rate(drive); +} #endif /* @@ -1021,7 +1259,7 @@ static int hpt370_busproc(ide_drive_t * drive, int state) return 0; } -static void __init init_hpt370(struct pci_dev *dev) +static void __init init_hpt37x(struct pci_dev *dev) { int adjust, i; u16 freq; @@ -1042,18 +1280,44 @@ static void __init init_hpt370(struct pci_dev *dev) freq &= 0x1FF; if (freq < 0x9c) { pll = F_LOW_PCI_33; - dev->sysdata = (void *) thirty_three_base_hpt370; - printk("HPT370: using 33MHz PCI clock\n"); + if (pci_rev7_check_hpt3xx(dev)) { + dev->sysdata = (void *) thirty_three_base_hpt374; + } else if (pci_rev5_check_hpt3xx(dev)) { + dev->sysdata = (void *) thirty_three_base_hpt372; + } else if (dev->device == PCI_DEVICE_ID_TTI_HPT372) { + dev->sysdata = (void *) thirty_three_base_hpt372; + } else { + dev->sysdata = (void *) thirty_three_base_hpt370; + } + printk("HPT37X: using 33MHz PCI clock\n"); } else if (freq < 0xb0) { pll = F_LOW_PCI_40; } else if (freq < 0xc8) { pll = F_LOW_PCI_50; - dev->sysdata = (void *) fifty_base_hpt370; - printk("HPT370: using 50MHz PCI clock\n"); + if (pci_rev7_check_hpt3xx(dev)) { + // dev->sysdata = (void *) fifty_base_hpt374; + BUG(); + } else if (pci_rev5_check_hpt3xx(dev)) { + dev->sysdata = (void *) fifty_base_hpt372; + } else if (dev->device == PCI_DEVICE_ID_TTI_HPT372) { + dev->sysdata = (void *) fifty_base_hpt372; + } else { + dev->sysdata = (void *) fifty_base_hpt370; + } + printk("HPT37X: using 50MHz PCI clock\n"); } else { pll = F_LOW_PCI_66; - dev->sysdata = (void *) sixty_six_base_hpt370; - printk("HPT370: using 66MHz PCI clock\n"); + if (pci_rev7_check_hpt3xx(dev)) { + // dev->sysdata = (void *) sixty_six_base_hpt374; + BUG(); + } else if (pci_rev5_check_hpt3xx(dev)) { + dev->sysdata = (void *) sixty_six_base_hpt372; + } else if (dev->device == PCI_DEVICE_ID_TTI_HPT372) { + dev->sysdata = (void *) sixty_six_base_hpt372; + } else { + dev->sysdata = (void *) sixty_six_base_hpt370; + } + printk("HPT37X: using 66MHz PCI clock\n"); } /* @@ -1064,7 +1328,7 @@ static void __init init_hpt370(struct pci_dev *dev) * on PRST/SRST when the HPT state engine gets reset. */ if (dev->sysdata) - goto init_hpt370_done; + goto init_hpt37X_done; /* * adjust PLL based upon PCI clock, enable it, and wait for @@ -1091,9 +1355,18 @@ static void __init init_hpt370(struct pci_dev *dev) pci_write_config_dword(dev, 0x5c, pll & ~0x100); pci_write_config_byte(dev, 0x5b, 0x21); - dev->sysdata = (void *) fifty_base_hpt370; - printk("HPT370: using 50MHz internal PLL\n"); - goto init_hpt370_done; + if (pci_rev7_check_hpt3xx(dev)) { + // dev->sysdata = (void *) fifty_base_hpt374; + BUG(); + } else if (pci_rev5_check_hpt3xx(dev)) { + dev->sysdata = (void *) fifty_base_hpt372; + } else if (dev->device == PCI_DEVICE_ID_TTI_HPT372) { + dev->sysdata = (void *) fifty_base_hpt372; + } else { + dev->sysdata = (void *) fifty_base_hpt370; + } + printk("HPT37X: using 50MHz internal PLL\n"); + goto init_hpt37X_done; } } pll_recal: @@ -1103,13 +1376,41 @@ pll_recal: pll += (adjust >> 1); } -init_hpt370_done: +init_hpt37X_done: /* reset state engine */ pci_write_config_byte(dev, 0x50, 0x37); pci_write_config_byte(dev, 0x54, 0x37); udelay(100); } +static void __init init_hpt366 (struct pci_dev *dev) +{ + unsigned int reg1 = 0; + byte drive_fast = 0; + + /* + * Disable the "fast interrupt" prediction. + */ + pci_read_config_byte(dev, 0x51, &drive_fast); + if (drive_fast & 0x80) + pci_write_config_byte(dev, 0x51, drive_fast & ~0x80); + pci_read_config_dword(dev, 0x40, ®1); + + /* detect bus speed by looking at control reg timing: */ + switch((reg1 >> 8) & 7) { + case 5: + dev->sysdata = (void *) forty_base_hpt366; + break; + case 9: + dev->sysdata = (void *) twenty_five_base_hpt366; + break; + case 7: + default: + dev->sysdata = (void *) thirty_three_base_hpt366; + break; + } +} + unsigned int __init pci_init_hpt366(struct pci_dev *dev) { byte test = 0; @@ -1133,8 +1434,10 @@ unsigned int __init pci_init_hpt366(struct pci_dev *dev) if (test != 0x08) pci_write_config_byte(dev, PCI_MAX_LAT, 0x08); - if (pci_rev_check_hpt3xx(dev)) - init_hpt370(dev); + if (pci_rev3_check_hpt3xx(dev)) + init_hpt37x(dev); + else + init_hpt366(dev); if (n_hpt_devs < HPT366_MAX_DEVS) hpt_devs[n_hpt_devs++] = dev; @@ -1165,8 +1468,6 @@ unsigned int __init ata66_hpt366(struct ata_channel *hwif) void __init ide_init_hpt366(struct ata_channel *hwif) { - int hpt_rev; - hwif->tuneproc = &hpt3xx_tune_drive; hwif->speedproc = &hpt3xx_tune_chipset; hwif->quirkproc = &hpt3xx_quirkproc; @@ -1179,36 +1480,46 @@ void __init ide_init_hpt366(struct ata_channel *hwif) hwif->serialized = hwif->mate->serialized = 1; #endif - hpt_rev = pci_rev_check_hpt3xx(hwif->pci_dev); - if (hpt_rev) { - /* set up ioctl for power status. note: power affects both - * drives on each channel */ - hwif->busproc = &hpt370_busproc; - } - - if (pci_rev2_check_hpt3xx(hwif->pci_dev)) { - /* do nothing now but will split device types */ - hwif->resetproc = &hpt3xx_reset; -/* - * don't do until we can parse out the cobalt box argh ... - * hwif->busproc = &hpt3xx_tristate; - */ - } - #ifdef CONFIG_BLK_DEV_IDEDMA if (hwif->dma_base) { - if (hpt_rev) { + if (pci_rev3_check_hpt3xx(hwif->pci_dev)) { byte reg5ah = 0; pci_read_config_byte(hwif->pci_dev, 0x5a, ®5ah); if (reg5ah & 0x10) /* interrupt force enable */ pci_write_config_byte(hwif->pci_dev, 0x5a, reg5ah & ~0x10); - hwif->udma_start = hpt370_udma_start; - hwif->udma_stop = hpt370_udma_stop; - hwif->udma_timeout = hpt370_udma_timeout; - hwif->udma_irq_lost = hpt370_udma_irq_lost; - hwif->XXX_udma = hpt370_dmaproc; + /* + * set up ioctl for power status. + * note: power affects both + * drives on each channel + */ + hwif->resetproc = hpt3xx_reset; + hwif->busproc = hpt370_busproc; + + if (pci_rev7_check_hpt3xx(hwif->pci_dev)) { + hwif->udma_stop = hpt374_udma_stop; + hwif->XXX_udma = hpt374_dmaproc; + } else if (pci_rev5_check_hpt3xx(hwif->pci_dev)) { + hwif->udma_stop = hpt374_udma_stop; + hwif->XXX_udma = hpt374_dmaproc; + } else if (hwif->pci_dev->device == PCI_DEVICE_ID_TTI_HPT372) { + hwif->udma_stop = hpt374_udma_stop; + hwif->XXX_udma = hpt374_dmaproc; + } else if (pci_rev3_check_hpt3xx(hwif->pci_dev)) { + hwif->udma_start = hpt370_udma_start; + hwif->udma_stop = hpt370_udma_stop; + hwif->udma_timeout = hpt370_udma_timeout; + hwif->udma_irq_lost = hpt370_udma_irq_lost; + hwif->XXX_udma = hpt370_dmaproc; + } + } else if (pci_rev2_check_hpt3xx(hwif->pci_dev)) { + hwif->udma_irq_lost = hpt366_udma_irq_lost; +// hwif->resetproc = hpt3xx_reset; +// hwif->busproc = hpt3xx_tristate; + hwif->XXX_udma = hpt366_dmaproc; } else { hwif->udma_irq_lost = hpt366_udma_irq_lost; +// hwif->resetproc = hpt3xx_reset; +// hwif->busproc = hpt3xx_tristate; hwif->XXX_udma = hpt366_dmaproc; } if (!noautodma) diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index c2da3dc7f6a1..9903a107daf8 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -490,106 +490,6 @@ static void idedisk_pre_reset(struct ata_device *drive) #ifdef CONFIG_PROC_FS -static int smart_enable(struct ata_device *drive) -{ - struct ata_taskfile args; - - memset(&args, 0, sizeof(args)); - args.taskfile.feature = SMART_ENABLE; - args.taskfile.low_cylinder = SMART_LCYL_PASS; - args.taskfile.high_cylinder = SMART_HCYL_PASS; - args.taskfile.command = WIN_SMART; - ide_cmd_type_parser(&args); - - return ide_raw_taskfile(drive, &args, NULL); -} - -static int get_smart_values(struct ata_device *drive, u8 *buf) -{ - struct ata_taskfile args; - - memset(&args, 0, sizeof(args)); - args.taskfile.feature = SMART_READ_VALUES; - args.taskfile.sector_count = 0x01; - args.taskfile.low_cylinder = SMART_LCYL_PASS; - args.taskfile.high_cylinder = SMART_HCYL_PASS; - args.taskfile.command = WIN_SMART; - ide_cmd_type_parser(&args); - - smart_enable(drive); - - return ide_raw_taskfile(drive, &args, buf); -} - -static int get_smart_thresholds(struct ata_device *drive, u8 *buf) -{ - struct ata_taskfile args; - - memset(&args, 0, sizeof(args)); - args.taskfile.feature = SMART_READ_THRESHOLDS; - args.taskfile.sector_count = 0x01; - args.taskfile.low_cylinder = SMART_LCYL_PASS; - args.taskfile.high_cylinder = SMART_HCYL_PASS; - args.taskfile.command = WIN_SMART; - ide_cmd_type_parser(&args); - - smart_enable(drive); - - return ide_raw_taskfile(drive, &args, buf); -} - -static int proc_idedisk_read_cache - (char *page, char **start, off_t off, int count, int *eof, void *data) -{ - struct ata_device *drive = (struct ata_device *) data; - char *out = page; - int len; - - if (drive->id) - len = sprintf(out,"%i\n", drive->id->buf_size / 2); - else - len = sprintf(out,"(none)\n"); - PROC_IDE_READ_RETURN(page,start,off,count,eof,len); -} - -static int proc_idedisk_read_smart_thresholds - (char *page, char **start, off_t off, int count, int *eof, void *data) -{ - struct ata_device *drive = (struct ata_device *)data; - int len = 0, i = 0; - - if (!get_smart_thresholds(drive, page)) { - unsigned short *val = (unsigned short *) page; - char *out = ((char *)val) + (SECTOR_WORDS * 4); - page = out; - do { - out += sprintf(out, "%04x%c", le16_to_cpu(*val), (++i & 7) ? ' ' : '\n'); - val += 1; - } while (i < (SECTOR_WORDS * 2)); - len = out - page; - } - PROC_IDE_READ_RETURN(page,start,off,count,eof,len); -} - -static int proc_idedisk_read_smart_values - (char *page, char **start, off_t off, int count, int *eof, void *data) -{ - struct ata_device *drive = (struct ata_device *)data; - int len = 0, i = 0; - - if (!get_smart_values(drive, page)) { - unsigned short *val = (unsigned short *) page; - char *out = ((char *)val) + (SECTOR_WORDS * 4); - page = out; - do { - out += sprintf(out, "%04x%c", le16_to_cpu(*val), (++i & 7) ? ' ' : '\n'); - val += 1; - } while (i < (SECTOR_WORDS * 2)); - len = out - page; - } - PROC_IDE_READ_RETURN(page,start,off,count,eof,len); -} - #ifdef CONFIG_BLK_DEV_IDE_TCQ static int proc_idedisk_read_tcq (char *page, char **start, off_t off, int count, int *eof, void *data) @@ -638,10 +538,6 @@ static int proc_idedisk_read_tcq #endif static ide_proc_entry_t idedisk_proc[] = { - { "cache", S_IFREG|S_IRUGO, proc_idedisk_read_cache, NULL }, - { "geometry", S_IFREG|S_IRUGO, proc_ide_read_geometry, NULL }, - { "smart_values", S_IFREG|S_IRUSR, proc_idedisk_read_smart_values, NULL }, - { "smart_thresholds", S_IFREG|S_IRUSR, proc_idedisk_read_smart_thresholds, NULL }, #ifdef CONFIG_BLK_DEV_IDE_TCQ { "tcq", S_IFREG|S_IRUSR, proc_idedisk_read_tcq, NULL }, #endif @@ -650,9 +546,9 @@ static ide_proc_entry_t idedisk_proc[] = { #else -#define idedisk_proc NULL +# define idedisk_proc NULL -#endif /* CONFIG_PROC_FS */ +#endif /* * This is tightly woven into the driver->special can not touch. diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index c92eb798c346..9f507c7ddd70 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c @@ -489,7 +489,8 @@ void ide_setup_dma(struct ata_channel *ch, unsigned long dma_base, unsigned int goto dma_alloc_failure; } - ch->XXX_udma = XXX_ide_dmaproc; + if (!ch->XXX_udma) + ch->XXX_udma = XXX_ide_dmaproc; if (ch->chipset != ide_trm290) { u8 dma_stat = inb(dma_base+2); diff --git a/drivers/ide/ide-features.c b/drivers/ide/ide-features.c index 34a0fca9ba2f..801df7cc1b74 100644 --- a/drivers/ide/ide-features.c +++ b/drivers/ide/ide-features.c @@ -103,6 +103,105 @@ byte ide_auto_reduce_xfer (ide_drive_t *drive) } } +/* + * hd_driveid data come as little endian, + * they need to be converted on big endian machines + */ +void ide_fix_driveid(struct hd_driveid *id) +{ +#ifndef __LITTLE_ENDIAN +#ifdef __BIG_ENDIAN + int i; + unsigned short *stringcast; + + id->config = __le16_to_cpu(id->config); + id->cyls = __le16_to_cpu(id->cyls); + id->reserved2 = __le16_to_cpu(id->reserved2); + id->heads = __le16_to_cpu(id->heads); + id->track_bytes = __le16_to_cpu(id->track_bytes); + id->sector_bytes = __le16_to_cpu(id->sector_bytes); + id->sectors = __le16_to_cpu(id->sectors); + id->vendor0 = __le16_to_cpu(id->vendor0); + id->vendor1 = __le16_to_cpu(id->vendor1); + id->vendor2 = __le16_to_cpu(id->vendor2); + stringcast = (unsigned short *)&id->serial_no[0]; + for (i = 0; i < (20/2); i++) + stringcast[i] = __le16_to_cpu(stringcast[i]); + id->buf_type = __le16_to_cpu(id->buf_type); + id->buf_size = __le16_to_cpu(id->buf_size); + id->ecc_bytes = __le16_to_cpu(id->ecc_bytes); + stringcast = (unsigned short *)&id->fw_rev[0]; + for (i = 0; i < (8/2); i++) + stringcast[i] = __le16_to_cpu(stringcast[i]); + stringcast = (unsigned short *)&id->model[0]; + for (i = 0; i < (40/2); i++) + stringcast[i] = __le16_to_cpu(stringcast[i]); + id->dword_io = __le16_to_cpu(id->dword_io); + id->reserved50 = __le16_to_cpu(id->reserved50); + id->field_valid = __le16_to_cpu(id->field_valid); + id->cur_cyls = __le16_to_cpu(id->cur_cyls); + id->cur_heads = __le16_to_cpu(id->cur_heads); + id->cur_sectors = __le16_to_cpu(id->cur_sectors); + id->cur_capacity0 = __le16_to_cpu(id->cur_capacity0); + id->cur_capacity1 = __le16_to_cpu(id->cur_capacity1); + id->lba_capacity = __le32_to_cpu(id->lba_capacity); + id->dma_1word = __le16_to_cpu(id->dma_1word); + id->dma_mword = __le16_to_cpu(id->dma_mword); + id->eide_pio_modes = __le16_to_cpu(id->eide_pio_modes); + id->eide_dma_min = __le16_to_cpu(id->eide_dma_min); + id->eide_dma_time = __le16_to_cpu(id->eide_dma_time); + id->eide_pio = __le16_to_cpu(id->eide_pio); + id->eide_pio_iordy = __le16_to_cpu(id->eide_pio_iordy); + for (i = 0; i < 2; i++) + id->words69_70[i] = __le16_to_cpu(id->words69_70[i]); + for (i = 0; i < 4; i++) + id->words71_74[i] = __le16_to_cpu(id->words71_74[i]); + id->queue_depth = __le16_to_cpu(id->queue_depth); + for (i = 0; i < 4; i++) + id->words76_79[i] = __le16_to_cpu(id->words76_79[i]); + id->major_rev_num = __le16_to_cpu(id->major_rev_num); + id->minor_rev_num = __le16_to_cpu(id->minor_rev_num); + id->command_set_1 = __le16_to_cpu(id->command_set_1); + id->command_set_2 = __le16_to_cpu(id->command_set_2); + id->cfsse = __le16_to_cpu(id->cfsse); + id->cfs_enable_1 = __le16_to_cpu(id->cfs_enable_1); + id->cfs_enable_2 = __le16_to_cpu(id->cfs_enable_2); + id->csf_default = __le16_to_cpu(id->csf_default); + id->dma_ultra = __le16_to_cpu(id->dma_ultra); + id->word89 = __le16_to_cpu(id->word89); + id->word90 = __le16_to_cpu(id->word90); + id->CurAPMvalues = __le16_to_cpu(id->CurAPMvalues); + id->word92 = __le16_to_cpu(id->word92); + id->hw_config = __le16_to_cpu(id->hw_config); + id->acoustic = __le16_to_cpu(id->acoustic); + for (i = 0; i < 5; i++) + id->words95_99[i] = __le16_to_cpu(id->words95_99[i]); + id->lba_capacity_2 = __le64_to_cpu(id->lba_capacity_2); + for (i = 0; i < 22; i++) + id->words104_125[i] = __le16_to_cpu(id->words104_125[i]); + id->last_lun = __le16_to_cpu(id->last_lun); + id->word127 = __le16_to_cpu(id->word127); + id->dlf = __le16_to_cpu(id->dlf); + id->csfo = __le16_to_cpu(id->csfo); + for (i = 0; i < 26; i++) + id->words130_155[i] = __le16_to_cpu(id->words130_155[i]); + id->word156 = __le16_to_cpu(id->word156); + for (i = 0; i < 3; i++) + id->words157_159[i] = __le16_to_cpu(id->words157_159[i]); + id->cfa_power = __le16_to_cpu(id->cfa_power); + for (i = 0; i < 14; i++) + id->words161_175[i] = __le16_to_cpu(id->words161_175[i]); + for (i = 0; i < 31; i++) + id->words176_205[i] = __le16_to_cpu(id->words176_205[i]); + for (i = 0; i < 48; i++) + id->words206_254[i] = __le16_to_cpu(id->words206_254[i]); + id->integrity_word = __le16_to_cpu(id->integrity_word); +#else +#error "Please fix <asm/byteorder.h>" +#endif /* __BIG_ENDIAN */ +#endif /* __LITTLE_ENDIAN */ +} + int ide_driveid_update (ide_drive_t *drive) { /* @@ -331,6 +430,7 @@ int ide_config_drive_speed (ide_drive_t *drive, byte speed) } EXPORT_SYMBOL(ide_auto_reduce_xfer); +EXPORT_SYMBOL(ide_fix_driveid); EXPORT_SYMBOL(ide_driveid_update); EXPORT_SYMBOL(ide_ata66_check); EXPORT_SYMBOL(set_transfer); diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index f3d5e10ec89c..1001000e8619 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c @@ -2032,19 +2032,6 @@ static int idefloppy_cleanup (ide_drive_t *drive) return 0; } -#ifdef CONFIG_PROC_FS - -static ide_proc_entry_t idefloppy_proc[] = { - { "geometry", S_IFREG|S_IRUGO, proc_ide_read_geometry, NULL }, - { NULL, 0, NULL, NULL } -}; - -#else - -#define idefloppy_proc NULL - -#endif /* CONFIG_PROC_FS */ - /* * IDE subdriver functions, registered with ide.c */ @@ -2060,7 +2047,6 @@ static struct ata_operations idefloppy_driver = { check_media_change: idefloppy_check_media_change, revalidate: NULL, /* use default method */ capacity: idefloppy_capacity, - proc: idefloppy_proc }; MODULE_DESCRIPTION("ATAPI FLOPPY Driver"); @@ -2075,13 +2061,6 @@ static void __exit idefloppy_exit (void) printk ("%s: cleanup_module() called while still busy\n", drive->name); failed++; } - -#ifdef CONFIG_PROC_FS - /* We must remove proc entries defined in this module. - Otherwise we oops while accessing these entries */ - if (drive->proc) - ide_remove_proc_entries(drive->proc, idefloppy_proc); -#endif } } diff --git a/drivers/ide/ide-pci.c b/drivers/ide/ide-pci.c index 9d2283c6b0b7..3807d0a809e0 100644 --- a/drivers/ide/ide-pci.c +++ b/drivers/ide/ide-pci.c @@ -265,6 +265,8 @@ static struct ata_pci_device pci_chipsets[] __initdata = { #endif #ifdef CONFIG_BLK_DEV_HPT366 {PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT366, pci_init_hpt366, ata66_hpt366, ide_init_hpt366, ide_dmacapable_hpt366, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 240, ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA }, + {PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT372, pci_init_hpt366, ata66_hpt366, ide_init_hpt366, ide_dmacapable_hpt366, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 0, ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA }, + {PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT374, pci_init_hpt366, ata66_hpt366, ide_init_hpt366, ide_dmacapable_hpt366, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 0, ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA }, #endif #ifdef CONFIG_BLK_DEV_ALI15X3 {PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5229, pci_init_ali15x3, ata66_ali15x3, ide_init_ali15x3, ide_dmacapable_ali15x3, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0, 0 }, @@ -307,6 +309,8 @@ static struct ata_pci_device pci_chipsets[] __initdata = { {PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF, NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0, ATA_F_FIXIRQ }, {PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C561, NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0, ATA_F_NOADMA }, {PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT366, NULL, NULL, IDE_NO_DRIVER, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 240, ATA_F_IRQ | ATA_F_HPTHACK }, + {PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT372, NULL, NULL, IDE_NO_DRIVER, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 0, ATA_F_IRQ | ATA_F_HPTHACK }, + {PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT374, NULL, NULL, IDE_NO_DRIVER, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 0, ATA_F_IRQ | ATA_F_HPTHACK }, {0, 0, NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }}; /* @@ -809,6 +813,48 @@ static void __init pdc20270_device_order_fixup (struct pci_dev *dev, struct ata_ setup_pci_device(dev2, d2); } +static void __init hpt374_device_order_fixup (struct pci_dev *dev, struct ata_pci_device *d) +{ + struct pci_dev *dev2 = NULL; + struct pci_dev *findev; + struct ata_pci_device *d2; + + if (PCI_FUNC(dev->devfn) & 1) + return; + + pci_for_each_dev(findev) { + if ((findev->vendor == dev->vendor) && + (findev->device == dev->device) && + ((findev->devfn - dev->devfn) == 1) && + (PCI_FUNC(findev->devfn) & 1)) { + dev2 = findev; + break; + } + } + + printk("%s: IDE controller on PCI bus %02x dev %02x\n", + dev->name, dev->bus->number, dev->devfn); + setup_pci_device(dev, d); + if (!dev2) { + return; + } else { + byte irq = 0, irq2 = 0; + pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq); + pci_read_config_byte(dev2, PCI_INTERRUPT_LINE, &irq2); + if (irq != irq2) { + pci_write_config_byte(dev2, PCI_INTERRUPT_LINE, irq); + dev2->irq = dev->irq; + printk("%s: pci-config space interrupt fixed.\n", + dev2->name); + } + } + d2 = d; + printk("%s: IDE controller on PCI bus %02x dev %02x\n", + dev2->name, dev2->bus->number, dev2->devfn); + setup_pci_device(dev2, d2); + +} + static void __init hpt366_device_order_fixup (struct pci_dev *dev, struct ata_pci_device *d) { struct pci_dev *dev2 = NULL, *findev; @@ -823,6 +869,7 @@ static void __init hpt366_device_order_fixup (struct pci_dev *dev, struct ata_pc class_rev &= 0xff; switch(class_rev) { + case 5: case 4: case 3: printk("%s: IDE controller on PCI slot %s\n", dev->name, dev->slot_name); setup_pci_device(dev, d); @@ -854,6 +901,8 @@ static void __init hpt366_device_order_fixup (struct pci_dev *dev, struct ata_pc setup_pci_device(dev2, d2); } + + /* * This finds all PCI IDE controllers and calls appropriate initialization * functions for them. @@ -883,8 +932,12 @@ static void __init scan_pcidev(struct pci_dev *dev) return; /* IT8172G is also more than only an IDE controller */ else if ((d->vendor == PCI_VENDOR_ID_UMC && d->device == PCI_DEVICE_ID_UMC_UM8886A) && !(PCI_FUNC(dev->devfn) & 1)) return; /* UM8886A/BF pair */ - else if (d->flags & ATA_F_HPTHACK) - hpt366_device_order_fixup(dev, d); + else if (d->flags & ATA_F_HPTHACK) { + if (d->device == PCI_DEVICE_ID_TTI_HPT366) + hpt366_device_order_fixup(dev, d); + if (d->device == PCI_DEVICE_ID_TTI_HPT374) + hpt374_device_order_fixup(dev, d); + } else if (d->vendor == PCI_VENDOR_ID_PROMISE && d->device == PCI_DEVICE_ID_PROMISE_20268R) pdc20270_device_order_fixup(dev, d); else if (!(d->vendor == 0 && d->device == 0) || (dev->class >> 8) == PCI_CLASS_STORAGE_IDE) { diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index d1c549ca9a73..f95417406a43 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -518,7 +518,7 @@ static void channel_probe(struct ata_channel *ch) sprintf(ch->dev.bus_id, "%04x", ch->io_ports[IDE_DATA_OFFSET]); sprintf(ch->dev.name, "ide"); ch->dev.driver_data = ch; -#ifdef CONFIG_BLK_DEV_IDEPCI +#ifdef CONFIG_PCI if (ch->pci_dev) ch->dev.parent = &ch->pci_dev->dev; else diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c index e46e0627efdc..344c4fd72486 100644 --- a/drivers/ide/ide-proc.c +++ b/drivers/ide/ide-proc.c @@ -38,18 +38,6 @@ * "settings" files. e.g. "cat /proc/ide0/hda/settings" * To write a new value "val" into a specific setting "name", use: * echo "name:val" >/proc/ide/ide0/hda/settings - * - * Also useful, "cat /proc/ide0/hda/[identify, smart_values, - * smart_thresholds, capabilities]" will issue an IDENTIFY / - * PACKET_IDENTIFY / SMART_READ_VALUES / SMART_READ_THRESHOLDS / - * SENSE CAPABILITIES command to /dev/hda, and then dump out the - * returned data as 256 16-bit words. The "hdparm" utility will - * be updated someday soon to use this mechanism. - * - * Feel free to develop and distribute fancy GUI configuration - * utilities for your favorite PCI chipsets. I'll be working on - * one for the Promise 20246 someday soon. -ml - * */ #include <linux/config.h> @@ -131,80 +119,6 @@ static int ide_getdigit(char c) return digit; } -static int proc_ide_read_imodel - (char *page, char **start, off_t off, int count, int *eof, void *data) -{ - struct ata_channel *hwif = data; - int len; - const char *name; - - switch (hwif->chipset) { - case ide_unknown: name = "(none)"; break; - case ide_generic: name = "generic"; break; - case ide_pci: name = "pci"; break; - case ide_cmd640: name = "cmd640"; break; - case ide_dtc2278: name = "dtc2278"; break; - case ide_ali14xx: name = "ali14xx"; break; - case ide_qd65xx: name = "qd65xx"; break; - case ide_umc8672: name = "umc8672"; break; - case ide_ht6560b: name = "ht6560b"; break; - case ide_pdc4030: name = "pdc4030"; break; - case ide_rz1000: name = "rz1000"; break; - case ide_trm290: name = "trm290"; break; - case ide_cmd646: name = "cmd646"; break; - case ide_cy82c693: name = "cy82c693"; break; - case ide_pmac: name = "mac-io"; break; - default: name = "(unknown)"; break; - } - len = sprintf(page, "%s\n", name); - PROC_IDE_READ_RETURN(page,start,off,count,eof,len); -} - -static int proc_ide_read_channel(char *page, char **start, - off_t off, int count, int *eof, void *data) -{ - struct ata_channel *hwif = data; - int len; - - page[0] = hwif->unit ? '1' : '0'; - page[1] = '\n'; - len = 2; - PROC_IDE_READ_RETURN(page,start,off,count,eof,len); -} - -static int get_identify(ide_drive_t *drive, u8 *buf) -{ - struct ata_taskfile args; - - memset(&args, 0, sizeof(args)); - args.taskfile.sector_count = 0x01; - args.taskfile.command = (drive->type == ATA_DISK) ? WIN_IDENTIFY : WIN_PIDENTIFY ; - ide_cmd_type_parser(&args); - - return ide_raw_taskfile(drive, &args, buf); -} - -static int proc_ide_read_identify - (char *page, char **start, off_t off, int count, int *eof, void *data) -{ - ide_drive_t *drive = data; - int len = 0; - int i = 0; - - if (drive && !get_identify(drive, page)) { - unsigned short *val = (unsigned short *) page; - char *out = ((char *)val) + (SECTOR_WORDS * 4); - page = out; - do { - out += sprintf(out, "%04x%c", le16_to_cpu(*val), (++i & 7) ? ' ' : '\n'); - val += 1; - } while (i < (SECTOR_WORDS * 2)); - len = out - page; - } else - len = sprintf(page, "\n"); - PROC_IDE_READ_RETURN(page,start,off,count,eof,len); -} - static int proc_ide_read_settings (char *page, char **start, off_t off, int count, int *eof, void *data) { @@ -320,72 +234,7 @@ parse_error: return -EINVAL; } -int proc_ide_read_capacity - (char *page, char **start, off_t off, int count, int *eof, void *data) -{ - ide_drive_t *drive = data; - struct ata_operations *driver = drive->driver; - int len; - - if (!driver) - len = sprintf(page, "(none)\n"); - else - len = sprintf(page,"%llu\n", (unsigned long long) ata_capacity(drive)); - PROC_IDE_READ_RETURN(page,start,off,count,eof,len); -} - -int proc_ide_read_geometry - (char *page, char **start, off_t off, int count, int *eof, void *data) -{ - ide_drive_t *drive = data; - char *out = page; - int len; - - out += sprintf(out,"physical %d/%d/%d\n", drive->cyl, drive->head, drive->sect); - out += sprintf(out,"logical %d/%d/%d\n", drive->bios_cyl, drive->bios_head, drive->bios_sect); - len = out - page; - PROC_IDE_READ_RETURN(page,start,off,count,eof,len); -} - -static int proc_ide_read_dmodel - (char *page, char **start, off_t off, int count, int *eof, void *data) -{ - ide_drive_t *drive = data; - struct hd_driveid *id = drive->id; - int len; - - len = sprintf(page, "%.40s\n", (id && id->model[0]) ? (char *)id->model : "(none)"); - PROC_IDE_READ_RETURN(page,start,off,count,eof,len); -} - -static int proc_ide_read_media - (char *page, char **start, off_t off, int count, int *eof, void *data) -{ - ide_drive_t *drive = data; - const char *type; - int len; - - switch (drive->type) { - case ATA_DISK: type = "disk\n"; - break; - case ATA_ROM: type = "cdrom\n"; - break; - case ATA_TAPE: type = "tape\n"; - break; - case ATA_FLOPPY:type = "floppy\n"; - break; - default: type = "UNKNOWN\n"; - break; - } - strcpy(page,type); - len = strlen(type); - PROC_IDE_READ_RETURN(page,start,off,count,eof,len); -} - static ide_proc_entry_t generic_drive_entries[] = { - { "identify", S_IFREG|S_IRUSR, proc_ide_read_identify, NULL }, - { "media", S_IFREG|S_IRUGO, proc_ide_read_media, NULL }, - { "model", S_IFREG|S_IRUGO, proc_ide_read_dmodel, NULL }, { "settings", S_IFREG|S_IRUSR|S_IWUSR,proc_ide_read_settings, proc_ide_write_settings }, { NULL, 0, NULL, NULL } }; @@ -472,12 +321,6 @@ void destroy_proc_ide_drives(struct ata_channel *hwif) } } -static ide_proc_entry_t hwif_entries[] = { - { "channel", S_IFREG|S_IRUGO, proc_ide_read_channel, NULL }, - { "model", S_IFREG|S_IRUGO, proc_ide_read_imodel, NULL }, - { NULL, 0, NULL, NULL } -}; - void create_proc_ide_interfaces(void) { int h; @@ -491,7 +334,6 @@ void create_proc_ide_interfaces(void) hwif->proc = proc_mkdir(hwif->name, proc_ide_root); if (!hwif->proc) return; - ide_add_proc_entries(hwif->proc, hwif_entries, hwif); } create_proc_ide_drives(hwif); } @@ -510,7 +352,6 @@ static void destroy_proc_ide_interfaces(void) #endif if (exist) { destroy_proc_ide_drives(hwif); - ide_remove_proc_entries(hwif->proc, hwif_entries); remove_proc_entry(hwif->name, proc_ide_root); hwif->proc = NULL; } else diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 9b395beb7d33..e56ff250b73f 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c @@ -6000,7 +6000,7 @@ static void idetape_setup (ide_drive_t *drive, idetape_tape_t *tape, int minor) if (strstr(drive->id->model, "OnStream DI-")) tape->onstream = 1; drive->dsc_overlap = 1; -#ifdef CONFIG_BLK_DEV_IDEPCI +#ifdef CONFIG_PCI if (!tape->onstream && drive->channel->pci_dev != NULL) { /* * These two ide-pci host adapters appear to need DSC overlap disabled. @@ -6009,10 +6009,10 @@ static void idetape_setup (ide_drive_t *drive, idetape_tape_t *tape, int minor) if ((drive->channel->pci_dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) || (drive->channel->pci_dev->device == PCI_DEVICE_ID_TTI_HPT343)) { printk(KERN_INFO "ide-tape: %s: disabling DSC overlap\n", tape->name); - drive->dsc_overlap = 0; + drive->dsc_overlap = 0; } } -#endif /* CONFIG_BLK_DEV_IDEPCI */ +#endif tape->drive = drive; tape->minor = minor; tape->name[0] = 'h'; tape->name[1] = 't'; tape->name[2] = '0' + minor; diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index dc5223d8fa1d..da781a0cf347 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c @@ -468,10 +468,10 @@ ide_startstop_t ata_taskfile(struct ata_device *drive, /* for dma commands we don't set the handler */ if (args->taskfile.command == WIN_WRITEDMA || args->taskfile.command == WIN_WRITEDMA_EXT) - udma_write(drive, rq); + return !udma_write(drive, rq); else if (args->taskfile.command == WIN_READDMA || args->taskfile.command == WIN_READDMA_EXT) - udma_read(drive, rq); + return !udma_read(drive, rq); #ifdef CONFIG_BLK_DEV_IDE_TCQ else if (args->taskfile.command == WIN_WRITEDMA_QUEUED || args->taskfile.command == WIN_WRITEDMA_QUEUED_EXT diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 000f05db7419..a1194676980b 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -123,7 +123,7 @@ static int initializing; /* set while initializing built-in drivers */ */ spinlock_t ide_lock __cacheline_aligned = SPIN_LOCK_UNLOCKED; -#ifdef CONFIG_BLK_DEV_IDEPCI +#ifdef CONFIG_PCI static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */ #endif @@ -1614,7 +1614,7 @@ void ata_irq_request(int irq, void *data, struct pt_regs *regs) * For PCI, we cannot tell the difference, * so in that case we just ignore it and hope it goes away. */ -#ifdef CONFIG_BLK_DEV_IDEPCI +#ifdef CONFIG_PCI if (ch->pci_dev && !ch->pci_dev->vendor) #endif { @@ -1622,7 +1622,7 @@ void ata_irq_request(int irq, void *data, struct pt_regs *regs) * safely try to do something about it: */ unexpected_irq(irq); -#ifdef CONFIG_BLK_DEV_IDEPCI +#ifdef CONFIG_PCI } else { /* * Whack the status register, just in case we have a leftover pending IRQ. @@ -1936,7 +1936,6 @@ static int ide_release(struct inode * inode, struct file * file) #ifdef CONFIG_PROC_FS ide_proc_entry_t generic_subdriver_entries[] = { - { "capacity", S_IFREG|S_IRUGO, proc_ide_read_capacity, NULL }, { NULL, 0, NULL, NULL } }; #endif @@ -2142,7 +2141,7 @@ void ide_unregister(struct ata_channel *ch) ch->chipset = old.chipset; ch->autodma = old.autodma; ch->udma_four = old.udma_four; -#ifdef CONFIG_BLK_DEV_IDEPCI +#ifdef CONFIG_PCI ch->pci_dev = old.pci_dev; #endif ch->straight8 = old.straight8; @@ -2849,7 +2848,7 @@ int __init ide_setup (char *s) return 1; } -#ifdef CONFIG_BLK_DEV_IDEPCI +#ifdef CONFIG_PCI if (!strcmp(s, "ide=reverse")) { ide_scan_direction = 1; printk(" : Enabled support for IDE inverse scan order.\n"); @@ -3051,7 +3050,7 @@ int __init ide_setup (char *s) case -8: /* minus8 */ goto bad_option; case -7: /* ata66 */ -#ifdef CONFIG_BLK_DEV_IDEPCI +#ifdef CONFIG_PCI hwif->udma_four = 1; goto done; #else @@ -3332,7 +3331,6 @@ EXPORT_SYMBOL(ide_stall_queue); #ifdef CONFIG_PROC_FS EXPORT_SYMBOL(ide_add_proc_entries); EXPORT_SYMBOL(ide_remove_proc_entries); -EXPORT_SYMBOL(proc_ide_read_geometry); #endif EXPORT_SYMBOL(ide_add_setting); EXPORT_SYMBOL(ide_remove_setting); @@ -3433,7 +3431,7 @@ static int __init ata_module_init(void) */ #ifdef CONFIG_PCI if (pci_present()) { -# ifdef CONFIG_BLK_DEV_IDEPCI +# ifdef CONFIG_PCI ide_scan_pcibus(ide_scan_direction); # else # ifdef CONFIG_BLK_DEV_RZ1000 diff --git a/drivers/ide/rz1000.c b/drivers/ide/rz1000.c index 8cd4bce4ea2e..f5cb62fac482 100644 --- a/drivers/ide/rz1000.c +++ b/drivers/ide/rz1000.c @@ -11,7 +11,7 @@ * Dunno if this fixes both ports, or only the primary port (?). */ -#include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */ +#include <linux/config.h> /* for CONFIG_PCI */ #include <linux/types.h> #include <linux/kernel.h> #include <linux/delay.h> @@ -26,7 +26,7 @@ #include <asm/io.h> -#ifdef CONFIG_BLK_DEV_IDEPCI +#ifdef CONFIG_PCI void __init ide_init_rz1000(struct ata_channel *hwif) /* called from ide-pci.c */ { @@ -87,4 +87,4 @@ void __init ide_probe_for_rz100x (void) /* called from ide.c */ init_rz1000 (dev, "RZ1001"); } -#endif /* CONFIG_BLK_DEV_IDEPCI */ +#endif |
