]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[ARM] Kirkwood: enhance TCLK detection
authorSimon Guinot <sguinot@lacie.com>
Thu, 21 Oct 2010 09:42:28 +0000 (11:42 +0200)
committerNicolas Pitre <nico@fluxnic.net>
Thu, 21 Oct 2010 18:09:52 +0000 (14:09 -0400)
According to the Marvell LSP, the Sample at Reset regiter bit 21 can be
used to detect TCLK on 6281 and 6282 devices.

This patch has only been tested on LaCie boards.

Signed-off-by: Simon Guinot <sguinot@lacie.com>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
arch/arm/mach-kirkwood/common.c

index 1c82d4290dad6f6e593022fb318e4f67b5694fb6..ee99a5acc89d91feb7bf50fdebf64e2224a8b1aa 100644 (file)
@@ -854,10 +854,9 @@ int __init kirkwood_find_tclk(void)
 
        kirkwood_pcie_id(&dev, &rev);
 
-       if ((dev == MV88F6281_DEV_ID && (rev == MV88F6281_REV_A0 ||
-                                       rev == MV88F6281_REV_A1)) ||
-           (dev == MV88F6282_DEV_ID))
-               return 200000000;
+       if (dev == MV88F6281_DEV_ID || dev == MV88F6282_DEV_ID)
+               if (((readl(SAMPLE_AT_RESET) >> 21) & 1) == 0)
+                       return 200000000;
 
        return 166666667;
 }