1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
6 * Copyright (c) 2004-2005 Simtec Electronics
9 * Header file for Samsung CPU support
12 /* todo - fix when rmk changes iodescs to use `void __iomem *` */
14 #ifndef __SAMSUNG_PLAT_CPU_H
15 #define __SAMSUNG_PLAT_CPU_H
17 extern unsigned long samsung_cpu_id;
19 #define S3C6400_CPU_ID 0x36400000
20 #define S3C6410_CPU_ID 0x36410000
21 #define S3C64XX_CPU_MASK 0xFFFFF000
23 #define S5PV210_CPU_ID 0x43110000
24 #define S5PV210_CPU_MASK 0xFFFFF000
26 #define IS_SAMSUNG_CPU(name, id, mask) \
27 static inline int is_samsung_##name(void) \
29 return ((samsung_cpu_id & mask) == (id & mask)); \
32 IS_SAMSUNG_CPU(s3c6400, S3C6400_CPU_ID, S3C64XX_CPU_MASK)
33 IS_SAMSUNG_CPU(s3c6410, S3C6410_CPU_ID, S3C64XX_CPU_MASK)
35 #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
36 # define soc_is_s3c6400() is_samsung_s3c6400()
37 # define soc_is_s3c6410() is_samsung_s3c6410()
38 # define soc_is_s3c64xx() (is_samsung_s3c6400() || is_samsung_s3c6410())
40 # define soc_is_s3c6400() 0
41 # define soc_is_s3c6410() 0
42 # define soc_is_s3c64xx() 0
46 #define MHZ (1000*1000)
49 #define print_mhz(m) ((m) / MHZ), (((m) / 1000) % 1000)
51 /* forward declaration */
52 struct s3c24xx_uart_resources;
53 struct platform_device;
54 struct s3c2410_uartcfg;
57 /* per-cpu initialisation function table. */
63 void (*init_uarts)(struct s3c2410_uartcfg *cfg, int no);
68 extern void s3c_init_cpu(unsigned long idcode,
69 struct cpu_table *cpus, unsigned int cputab_size);
71 /* core initialisation functions */
72 extern void s3c64xx_init_cpu(void);
74 extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no);
75 extern void s3c24xx_init_uartdevs(char *name,
76 struct s3c24xx_uart_resources *res,
77 struct s3c2410_uartcfg *cfg, int no);
79 extern struct bus_type s3c6410_subsys;