]>
Commit | Line | Data |
---|---|---|
cc511b8d KK |
1 | /* |
2 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. | |
3 | * http://www.samsung.com | |
4 | * | |
5 | * Common Header for EXYNOS machines | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License version 2 as | |
9 | * published by the Free Software Foundation. | |
10 | */ | |
11 | ||
12 | #ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H | |
13 | #define __ARCH_ARM_MACH_EXYNOS_COMMON_H | |
14 | ||
7b6d864b | 15 | #include <linux/reboot.h> |
6e6aac75 TA |
16 | #include <linux/of.h> |
17 | ||
940bc58d CC |
18 | #define EXYNOS3250_SOC_ID 0xE3472000 |
19 | #define EXYNOS3_SOC_MASK 0xFFFFF000 | |
20 | ||
7cb2ded1 SK |
21 | #define EXYNOS4210_CPU_ID 0x43210000 |
22 | #define EXYNOS4212_CPU_ID 0x43220000 | |
23 | #define EXYNOS4412_CPU_ID 0xE4412200 | |
24 | #define EXYNOS4_CPU_MASK 0xFFFE0000 | |
25 | ||
26 | #define EXYNOS5250_SOC_ID 0x43520000 | |
723c9c7e | 27 | #define EXYNOS5410_SOC_ID 0xE5410000 |
7cb2ded1 SK |
28 | #define EXYNOS5420_SOC_ID 0xE5420000 |
29 | #define EXYNOS5440_SOC_ID 0xE5440000 | |
86c6f148 | 30 | #define EXYNOS5800_SOC_ID 0xE5422000 |
7cb2ded1 SK |
31 | #define EXYNOS5_SOC_MASK 0xFFFFF000 |
32 | ||
33 | extern unsigned long samsung_cpu_id; | |
34 | ||
35 | #define IS_SAMSUNG_CPU(name, id, mask) \ | |
36 | static inline int is_samsung_##name(void) \ | |
37 | { \ | |
38 | return ((samsung_cpu_id & mask) == (id & mask)); \ | |
39 | } | |
40 | ||
940bc58d | 41 | IS_SAMSUNG_CPU(exynos3250, EXYNOS3250_SOC_ID, EXYNOS3_SOC_MASK) |
7cb2ded1 SK |
42 | IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK) |
43 | IS_SAMSUNG_CPU(exynos4212, EXYNOS4212_CPU_ID, EXYNOS4_CPU_MASK) | |
44 | IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK) | |
45 | IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID, EXYNOS5_SOC_MASK) | |
723c9c7e | 46 | IS_SAMSUNG_CPU(exynos5410, EXYNOS5410_SOC_ID, EXYNOS5_SOC_MASK) |
7cb2ded1 SK |
47 | IS_SAMSUNG_CPU(exynos5420, EXYNOS5420_SOC_ID, EXYNOS5_SOC_MASK) |
48 | IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK) | |
86c6f148 | 49 | IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK) |
7cb2ded1 | 50 | |
940bc58d CC |
51 | #if defined(CONFIG_SOC_EXYNOS3250) |
52 | # define soc_is_exynos3250() is_samsung_exynos3250() | |
53 | #else | |
54 | # define soc_is_exynos3250() 0 | |
55 | #endif | |
56 | ||
7cb2ded1 SK |
57 | #if defined(CONFIG_CPU_EXYNOS4210) |
58 | # define soc_is_exynos4210() is_samsung_exynos4210() | |
59 | #else | |
60 | # define soc_is_exynos4210() 0 | |
61 | #endif | |
62 | ||
63 | #if defined(CONFIG_SOC_EXYNOS4212) | |
64 | # define soc_is_exynos4212() is_samsung_exynos4212() | |
65 | #else | |
66 | # define soc_is_exynos4212() 0 | |
67 | #endif | |
68 | ||
69 | #if defined(CONFIG_SOC_EXYNOS4412) | |
70 | # define soc_is_exynos4412() is_samsung_exynos4412() | |
71 | #else | |
72 | # define soc_is_exynos4412() 0 | |
73 | #endif | |
74 | ||
75 | #define EXYNOS4210_REV_0 (0x0) | |
76 | #define EXYNOS4210_REV_1_0 (0x10) | |
77 | #define EXYNOS4210_REV_1_1 (0x11) | |
78 | ||
79 | #if defined(CONFIG_SOC_EXYNOS5250) | |
80 | # define soc_is_exynos5250() is_samsung_exynos5250() | |
81 | #else | |
82 | # define soc_is_exynos5250() 0 | |
83 | #endif | |
84 | ||
723c9c7e TD |
85 | #if defined(CONFIG_SOC_EXYNOS5410) |
86 | # define soc_is_exynos5410() is_samsung_exynos5410() | |
87 | #else | |
88 | # define soc_is_exynos5410() 0 | |
89 | #endif | |
90 | ||
7cb2ded1 SK |
91 | #if defined(CONFIG_SOC_EXYNOS5420) |
92 | # define soc_is_exynos5420() is_samsung_exynos5420() | |
93 | #else | |
94 | # define soc_is_exynos5420() 0 | |
95 | #endif | |
96 | ||
97 | #if defined(CONFIG_SOC_EXYNOS5440) | |
98 | # define soc_is_exynos5440() is_samsung_exynos5440() | |
99 | #else | |
100 | # define soc_is_exynos5440() 0 | |
101 | #endif | |
102 | ||
86c6f148 AK |
103 | #if defined(CONFIG_SOC_EXYNOS5800) |
104 | # define soc_is_exynos5800() is_samsung_exynos5800() | |
105 | #else | |
106 | # define soc_is_exynos5800() 0 | |
107 | #endif | |
108 | ||
7cb2ded1 SK |
109 | #define soc_is_exynos4() (soc_is_exynos4210() || soc_is_exynos4212() || \ |
110 | soc_is_exynos4412()) | |
723c9c7e TD |
111 | #define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5410() || \ |
112 | soc_is_exynos5420() || soc_is_exynos5800()) | |
7cb2ded1 | 113 | |
034c097c | 114 | void mct_init(void __iomem *base, int irq_g0, int irq_l0, int irq_l1); |
906c789c | 115 | |
06853ae4 | 116 | struct map_desc; |
b3205dea | 117 | extern void __iomem *sysram_ns_base_addr; |
cd245f59 | 118 | extern void __iomem *sysram_base_addr; |
0e2238ec | 119 | void exynos_init_io(void); |
cbf08b9e | 120 | void exynos_restart(enum reboot_mode mode, const char *cmd); |
35baa336 | 121 | void exynos_cpuidle_init(void); |
d568b6f7 | 122 | void exynos_cpufreq_init(void); |
bb13fabc SG |
123 | void exynos_init_late(void); |
124 | ||
bca28f8f TF |
125 | void exynos_firmware_init(void); |
126 | ||
d710aa31 TF |
127 | #ifdef CONFIG_PINCTRL_EXYNOS |
128 | extern u32 exynos_get_eint_wake_mask(void); | |
129 | #else | |
130 | static inline u32 exynos_get_eint_wake_mask(void) { return 0xffffffff; } | |
131 | #endif | |
132 | ||
559ba237 TF |
133 | #ifdef CONFIG_PM_SLEEP |
134 | extern void __init exynos_pm_init(void); | |
135 | #else | |
136 | static inline void exynos_pm_init(void) {} | |
137 | #endif | |
138 | ||
d710aa31 TF |
139 | extern void exynos_cpu_resume(void); |
140 | ||
06853ae4 MZ |
141 | extern struct smp_operations exynos_smp_ops; |
142 | ||
143 | extern void exynos_cpu_die(unsigned int cpu); | |
144 | ||
ccd458c1 KK |
145 | /* PMU(Power Management Unit) support */ |
146 | ||
147 | #define PMU_TABLE_END NULL | |
148 | ||
149 | enum sys_powerdown { | |
150 | SYS_AFTR, | |
151 | SYS_LPA, | |
152 | SYS_SLEEP, | |
153 | NUM_SYS_POWERDOWN, | |
154 | }; | |
155 | ||
ccd458c1 KK |
156 | struct exynos_pmu_conf { |
157 | void __iomem *reg; | |
158 | unsigned int val[NUM_SYS_POWERDOWN]; | |
159 | }; | |
160 | ||
161 | extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); | |
d3af6976 LKA |
162 | extern void exynos_cpu_power_down(int cpu); |
163 | extern void exynos_cpu_power_up(int cpu); | |
164 | extern int exynos_cpu_power_state(int cpu); | |
096d21c6 AK |
165 | extern void exynos_cluster_power_down(int cluster); |
166 | extern void exynos_cluster_power_up(int cluster); | |
167 | extern int exynos_cluster_power_state(int cluster); | |
3681bafe | 168 | extern void exynos_enter_aftr(void); |
ccd458c1 | 169 | |
7cb2ded1 SK |
170 | extern void s5p_init_cpu(void __iomem *cpuid_addr); |
171 | extern unsigned int samsung_rev(void); | |
172 | ||
cc511b8d | 173 | #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ |