diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2014-05-12 18:11:57 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2014-05-25 15:04:59 -0400 |
commit | 7cb2ded128ab34d8172f25e6da417d732d7e3520 (patch) | |
tree | 1af1302890adbf92a5fcdf6d1f04f635296c21ab /arch | |
parent | ced2d24584da35c5cd45faecf3c6db7abb7e16c9 (diff) |
ARM: EXYNOS: Migrate Exynos specific macros from plat to mach
Move Exynos specific macros to mach-exynos from plat-samsung to avoid
unnecessary dependency on plat based header files.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-exynos/common.h | 72 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/cpu.h | 60 |
2 files changed, 72 insertions, 60 deletions
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index 9ef3f83efaff..c1a2f2207af0 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h | |||
@@ -15,6 +15,75 @@ | |||
15 | #include <linux/reboot.h> | 15 | #include <linux/reboot.h> |
16 | #include <linux/of.h> | 16 | #include <linux/of.h> |
17 | 17 | ||
18 | #define EXYNOS4210_CPU_ID 0x43210000 | ||
19 | #define EXYNOS4212_CPU_ID 0x43220000 | ||
20 | #define EXYNOS4412_CPU_ID 0xE4412200 | ||
21 | #define EXYNOS4_CPU_MASK 0xFFFE0000 | ||
22 | |||
23 | #define EXYNOS5250_SOC_ID 0x43520000 | ||
24 | #define EXYNOS5420_SOC_ID 0xE5420000 | ||
25 | #define EXYNOS5440_SOC_ID 0xE5440000 | ||
26 | #define EXYNOS5_SOC_MASK 0xFFFFF000 | ||
27 | |||
28 | extern unsigned long samsung_cpu_id; | ||
29 | |||
30 | #define IS_SAMSUNG_CPU(name, id, mask) \ | ||
31 | static inline int is_samsung_##name(void) \ | ||
32 | { \ | ||
33 | return ((samsung_cpu_id & mask) == (id & mask)); \ | ||
34 | } | ||
35 | |||
36 | IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK) | ||
37 | IS_SAMSUNG_CPU(exynos4212, EXYNOS4212_CPU_ID, EXYNOS4_CPU_MASK) | ||
38 | IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK) | ||
39 | IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID, EXYNOS5_SOC_MASK) | ||
40 | IS_SAMSUNG_CPU(exynos5420, EXYNOS5420_SOC_ID, EXYNOS5_SOC_MASK) | ||
41 | IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK) | ||
42 | |||
43 | #if defined(CONFIG_CPU_EXYNOS4210) | ||
44 | # define soc_is_exynos4210() is_samsung_exynos4210() | ||
45 | #else | ||
46 | # define soc_is_exynos4210() 0 | ||
47 | #endif | ||
48 | |||
49 | #if defined(CONFIG_SOC_EXYNOS4212) | ||
50 | # define soc_is_exynos4212() is_samsung_exynos4212() | ||
51 | #else | ||
52 | # define soc_is_exynos4212() 0 | ||
53 | #endif | ||
54 | |||
55 | #if defined(CONFIG_SOC_EXYNOS4412) | ||
56 | # define soc_is_exynos4412() is_samsung_exynos4412() | ||
57 | #else | ||
58 | # define soc_is_exynos4412() 0 | ||
59 | #endif | ||
60 | |||
61 | #define EXYNOS4210_REV_0 (0x0) | ||
62 | #define EXYNOS4210_REV_1_0 (0x10) | ||
63 | #define EXYNOS4210_REV_1_1 (0x11) | ||
64 | |||
65 | #if defined(CONFIG_SOC_EXYNOS5250) | ||
66 | # define soc_is_exynos5250() is_samsung_exynos5250() | ||
67 | #else | ||
68 | # define soc_is_exynos5250() 0 | ||
69 | #endif | ||
70 | |||
71 | #if defined(CONFIG_SOC_EXYNOS5420) | ||
72 | # define soc_is_exynos5420() is_samsung_exynos5420() | ||
73 | #else | ||
74 | # define soc_is_exynos5420() 0 | ||
75 | #endif | ||
76 | |||
77 | #if defined(CONFIG_SOC_EXYNOS5440) | ||
78 | # define soc_is_exynos5440() is_samsung_exynos5440() | ||
79 | #else | ||
80 | # define soc_is_exynos5440() 0 | ||
81 | #endif | ||
82 | |||
83 | #define soc_is_exynos4() (soc_is_exynos4210() || soc_is_exynos4212() || \ | ||
84 | soc_is_exynos4412()) | ||
85 | #define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5420()) | ||
86 | |||
18 | void mct_init(void __iomem *base, int irq_g0, int irq_l0, int irq_l1); | 87 | void mct_init(void __iomem *base, int irq_g0, int irq_l0, int irq_l1); |
19 | 88 | ||
20 | struct map_desc; | 89 | struct map_desc; |
@@ -63,4 +132,7 @@ struct exynos_pmu_conf { | |||
63 | 132 | ||
64 | extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); | 133 | extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); |
65 | 134 | ||
135 | extern void s5p_init_cpu(void __iomem *cpuid_addr); | ||
136 | extern unsigned int samsung_rev(void); | ||
137 | |||
66 | #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ | 138 | #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ |
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h index 930b4be832cd..5a237db9f9eb 100644 --- a/arch/arm/plat-samsung/include/plat/cpu.h +++ b/arch/arm/plat-samsung/include/plat/cpu.h | |||
@@ -43,16 +43,6 @@ extern unsigned long samsung_cpu_id; | |||
43 | #define S5PV210_CPU_ID 0x43110000 | 43 | #define S5PV210_CPU_ID 0x43110000 |
44 | #define S5PV210_CPU_MASK 0xFFFFF000 | 44 | #define S5PV210_CPU_MASK 0xFFFFF000 |
45 | 45 | ||
46 | #define EXYNOS4210_CPU_ID 0x43210000 | ||
47 | #define EXYNOS4212_CPU_ID 0x43220000 | ||
48 | #define EXYNOS4412_CPU_ID 0xE4412200 | ||
49 | #define EXYNOS4_CPU_MASK 0xFFFE0000 | ||
50 | |||
51 | #define EXYNOS5250_SOC_ID 0x43520000 | ||
52 | #define EXYNOS5420_SOC_ID 0xE5420000 | ||
53 | #define EXYNOS5440_SOC_ID 0xE5440000 | ||
54 | #define EXYNOS5_SOC_MASK 0xFFFFF000 | ||
55 | |||
56 | #define IS_SAMSUNG_CPU(name, id, mask) \ | 46 | #define IS_SAMSUNG_CPU(name, id, mask) \ |
57 | static inline int is_samsung_##name(void) \ | 47 | static inline int is_samsung_##name(void) \ |
58 | { \ | 48 | { \ |
@@ -68,12 +58,6 @@ IS_SAMSUNG_CPU(s5p6440, S5P6440_CPU_ID, S5P64XX_CPU_MASK) | |||
68 | IS_SAMSUNG_CPU(s5p6450, S5P6450_CPU_ID, S5P64XX_CPU_MASK) | 58 | IS_SAMSUNG_CPU(s5p6450, S5P6450_CPU_ID, S5P64XX_CPU_MASK) |
69 | IS_SAMSUNG_CPU(s5pc100, S5PC100_CPU_ID, S5PC100_CPU_MASK) | 59 | IS_SAMSUNG_CPU(s5pc100, S5PC100_CPU_ID, S5PC100_CPU_MASK) |
70 | IS_SAMSUNG_CPU(s5pv210, S5PV210_CPU_ID, S5PV210_CPU_MASK) | 60 | IS_SAMSUNG_CPU(s5pv210, S5PV210_CPU_ID, S5PV210_CPU_MASK) |
71 | IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK) | ||
72 | IS_SAMSUNG_CPU(exynos4212, EXYNOS4212_CPU_ID, EXYNOS4_CPU_MASK) | ||
73 | IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK) | ||
74 | IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID, EXYNOS5_SOC_MASK) | ||
75 | IS_SAMSUNG_CPU(exynos5420, EXYNOS5420_SOC_ID, EXYNOS5_SOC_MASK) | ||
76 | IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK) | ||
77 | 61 | ||
78 | #if defined(CONFIG_CPU_S3C2410) || defined(CONFIG_CPU_S3C2412) || \ | 62 | #if defined(CONFIG_CPU_S3C2410) || defined(CONFIG_CPU_S3C2412) || \ |
79 | defined(CONFIG_CPU_S3C2416) || defined(CONFIG_CPU_S3C2440) || \ | 63 | defined(CONFIG_CPU_S3C2416) || defined(CONFIG_CPU_S3C2440) || \ |
@@ -126,50 +110,6 @@ IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK) | |||
126 | # define soc_is_s5pv210() 0 | 110 | # define soc_is_s5pv210() 0 |
127 | #endif | 111 | #endif |
128 | 112 | ||
129 | #if defined(CONFIG_CPU_EXYNOS4210) | ||
130 | # define soc_is_exynos4210() is_samsung_exynos4210() | ||
131 | #else | ||
132 | # define soc_is_exynos4210() 0 | ||
133 | #endif | ||
134 | |||
135 | #if defined(CONFIG_SOC_EXYNOS4212) | ||
136 | # define soc_is_exynos4212() is_samsung_exynos4212() | ||
137 | #else | ||
138 | # define soc_is_exynos4212() 0 | ||
139 | #endif | ||
140 | |||
141 | #if defined(CONFIG_SOC_EXYNOS4412) | ||
142 | # define soc_is_exynos4412() is_samsung_exynos4412() | ||
143 | #else | ||
144 | # define soc_is_exynos4412() 0 | ||
145 | #endif | ||
146 | |||
147 | #define EXYNOS4210_REV_0 (0x0) | ||
148 | #define EXYNOS4210_REV_1_0 (0x10) | ||
149 | #define EXYNOS4210_REV_1_1 (0x11) | ||
150 | |||
151 | #if defined(CONFIG_SOC_EXYNOS5250) | ||
152 | # define soc_is_exynos5250() is_samsung_exynos5250() | ||
153 | #else | ||
154 | # define soc_is_exynos5250() 0 | ||
155 | #endif | ||
156 | |||
157 | #if defined(CONFIG_SOC_EXYNOS5420) | ||
158 | # define soc_is_exynos5420() is_samsung_exynos5420() | ||
159 | #else | ||
160 | # define soc_is_exynos5420() 0 | ||
161 | #endif | ||
162 | |||
163 | #if defined(CONFIG_SOC_EXYNOS5440) | ||
164 | # define soc_is_exynos5440() is_samsung_exynos5440() | ||
165 | #else | ||
166 | # define soc_is_exynos5440() 0 | ||
167 | #endif | ||
168 | |||
169 | #define soc_is_exynos4() (soc_is_exynos4210() || soc_is_exynos4212() || \ | ||
170 | soc_is_exynos4412()) | ||
171 | #define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5420()) | ||
172 | |||
173 | #define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE } | 113 | #define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE } |
174 | 114 | ||
175 | #ifndef KHZ | 115 | #ifndef KHZ |