1 /* linux/arch/arm/plat-s5p/cpu.c
3 * Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
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.
13 #include <linux/init.h>
14 #include <linux/module.h>
16 #include <asm/mach/arch.h>
17 #include <asm/mach/map.h>
20 #include <mach/regs-clock.h>
23 #include <plat/s5p6440.h>
24 #include <plat/s5p6450.h>
25 #include <plat/s5pc100.h>
26 #include <plat/s5pv210.h>
27 #include <plat/exynos4.h>
29 /* table of supported CPUs */
31 static const char name_s5p6440
[] = "S5P6440";
32 static const char name_s5p6450
[] = "S5P6450";
33 static const char name_s5pc100
[] = "S5PC100";
34 static const char name_s5pv210
[] = "S5PV210/S5PC110";
35 static const char name_exynos4210
[] = "EXYNOS4210";
36 static const char name_exynos4212
[] = "EXYNOS4212";
38 static struct cpu_table cpu_ids
[] __initdata
= {
40 .idcode
= S5P6440_CPU_ID
,
41 .idmask
= S5P64XX_CPU_MASK
,
42 .map_io
= s5p6440_map_io
,
43 .init_clocks
= s5p6440_init_clocks
,
44 .init_uarts
= s5p6440_init_uarts
,
48 .idcode
= S5P6450_CPU_ID
,
49 .idmask
= S5P64XX_CPU_MASK
,
50 .map_io
= s5p6450_map_io
,
51 .init_clocks
= s5p6450_init_clocks
,
52 .init_uarts
= s5p6450_init_uarts
,
56 .idcode
= S5PC100_CPU_ID
,
57 .idmask
= S5PC100_CPU_MASK
,
58 .map_io
= s5pc100_map_io
,
59 .init_clocks
= s5pc100_init_clocks
,
60 .init_uarts
= s5pc100_init_uarts
,
64 .idcode
= S5PV210_CPU_ID
,
65 .idmask
= S5PV210_CPU_MASK
,
66 .map_io
= s5pv210_map_io
,
67 .init_clocks
= s5pv210_init_clocks
,
68 .init_uarts
= s5pv210_init_uarts
,
72 .idcode
= EXYNOS4210_CPU_ID
,
73 .idmask
= EXYNOS4_CPU_MASK
,
74 .map_io
= exynos4_map_io
,
75 .init_clocks
= exynos4_init_clocks
,
76 .init_uarts
= exynos4_init_uarts
,
78 .name
= name_exynos4210
,
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
,
86 .name
= name_exynos4212
,
90 /* minimal IO mapping */
92 static struct map_desc s5p_iodesc
[] __initdata
= {
94 .virtual = (unsigned long)S5P_VA_CHIPID
,
95 .pfn
= __phys_to_pfn(S5P_PA_CHIPID
),
99 .virtual = (unsigned long)S3C_VA_SYS
,
100 .pfn
= __phys_to_pfn(S5P_PA_SYSCON
),
104 .virtual = (unsigned long)S3C_VA_TIMER
,
105 .pfn
= __phys_to_pfn(S5P_PA_TIMER
),
109 .virtual = (unsigned long)S3C_VA_WATCHDOG
,
110 .pfn
= __phys_to_pfn(S3C_PA_WDT
),
114 .virtual = (unsigned long)S5P_VA_SROMC
,
115 .pfn
= __phys_to_pfn(S5P_PA_SROMC
),
121 /* read cpu identification code */
123 void __init
s5p_init_io(struct map_desc
*mach_desc
,
124 int size
, void __iomem
*cpuid_addr
)
126 /* initialize the io descriptors we need for initialization */
127 iotable_init(s5p_iodesc
, ARRAY_SIZE(s5p_iodesc
));
129 iotable_init(mach_desc
, size
);
131 /* detect cpu id and rev. */
132 s5p_init_cpu(cpuid_addr
);
134 s3c_init_cpu(samsung_cpu_id
, cpu_ids
, ARRAY_SIZE(cpu_ids
));