diff options
Diffstat (limited to 'arch/arm/plat-s3c24xx/include')
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/pll.h | 25 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/s3c2416.h | 31 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/s3c2443.h | 19 |
3 files changed, 75 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c24xx/include/plat/pll.h b/arch/arm/plat-s3c24xx/include/plat/pll.h index 7ea8bffa7a9..005729a1077 100644 --- a/arch/arm/plat-s3c24xx/include/plat/pll.h +++ b/arch/arm/plat-s3c24xx/include/plat/pll.h | |||
@@ -35,3 +35,28 @@ s3c24xx_get_pll(unsigned int pllval, unsigned int baseclk) | |||
35 | 35 | ||
36 | return (unsigned int)fvco; | 36 | return (unsigned int)fvco; |
37 | } | 37 | } |
38 | |||
39 | #define S3C2416_PLL_M_SHIFT (14) | ||
40 | #define S3C2416_PLL_P_SHIFT (5) | ||
41 | #define S3C2416_PLL_S_MASK (7) | ||
42 | #define S3C2416_PLL_M_MASK ((1 << 10) - 1) | ||
43 | #define S3C2416_PLL_P_MASK (63) | ||
44 | |||
45 | static inline unsigned int | ||
46 | s3c2416_get_pll(unsigned int pllval, unsigned int baseclk) | ||
47 | { | ||
48 | unsigned int m, p, s; | ||
49 | uint64_t fvco; | ||
50 | |||
51 | m = pllval >> S3C2416_PLL_M_SHIFT; | ||
52 | p = pllval >> S3C2416_PLL_P_SHIFT; | ||
53 | |||
54 | s = pllval & S3C2416_PLL_S_MASK; | ||
55 | m &= S3C2416_PLL_M_MASK; | ||
56 | p &= S3C2416_PLL_P_MASK; | ||
57 | |||
58 | fvco = (uint64_t)baseclk * m; | ||
59 | do_div(fvco, (p << s)); | ||
60 | |||
61 | return (unsigned int)fvco; | ||
62 | } | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2416.h b/arch/arm/plat-s3c24xx/include/plat/s3c2416.h new file mode 100644 index 00000000000..dc3c0907d22 --- /dev/null +++ b/arch/arm/plat-s3c24xx/include/plat/s3c2416.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/s3c2443.h | ||
2 | * | ||
3 | * Copyright (c) 2009 Yauhen Kharuzhy <jekhor@gmail.com> | ||
4 | * | ||
5 | * Header file for s3c2416 cpu support | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifdef CONFIG_CPU_S3C2416 | ||
13 | |||
14 | struct s3c2410_uartcfg; | ||
15 | |||
16 | extern int s3c2416_init(void); | ||
17 | |||
18 | extern void s3c2416_map_io(void); | ||
19 | |||
20 | extern void s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
21 | |||
22 | extern void s3c2416_init_clocks(int xtal); | ||
23 | |||
24 | extern int s3c2416_baseclk_add(void); | ||
25 | |||
26 | #else | ||
27 | #define s3c2416_init_clocks NULL | ||
28 | #define s3c2416_init_uarts NULL | ||
29 | #define s3c2416_map_io NULL | ||
30 | #define s3c2416_init NULL | ||
31 | #endif | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2443.h b/arch/arm/plat-s3c24xx/include/plat/s3c2443.h index 815b107ed89..a19715feb79 100644 --- a/arch/arm/plat-s3c24xx/include/plat/s3c2443.h +++ b/arch/arm/plat-s3c24xx/include/plat/s3c2443.h | |||
@@ -30,3 +30,22 @@ extern int s3c2443_baseclk_add(void); | |||
30 | #define s3c2443_map_io NULL | 30 | #define s3c2443_map_io NULL |
31 | #define s3c2443_init NULL | 31 | #define s3c2443_init NULL |
32 | #endif | 32 | #endif |
33 | |||
34 | /* common code used by s3c2443 and others. | ||
35 | * note, not to be used outside of arch/arm/mach-s3c* */ | ||
36 | |||
37 | struct clk; /* some files don't need clk.h otherwise */ | ||
38 | |||
39 | typedef unsigned int (*pll_fn)(unsigned int reg, unsigned int base); | ||
40 | typedef unsigned int (*fdiv_fn)(unsigned long clkcon0); | ||
41 | |||
42 | extern void s3c2443_common_setup_clocks(pll_fn get_mpll, fdiv_fn fdiv); | ||
43 | extern void s3c2443_common_init_clocks(int xtal, pll_fn get_mpll, fdiv_fn fdiv); | ||
44 | |||
45 | extern int s3c2443_clkcon_enable_h(struct clk *clk, int enable); | ||
46 | extern int s3c2443_clkcon_enable_p(struct clk *clk, int enable); | ||
47 | extern int s3c2443_clkcon_enable_s(struct clk *clk, int enable); | ||
48 | |||
49 | extern struct clksrc_clk clk_epllref; | ||
50 | extern struct clksrc_clk clk_esysclk; | ||
51 | extern struct clksrc_clk clk_msysclk; | ||