aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-s3c64xx/cpu.c10
-rw-r--r--arch/arm/plat-s3c24xx/cpu.c1
-rw-r--r--arch/arm/plat-s5p/cpu.c4
-rw-r--r--arch/arm/plat-samsung/Makefile2
-rw-r--r--arch/arm/plat-samsung/cpu.c58
-rw-r--r--arch/arm/plat-samsung/include/plat/cpu.h4
-rw-r--r--arch/arm/plat-samsung/init.c1
7 files changed, 69 insertions, 11 deletions
diff --git a/arch/arm/mach-s3c64xx/cpu.c b/arch/arm/mach-s3c64xx/cpu.c
index 7b665f3e2e1f..6c498f9a18c5 100644
--- a/arch/arm/mach-s3c64xx/cpu.c
+++ b/arch/arm/mach-s3c64xx/cpu.c
@@ -144,14 +144,8 @@ void __init s3c64xx_init_io(struct map_desc *mach_desc, int size)
144 iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc)); 144 iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc));
145 iotable_init(mach_desc, size); 145 iotable_init(mach_desc, size);
146 146
147 samsung_cpu_id = __raw_readl(S3C_VA_SYS + 0x118); 147 /* detect cpu id */
148 if (!samsung_cpu_id) { 148 s3c64xx_init_cpu();
149 /* S3C6400 has the ID register in a different place,
150 * and needs a write before it can be read. */
151
152 __raw_writel(0x0, S3C_VA_SYS + 0xA1C);
153 samsung_cpu_id = __raw_readl(S3C_VA_SYS + 0xA1C);
154 }
155 149
156 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); 150 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
157} 151}
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c
index ead21a4a7f8a..3c6335307fb1 100644
--- a/arch/arm/plat-s3c24xx/cpu.c
+++ b/arch/arm/plat-s3c24xx/cpu.c
@@ -224,6 +224,7 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
224 } else { 224 } else {
225 samsung_cpu_id = s3c24xx_read_idcode_v4(); 225 samsung_cpu_id = s3c24xx_read_idcode_v4();
226 } 226 }
227 s3c24xx_init_cpu();
227 228
228 arm_pm_restart = s3c24xx_pm_restart; 229 arm_pm_restart = s3c24xx_pm_restart;
229 230
diff --git a/arch/arm/plat-s5p/cpu.c b/arch/arm/plat-s5p/cpu.c
index 3ef673482111..04392c70d055 100644
--- a/arch/arm/plat-s5p/cpu.c
+++ b/arch/arm/plat-s5p/cpu.c
@@ -119,6 +119,8 @@ void __init s5p_init_io(struct map_desc *mach_desc,
119 if (mach_desc) 119 if (mach_desc)
120 iotable_init(mach_desc, size); 120 iotable_init(mach_desc, size);
121 121
122 samsung_cpu_id = __raw_readl(cpuid_addr); 122 /* detect cpu id and rev. */
123 s5p_init_cpu(cpuid_addr);
124
123 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); 125 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
124} 126}
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 853764ba8cc5..3de756da5eaa 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -11,7 +11,7 @@ obj- :=
11 11
12# Objects we always build independent of SoC choice 12# Objects we always build independent of SoC choice
13 13
14obj-y += init.o 14obj-y += init.o cpu.o
15obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o 15obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o
16obj-y += clock.o 16obj-y += clock.o
17obj-y += pwm-clock.o 17obj-y += pwm-clock.o
diff --git a/arch/arm/plat-samsung/cpu.c b/arch/arm/plat-samsung/cpu.c
new file mode 100644
index 000000000000..81c06d44c11e
--- /dev/null
+++ b/arch/arm/plat-samsung/cpu.c
@@ -0,0 +1,58 @@
1/* linux/arch/arm/plat-samsung/cpu.c
2 *
3 * Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Samsung CPU Support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/io.h>
17
18#include <asm/system.h>
19
20#include <mach/map.h>
21#include <plat/cpu.h>
22
23unsigned long samsung_cpu_id;
24static unsigned int samsung_cpu_rev;
25
26unsigned int samsung_rev(void)
27{
28 return samsung_cpu_rev;
29}
30EXPORT_SYMBOL(samsung_rev);
31
32void __init s3c24xx_init_cpu(void)
33{
34 /* nothing here yet */
35
36 samsung_cpu_rev = 0;
37}
38
39void __init s3c64xx_init_cpu(void)
40{
41 samsung_cpu_id = __raw_readl(S3C_VA_SYS + 0x118);
42 if (!samsung_cpu_id) {
43 /*
44 * S3C6400 has the ID register in a different place,
45 * and needs a write before it can be read.
46 */
47 __raw_writel(0x0, S3C_VA_SYS + 0xA1C);
48 samsung_cpu_id = __raw_readl(S3C_VA_SYS + 0xA1C);
49 }
50
51 samsung_cpu_rev = 0;
52}
53
54void __init s5p_init_cpu(void __iomem *cpuid_addr)
55{
56 samsung_cpu_id = __raw_readl(cpuid_addr);
57 samsung_cpu_rev = samsung_cpu_id & 0xFF;
58}
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
index bdf43ad3b5ec..c22d110a1965 100644
--- a/arch/arm/plat-samsung/include/plat/cpu.h
+++ b/arch/arm/plat-samsung/include/plat/cpu.h
@@ -140,6 +140,10 @@ extern void s3c64xx_init_io(struct map_desc *mach_desc, int size);
140extern void s5p_init_io(struct map_desc *mach_desc, 140extern void s5p_init_io(struct map_desc *mach_desc,
141 int size, void __iomem *cpuid_addr); 141 int size, void __iomem *cpuid_addr);
142 142
143extern void s3c24xx_init_cpu(void);
144extern void s3c64xx_init_cpu(void);
145extern void s5p_init_cpu(void __iomem *cpuid_addr);
146
143extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no); 147extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no);
144 148
145extern void s3c24xx_init_clocks(int xtal); 149extern void s3c24xx_init_clocks(int xtal);
diff --git a/arch/arm/plat-samsung/init.c b/arch/arm/plat-samsung/init.c
index 40b1228adb88..79d10fca9090 100644
--- a/arch/arm/plat-samsung/init.c
+++ b/arch/arm/plat-samsung/init.c
@@ -30,7 +30,6 @@
30#include <plat/regs-serial.h> 30#include <plat/regs-serial.h>
31 31
32static struct cpu_table *cpu; 32static struct cpu_table *cpu;
33unsigned long samsung_cpu_id;
34 33
35static struct cpu_table * __init s3c_lookup_cpu(unsigned long idcode, 34static struct cpu_table * __init s3c_lookup_cpu(unsigned long idcode,
36 struct cpu_table *tab, 35 struct cpu_table *tab,