1 /* linux/arch/arm/plat-samsung/include/plat/cpu.h
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
6 * Copyright (c) 2004-2005 Simtec Electronics
7 * Ben Dooks <ben@simtec.co.uk>
9 * Header file for Samsung CPU support
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
16 /* todo - fix when rmk changes iodescs to use `void __iomem *` */
18 #ifndef __SAMSUNG_PLAT_CPU_H
19 #define __SAMSUNG_PLAT_CPU_H
21 extern unsigned long samsung_cpu_id
;
23 #define S3C24XX_CPU_ID 0x32400000
24 #define S3C24XX_CPU_MASK 0xFFF00000
26 #define S3C6400_CPU_ID 0x36400000
27 #define S3C6410_CPU_ID 0x36410000
28 #define S3C64XX_CPU_MASK 0xFFFFF000
30 #define S5P6440_CPU_ID 0x56440000
31 #define S5P6450_CPU_ID 0x36450000
32 #define S5P64XX_CPU_MASK 0xFFFFF000
34 #define S5PC100_CPU_ID 0x43100000
35 #define S5PC100_CPU_MASK 0xFFFFF000
37 #define S5PV210_CPU_ID 0x43110000
38 #define S5PV210_CPU_MASK 0xFFFFF000
40 #define EXYNOS4210_CPU_ID 0x43210000
41 #define EXYNOS4212_CPU_ID 0x43220000
42 #define EXYNOS4412_CPU_ID 0xE4412200
43 #define EXYNOS4_CPU_MASK 0xFFFE0000
45 #define EXYNOS5250_SOC_ID 0x43520000
46 #define EXYNOS5440_SOC_ID 0x54400000
47 #define EXYNOS5_SOC_MASK 0xFFFFF000
49 #define IS_SAMSUNG_CPU(name, id, mask) \
50 static inline int is_samsung_##name(void) \
52 return ((samsung_cpu_id & mask) == (id & mask)); \
55 IS_SAMSUNG_CPU(s3c24xx
, S3C24XX_CPU_ID
, S3C24XX_CPU_MASK
)
56 IS_SAMSUNG_CPU(s3c6400
, S3C6400_CPU_ID
, S3C64XX_CPU_MASK
)
57 IS_SAMSUNG_CPU(s3c6410
, S3C6410_CPU_ID
, S3C64XX_CPU_MASK
)
58 IS_SAMSUNG_CPU(s5p6440
, S5P6440_CPU_ID
, S5P64XX_CPU_MASK
)
59 IS_SAMSUNG_CPU(s5p6450
, S5P6450_CPU_ID
, S5P64XX_CPU_MASK
)
60 IS_SAMSUNG_CPU(s5pc100
, S5PC100_CPU_ID
, S5PC100_CPU_MASK
)
61 IS_SAMSUNG_CPU(s5pv210
, S5PV210_CPU_ID
, S5PV210_CPU_MASK
)
62 IS_SAMSUNG_CPU(exynos4210
, EXYNOS4210_CPU_ID
, EXYNOS4_CPU_MASK
)
63 IS_SAMSUNG_CPU(exynos4212
, EXYNOS4212_CPU_ID
, EXYNOS4_CPU_MASK
)
64 IS_SAMSUNG_CPU(exynos4412
, EXYNOS4412_CPU_ID
, EXYNOS4_CPU_MASK
)
65 IS_SAMSUNG_CPU(exynos5250
, EXYNOS5250_SOC_ID
, EXYNOS5_SOC_MASK
)
66 IS_SAMSUNG_CPU(exynos5440
, EXYNOS5440_SOC_ID
, EXYNOS5_SOC_MASK
)
68 #if defined(CONFIG_CPU_S3C2410) || defined(CONFIG_CPU_S3C2412) || \
69 defined(CONFIG_CPU_S3C2416) || defined(CONFIG_CPU_S3C2440) || \
70 defined(CONFIG_CPU_S3C2442) || defined(CONFIG_CPU_S3C244X) || \
71 defined(CONFIG_CPU_S3C2443)
72 # define soc_is_s3c24xx() is_samsung_s3c24xx()
74 # define soc_is_s3c24xx() 0
77 #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
78 # define soc_is_s3c64xx() (is_samsung_s3c6400() || is_samsung_s3c6410())
80 # define soc_is_s3c64xx() 0
83 #if defined(CONFIG_CPU_S5P6440)
84 # define soc_is_s5p6440() is_samsung_s5p6440()
86 # define soc_is_s5p6440() 0
89 #if defined(CONFIG_CPU_S5P6450)
90 # define soc_is_s5p6450() is_samsung_s5p6450()
92 # define soc_is_s5p6450() 0
95 #if defined(CONFIG_CPU_S5PC100)
96 # define soc_is_s5pc100() is_samsung_s5pc100()
98 # define soc_is_s5pc100() 0
101 #if defined(CONFIG_CPU_S5PV210)
102 # define soc_is_s5pv210() is_samsung_s5pv210()
104 # define soc_is_s5pv210() 0
107 #if defined(CONFIG_CPU_EXYNOS4210)
108 # define soc_is_exynos4210() is_samsung_exynos4210()
110 # define soc_is_exynos4210() 0
113 #if defined(CONFIG_SOC_EXYNOS4212)
114 # define soc_is_exynos4212() is_samsung_exynos4212()
116 # define soc_is_exynos4212() 0
119 #if defined(CONFIG_SOC_EXYNOS4412)
120 # define soc_is_exynos4412() is_samsung_exynos4412()
122 # define soc_is_exynos4412() 0
125 #define EXYNOS4210_REV_0 (0x0)
126 #define EXYNOS4210_REV_1_0 (0x10)
127 #define EXYNOS4210_REV_1_1 (0x11)
129 #if defined(CONFIG_SOC_EXYNOS5250)
130 # define soc_is_exynos5250() is_samsung_exynos5250()
132 # define soc_is_exynos5250() 0
135 #if defined(CONFIG_SOC_EXYNOS5440)
136 # define soc_is_exynos5440() is_samsung_exynos5440()
138 # define soc_is_exynos5440() 0
141 #define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
148 #define MHZ (1000*1000)
151 #define print_mhz(m) ((m) / MHZ), (((m) / 1000) % 1000)
153 /* forward declaration */
154 struct s3c24xx_uart_resources
;
155 struct platform_device
;
156 struct s3c2410_uartcfg
;
159 /* per-cpu initialisation function table. */
162 unsigned long idcode
;
163 unsigned long idmask
;
164 void (*map_io
)(void);
165 void (*init_uarts
)(struct s3c2410_uartcfg
*cfg
, int no
);
166 void (*init_clocks
)(int xtal
);
171 extern void s3c_init_cpu(unsigned long idcode
,
172 struct cpu_table
*cpus
, unsigned int cputab_size
);
174 /* core initialisation functions */
176 extern void s3c24xx_init_irq(void);
177 extern void s5p_init_irq(u32
*vic
, u32 num_vic
);
179 extern void s3c24xx_init_io(struct map_desc
*mach_desc
, int size
);
181 extern void s3c24xx_init_cpu(void);
182 extern void s3c64xx_init_cpu(void);
183 extern void s5p_init_cpu(void __iomem
*cpuid_addr
);
185 extern unsigned int samsung_rev(void);
187 extern void s3c24xx_init_uarts(struct s3c2410_uartcfg
*cfg
, int no
);
189 extern void s3c24xx_init_clocks(int xtal
);
191 extern void s3c24xx_init_uartdevs(char *name
,
192 struct s3c24xx_uart_resources
*res
,
193 struct s3c2410_uartcfg
*cfg
, int no
);
195 /* timer for 2410/2440 */
198 extern struct sys_timer s3c24xx_timer
;
200 extern struct syscore_ops s3c2410_pm_syscore_ops
;
201 extern struct syscore_ops s3c2412_pm_syscore_ops
;
202 extern struct syscore_ops s3c2416_pm_syscore_ops
;
203 extern struct syscore_ops s3c244x_pm_syscore_ops
;
205 /* system device subsystems */
207 extern struct bus_type s3c2410_subsys
;
208 extern struct bus_type s3c2410a_subsys
;
209 extern struct bus_type s3c2412_subsys
;
210 extern struct bus_type s3c2416_subsys
;
211 extern struct bus_type s3c2440_subsys
;
212 extern struct bus_type s3c2442_subsys
;
213 extern struct bus_type s3c2443_subsys
;
214 extern struct bus_type s3c6410_subsys
;
215 extern struct bus_type s5p64x0_subsys
;
216 extern struct bus_type s5pv210_subsys
;
217 extern struct bus_type exynos_subsys
;
219 extern void (*s5pc1xx_idle
)(void);