ARM: S3C64XX: Add support for synchronous clock operation
authorTomasz Figa <tomasz.figa@gmail.com>
Fri, 19 Aug 2011 09:54:31 +0000 (11:54 +0200)
committerKukjin Kim <kgene.kim@samsung.com>
Mon, 19 Sep 2011 07:38:11 +0000 (16:38 +0900)
Some boards based on S3C6410 use synchronous clocking, which means that HCLKx2
and other system clocks are generated from APLL instead of MPLL.

This patch adds support for such boards, by calculating hclk2 depending on
the status of S3C_OTHERS_SYNCMUXSEL bit in S3C64XX_OTHERS regist

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/mach-s3c64xx/clock.c
arch/arm/mach-s3c64xx/include/mach/regs-sys.h

index 8cf39e33579e3bb9c7d30eceb6afcaa5914e6d2c..872e68361eb44d8f289c963e0cf0456d01dc7822 100644 (file)
@@ -744,7 +744,13 @@ void __init_or_cpufreq s3c6400_setup_clocks(void)
        printk(KERN_INFO "S3C64XX: PLL settings, A=%ld, M=%ld, E=%ld\n",
               apll, mpll, epll);
 
-       hclk2 = mpll / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK2);
+       if(__raw_readl(S3C64XX_OTHERS) & S3C64XX_OTHERS_SYNCMUXSEL)
+               /* Synchronous mode */
+               hclk2 = apll / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK2);
+       else
+               /* Asynchronous mode */
+               hclk2 = mpll / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK2);
+
        hclk = hclk2 / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK);
        pclk = hclk2 / GET_DIV(clkdiv0, S3C6400_CLKDIV0_PCLK);
 
index 774e0de31400506148a460a58dda99fc63de8a69..b91e02093289d6af7c9a216adaa1273acf8f5f4b 100644 (file)
@@ -26,5 +26,6 @@
 #define S3C64XX_OTHERS         S3C_SYSREG(0x900)
 
 #define S3C64XX_OTHERS_USBMASK (1 << 16)
+#define S3C64XX_OTHERS_SYNCMUXSEL      (1 << 6)
 
 #endif /* _PLAT_REGS_SYS_H */