Commit | Line | Data |
---|---|---|
4490e3c6 KK |
1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | /* | |
c06af3cc KK |
3 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. |
4 | * http://www.samsung.com/ | |
1da177e4 LT |
5 | * |
6 | * Copyright (c) 2004-2005 Simtec Electronics | |
7 | * Ben Dooks <ben@simtec.co.uk> | |
8 | * | |
c06af3cc | 9 | * Header file for Samsung CPU support |
4490e3c6 | 10 | */ |
1da177e4 LT |
11 | |
12 | /* todo - fix when rmk changes iodescs to use `void __iomem *` */ | |
13 | ||
c3fcf5d1 KP |
14 | #ifndef __SAMSUNG_PLAT_CPU_H |
15 | #define __SAMSUNG_PLAT_CPU_H | |
16 | ||
c06af3cc KK |
17 | extern unsigned long samsung_cpu_id; |
18 | ||
c06af3cc KK |
19 | #define S3C6400_CPU_ID 0x36400000 |
20 | #define S3C6410_CPU_ID 0x36410000 | |
2747f5e5 | 21 | #define S3C64XX_CPU_MASK 0xFFFFF000 |
c06af3cc | 22 | |
c06af3cc KK |
23 | #define S5PV210_CPU_ID 0x43110000 |
24 | #define S5PV210_CPU_MASK 0xFFFFF000 | |
25 | ||
c06af3cc KK |
26 | #define IS_SAMSUNG_CPU(name, id, mask) \ |
27 | static inline int is_samsung_##name(void) \ | |
28 | { \ | |
29 | return ((samsung_cpu_id & mask) == (id & mask)); \ | |
30 | } | |
31 | ||
0f4e54c6 MB |
32 | IS_SAMSUNG_CPU(s3c6400, S3C6400_CPU_ID, S3C64XX_CPU_MASK) |
33 | IS_SAMSUNG_CPU(s3c6410, S3C6410_CPU_ID, S3C64XX_CPU_MASK) | |
c06af3cc | 34 | |
c06af3cc | 35 | #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410) |
57a23126 TF |
36 | # define soc_is_s3c6400() is_samsung_s3c6400() |
37 | # define soc_is_s3c6410() is_samsung_s3c6410() | |
0f4e54c6 | 38 | # define soc_is_s3c64xx() (is_samsung_s3c6400() || is_samsung_s3c6410()) |
c06af3cc | 39 | #else |
57a23126 TF |
40 | # define soc_is_s3c6400() 0 |
41 | # define soc_is_s3c6410() 0 | |
c06af3cc KK |
42 | # define soc_is_s3c64xx() 0 |
43 | #endif | |
44 | ||
1da177e4 LT |
45 | #ifndef MHZ |
46 | #define MHZ (1000*1000) | |
47 | #endif | |
48 | ||
a503059c | 49 | #define print_mhz(m) ((m) / MHZ), (((m) / 1000) % 1000) |
1da177e4 LT |
50 | |
51 | /* forward declaration */ | |
66a9b49a BD |
52 | struct s3c24xx_uart_resources; |
53 | struct platform_device; | |
1da177e4 LT |
54 | struct s3c2410_uartcfg; |
55 | struct map_desc; | |
56 | ||
74b265d4 BD |
57 | /* per-cpu initialisation function table. */ |
58 | ||
59 | struct cpu_table { | |
60 | unsigned long idcode; | |
61 | unsigned long idmask; | |
62 | void (*map_io)(void); | |
63 | void (*init_uarts)(struct s3c2410_uartcfg *cfg, int no); | |
74b265d4 BD |
64 | int (*init)(void); |
65 | const char *name; | |
66 | }; | |
67 | ||
68 | extern void s3c_init_cpu(unsigned long idcode, | |
69 | struct cpu_table *cpus, unsigned int cputab_size); | |
70 | ||
1da177e4 | 71 | /* core initialisation functions */ |
e6d1cb9f | 72 | extern void s3c64xx_init_cpu(void); |
56b20922 | 73 | |
1da177e4 | 74 | extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no); |
66a9b49a BD |
75 | extern void s3c24xx_init_uartdevs(char *name, |
76 | struct s3c24xx_uart_resources *res, | |
77 | struct s3c2410_uartcfg *cfg, int no); | |
78 | ||
4a858cfc | 79 | extern struct bus_type s3c6410_subsys; |
1deb507d | 80 | |
c3fcf5d1 | 81 | #endif |