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 S3C2410_CPU_ID 0x32410000
24 #define S3C2410_CPU_MASK 0xFFFFFFFF
26 #define S3C24XX_CPU_ID 0x32400000
27 #define S3C24XX_CPU_MASK 0xFFF00000
29 #define S3C2412_CPU_ID 0x32412000
30 #define S3C2412_CPU_MASK 0xFFFFF000
32 #define S3C6400_CPU_ID 0x36400000
33 #define S3C6410_CPU_ID 0x36410000
34 #define S3C64XX_CPU_MASK 0xFFFFF000
36 #define S5PV210_CPU_ID 0x43110000
37 #define S5PV210_CPU_MASK 0xFFFFF000
39 #define IS_SAMSUNG_CPU(name, id, mask) \
40 static inline int is_samsung_##name(void) \
42 return ((samsung_cpu_id & mask) == (id & mask)); \
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
)
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()
59 # define soc_is_s3c24xx() 0
60 # define soc_is_s3c2410() 0
63 #if defined(CONFIG_CPU_S3C2412)
64 # define soc_is_s3c2412() is_samsung_s3c2412()
66 # define soc_is_s3c2412() 0
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())
74 # define soc_is_s3c6400() 0
75 # define soc_is_s3c6410() 0
76 # define soc_is_s3c64xx() 0
79 #if defined(CONFIG_CPU_S5PV210)
80 # define soc_is_s5pv210() is_samsung_s5pv210()
82 # define soc_is_s5pv210() 0
85 #define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
92 #define MHZ (1000*1000)
95 #define print_mhz(m) ((m) / MHZ), (((m) / 1000) % 1000)
97 /* forward declaration */
98 struct s3c24xx_uart_resources
;
99 struct platform_device
;
100 struct s3c2410_uartcfg
;
103 /* per-cpu initialisation function 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
);
115 extern void s3c_init_cpu(unsigned long idcode
,
116 struct cpu_table
*cpus
, unsigned int cputab_size
);
118 /* core initialisation functions */
120 extern void s5p_init_irq(u32
*vic
, u32 num_vic
);
122 extern void s3c24xx_init_io(struct map_desc
*mach_desc
, int size
);
124 extern void s3c64xx_init_cpu(void);
125 extern void s5p_init_cpu(void __iomem
*cpuid_addr
);
127 extern unsigned int samsung_rev(void);
129 extern void s3c24xx_init_uarts(struct s3c2410_uartcfg
*cfg
, int no
);
131 extern void s3c24xx_init_clocks(int xtal
);
133 extern void s3c24xx_init_uartdevs(char *name
,
134 struct s3c24xx_uart_resources
*res
,
135 struct s3c2410_uartcfg
*cfg
, int no
);
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
;
142 /* system device subsystems */
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
;
154 extern void (*s5pc1xx_idle
)(void);