Krzysztof Kozlowski | 84b2170 | 2017-12-25 20:54:32 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Kukjin Kim | 8551f3f | 2012-03-29 08:55:48 +0900 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2012 Samsung Electronics Co., Ltd. |
| 4 | * http://www.samsung.com |
| 5 | * |
| 6 | * Common Header for S3C24XX SoCs |
Kukjin Kim | 8551f3f | 2012-03-29 08:55:48 +0900 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef __ARCH_ARM_MACH_S3C24XX_COMMON_H |
| 10 | #define __ARCH_ARM_MACH_S3C24XX_COMMON_H __FILE__ |
| 11 | |
Robin Holt | 7b6d864 | 2013-07-08 16:01:40 -0700 | [diff] [blame] | 12 | #include <linux/reboot.h> |
Arnd Bergmann | b2a587c | 2020-08-06 20:20:47 +0200 | [diff] [blame] | 13 | #include <mach/irqs.h> |
Robin Holt | 7b6d864 | 2013-07-08 16:01:40 -0700 | [diff] [blame] | 14 | |
Heiko Stuebner | 7488335 | 2013-02-08 10:37:13 -0800 | [diff] [blame] | 15 | struct s3c2410_uartcfg; |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 16 | |
Heiko Stuebner | 7488335 | 2013-02-08 10:37:13 -0800 | [diff] [blame] | 17 | #ifdef CONFIG_CPU_S3C2410 |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 18 | extern int s3c2410_init(void); |
| 19 | extern int s3c2410a_init(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 20 | extern void s3c2410_map_io(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 21 | extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 22 | extern void s3c2410_init_clocks(int xtal); |
Heiko Stuebner | f182aa1 | 2013-03-07 12:38:19 +0900 | [diff] [blame] | 23 | extern void s3c2410_init_irq(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 24 | #else |
| 25 | #define s3c2410_init_clocks NULL |
| 26 | #define s3c2410_init_uarts NULL |
| 27 | #define s3c2410_map_io NULL |
| 28 | #define s3c2410_init NULL |
| 29 | #define s3c2410a_init NULL |
| 30 | #endif |
| 31 | |
| 32 | #ifdef CONFIG_CPU_S3C2412 |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 33 | extern int s3c2412_init(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 34 | extern void s3c2412_map_io(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 35 | extern void s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 36 | extern void s3c2412_init_clocks(int xtal); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 37 | extern int s3c2412_baseclk_add(void); |
Heiko Stuebner | 0da0993 | 2013-02-12 10:09:18 -0800 | [diff] [blame] | 38 | extern void s3c2412_init_irq(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 39 | #else |
| 40 | #define s3c2412_init_clocks NULL |
| 41 | #define s3c2412_init_uarts NULL |
| 42 | #define s3c2412_map_io NULL |
| 43 | #define s3c2412_init NULL |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 44 | #endif |
| 45 | |
| 46 | #ifdef CONFIG_CPU_S3C2416 |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 47 | extern int s3c2416_init(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 48 | extern void s3c2416_map_io(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 49 | extern void s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 50 | extern void s3c2416_init_clocks(int xtal); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 51 | extern int s3c2416_baseclk_add(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 52 | extern void s3c2416_init_irq(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 53 | |
Heiko Stuebner | 7488335 | 2013-02-08 10:37:13 -0800 | [diff] [blame] | 54 | extern struct syscore_ops s3c2416_irq_syscore_ops; |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 55 | #else |
| 56 | #define s3c2416_init_clocks NULL |
| 57 | #define s3c2416_init_uarts NULL |
| 58 | #define s3c2416_map_io NULL |
| 59 | #define s3c2416_init NULL |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 60 | #endif |
| 61 | |
| 62 | #if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2442) |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 63 | extern void s3c244x_map_io(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 64 | extern void s3c244x_init_uarts(struct s3c2410_uartcfg *cfg, int no); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 65 | #else |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 66 | #define s3c244x_init_uarts NULL |
| 67 | #endif |
| 68 | |
| 69 | #ifdef CONFIG_CPU_S3C2440 |
| 70 | extern int s3c2440_init(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 71 | extern void s3c2440_map_io(void); |
Heiko Stuebner | 4659c53 | 2014-05-09 05:49:14 +0900 | [diff] [blame] | 72 | extern void s3c2440_init_clocks(int xtal); |
Heiko Stuebner | ce6c164 | 2013-02-12 09:59:20 -0800 | [diff] [blame] | 73 | extern void s3c2440_init_irq(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 74 | #else |
| 75 | #define s3c2440_init NULL |
| 76 | #define s3c2440_map_io NULL |
| 77 | #endif |
| 78 | |
| 79 | #ifdef CONFIG_CPU_S3C2442 |
| 80 | extern int s3c2442_init(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 81 | extern void s3c2442_map_io(void); |
Heiko Stuebner | 4659c53 | 2014-05-09 05:49:14 +0900 | [diff] [blame] | 82 | extern void s3c2442_init_clocks(int xtal); |
Heiko Stuebner | ce6c164 | 2013-02-12 09:59:20 -0800 | [diff] [blame] | 83 | extern void s3c2442_init_irq(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 84 | #else |
| 85 | #define s3c2442_init NULL |
| 86 | #define s3c2442_map_io NULL |
| 87 | #endif |
| 88 | |
| 89 | #ifdef CONFIG_CPU_S3C2443 |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 90 | extern int s3c2443_init(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 91 | extern void s3c2443_map_io(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 92 | extern void s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 93 | extern void s3c2443_init_clocks(int xtal); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 94 | extern int s3c2443_baseclk_add(void); |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 95 | extern void s3c2443_init_irq(void); |
| 96 | #else |
| 97 | #define s3c2443_init_clocks NULL |
| 98 | #define s3c2443_init_uarts NULL |
| 99 | #define s3c2443_map_io NULL |
| 100 | #define s3c2443_init NULL |
Heiko Stuebner | e1a621d | 2013-02-08 10:31:28 -0800 | [diff] [blame] | 101 | #endif |
| 102 | |
Heiko Stuebner | d8fdec1 | 2013-01-29 10:25:22 -0800 | [diff] [blame] | 103 | extern struct syscore_ops s3c24xx_irq_syscore_ops; |
| 104 | |
Heiko Stuebner | 1fecf89 | 2013-10-21 05:32:48 +0900 | [diff] [blame] | 105 | extern struct platform_device s3c2410_device_dma; |
Heiko Stuebner | f2dda07 | 2013-10-08 06:42:10 +0900 | [diff] [blame] | 106 | extern struct platform_device s3c2412_device_dma; |
Heiko Stuebner | 1fecf89 | 2013-10-21 05:32:48 +0900 | [diff] [blame] | 107 | extern struct platform_device s3c2440_device_dma; |
Heiko Stuebner | f2dda07 | 2013-10-08 06:42:10 +0900 | [diff] [blame] | 108 | extern struct platform_device s3c2443_device_dma; |
| 109 | |
Heiko Stuebner | 51cb128 | 2014-05-09 05:48:57 +0900 | [diff] [blame] | 110 | extern struct platform_device s3c2410_device_dclk; |
| 111 | |
Krzysztof Kozlowski | a1342f6 | 2020-08-20 22:42:03 +0200 | [diff] [blame] | 112 | enum s3c24xx_timer_mode { |
| 113 | S3C24XX_PWM0, |
| 114 | S3C24XX_PWM1, |
| 115 | S3C24XX_PWM2, |
| 116 | S3C24XX_PWM3, |
| 117 | S3C24XX_PWM4, |
Krzysztof Kozlowski | 80c0b15 | 2020-08-04 21:26:45 +0200 | [diff] [blame] | 118 | }; |
| 119 | |
Krzysztof Kozlowski | a1342f6 | 2020-08-20 22:42:03 +0200 | [diff] [blame] | 120 | extern void __init s3c24xx_set_timer_source(enum s3c24xx_timer_mode event, |
| 121 | enum s3c24xx_timer_mode source); |
| 122 | extern void __init s3c24xx_timer_init(void); |
Krzysztof Kozlowski | 80c0b15 | 2020-08-04 21:26:45 +0200 | [diff] [blame] | 123 | |
Kukjin Kim | 8551f3f | 2012-03-29 08:55:48 +0900 | [diff] [blame] | 124 | #endif /* __ARCH_ARM_MACH_S3C24XX_COMMON_H */ |