]>
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 | ||
7cb2ded1 SK |
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 | |
86c6f148 | 26 | #define EXYNOS5800_SOC_ID 0xE5422000 |
7cb2ded1 SK |
27 | #define EXYNOS5_SOC_MASK 0xFFFFF000 |
28 | ||
29 | extern unsigned long samsung_cpu_id; | |
30 | ||
31 | #define IS_SAMSUNG_CPU(name, id, mask) \ | |
32 | static inline int is_samsung_##name(void) \ | |
33 | { \ | |
34 | return ((samsung_cpu_id & mask) == (id & mask)); \ | |
35 | } | |
36 | ||
37 | IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK) | |
38 | IS_SAMSUNG_CPU(exynos4212, EXYNOS4212_CPU_ID, EXYNOS4_CPU_MASK) | |
39 | IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK) | |
40 | IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID, EXYNOS5_SOC_MASK) | |
41 | IS_SAMSUNG_CPU(exynos5420, EXYNOS5420_SOC_ID, EXYNOS5_SOC_MASK) | |
42 | IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK) | |
86c6f148 | 43 | IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK) |
7cb2ded1 SK |
44 | |
45 | #if defined(CONFIG_CPU_EXYNOS4210) | |
46 | # define soc_is_exynos4210() is_samsung_exynos4210() | |
47 | #else | |
48 | # define soc_is_exynos4210() 0 | |
49 | #endif | |
50 | ||
51 | #if defined(CONFIG_SOC_EXYNOS4212) | |
52 | # define soc_is_exynos4212() is_samsung_exynos4212() | |
53 | #else | |
54 | # define soc_is_exynos4212() 0 | |
55 | #endif | |
56 | ||
57 | #if defined(CONFIG_SOC_EXYNOS4412) | |
58 | # define soc_is_exynos4412() is_samsung_exynos4412() | |
59 | #else | |
60 | # define soc_is_exynos4412() 0 | |
61 | #endif | |
62 | ||
63 | #define EXYNOS4210_REV_0 (0x0) | |
64 | #define EXYNOS4210_REV_1_0 (0x10) | |
65 | #define EXYNOS4210_REV_1_1 (0x11) | |
66 | ||
67 | #if defined(CONFIG_SOC_EXYNOS5250) | |
68 | # define soc_is_exynos5250() is_samsung_exynos5250() | |
69 | #else | |
70 | # define soc_is_exynos5250() 0 | |
71 | #endif | |
72 | ||
73 | #if defined(CONFIG_SOC_EXYNOS5420) | |
74 | # define soc_is_exynos5420() is_samsung_exynos5420() | |
75 | #else | |
76 | # define soc_is_exynos5420() 0 | |
77 | #endif | |
78 | ||
79 | #if defined(CONFIG_SOC_EXYNOS5440) | |
80 | # define soc_is_exynos5440() is_samsung_exynos5440() | |
81 | #else | |
82 | # define soc_is_exynos5440() 0 | |
83 | #endif | |
84 | ||
86c6f148 AK |
85 | #if defined(CONFIG_SOC_EXYNOS5800) |
86 | # define soc_is_exynos5800() is_samsung_exynos5800() | |
87 | #else | |
88 | # define soc_is_exynos5800() 0 | |
89 | #endif | |
90 | ||
7cb2ded1 SK |
91 | #define soc_is_exynos4() (soc_is_exynos4210() || soc_is_exynos4212() || \ |
92 | soc_is_exynos4412()) | |
86c6f148 AK |
93 | #define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5420() || \ |
94 | soc_is_exynos5800()) | |
7cb2ded1 | 95 | |
034c097c | 96 | void mct_init(void __iomem *base, int irq_g0, int irq_l0, int irq_l1); |
906c789c | 97 | |
06853ae4 | 98 | struct map_desc; |
0e2238ec | 99 | void exynos_init_io(void); |
cbf08b9e | 100 | void exynos_restart(enum reboot_mode mode, const char *cmd); |
35baa336 | 101 | void exynos_cpuidle_init(void); |
d568b6f7 | 102 | void exynos_cpufreq_init(void); |
bb13fabc SG |
103 | void exynos_init_late(void); |
104 | ||
bca28f8f TF |
105 | void exynos_firmware_init(void); |
106 | ||
d710aa31 TF |
107 | #ifdef CONFIG_PINCTRL_EXYNOS |
108 | extern u32 exynos_get_eint_wake_mask(void); | |
109 | #else | |
110 | static inline u32 exynos_get_eint_wake_mask(void) { return 0xffffffff; } | |
111 | #endif | |
112 | ||
559ba237 TF |
113 | #ifdef CONFIG_PM_SLEEP |
114 | extern void __init exynos_pm_init(void); | |
115 | #else | |
116 | static inline void exynos_pm_init(void) {} | |
117 | #endif | |
118 | ||
d710aa31 TF |
119 | extern void exynos_cpu_resume(void); |
120 | ||
06853ae4 MZ |
121 | extern struct smp_operations exynos_smp_ops; |
122 | ||
123 | extern void exynos_cpu_die(unsigned int cpu); | |
124 | ||
ccd458c1 KK |
125 | /* PMU(Power Management Unit) support */ |
126 | ||
127 | #define PMU_TABLE_END NULL | |
128 | ||
129 | enum sys_powerdown { | |
130 | SYS_AFTR, | |
131 | SYS_LPA, | |
132 | SYS_SLEEP, | |
133 | NUM_SYS_POWERDOWN, | |
134 | }; | |
135 | ||
136 | extern unsigned long l2x0_regs_phys; | |
137 | struct exynos_pmu_conf { | |
138 | void __iomem *reg; | |
139 | unsigned int val[NUM_SYS_POWERDOWN]; | |
140 | }; | |
141 | ||
142 | extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); | |
ccd458c1 | 143 | |
7cb2ded1 SK |
144 | extern void s5p_init_cpu(void __iomem *cpuid_addr); |
145 | extern unsigned int samsung_rev(void); | |
146 | ||
cc511b8d | 147 | #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ |