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
)
51 #if defined(CONFIG_CPU_S3C2410) || defined(CONFIG_CPU_S3C2412) || \
52 defined(CONFIG_CPU_S3C2416) || defined(CONFIG_CPU_S3C2440) || \
53 defined(CONFIG_CPU_S3C2442) || defined(CONFIG_CPU_S3C244X) || \
54 defined(CONFIG_CPU_S3C2443)
55 # define soc_is_s3c24xx() is_samsung_s3c24xx()
56 # define soc_is_s3c2410() is_samsung_s3c2410()
58 # define soc_is_s3c24xx() 0
59 # define soc_is_s3c2410() 0
62 #if defined(CONFIG_CPU_S3C2412)
63 # define soc_is_s3c2412() is_samsung_s3c2412()
65 # define soc_is_s3c2412() 0
68 #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
69 # define soc_is_s3c6400() is_samsung_s3c6400()
70 # define soc_is_s3c6410() is_samsung_s3c6410()
71 # define soc_is_s3c64xx() (is_samsung_s3c6400() || is_samsung_s3c6410())
73 # define soc_is_s3c6400() 0
74 # define soc_is_s3c6410() 0
75 # define soc_is_s3c64xx() 0
78 #define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
85 #define MHZ (1000*1000)
88 #define print_mhz(m) ((m) / MHZ), (((m) / 1000) % 1000)
90 /* forward declaration */
91 struct s3c24xx_uart_resources
;
92 struct platform_device
;
93 struct s3c2410_uartcfg
;
96 /* per-cpu initialisation function table. */
100 unsigned long idmask
;
101 void (*map_io
)(void);
102 void (*init_uarts
)(struct s3c2410_uartcfg
*cfg
, int no
);
103 void (*init_clocks
)(int xtal
);
108 extern void s3c_init_cpu(unsigned long idcode
,
109 struct cpu_table
*cpus
, unsigned int cputab_size
);
111 /* core initialisation functions */
113 extern void s3c24xx_init_io(struct map_desc
*mach_desc
, int size
);
115 extern void s3c64xx_init_cpu(void);
117 extern unsigned int samsung_rev(void);
119 extern void s3c24xx_init_uarts(struct s3c2410_uartcfg
*cfg
, int no
);
121 extern void s3c24xx_init_clocks(int xtal
);
123 extern void s3c24xx_init_uartdevs(char *name
,
124 struct s3c24xx_uart_resources
*res
,
125 struct s3c2410_uartcfg
*cfg
, int no
);
127 extern struct syscore_ops s3c2410_pm_syscore_ops
;
128 extern struct syscore_ops s3c2412_pm_syscore_ops
;
129 extern struct syscore_ops s3c2416_pm_syscore_ops
;
130 extern struct syscore_ops s3c244x_pm_syscore_ops
;
132 /* system device subsystems */
134 extern struct bus_type s3c2410_subsys
;
135 extern struct bus_type s3c2410a_subsys
;
136 extern struct bus_type s3c2412_subsys
;
137 extern struct bus_type s3c2416_subsys
;
138 extern struct bus_type s3c2440_subsys
;
139 extern struct bus_type s3c2442_subsys
;
140 extern struct bus_type s3c2443_subsys
;
141 extern struct bus_type s3c6410_subsys
;