• Sergei Shtylyov's avatar
    cmd64x: fix multiword and remove single-word DMA support · 60e7a82f
    Sergei Shtylyov authored
    Fix the multiword DMA and drop the single-word DMA support (which nobody will
    miss, I think).  In order to do it, a number of changes was necessary:
    
    - rename program_drive_counts() to program_cycle_times(), pass to it cycle's
      total/active times instead of the clock counts, and convert them into the
      active/recovery clocks there instead of cmd64x_tune_pio() -- this causes
      quantize_timing() to also move;
    
    - contrarywise, move all the code handling the address setup timing into
      cmd64x_tune_pio(), so that setting MWDMA mode wouldn't change address setup;
    
    - remove from the speedproc() method the  bogus code pretending to set the DMA
      timings by twiddling bits in the BMIDE status register, handle setting MWDMA
      by just calling program_cycle_times(); while at it, improve the style of that
      whole switch statement;
    
    - stop fiddling with the DMA capable bits in the speedproc() method -- they do
      not enable DMA, and are properly dealt with by the dma_host_{on,off} methods;
    
    - don't set hwif->swdma_mask in the init_hwif() method anymore.
    
    In addition to those changes, do the following:
    
    - in cmd64x_tune_pio(), when writing to ARTTIM23 register preserve the interrupt
      status bit, eliminate local_irq_{save|restore}() around this code as there's
      *no* actual race with the interrupt handler, and move cmdprintk() to a more
      fitting place -- after ide_get_best_pio_mode() call;
    
    - make {arttim|drwtim}_regs arrays single-dimensional, indexed with drive->dn;
    
    - rename {setup|recovery}_counts[] into more fitting {setup|recovery}_values[];
    
    - in  the speedproc() method, get rid of the duplicate reads/writes from/to the
      UDIDETCRx registers and of the extra variable used to store the transfer mode
      value after filtering,  use another method of determining master/slave drive,
      and cleanup useless parens;
    
    - beautify cmdprintk() output here and there.
    
    While at it, remove meaningless comment about the driver being used only on
    UltraSPARC and long non-relevant RCS tag. :-)
    Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
    Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    60e7a82f
cmd64x.c 20.6 KB