EXNOS: SMDK5422: support control kfc frequency
authorChanho Park <chanho61.park@samsung.com>
Wed, 22 Jul 2015 07:42:03 +0000 (16:42 +0900)
committerChanho Park <chanho61.park@samsung.com>
Fri, 24 Jul 2015 07:30:15 +0000 (16:30 +0900)
This patch supports kfc core frequency to minimal. When cpu temperature
is hot, it is helpful to minimize cpu clock. It also support reset cpu
clock to default value.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
board/samsung/smdk5422/clock_init.c
board/samsung/smdk5422/setup.h

index 2003bf2fa9e4f284bddc49f9019d5d3540ae622a..7423eddd477c1195f158788a66506bebe70a6e2b 100644 (file)
@@ -38,6 +38,22 @@ u32 gEvtNum;
 u32 g_nMEMCLK;
 #endif
 
+void set_kfc_clock(int min)
+{
+       struct exynos5420_clock *clk =
+               (struct exynos5420_clock *)EXYNOS5_CLOCK_BASE;
+
+#ifdef CONFIG_CPU_EXYNOS5422_EVT0
+       if (min) {
+               writel(0x03300720, &clk->div_kfc0);
+               writel(0x80C80303, &clk->kpll_con0);
+       } else {
+               writel(0x03500720, &clk->div_kfc0);
+               writel(0x80C80301, &clk->kpll_con0);
+       }
+#endif
+}
+
 void system_clock_init()
 {
        struct exynos5420_clock *clk =
index e6da7461dbdb4f1b1913e489dcd632c63d2fc073..7cdfb3dbf18582ec62a5c8c1a0e2e2b49b900cc9 100644 (file)
@@ -59,4 +59,5 @@ void sdelay(unsigned long);
 void mem_ctrl_init(void);
 void system_clock_init(void);
 extern unsigned int second_boot_info;
+extern void set_kfc_clock(int min);
 #endif