aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s5p
diff options
context:
space:
mode:
authorKukjin Kim <kgene.kim@samsung.com>2011-10-04 07:14:11 -0400
committerKukjin Kim <kgene.kim@samsung.com>2011-10-04 07:14:11 -0400
commitc9477f38cba225870862fd9e08868ae3d4abdfe0 (patch)
tree01c7575a1e8e3197d072890f48944f1232a885c6 /arch/arm/plat-s5p
parentc37b25046289e857918d25fd96aa441ea7929ad5 (diff)
parent2520123382e97271e932377c83bca010c265be55 (diff)
Merge branch 'next-samsung-board' into next-samsung-devel-2
Diffstat (limited to 'arch/arm/plat-s5p')
-rw-r--r--arch/arm/plat-s5p/cpu.c37
-rw-r--r--arch/arm/plat-s5p/include/plat/exynos4.h5
-rw-r--r--arch/arm/plat-s5p/include/plat/pll.h55
3 files changed, 79 insertions, 18 deletions
diff --git a/arch/arm/plat-s5p/cpu.c b/arch/arm/plat-s5p/cpu.c
index bbc2aa7449ca..909507bae2fa 100644
--- a/arch/arm/plat-s5p/cpu.c
+++ b/arch/arm/plat-s5p/cpu.c
@@ -33,48 +33,57 @@ static const char name_s5p6450[] = "S5P6450";
33static const char name_s5pc100[] = "S5PC100"; 33static const char name_s5pc100[] = "S5PC100";
34static const char name_s5pv210[] = "S5PV210/S5PC110"; 34static const char name_s5pv210[] = "S5PV210/S5PC110";
35static const char name_exynos4210[] = "EXYNOS4210"; 35static const char name_exynos4210[] = "EXYNOS4210";
36static const char name_exynos4212[] = "EXYNOS4212";
36 37
37static struct cpu_table cpu_ids[] __initdata = { 38static struct cpu_table cpu_ids[] __initdata = {
38 { 39 {
39 .idcode = 0x56440100, 40 .idcode = S5P6440_CPU_ID,
40 .idmask = 0xfffff000, 41 .idmask = S5P64XX_CPU_MASK,
41 .map_io = s5p6440_map_io, 42 .map_io = s5p6440_map_io,
42 .init_clocks = s5p6440_init_clocks, 43 .init_clocks = s5p6440_init_clocks,
43 .init_uarts = s5p6440_init_uarts, 44 .init_uarts = s5p6440_init_uarts,
44 .init = s5p64x0_init, 45 .init = s5p64x0_init,
45 .name = name_s5p6440, 46 .name = name_s5p6440,
46 }, { 47 }, {
47 .idcode = 0x36450000, 48 .idcode = S5P6450_CPU_ID,
48 .idmask = 0xfffff000, 49 .idmask = S5P64XX_CPU_MASK,
49 .map_io = s5p6450_map_io, 50 .map_io = s5p6450_map_io,
50 .init_clocks = s5p6450_init_clocks, 51 .init_clocks = s5p6450_init_clocks,
51 .init_uarts = s5p6450_init_uarts, 52 .init_uarts = s5p6450_init_uarts,
52 .init = s5p64x0_init, 53 .init = s5p64x0_init,
53 .name = name_s5p6450, 54 .name = name_s5p6450,
54 }, { 55 }, {
55 .idcode = 0x43100000, 56 .idcode = S5PC100_CPU_ID,
56 .idmask = 0xfffff000, 57 .idmask = S5PC100_CPU_MASK,
57 .map_io = s5pc100_map_io, 58 .map_io = s5pc100_map_io,
58 .init_clocks = s5pc100_init_clocks, 59 .init_clocks = s5pc100_init_clocks,
59 .init_uarts = s5pc100_init_uarts, 60 .init_uarts = s5pc100_init_uarts,
60 .init = s5pc100_init, 61 .init = s5pc100_init,
61 .name = name_s5pc100, 62 .name = name_s5pc100,
62 }, { 63 }, {
63 .idcode = 0x43110000, 64 .idcode = S5PV210_CPU_ID,
64 .idmask = 0xfffff000, 65 .idmask = S5PV210_CPU_MASK,
65 .map_io = s5pv210_map_io, 66 .map_io = s5pv210_map_io,
66 .init_clocks = s5pv210_init_clocks, 67 .init_clocks = s5pv210_init_clocks,
67 .init_uarts = s5pv210_init_uarts, 68 .init_uarts = s5pv210_init_uarts,
68 .init = s5pv210_init, 69 .init = s5pv210_init,
69 .name = name_s5pv210, 70 .name = name_s5pv210,
70 }, { 71 }, {
71 .idcode = 0x43210000, 72 .idcode = EXYNOS4210_CPU_ID,
72 .idmask = 0xfffe0000, 73 .idmask = EXYNOS4_CPU_MASK,
73 .map_io = exynos4_map_io, 74 .map_io = exynos4_map_io,
74 .init_clocks = exynos4_init_clocks, 75 .init_clocks = exynos4_init_clocks,
75 .init_uarts = exynos4_init_uarts, 76 .init_uarts = exynos4_init_uarts,
76 .init = exynos4_init, 77 .init = exynos4_init,
77 .name = name_exynos4210, 78 .name = name_exynos4210,
79 }, {
80 .idcode = EXYNOS4212_CPU_ID,
81 .idmask = EXYNOS4_CPU_MASK,
82 .map_io = exynos4_map_io,
83 .init_clocks = exynos4_init_clocks,
84 .init_uarts = exynos4_init_uarts,
85 .init = exynos4_init,
86 .name = name_exynos4212,
78 }, 87 },
79}; 88};
80 89
@@ -114,13 +123,13 @@ static struct map_desc s5p_iodesc[] __initdata = {
114void __init s5p_init_io(struct map_desc *mach_desc, 123void __init s5p_init_io(struct map_desc *mach_desc,
115 int size, void __iomem *cpuid_addr) 124 int size, void __iomem *cpuid_addr)
116{ 125{
117 unsigned long idcode;
118
119 /* initialize the io descriptors we need for initialization */ 126 /* initialize the io descriptors we need for initialization */
120 iotable_init(s5p_iodesc, ARRAY_SIZE(s5p_iodesc)); 127 iotable_init(s5p_iodesc, ARRAY_SIZE(s5p_iodesc));
121 if (mach_desc) 128 if (mach_desc)
122 iotable_init(mach_desc, size); 129 iotable_init(mach_desc, size);
123 130
124 idcode = __raw_readl(cpuid_addr); 131 /* detect cpu id and rev. */
125 s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids)); 132 s5p_init_cpu(cpuid_addr);
133
134 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
126} 135}
diff --git a/arch/arm/plat-s5p/include/plat/exynos4.h b/arch/arm/plat-s5p/include/plat/exynos4.h
index 907caab53dcf..f680a143e38c 100644
--- a/arch/arm/plat-s5p/include/plat/exynos4.h
+++ b/arch/arm/plat-s5p/include/plat/exynos4.h
@@ -14,10 +14,11 @@
14 14
15extern void exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no); 15extern void exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
16extern void exynos4_register_clocks(void); 16extern void exynos4_register_clocks(void);
17extern void exynos4210_register_clocks(void);
18extern void exynos4212_register_clocks(void);
17extern void exynos4_setup_clocks(void); 19extern void exynos4_setup_clocks(void);
18 20
19#ifdef CONFIG_CPU_EXYNOS4210 21#ifdef CONFIG_ARCH_EXYNOS4
20
21extern int exynos4_init(void); 22extern int exynos4_init(void);
22extern void exynos4_init_irq(void); 23extern void exynos4_init_irq(void);
23extern void exynos4_map_io(void); 24extern void exynos4_map_io(void);
diff --git a/arch/arm/plat-s5p/include/plat/pll.h b/arch/arm/plat-s5p/include/plat/pll.h
index ebc142c5c84c..3e21b9444cc5 100644
--- a/arch/arm/plat-s5p/include/plat/pll.h
+++ b/arch/arm/plat-s5p/include/plat/pll.h
@@ -12,6 +12,59 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13*/ 13*/
14 14
15#include <asm/div64.h>
16
17#define PLL35XX_MDIV_MASK (0x3FF)
18#define PLL35XX_PDIV_MASK (0x3F)
19#define PLL35XX_SDIV_MASK (0x7)
20#define PLL35XX_MDIV_SHIFT (16)
21#define PLL35XX_PDIV_SHIFT (8)
22#define PLL35XX_SDIV_SHIFT (0)
23
24static inline unsigned long s5p_get_pll35xx(unsigned long baseclk, u32 pll_con)
25{
26 u32 mdiv, pdiv, sdiv;
27 u64 fvco = baseclk;
28
29 mdiv = (pll_con >> PLL35XX_MDIV_SHIFT) & PLL35XX_MDIV_MASK;
30 pdiv = (pll_con >> PLL35XX_PDIV_SHIFT) & PLL35XX_PDIV_MASK;
31 sdiv = (pll_con >> PLL35XX_SDIV_SHIFT) & PLL35XX_SDIV_MASK;
32
33 fvco *= mdiv;
34 do_div(fvco, (pdiv << sdiv));
35
36 return (unsigned long)fvco;
37}
38
39#define PLL36XX_KDIV_MASK (0xFFFF)
40#define PLL36XX_MDIV_MASK (0x1FF)
41#define PLL36XX_PDIV_MASK (0x3F)
42#define PLL36XX_SDIV_MASK (0x7)
43#define PLL36XX_MDIV_SHIFT (16)
44#define PLL36XX_PDIV_SHIFT (8)
45#define PLL36XX_SDIV_SHIFT (0)
46
47static inline unsigned long s5p_get_pll36xx(unsigned long baseclk,
48 u32 pll_con0, u32 pll_con1)
49{
50 unsigned long result;
51 u32 mdiv, pdiv, sdiv, kdiv;
52 u64 tmp;
53
54 mdiv = (pll_con0 >> PLL36XX_MDIV_SHIFT) & PLL36XX_MDIV_MASK;
55 pdiv = (pll_con0 >> PLL36XX_PDIV_SHIFT) & PLL36XX_PDIV_MASK;
56 sdiv = (pll_con0 >> PLL36XX_SDIV_SHIFT) & PLL36XX_SDIV_MASK;
57 kdiv = pll_con1 & PLL36XX_KDIV_MASK;
58
59 tmp = baseclk;
60
61 tmp *= (mdiv << 16) + kdiv;
62 do_div(tmp, (pdiv << sdiv));
63 result = tmp >> 16;
64
65 return result;
66}
67
15#define PLL45XX_MDIV_MASK (0x3FF) 68#define PLL45XX_MDIV_MASK (0x3FF)
16#define PLL45XX_PDIV_MASK (0x3F) 69#define PLL45XX_PDIV_MASK (0x3F)
17#define PLL45XX_SDIV_MASK (0x7) 70#define PLL45XX_SDIV_MASK (0x7)
@@ -19,8 +72,6 @@
19#define PLL45XX_PDIV_SHIFT (8) 72#define PLL45XX_PDIV_SHIFT (8)
20#define PLL45XX_SDIV_SHIFT (0) 73#define PLL45XX_SDIV_SHIFT (0)
21 74
22#include <asm/div64.h>
23
24enum pll45xx_type_t { 75enum pll45xx_type_t {
25 pll_4500, 76 pll_4500,
26 pll_4502, 77 pll_4502,