summaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/hpt366.c
Commit message (Collapse)AuthorAgeFilesLines
* drivers/ide/pci/: use __devexit_p()Adrian Bunk2008-08-181-1/+1
| | | | | | | | This patch adds missing __devexit_p's. Reported-by: Russell King <rmk+lkml@arm.linux.org.uk> Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: ->cable_detect method cannot be marked __devinitBartlomiej Zolnierkiewicz2008-08-051-1/+1
| | | | | | | Now that we have warm-plug support ->cable_detect method no longer can be be marked __devinit. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: drop 'name' parameter from ->init_chipset methodBartlomiej Zolnierkiewicz2008-07-241-1/+2
| | | | | | There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: prefix messages from IDE PCI host drivers by driver nameBartlomiej Zolnierkiewicz2008-07-241-53/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Prefix messages from IDE PCI host drivers by driver name instead of marketed chipset name (it is still possible to exactly identify the particular chipset basing on driver messages). As a bonus this provides nice code savings for some drivers: text data bss dec hex filename 3826 112 8 3946 f6a drivers/ide/pci/amd74xx.o.before 2786 112 8 2906 b5a drivers/ide/pci/amd74xx.o.after 764 108 0 872 368 drivers/ide/pci/cs5520.o.before 680 108 0 788 314 drivers/ide/pci/cs5520.o.after 1680 112 4 1796 704 drivers/ide/pci/generic.o.before 1155 112 4 1271 4f7 drivers/ide/pci/generic.o.after 7128 792 0 7920 1ef0 drivers/ide/pci/hpt366.o.before 6984 792 0 7776 1e60 drivers/ide/pci/hpt366.o.after 2800 148 0 2948 b84 drivers/ide/pci/pdc202xx_new.o.before 2523 148 0 2671 a6f drivers/ide/pci/pdc202xx_new.o.after 2831 148 0 2979 ba3 drivers/ide/pci/pdc202xx_old.o.before 2683 148 0 2831 b0f drivers/ide/pci/pdc202xx_old.o.after 3776 112 4 3892 f34 drivers/ide/pci/piix.o.before 2804 112 4 2920 b68 drivers/ide/pci/piix.o.after 4693 116 0 4809 12c9 drivers/ide/pci/siimage.o.before 4600 116 0 4716 126c drivers/ide/pci/siimage.o.after Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: include PCI device name in messages from IDE PCI host driversBartlomiej Zolnierkiewicz2008-07-241-12/+19
| | | | | | | | | | | | | | | | | | | | | | | | While at it: * Apply small fixes to messages (s/dma/DMA/, remove trailing '.', etc). * Fix printk() call in ide_setup_pci_baseregs() to use KERN_INFO. * Move printk() call from ide_pci_clear_simplex() to the caller. * Cleanup do_ide_setup_pci_device() a bit. * amd74xx.c: remove superfluous PCI device revision information. * hpt366.c: fix two printk() calls in ->init_chipset to use KERN_INFO. * pdc202xx_new.c: fix printk() call in ->init_chipset to use KERN_INFO. * pdc202xx_old.c: fix driver message in pdc202xx_init_one(). * via82cxxx.c: fix driver warning message in via_init_one(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* hpt366: add ->remove method and module_exit()Bartlomiej Zolnierkiewicz2008-07-241-0/+18
| | | | | Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* hpt366: convert to use ->host_privBartlomiej Zolnierkiewicz2008-07-241-31/+41
| | | | | | | | | While at it: * Allocate both struct hpt_info instances at once. Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add ->dev and ->host_priv fields to struct ide_hostBartlomiej Zolnierkiewicz2008-07-241-2/+2
| | | | | | | | | | | | | | | | | * Add 'struct device *dev[2]' and 'void *host_priv' fields to struct ide_host. * Set ->dev[] in ide_host_alloc_all()/ide_setup_pci_device[s](). * Pass 'void *priv' argument to ide_setup_pci_device[s]() and use it to set ->host_priv. * Set PCI dev's ->driver_data to point to the struct ide_host instance if PCI host driver wants to use ->host_priv. * Rename ide_setup_pci_device[s]() to ide_pci_init_{one,two}(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: filter out "default" transfer mode values in set_xfer_rate()Bartlomiej Zolnierkiewicz2008-07-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | * Filter out "default" transfer mode values (0x00 - default PIO mode, 0x01 - default PIO mode w/ IORDY disabled) in write handler for obsoleted /proc/ide/hd?/settings:current_speed setting. Allowing "default" transfer mode values is a dangerous thing to do as we don't support programming controller to the "default" transfer mode and devices often use different values for the default and maximum PIO mode (i.e. PIO2 default and PIO4 maximum) so the controller will stay programmed for higher PIO mode while device will use the lower PIO mode. There is no functionality loss as by using special IOCTLs device can still be programmed to "default" transfer modes (it is only useful for debugging/testing purposes anyway). * Remove no longer needed IDE_HFLAG_ABUSE_SET_DMA_MODE host flag, it was previously used by few host drivers to program the controller to PIO0 timings for "default" transfer mode == 0x01 (although some host drivers would program invalid PIO timings instead). * Cleanup ide_set_xfer_rate() and add BUG_ON(). Suggested-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: factor out simplex handling from ide_pci_dma_base()Bartlomiej Zolnierkiewicz2008-07-231-3/+9
| | | | | | | | | | | | | | * Factor out simplex handling from ide_pci_dma_base() to ide_pci_check_simplex(). * Set hwif->dma_base early in ->init_dma method / ide_hwif_setup_dma() and reset it in ide_init_port() if DMA initialization fails. * Use ->read_sff_dma_status instead of ->INB in ide_pci_dma_base(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove ide_setup_dma()Bartlomiej Zolnierkiewicz2008-07-231-1/+3
| | | | | | | | Export sff_dma_ops and then remove ide_setup_dma(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove ->dma_{status,command} fields from ide_hwif_tBartlomiej Zolnierkiewicz2008-07-231-5/+5
| | | | | | | | | | | | | * Use ->dma_base + offset instead of ->dma_{status,command} and remove no longer needed ->dma_{status,command}. While at it: * Use ATA_DMA_* defines. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove drive->ctlBartlomiej Zolnierkiewicz2008-07-151-2/+1
| | | | | | | | | | | | Remove drive->ctl (it is always equal to 0x08 after init time). While at it: * Use ATA_DEVCTL_OBS define. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add struct ide_io_ports (take 3)Bartlomiej Zolnierkiewicz2008-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | * Add struct ide_io_ports and use it instead of `unsigned long io_ports[]` in ide_hwif_t. * Rename io_ports[] in hw_regs_t to io_ports_array[]. * Use un-named union for 'unsigned long io_ports_array[]' and 'struct ide_io_ports io_ports' in hw_regs_t. * Remove IDE_*_OFFSET defines. v2: * scc_pata.c build fix from Stephen Rothwell. v3: * Fix ctl_adrr typo in Sparc-specific part of ns87415.c. (Noticed by Andrew Morton) Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: constify struct ide_dma_opsBartlomiej Zolnierkiewicz2008-04-261-4/+22
| | | | | | | | | | | | | | | | | * Export ide_dma_exec_cmd() and __ide_dma_test_irq(). * Constify struct ide_dma_ops. * Always set hwif->dma_ops to &sff_dma_ops in ide_setup_dma() (it is later overriden by ide_init_port() if needed) and drop 'const struct ide_port_info *d' argument. While at it: * Rename __ide_dma_test_irq() to ide_dma_test_irq(). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add struct ide_dma_ops (take 3)Bartlomiej Zolnierkiewicz2008-04-261-18/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add struct ide_dma_ops and convert core code + drivers to use it. While at it: * Drop "ide_" prefix from ->ide_dma_end and ->ide_dma_test_irq methods. * Drop "ide_" "infixes" from DMA methods. * au1xxx-ide.c: - use auide_dma_{test_irq,end}() directly in auide_dma_timeout() * pdc202xx_old.c: - drop "old_" "infixes" from DMA methods * siimage.c: - add siimage_dma_test_irq() helper - print SATA warning in siimage_init_one() * Remove no longer needed ->init_hwif implementations. v2: * Changes based on review from Sergei: - s/siimage_ide_dma_test_irq/siimage_dma_test_irq/ - s/drive->hwif/hwif/ in idefloppy_pc_intr(). - fix patch description w.r.t. au1xxx-ide changes - fix au1xxx-ide build - fix naming for cmd64*_dma_ops - drop "ide_" and "old_" infixes - s/hpt3xxx_dma_ops/hpt37x_dma_ops/ - s/hpt370x_dma_ops/hpt370_dma_ops/ - use correct DMA ops for HPT302/N, HPT371/N and HPT374 - s/it821x_smart_dma_ops/it821x_pass_through_dma_ops/ v3: * Two bugs slipped in v2 (noticed by Sergei): - use correct DMA ops for HPT374 (for real this time) - handle HPT370/HPT370A properly Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: do complete DMA setup in ->init_dma method (take 2)Bartlomiej Zolnierkiewicz2008-04-261-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make ide_hwif_setup_dma() return an error value. * Pass 'const struct ide_port_info *d' instead of 'unsigned long dmabase' to ->init_dma method and make it return an error value. * Rename ide_get_or_set_dma_base() to ide_pci_dma_base(), change ordering of its arguments and then export it. * Export ide_pci_set_master(). * Do complete DMA setup inside ->init_dma method and update ->init_dma users accordingly. * Sanitize code for DMA setup in ide_init_port(). v2: * Fix for CONFIG_BLK_DEV_IDEDMA_PCI=n configs (from Jiri Slaby <jirislaby@gmail.com>): Fix following compiler warning by returning EINVAL: In file included from ANYTHING-INCLUDING-IDE.H:45: include/linux/ide.h: In function ‘ide_hwif_setup_dma’: include/linux/ide.h:1022: warning: no return statement in function returning non-void Cc: Jiri Slaby <jirislaby@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: move ide_setup_dma() call out from ->init_dma methodBartlomiej Zolnierkiewicz2008-04-261-2/+0
| | | | | | | There should be no functional changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove ->extra field from struct ide_port_infoBartlomiej Zolnierkiewicz2008-04-261-6/+0
| | | | | | | | | Always setup hwif->extra_base in ide_iomio_dma() and remove no longer needed ->extra field from struct ide_port_info. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: replace remaining __FUNCTION__ occurrencesHarvey Harrison2008-04-261-2/+2
| | | | | | | | | | __FUNCTION__ is gcc-specific, use __func__ [bart: fix checkpatch.pl errors in ide-lib.c and ppc/mpc8xx.c while at it] Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add struct ide_port_ops (take 2)Bartlomiej Zolnierkiewicz2008-04-261-11/+16
| | | | | | | | | | | | | | | | | | | | | * Move hooks for port/host specific methods from ide_hwif_t to 'struct ide_port_ops'. * Add 'const struct ide_port_ops *port_ops' to 'struct ide_port_info' and ide_hwif_t. * Update host drivers and core code accordingly. While at it: * Rename ata66_*() cable detect functions to *_cable_detect() to match the standard naming. (Suggested by Sergei Shtylyov) v2: * Fix build for bast-ide. (Noticed by Andrew Morton) Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: IDE_HFLAG_BOOTABLE -> IDE_HFLAG_NON_BOOTABLEBartlomiej Zolnierkiewicz2008-04-261-1/+1
| | | | | | | | | "bootable" should be the default behavior so replace IDE_HFLAG_BOOTABLE host flag with IDE_HFLAG_NON_BOOTABLE. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove IDE_*_REG macrosBartlomiej Zolnierkiewicz2008-04-181-1/+1
| | | | | | | | | | | | | * Add IDE_{ALTSTATUS,IREASON,BCOUNTL,BCOUNTH}_OFFSET defines. * Remove IDE_*_REG macros - this results in more readable and slightly smaller code. There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove dead/obsolete ->busproc methodBartlomiej Zolnierkiewicz2008-04-181-59/+0
| | | | | | | | | | | | | | | | ->busproc method is used by HDIO_SET_BUSSTATE ioctl but it has no chance of working as intended (in 2.4.x days) because to issue an ioctl there is a device node needed and: - for BUSSTATE_TRISTATE+OFF it is too late (devices are already gone) - for BUSSTATE_TRISTATE+ON it is too early (devices are not registered yet) Just remove ->busproc method for now (it was only implemented by hpt366, siimage and tc86c001 host drivers). Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* hpt366: fix section mismatch warningsSam Ravnborg2008-02-261-5/+7
| | | | | | | | | | | | | | | | | | | | | | hpt366: fix section mismatch warnings Fix following warnings: WARNING: o-sparc64/vmlinux.o(.data+0x195a38): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt370 WARNING: o-sparc64/vmlinux.o(.data+0x195a40): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt370a WARNING: o-sparc64/vmlinux.o(.data+0x195a48): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt372 WARNING: o-sparc64/vmlinux.o(.data+0x195a50): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt372n Replace a static array with a small switch resulting in more readable code. Mark the pci table __devinitconst. A lot of variables are const but annotated __devinitdata. Annotating them __devinitconst would cause a section type conflict error when build for 64 bit powerpc. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove needless includes from PCI host driversBartlomiej Zolnierkiewicz2008-02-021-5/+0
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add ->cable_detect method to ide_hwif_tBartlomiej Zolnierkiewicz2008-02-021-38/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add ->cable_detect method to ide_hwif_t. * Call the new method in ide_init_port() if: - the host supports UDMA modes > UDMA2 ('hwif->ultra_mask & 78') - DMA initialization was successful (if hwif->dma_base is not set ide_init_port() sets hwif->ultra_mask to zero) - "idex=ata66" is not used ('hwif->cbl != ATA_CBL_PATA40_SHORT') * Convert PCI host drivers to use ->cable_detect method. While at it: * Factor out cable detection to separate functions (if not already done). * hpt366.c/it8213.c/slc90e66.c: - don't check cable type if "idex=ata66" is used * pdc202xx_new.c: - add __devinit tag to pdcnew_cable_detect() * pdc202xx_old.c: - rename pdc202xx_old_cable_detect() to pdc2026x_old_cable_detect() - add __devinit tag to pdc2026x_old_cable_detect() Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: delete filenames/versions from commentsBartlomiej Zolnierkiewicz2008-02-011-2/+0
| | | | | | | | | | | | | | | Delete filenames/versions from comments. I'm leaving decisions about adding DRV_VERSION defines and MODULE_VERSION()-s to maintainers of the respective drivers. While at it: * Remove unused VERSION define from ide.c. * Remove unused/stale DRV_VERSION define from au1xxx-ide.c. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: keep pointer to struct device instead of struct pci_dev in ide_hwif_tBartlomiej Zolnierkiewicz2008-02-011-12/+17
| | | | | | | | | | | Keep pointer to struct device instead of struct pci_dev in ide_hwif_t. While on it: * Use *dev->dma_mask instead of pci_dev->dma_mask in ide_toggle_bounce(). There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: ide_setup_dma() assumes 8 portsSergei Shtylyov2008-02-011-1/+1
| | | | | | | | | According to http://marc.info/?l=linux-ide&m=114346138611631, the drivers must always register 8 DMA ports with ide_setup_dma(), so its last argument is not needed. While at it, kill some useless parens in that function... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: merge ->fixup and ->quirkproc methodsBartlomiej Zolnierkiewicz2008-01-261-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | * Assign drive->quirk_list in ->quirkproc implementations: - hpt366.c::hpt3xx_quirkproc() - pdc202xx_new.c::pdcnew_quirkproc() - pdc202xx_old.c::pdc202xx_quirkproc() * Make ->quirkproc void. * Move calling ->quirkproc from do_identify() to probe_hwif(). * Convert it821x_fixups() to it821x_quirkproc() in it821x.c. * Convert siimage_fixup() to sil_quirkproc() in siimage.c, also remove no longer needed drive->present check from is_dev_seagate_sata(). * Convert ide_undecoded_slave() to accept 'drive' instead of 'hwif' as an argument. Then convert ide_register_hw() to accept 'quirkproc' argument instead of 'fixup' one. * Remove no longer needed ->fixup method. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add IDE_HFLAG_ABUSE_SET_DMA_MODE host flagBartlomiej Zolnierkiewicz2008-01-251-8/+11
| | | | | | | | | | | | | | | | | | | | | | * Add IDE_HFLAG_ABUSE_SET_DMA_MODE host flag and use it to decide what to do with transfer modes < XFER_PIO_0 in ide_set_xfer_rate(). * Set IDE_HFLAG_ABUSE_SET_DMA_MODE in host drivers that need it (aec62xx, amd74xx, cs5520, cs5535, hpt34x, hpt366, pdc202xx_old, serverworks, tc86c001 and via82cxxx) and cleanup ->set_dma_mode methods in host drivers that don't (IDE core code guarantees that ->set_dma_mode will be called only for modes which are present in SWDMA/MWDMA/UDMA masks). While at it: * Add IDE_HFLAGS_HPT34X/HPT3XX/PDC202XX/SVWKS define in hpt34x/hpt366/pdc202xx_old/serverworks host driver. There should be no functionality changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove hwif->intrprocBartlomiej Zolnierkiewicz2008-01-251-10/+0
| | | | | | | | | | | | | | | Given that: * hpt366.c::hpt3xx_intrproc() is the only user of hwif->intrproc * hpt366.c::hpt3xx_quirkproc() sets drive->quirk_list to 1 for quirky drives which is a value unique to hpt366 host driver we can remove hwif->intproc and just check for drive->quirk_list == 1 in ide_do_request(). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove ->dma_master field from ide_hwif_t (take 5)Bartlomiej Zolnierkiewicz2008-01-251-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | * Convert cmd64x, hpt366 and pdc202xx_old host drivers to use pci_resource_start(hwif->pci_dev, 4) instead of hwif->dma_master. * Remove no longer needed ->dma_master field from ide_hwif_t. v2: * Use the more readable 'hwif->dma_base - (hwif->channel * 8)' instead of pci_resource_start(hwif->pci_dev, 4). v3: * Use hwif->extra_base in hpt366/pdc20xx_old + some cosmetic fixups over v2 (suggested by Sergei). v4: * Correct offsets in hpt3xxn_set_clock(). v5: * Use hwif->extra_base in hpt366 for _real_ this time. (Noticed by Sergei) Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* hpt366: merge set_dma_mode() methodsSergei Shtylyov2008-01-251-71/+58
| | | | | | | | Group the array of pointers to the timing tables with the timing register masks which allows us to merge HPT36x/HPT37x set_dma_mode() methods into one. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* hpt366: kill set_dma_mode() method wrapperSergei Shtylyov2008-01-251-14/+7
| | | | | | | | There's no reason to keep the set_dma_mode() method wrapper for two different chip families, so get rid of it... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* hpt366: change timing register masksSergei Shtylyov2008-01-251-17/+13
| | | | | | | | | Since PIO autotuning is now done always, there's no need anymore to program the taskfile timings also on DMA modes, so change the IDE timing register masks accordingly, "inverting the polarity" of the masks while at it... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* hpt366: fix HPT37x PIO mode timings (take 2)Sergei Shtylyov2007-12-121-1/+70
| | | | | | | | | | | | | | | | | | | | | After looking into the HPT370 manual (now that I have it) and re-checking all the timing tables, here's what I have discovered: - at 33 MHz clock, PIO mode 0 timings turned to be overclocked, and all other PIO modes underclocked; - at 50 MHz clock, PIO modes 0 to 2 turned to be overclocked; - at 66 MHz clock, PIO mode 0 was overclocked too. Finally, the taskfile timing (matching PIO mode 0) turned to be overclocked at all clock frequencies (and in all manuals)... The new timings have been tested on HPT370 chip (at 33 MHz PCI clock) and on HPT371N chip (at both 50 and 66 MHz DPLL clock). Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* hpt366: fix build for CONFIG_HOTPLUG=nBartlomiej Zolnierkiewicz2007-10-261-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Saturday 20 October 2007, Avuton Olrich wrote: > My randconfig script the attached config caught an error on: > drivers/ide/pci/cy82c693.c:439: error: primary causes a section type conflict > > My git tree: c00046c279a2521075250fad682ca0acc10d4fd7 > > Bisected to: > 8562043606430185cad26d085d46adcc7ad67fd1 is first bad commit > commit 8562043606430185cad26d085d46adcc7ad67fd1 > Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> > Date: Sat Oct 20 00:32:34 2007 +0200 > > ide: constify struct ide_port_info > > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> It turns out that const and __{dev}initdata cannot be mixed currently and that hpt366 host driver is also affected by the same issue: > drivers/ide/pci/hpt366.c:1428: error: hpt366_chipsets causes a section type > conflict This patch workarounds the problem by making static struct hpt_info instances const. Now all __devinitdata data in hpt366 host driver are read-only so it builds again (driver's .init.data section gets marked as READONLY). While at it: * Bump driver version. Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: "Avuton Olrich" <avuton@gmail.com> Cc: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: constify struct ide_port_infoBartlomiej Zolnierkiewicz2007-10-201-1/+1
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: replace ide_pci_device_t by struct ide_port_infoBartlomiej Zolnierkiewicz2007-10-201-2/+2
| | | | | | | | | | | | | | | | * Rename struct ide_pci_device_s to struct ide_port_info. * Remove ide_pci_device_t typedef. While at it: * Fix __ide_pci_register_driver() comment. * Fix aec62xx_init_one() comment. * Remove unused 'cds' field from ide_hwgroup_t. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: set drive->autotune in ide_pci_setup_ports()Bartlomiej Zolnierkiewicz2007-10-191-2/+0
| | | | | | | | | | | | | | | | | | | | | | | Majority of host drivers using IDE PCI layer set drive->autotune, the only exceptions are: generic.c ns87415.c rz1000.c trm290.c * no ->set_pio_mode method it821x.c: * if memory allocation fails drive->autotune won't be set (but there also won't be ->set_pio_mode method in such case) piix.c: * MPIIX controller (no ->init_hwif method so also no ->set_pio_mode method) However if there is no ->set_pio_mode method there are no changes in behavior w.r.t. PIO tuning so always set drive->autotune in ide_pci_setup_ports(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* hpt366: remove ->init_setupBartlomiej Zolnierkiewicz2007-10-191-179/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Split off hpt{374,371,366}_init() helper from init_setup_hpt{374,371,366}(). * Merge init_setup_{374,372n,371,372a,302,366}() into hpt366_init_one(). While at it: * Use "HPT36x" name for HPT366/HPT368 chipsets. * Add .chip_name to struct hpt_info and use it to set set d->name. * Convert .max_ultra in struct hpt_info to .udma_mask and use it to set d->udma_mask. * Fix hpt302 to use HPT302_ALLOW_ATA133_6 define. * Change HPT366/HPT374 interrupt fixup message from KERN_WARNING to KERN_INFO. * Use the second hpt366_chipsets[] entry for HPT37x chipsets using HPT36x PCI device ID and fix .enablebits/.host_flags for HPT36x hpt366_chipsets[] entry. * Bump driver version. Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: use I/O ops directly part #2 (take 2)Bartlomiej Zolnierkiewicz2007-10-191-24/+21
| | | | | | | | | v2: - bump host driver versions (as suggested by Sergei) - use I/O ops directly in drivers/ide/setup-pci.c Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add ->mwdma_mask and ->swdma_mask to ide_pci_device_t (take 2)Bartlomiej Zolnierkiewicz2007-10-191-3/+6
| | | | | | | | | | | | | | | | | | | | | | | * Add ->mwdma_mask and ->swdma_mask to ide_pci_device_t. * Set ide_hwif_t DMA masks using DMA masks from ide_pci_device_t in setup-pci.c::ide_pci_setup_ports() (iff DMA base is valid and ->init_hwif method may still override them). * Convert IDE PCI host drivers to use ide_pci_device_t DMA masks. While at it: * Use ATA_{UDMA,MWDMA,SWDMA}* defines. * hpt34x.c: add separate ide_pci_device_t instances for HPT343 and HPT345. * serverworks.c: fix DMA masks being set before checking DMA base. v2: * Add missing masks to DECLARE_GENERIC_PCI_DEV() macro. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add IDE_HFLAG_NO_{DMA,AUTODMA} host flagsBartlomiej Zolnierkiewicz2007-10-191-6/+0
| | | | | | | | Add IDE_HFLAG_NO_{DMA,AUTODMA} host flags. Convert all host drivers using ide_pci_device_t to use these flags instead of d->autodma and then remove no longer needed d->autodma. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add IDE_HFLAG_BOOTABLE host flagBartlomiej Zolnierkiewicz2007-10-191-13/+7
| | | | | | | | Add IDE_HFLAG_BOOTABLE host flag and IDE_HFLAG_OFF_BOARD define. Convert all host drivers using ide_pci_device_t to use IDE_HFLAG_{BOOTABLE,OFF_BOARD} instead of d->bootable and then remove no longer needed d->bootable. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add IDE_HFLAG_NO_ATAPI_DMA host flagBartlomiej Zolnierkiewicz2007-10-191-0/+6
| | | | | | | Add IDE_HFLAG_NO_ATAPI_DMA host flag and set it in host drivers which don't support ATAPI DMA. Then remove no longer needed hwif->atapi_dma. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove hwif->autodma and drive->autodmaBartlomiej Zolnierkiewicz2007-10-161-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | * hpt34x.c: disable DMA masks for HPT345 (hwif->autodma is zero so DMA won't be enabled anyway). * trm290.c: disable IDE_HFLAG_TRUST_BIOS_FOR_DMA flag (hwif->autodma is zero so DMA won't be enabled anyway). * Check noautodma global variable instead of drive->autodma in ide_tune_dma(). This fixes handling of "ide=nodma" kernel parameter for icside, ide-cris, au1xxx-ide, pmac, it821x, jmicron, sgiioc4 and siimage host drivers. * Remove hwif->autodma (it was not checked by IDE core code anyway) and drive->autodma (was set by all host drivers - except HPT345/TRM290 special cases - unless "ide=nodma" was used). While at it: - remove needless printk() from icside.c - remove stale FIXME/comment from ide-probe.c - don't force DMA off if PCI bus-mastering had to be enabled in setup-pci.c (this setting was always later over-ridden by host drivers anyway) Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: use PCI_VDEVICE() macroBartlomiej Zolnierkiewicz2007-10-161-7/+7
| | | | | | | | | While at it: - make struct pci_device_id tables const - use PCI_DEVICE_ID_ITE_8213 define in it8213.c - fix comment in generic.c Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
OpenPOWER on IntegriCloud