linux/drivers/ide/pci
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
..
Makefile scc_pata: dependency fix 2007-03-17 21:57:25 +01:00
aec62xx.c ide: add ide_tune_dma() helper 2007-05-10 00:01:09 +02:00
alim15x3.c ide: make /proc/ide/ optional 2007-05-10 00:01:09 +02:00
amd74xx.c ide: make /proc/ide/ optional 2007-05-10 00:01:09 +02:00
atiixp.c ide: add ide_tune_dma() helper 2007-05-10 00:01:09 +02:00
cmd64x.c ide: make /proc/ide/ optional 2007-05-10 00:01:09 +02:00
cmd640.c ide: remove a ton of pointless #undef REALLY_SLOW_IO 2007-03-03 17:48:54 +01:00
cs5520.c ide: add ide_proc_register_port() 2007-05-10 00:01:11 +02:00
cs5530.c ide: make ide_hwif_t.ide_dma_{host_off,off_quietly} void (v2) 2007-02-17 02:40:26 +01:00
cs5535.c ide: add ide_tune_dma() helper 2007-05-10 00:01:09 +02:00
cy82c693.c ide: use PIO/MMIO operations directly where possible (v2) 2007-02-17 02:40:25 +01:00
delkin_cb.c ide: add "initializing" argument to ide_register_hw() 2007-05-10 00:01:10 +02:00
generic.c ide: remove a ton of pointless #undef REALLY_SLOW_IO 2007-03-03 17:48:54 +01:00
hpt34x.c ide: add ide_tune_dma() helper 2007-05-10 00:01:09 +02:00
hpt366.c ide: add ide_tune_dma() helper 2007-05-10 00:01:09 +02:00
it821x.c ide: rework the code for selecting the best DMA transfer mode (v3) 2007-05-10 00:01:08 +02:00
it8213.c ide: add ide_tune_dma() helper 2007-05-10 00:01:09 +02:00
jmicron.c ide: add ide_tune_dma() helper 2007-05-10 00:01:09 +02:00
ns87415.c ide: add ide_set_dma() helper (v2) 2007-02-17 02:40:26 +01:00
opti621.c ide: remove some obsoleted kernel params (v2) 2007-03-03 17:48:55 +01:00
pdc202xx_new.c ide: cable detection fixes (take 2) 2007-05-10 00:01:10 +02:00
pdc202xx_old.c pdc202xx_old: rewrite mode programming code (v2) 2007-05-16 00:51:41 +02:00
piix.c ide: add ide_tune_dma() helper 2007-05-10 00:01:09 +02:00
rz1000.c ide: remove a ton of pointless #undef REALLY_SLOW_IO 2007-03-03 17:48:54 +01:00
sc1200.c ide: make ide_hwif_t.ide_dma_{host_off,off_quietly} void (v2) 2007-02-17 02:40:26 +01:00
scc_pata.c ide: rework the code for selecting the best DMA transfer mode (v3) 2007-05-10 00:01:08 +02:00
serverworks.c ide: rework the code for selecting the best DMA transfer mode (v3) 2007-05-10 00:01:08 +02:00
sgiioc4.c ide: add ide_proc_register_port() 2007-05-10 00:01:11 +02:00
siimage.c Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6 2007-05-09 15:41:31 -07:00
sis5513.c ide: make /proc/ide/ optional 2007-05-10 00:01:09 +02:00
sl82c105.c sl82c105: DMA support code cleanup (take 4) 2007-05-05 22:03:49 +02:00
slc90e66.c ide: add ide_tune_dma() helper 2007-05-10 00:01:09 +02:00
tc86c001.c ide: add ide_tune_dma() helper 2007-05-10 00:01:09 +02:00
triflex.c ide: add ide_tune_dma() helper 2007-05-10 00:01:09 +02:00
trm290.c ide: use PIO/MMIO operations directly where possible (v2) 2007-02-17 02:40:25 +01:00
via82cxxx.c ide: add ide_set_dma() helper (v2) 2007-02-17 02:40:26 +01:00