ARM: S5P64X0: no more support S5P6440 and S5P6450 SoCs
[deliverable/linux.git] / arch / arm / plat-samsung / include / plat / cpu.h
1 /* linux/arch/arm/plat-samsung/include/plat/cpu.h
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Copyright (c) 2004-2005 Simtec Electronics
7 * Ben Dooks <ben@simtec.co.uk>
8 *
9 * Header file for Samsung CPU support
10 *
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.
14 */
15
16 /* todo - fix when rmk changes iodescs to use `void __iomem *` */
17
18 #ifndef __SAMSUNG_PLAT_CPU_H
19 #define __SAMSUNG_PLAT_CPU_H
20
21 extern unsigned long samsung_cpu_id;
22
23 #define S3C2410_CPU_ID 0x32410000
24 #define S3C2410_CPU_MASK 0xFFFFFFFF
25
26 #define S3C24XX_CPU_ID 0x32400000
27 #define S3C24XX_CPU_MASK 0xFFF00000
28
29 #define S3C2412_CPU_ID 0x32412000
30 #define S3C2412_CPU_MASK 0xFFFFF000
31
32 #define S3C6400_CPU_ID 0x36400000
33 #define S3C6410_CPU_ID 0x36410000
34 #define S3C64XX_CPU_MASK 0xFFFFF000
35
36 #define S5PC100_CPU_ID 0x43100000
37 #define S5PC100_CPU_MASK 0xFFFFF000
38
39 #define S5PV210_CPU_ID 0x43110000
40 #define S5PV210_CPU_MASK 0xFFFFF000
41
42 #define IS_SAMSUNG_CPU(name, id, mask) \
43 static inline int is_samsung_##name(void) \
44 { \
45 return ((samsung_cpu_id & mask) == (id & mask)); \
46 }
47
48 IS_SAMSUNG_CPU(s3c2410, S3C2410_CPU_ID, S3C2410_CPU_MASK)
49 IS_SAMSUNG_CPU(s3c24xx, S3C24XX_CPU_ID, S3C24XX_CPU_MASK)
50 IS_SAMSUNG_CPU(s3c2412, S3C2412_CPU_ID, S3C2412_CPU_MASK)
51 IS_SAMSUNG_CPU(s3c6400, S3C6400_CPU_ID, S3C64XX_CPU_MASK)
52 IS_SAMSUNG_CPU(s3c6410, S3C6410_CPU_ID, S3C64XX_CPU_MASK)
53 IS_SAMSUNG_CPU(s5pc100, S5PC100_CPU_ID, S5PC100_CPU_MASK)
54 IS_SAMSUNG_CPU(s5pv210, S5PV210_CPU_ID, S5PV210_CPU_MASK)
55
56 #if defined(CONFIG_CPU_S3C2410) || defined(CONFIG_CPU_S3C2412) || \
57 defined(CONFIG_CPU_S3C2416) || defined(CONFIG_CPU_S3C2440) || \
58 defined(CONFIG_CPU_S3C2442) || defined(CONFIG_CPU_S3C244X) || \
59 defined(CONFIG_CPU_S3C2443)
60 # define soc_is_s3c24xx() is_samsung_s3c24xx()
61 # define soc_is_s3c2410() is_samsung_s3c2410()
62 #else
63 # define soc_is_s3c24xx() 0
64 # define soc_is_s3c2410() 0
65 #endif
66
67 #if defined(CONFIG_CPU_S3C2412)
68 # define soc_is_s3c2412() is_samsung_s3c2412()
69 #else
70 # define soc_is_s3c2412() 0
71 #endif
72
73 #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
74 # define soc_is_s3c6400() is_samsung_s3c6400()
75 # define soc_is_s3c6410() is_samsung_s3c6410()
76 # define soc_is_s3c64xx() (is_samsung_s3c6400() || is_samsung_s3c6410())
77 #else
78 # define soc_is_s3c6400() 0
79 # define soc_is_s3c6410() 0
80 # define soc_is_s3c64xx() 0
81 #endif
82
83 #if defined(CONFIG_CPU_S5PC100)
84 # define soc_is_s5pc100() is_samsung_s5pc100()
85 #else
86 # define soc_is_s5pc100() 0
87 #endif
88
89 #if defined(CONFIG_CPU_S5PV210)
90 # define soc_is_s5pv210() is_samsung_s5pv210()
91 #else
92 # define soc_is_s5pv210() 0
93 #endif
94
95 #define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
96
97 #ifndef KHZ
98 #define KHZ (1000)
99 #endif
100
101 #ifndef MHZ
102 #define MHZ (1000*1000)
103 #endif
104
105 #define print_mhz(m) ((m) / MHZ), (((m) / 1000) % 1000)
106
107 /* forward declaration */
108 struct s3c24xx_uart_resources;
109 struct platform_device;
110 struct s3c2410_uartcfg;
111 struct map_desc;
112
113 /* per-cpu initialisation function table. */
114
115 struct cpu_table {
116 unsigned long idcode;
117 unsigned long idmask;
118 void (*map_io)(void);
119 void (*init_uarts)(struct s3c2410_uartcfg *cfg, int no);
120 void (*init_clocks)(int xtal);
121 int (*init)(void);
122 const char *name;
123 };
124
125 extern void s3c_init_cpu(unsigned long idcode,
126 struct cpu_table *cpus, unsigned int cputab_size);
127
128 /* core initialisation functions */
129
130 extern void s5p_init_irq(u32 *vic, u32 num_vic);
131
132 extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
133
134 extern void s3c64xx_init_cpu(void);
135 extern void s5p_init_cpu(void __iomem *cpuid_addr);
136
137 extern unsigned int samsung_rev(void);
138
139 extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no);
140
141 extern void s3c24xx_init_clocks(int xtal);
142
143 extern void s3c24xx_init_uartdevs(char *name,
144 struct s3c24xx_uart_resources *res,
145 struct s3c2410_uartcfg *cfg, int no);
146
147 extern struct syscore_ops s3c2410_pm_syscore_ops;
148 extern struct syscore_ops s3c2412_pm_syscore_ops;
149 extern struct syscore_ops s3c2416_pm_syscore_ops;
150 extern struct syscore_ops s3c244x_pm_syscore_ops;
151
152 /* system device subsystems */
153
154 extern struct bus_type s3c2410_subsys;
155 extern struct bus_type s3c2410a_subsys;
156 extern struct bus_type s3c2412_subsys;
157 extern struct bus_type s3c2416_subsys;
158 extern struct bus_type s3c2440_subsys;
159 extern struct bus_type s3c2442_subsys;
160 extern struct bus_type s3c2443_subsys;
161 extern struct bus_type s3c6410_subsys;
162 extern struct bus_type s5pv210_subsys;
163
164 extern void (*s5pc1xx_idle)(void);
165
166 #endif
This page took 0.035657 seconds and 6 git commands to generate.