blob: 5848bef5bb49b1a7bf536f0bef91815cc165e025 [file] [log] [blame]
Krzysztof Kozlowski84b21702017-12-25 20:54:32 +01001/* SPDX-License-Identifier: GPL-2.0 */
Kukjin Kim8551f3f2012-03-29 08:55:48 +09002/*
3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Common Header for S3C24XX SoCs
Kukjin Kim8551f3f2012-03-29 08:55:48 +09007 */
8
9#ifndef __ARCH_ARM_MACH_S3C24XX_COMMON_H
10#define __ARCH_ARM_MACH_S3C24XX_COMMON_H __FILE__
11
Robin Holt7b6d8642013-07-08 16:01:40 -070012#include <linux/reboot.h>
Arnd Bergmannb2a587c2020-08-06 20:20:47 +020013#include <mach/irqs.h>
Robin Holt7b6d8642013-07-08 16:01:40 -070014
Heiko Stuebner74883352013-02-08 10:37:13 -080015struct s3c2410_uartcfg;
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080016
Heiko Stuebner74883352013-02-08 10:37:13 -080017#ifdef CONFIG_CPU_S3C2410
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080018extern int s3c2410_init(void);
19extern int s3c2410a_init(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080020extern void s3c2410_map_io(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080021extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080022extern void s3c2410_init_clocks(int xtal);
Heiko Stuebnerf182aa12013-03-07 12:38:19 +090023extern void s3c2410_init_irq(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080024#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 Stuebnere1a621d2013-02-08 10:31:28 -080033extern int s3c2412_init(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080034extern void s3c2412_map_io(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080035extern void s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080036extern void s3c2412_init_clocks(int xtal);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080037extern int s3c2412_baseclk_add(void);
Heiko Stuebner0da09932013-02-12 10:09:18 -080038extern void s3c2412_init_irq(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080039#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 Stuebnere1a621d2013-02-08 10:31:28 -080044#endif
45
46#ifdef CONFIG_CPU_S3C2416
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080047extern int s3c2416_init(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080048extern void s3c2416_map_io(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080049extern void s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080050extern void s3c2416_init_clocks(int xtal);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080051extern int s3c2416_baseclk_add(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080052extern void s3c2416_init_irq(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080053
Heiko Stuebner74883352013-02-08 10:37:13 -080054extern struct syscore_ops s3c2416_irq_syscore_ops;
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080055#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 Stuebnere1a621d2013-02-08 10:31:28 -080060#endif
61
62#if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2442)
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080063extern void s3c244x_map_io(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080064extern void s3c244x_init_uarts(struct s3c2410_uartcfg *cfg, int no);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080065#else
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080066#define s3c244x_init_uarts NULL
67#endif
68
69#ifdef CONFIG_CPU_S3C2440
70extern int s3c2440_init(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080071extern void s3c2440_map_io(void);
Heiko Stuebner4659c532014-05-09 05:49:14 +090072extern void s3c2440_init_clocks(int xtal);
Heiko Stuebnerce6c1642013-02-12 09:59:20 -080073extern void s3c2440_init_irq(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080074#else
75#define s3c2440_init NULL
76#define s3c2440_map_io NULL
77#endif
78
79#ifdef CONFIG_CPU_S3C2442
80extern int s3c2442_init(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080081extern void s3c2442_map_io(void);
Heiko Stuebner4659c532014-05-09 05:49:14 +090082extern void s3c2442_init_clocks(int xtal);
Heiko Stuebnerce6c1642013-02-12 09:59:20 -080083extern void s3c2442_init_irq(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080084#else
85#define s3c2442_init NULL
86#define s3c2442_map_io NULL
87#endif
88
89#ifdef CONFIG_CPU_S3C2443
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080090extern int s3c2443_init(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080091extern void s3c2443_map_io(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080092extern void s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080093extern void s3c2443_init_clocks(int xtal);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080094extern int s3c2443_baseclk_add(void);
Heiko Stuebnere1a621d2013-02-08 10:31:28 -080095extern 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 Stuebnere1a621d2013-02-08 10:31:28 -0800101#endif
102
Heiko Stuebnerd8fdec12013-01-29 10:25:22 -0800103extern struct syscore_ops s3c24xx_irq_syscore_ops;
104
Heiko Stuebner1fecf892013-10-21 05:32:48 +0900105extern struct platform_device s3c2410_device_dma;
Heiko Stuebnerf2dda072013-10-08 06:42:10 +0900106extern struct platform_device s3c2412_device_dma;
Heiko Stuebner1fecf892013-10-21 05:32:48 +0900107extern struct platform_device s3c2440_device_dma;
Heiko Stuebnerf2dda072013-10-08 06:42:10 +0900108extern struct platform_device s3c2443_device_dma;
109
Heiko Stuebner51cb1282014-05-09 05:48:57 +0900110extern struct platform_device s3c2410_device_dclk;
111
Krzysztof Kozlowskia1342f62020-08-20 22:42:03 +0200112enum s3c24xx_timer_mode {
113 S3C24XX_PWM0,
114 S3C24XX_PWM1,
115 S3C24XX_PWM2,
116 S3C24XX_PWM3,
117 S3C24XX_PWM4,
Krzysztof Kozlowski80c0b152020-08-04 21:26:45 +0200118};
119
Krzysztof Kozlowskia1342f62020-08-20 22:42:03 +0200120extern void __init s3c24xx_set_timer_source(enum s3c24xx_timer_mode event,
121 enum s3c24xx_timer_mode source);
122extern void __init s3c24xx_timer_init(void);
Krzysztof Kozlowski80c0b152020-08-04 21:26:45 +0200123
Kukjin Kim8551f3f2012-03-29 08:55:48 +0900124#endif /* __ARCH_ARM_MACH_S3C24XX_COMMON_H */