linux/drivers/ide
Bartlomiej Zolnierkiewicz 4fce3164b8 pdc202xx_old: rewrite mode programming code (v2)
This patch is based on the documentation (I would like to thank Promise
for it) and also partially on the older vendor driver.

Rewrite mode programming code:

* disable 66MHz clock in pdc202xx_tune_chipset() so it is correctly disabled
  even if both devices on the channel are not DMA capable and after reset

* enable/disable IORDY and PREFETCH bits in pdc202xx_tune_chipset()
  as they need to be setup correctly also for PIO only devices, plus IORDY
  wasn't disabled for non-IORDY devices and PREFETCH wasn't disabled for
  ATAPI devices

* remove dead code for setting SYNC_ERDDY_EN bits from config_chipset_for_dma()
  (driver sets ->autotune to 1 so PIO modes are always programmed => lower
   nibble of register A never equals 4 => "chipset_is_set" is always true)

* enable PIO mode programming for all ATAPI devices
  (it was limited to ->media == ide_cdrom devices)

* remove extra reads of registers A/B/C, don't read register D et all

* do clearing / programming of registers A/B/C in one go
  (gets rid of extra PCI config space read/write cycle)

* set initial values of drive_conf/AP/BP/CP variables to zero
  (paranoia for the case when PCI reads fail)

* remove XFER_UDMA6 to XFER_UDMA5 remapping case - it can't happen
  (ide_rate_filter() takes care of it)

* fix XFER_MW_DMA0 timings (they were overclocked, use the official ones)

* fix bitmasks for clearing bits of register B:

  - when programming DMA mode bit 0x10 of register B was cleared which
    resulted in overclocked PIO timing setting (iff PIO0 was used)

  - when programming PIO mode bits 0x18 weren't cleared so suboptimal
    timings were used for PIO1-4 if PIO0 was previously set (bit 0x10)
    and for PIO0/3/4 if PIO1/2 was previously set (bit 0x08)

* add FIXME comment about missing locking for 66MHz clock register

Also while at it:

* remove unused defines

* do a few cosmetic / CodingStyle fixes

* bump driver version

v2:
* in pdc202xx_tune_chipset() the old content of drive configuration
  registers is used only by the debugging code so cover "drive_conf"
  PCI registers read by #if PDC202XX_DEBUG_DRIVE_INFO
  (Noticed by Sergei Shtylyov)

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-05-16 00:51:41 +02:00
..
arm [ARM] ecard: add ecardm_iomap() / ecardm_iounmap() 2007-05-11 17:19:02 +01:00
cris ide: add "initializing" argument to ide_register_hw() 2007-05-10 00:01:10 +02:00
h8300 ide: add "initializing" argument to ide_register_hw() 2007-05-10 00:01:10 +02:00
legacy ide: add ide_proc_register_port() 2007-05-10 00:01:11 +02:00
mips ide: add ide_proc_register_port() 2007-05-10 00:01:11 +02:00
pci pdc202xx_old: rewrite mode programming code (v2) 2007-05-16 00:51:41 +02:00
ppc ide: add ide_proc_register_port() 2007-05-10 00:01:11 +02:00
ide-acpi.c ide-acpi support warning fix 2007-02-07 18:19:42 +01:00
ide-cd.c ide: move IDE settings handling to ide-proc.c 2007-05-10 00:01:10 +02:00
ide-cd.h [PATCH] ide-cd: remove write-only cmd field from struct cdrom_info 2005-12-15 02:20:49 +01:00
ide-disk.c ide: move IDE settings handling to ide-proc.c 2007-05-10 00:01:10 +02:00
ide-dma.c ide: add ide_tune_dma() helper 2007-05-10 00:01:09 +02:00
ide-floppy.c ide: move IDE settings handling to ide-proc.c 2007-05-10 00:01:10 +02:00
ide-generic.c ide: add ide_proc_register_port() 2007-05-10 00:01:11 +02:00
ide-io.c ide: fix PIO setup on resume for ATAPI devices 2007-05-10 00:01:11 +02:00
ide-iops.c ide: cable detection fixes (take 2) 2007-05-10 00:01:10 +02:00
ide-lib.c ide: cable detection fixes (take 2) 2007-05-10 00:01:10 +02:00
ide-pnp.c ide: add "initializing" argument to ide_register_hw() 2007-05-10 00:01:10 +02:00
ide-probe.c ide: add ide_proc_register_port() 2007-05-10 00:01:11 +02:00
ide-proc.c ide: add ide_proc_register_port() 2007-05-10 00:01:11 +02:00
ide-tape.c ide: move IDE settings handling to ide-proc.c 2007-05-10 00:01:10 +02:00
ide-taskfile.c [PATCH] ide: add sanity checking to ide taskfile ioctl 2006-10-16 08:27:54 -07:00
ide-timing.h [PATCH] ide: actually honor drive's minimum PIO/DMA cycle times 2006-06-26 09:58:27 -07:00
ide.c ide: legacy PCI bus order probing fixes 2007-05-10 00:01:11 +02:00
Kconfig [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
Makefile ide: make /proc/ide/ optional 2007-05-10 00:01:09 +02:00
setup-pci.c ide: legacy PCI bus order probing fixes 2007-05-10 00:01:11 +02:00