Merge tag 'power-exynos' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux...
[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 S5PV210_CPU_ID 0x43110000
37 #define S5PV210_CPU_MASK 0xFFFFF000
38
39 #define IS_SAMSUNG_CPU(name, id, mask) \
40 static inline int is_samsung_##name(void) \
41 { \
42 return ((samsung_cpu_id & mask) == (id & mask)); \
43 }
44
45 IS_SAMSUNG_CPU(s3c2410, S3C2410_CPU_ID, S3C2410_CPU_MASK)
46 IS_SAMSUNG_CPU(s3c24xx, S3C24XX_CPU_ID, S3C24XX_CPU_MASK)
47 IS_SAMSUNG_CPU(s3c2412, S3C2412_CPU_ID, S3C2412_CPU_MASK)
48 IS_SAMSUNG_CPU(s3c6400, S3C6400_CPU_ID, S3C64XX_CPU_MASK)
49 IS_SAMSUNG_CPU(s3c6410, S3C6410_CPU_ID, S3C64XX_CPU_MASK)
50 IS_SAMSUNG_CPU(s5pv210, S5PV210_CPU_ID, S5PV210_CPU_MASK)
51
52 #if defined(CONFIG_CPU_S3C2410) || defined(CONFIG_CPU_S3C2412) || \
53 defined(CONFIG_CPU_S3C2416) || defined(CONFIG_CPU_S3C2440) || \
54 defined(CONFIG_CPU_S3C2442) || defined(CONFIG_CPU_S3C244X) || \
55 defined(CONFIG_CPU_S3C2443)
56 # define soc_is_s3c24xx() is_samsung_s3c24xx()
57 # define soc_is_s3c2410() is_samsung_s3c2410()
58 #else
59 # define soc_is_s3c24xx() 0
60 # define soc_is_s3c2410() 0
61 #endif
62
63 #if defined(CONFIG_CPU_S3C2412)
64 # define soc_is_s3c2412() is_samsung_s3c2412()
65 #else
66 # define soc_is_s3c2412() 0
67 #endif
68
69 #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
70 # define soc_is_s3c6400() is_samsung_s3c6400()
71 # define soc_is_s3c6410() is_samsung_s3c6410()
72 # define soc_is_s3c64xx() (is_samsung_s3c6400() || is_samsung_s3c6410())
73 #else
74 # define soc_is_s3c6400() 0
75 # define soc_is_s3c6410() 0
76 # define soc_is_s3c64xx() 0
77 #endif
78
79 #if defined(CONFIG_CPU_S5PV210)
80 # define soc_is_s5pv210() is_samsung_s5pv210()
81 #else
82 # define soc_is_s5pv210() 0
83 #endif
84
85 #define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
86
87 #ifndef KHZ
88 #define KHZ (1000)
89 #endif
90
91 #ifndef MHZ
92 #define MHZ (1000*1000)
93 #endif
94
95 #define print_mhz(m) ((m) / MHZ), (((m) / 1000) % 1000)
96
97 /* forward declaration */
98 struct s3c24xx_uart_resources;
99 struct platform_device;
100 struct s3c2410_uartcfg;
101 struct map_desc;
102
103 /* per-cpu initialisation function table. */
104
105 struct cpu_table {
106 unsigned long idcode;
107 unsigned long idmask;
108 void (*map_io)(void);
109 void (*init_uarts)(struct s3c2410_uartcfg *cfg, int no);
110 void (*init_clocks)(int xtal);
111 int (*init)(void);
112 const char *name;
113 };
114
115 extern void s3c_init_cpu(unsigned long idcode,
116 struct cpu_table *cpus, unsigned int cputab_size);
117
118 /* core initialisation functions */
119
120 extern void s5p_init_irq(u32 *vic, u32 num_vic);
121
122 extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
123
124 extern void s3c64xx_init_cpu(void);
125 extern void s5p_init_cpu(void __iomem *cpuid_addr);
126
127 extern unsigned int samsung_rev(void);
128
129 extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no);
130
131 extern void s3c24xx_init_clocks(int xtal);
132
133 extern void s3c24xx_init_uartdevs(char *name,
134 struct s3c24xx_uart_resources *res,
135 struct s3c2410_uartcfg *cfg, int no);
136
137 extern struct syscore_ops s3c2410_pm_syscore_ops;
138 extern struct syscore_ops s3c2412_pm_syscore_ops;
139 extern struct syscore_ops s3c2416_pm_syscore_ops;
140 extern struct syscore_ops s3c244x_pm_syscore_ops;
141
142 /* system device subsystems */
143
144 extern struct bus_type s3c2410_subsys;
145 extern struct bus_type s3c2410a_subsys;
146 extern struct bus_type s3c2412_subsys;
147 extern struct bus_type s3c2416_subsys;
148 extern struct bus_type s3c2440_subsys;
149 extern struct bus_type s3c2442_subsys;
150 extern struct bus_type s3c2443_subsys;
151 extern struct bus_type s3c6410_subsys;
152 extern struct bus_type s5pv210_subsys;
153
154 extern void (*s5pc1xx_idle)(void);
155
156 #endif
This page took 0.032773 seconds and 5 git commands to generate.