• Sergei Shtylyov's avatar
    [PATCH] pdc202xx_new: fix PLL/timing issues · 47694bb8
    Sergei Shtylyov authored
    Fix the CRC errors in the higher UltraDMA modes with the Promise PDC20268
    and newer chips that always occur on non-x86 machines and when there are
    more than 2 adapters on x86 machines.  Fix the overclocking issue for
    PDC20269 and newer chips that occurs when an UltraDMA/133 capable drive is
    connected.  Here's the summary of changes:
    
    - add code to detect the PLL input clock detection and setup it output clock,
      remove the PowerMac hacks;
    
    - replace the macros accessing the indexed regiters with functions, switch to
      using them where appropriate, gather the PIO/MWDMA/UDMA timings into tables;
    
    - rewrite the speedproc() handler to set the drive's transfer mode first, and
      then override the timing registers set by hardware on UltraDMA/133 chips;
    
    - use better criterion for determining higher UltraDMA modes, and add comment
      concerning the doubtful value of the code enabling IORDY/prefetch;
    
    - replace the stupid 'pdcnew_new_' prefixes with mere 'pdcnew_';
    
    - get rid of unneded spaces, parens and type casts, clean up some printk's,
      add some new lines here and there...
    
    This work is loosely based on these former patches by Albert Lee:
    
    [1] http://marc.theaimsgroup.com/?l=linux-ide&m=110992442032300
    [2] http://marc.theaimsgroup.com/?l=linux-ide&m=110992457729382
    [3] http://marc.theaimsgroup.com/?l=linux-ide&m=110992474205555
    [4] http://marc.theaimsgroup.com/?l=linux-ide&m=111019224802939
    
    Some PLL clock detection code was backported from his pata_pdc2027x driver...
    
    This code has been successfully tested by me on PDC2026[89] chips.
    
    I tried to keep this rework as several patches but it made no sense: [2] was
    largely a modification of the non-working timing override code, [3] by itself
    extended the overclocking issue to the case of non-UltraDMA/133 drives, and
    finally, the cleanup patch based on [1] ended up rejected...
    Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
    Cc: Albert Lee <albertcc@tw.ibm.com>
    Acked-by: default avatarAlan Cox <alan@lxorguk.ukuu.org.uk>
    Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    47694bb8
pdc202xx_new.c 19.5 KB