aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s5p
diff options
context:
space:
mode:
authorKukjin Kim <kgene.kim@samsung.com>2011-08-19 13:18:18 -0400
committerKukjin Kim <kgene.kim@samsung.com>2011-08-21 18:14:07 -0400
commitc06af3cc6a27991187fd513765fed943684d41bf (patch)
tree1bdcaab50fd7ba121218c8ee23f19df9caaf149b /arch/arm/plat-s5p
parent93ee7a9340d64f20295aacc3fb6a22b759323280 (diff)
ARM: SAMSUNG: Add support for detecting CPU at runtime
The soc_is_[name]() can be used to distinguish cpu at runtime. This patch was originally from Changhwan Youn <chaos.youn@samsung.com> Acked-by: Changhwan Youn <chaos.youn@samsung.com> Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/plat-s5p')
-rw-r--r--arch/arm/plat-s5p/cpu.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/arch/arm/plat-s5p/cpu.c b/arch/arm/plat-s5p/cpu.c
index bbc2aa7449ca..3ef673482111 100644
--- a/arch/arm/plat-s5p/cpu.c
+++ b/arch/arm/plat-s5p/cpu.c
@@ -36,40 +36,40 @@ static const char name_exynos4210[] = "EXYNOS4210";
36 36
37static struct cpu_table cpu_ids[] __initdata = { 37static struct cpu_table cpu_ids[] __initdata = {
38 { 38 {
39 .idcode = 0x56440100, 39 .idcode = S5P6440_CPU_ID,
40 .idmask = 0xfffff000, 40 .idmask = S5P64XX_CPU_MASK,
41 .map_io = s5p6440_map_io, 41 .map_io = s5p6440_map_io,
42 .init_clocks = s5p6440_init_clocks, 42 .init_clocks = s5p6440_init_clocks,
43 .init_uarts = s5p6440_init_uarts, 43 .init_uarts = s5p6440_init_uarts,
44 .init = s5p64x0_init, 44 .init = s5p64x0_init,
45 .name = name_s5p6440, 45 .name = name_s5p6440,
46 }, { 46 }, {
47 .idcode = 0x36450000, 47 .idcode = S5P6450_CPU_ID,
48 .idmask = 0xfffff000, 48 .idmask = S5P64XX_CPU_MASK,
49 .map_io = s5p6450_map_io, 49 .map_io = s5p6450_map_io,
50 .init_clocks = s5p6450_init_clocks, 50 .init_clocks = s5p6450_init_clocks,
51 .init_uarts = s5p6450_init_uarts, 51 .init_uarts = s5p6450_init_uarts,
52 .init = s5p64x0_init, 52 .init = s5p64x0_init,
53 .name = name_s5p6450, 53 .name = name_s5p6450,
54 }, { 54 }, {
55 .idcode = 0x43100000, 55 .idcode = S5PC100_CPU_ID,
56 .idmask = 0xfffff000, 56 .idmask = S5PC100_CPU_MASK,
57 .map_io = s5pc100_map_io, 57 .map_io = s5pc100_map_io,
58 .init_clocks = s5pc100_init_clocks, 58 .init_clocks = s5pc100_init_clocks,
59 .init_uarts = s5pc100_init_uarts, 59 .init_uarts = s5pc100_init_uarts,
60 .init = s5pc100_init, 60 .init = s5pc100_init,
61 .name = name_s5pc100, 61 .name = name_s5pc100,
62 }, { 62 }, {
63 .idcode = 0x43110000, 63 .idcode = S5PV210_CPU_ID,
64 .idmask = 0xfffff000, 64 .idmask = S5PV210_CPU_MASK,
65 .map_io = s5pv210_map_io, 65 .map_io = s5pv210_map_io,
66 .init_clocks = s5pv210_init_clocks, 66 .init_clocks = s5pv210_init_clocks,
67 .init_uarts = s5pv210_init_uarts, 67 .init_uarts = s5pv210_init_uarts,
68 .init = s5pv210_init, 68 .init = s5pv210_init,
69 .name = name_s5pv210, 69 .name = name_s5pv210,
70 }, { 70 }, {
71 .idcode = 0x43210000, 71 .idcode = EXYNOS4210_CPU_ID,
72 .idmask = 0xfffe0000, 72 .idmask = EXYNOS4_CPU_MASK,
73 .map_io = exynos4_map_io, 73 .map_io = exynos4_map_io,
74 .init_clocks = exynos4_init_clocks, 74 .init_clocks = exynos4_init_clocks,
75 .init_uarts = exynos4_init_uarts, 75 .init_uarts = exynos4_init_uarts,
@@ -114,13 +114,11 @@ static struct map_desc s5p_iodesc[] __initdata = {
114void __init s5p_init_io(struct map_desc *mach_desc, 114void __init s5p_init_io(struct map_desc *mach_desc,
115 int size, void __iomem *cpuid_addr) 115 int size, void __iomem *cpuid_addr)
116{ 116{
117 unsigned long idcode;
118
119 /* initialize the io descriptors we need for initialization */ 117 /* initialize the io descriptors we need for initialization */
120 iotable_init(s5p_iodesc, ARRAY_SIZE(s5p_iodesc)); 118 iotable_init(s5p_iodesc, ARRAY_SIZE(s5p_iodesc));
121 if (mach_desc) 119 if (mach_desc)
122 iotable_init(mach_desc, size); 120 iotable_init(mach_desc, size);
123 121
124 idcode = __raw_readl(cpuid_addr); 122 samsung_cpu_id = __raw_readl(cpuid_addr);
125 s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids)); 123 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
126} 124}