]>
Commit | Line | Data |
---|---|---|
84b21701 KK |
1 | // SPDX-License-Identifier: GPL-2.0 |
2 | // | |
3 | // Copyright (c) 2003-2005 Simtec Electronics | |
4 | // Ben Dooks <ben@simtec.co.uk> | |
5 | // | |
6 | // http://www.simtec.co.uk/products/EB2410ITX/ | |
1da177e4 LT |
7 | |
8 | #include <linux/kernel.h> | |
9 | #include <linux/types.h> | |
10 | #include <linux/interrupt.h> | |
11 | #include <linux/list.h> | |
12 | #include <linux/timer.h> | |
13 | #include <linux/init.h> | |
1ec7269f | 14 | #include <linux/gpio.h> |
e425382e | 15 | #include <linux/clk.h> |
4a858cfc | 16 | #include <linux/device.h> |
bb072c3c | 17 | #include <linux/syscore_ops.h> |
b6d1f542 | 18 | #include <linux/serial_core.h> |
334a1c70 | 19 | #include <linux/serial_s3c.h> |
d052d1be | 20 | #include <linux/platform_device.h> |
7b6d864b | 21 | #include <linux/reboot.h> |
fced80c7 | 22 | #include <linux/io.h> |
1da177e4 LT |
23 | |
24 | #include <asm/mach/arch.h> | |
25 | #include <asm/mach/map.h> | |
26 | #include <asm/mach/irq.h> | |
27 | ||
c6ff132d AB |
28 | #include "map.h" |
29 | #include "gpio-samsung.h" | |
1da177e4 | 30 | #include <asm/irq.h> |
9f97da78 | 31 | #include <asm/system_misc.h> |
1da177e4 | 32 | |
e425382e | 33 | |
c6ff132d | 34 | #include "regs-clock.h" |
1da177e4 | 35 | |
c6ff132d AB |
36 | #include "cpu.h" |
37 | #include "devs.h" | |
38 | #include "pm.h" | |
1da177e4 | 39 | |
c6ff132d AB |
40 | #include "gpio-core.h" |
41 | #include "gpio-cfg.h" | |
42 | #include "gpio-cfg-helpers.h" | |
1ec7269f | 43 | |
71b9114d | 44 | #include "s3c24xx.h" |
d8fdec16 | 45 | |
1da177e4 LT |
46 | /* Initial IO mappings */ |
47 | ||
a0663189 | 48 | static struct map_desc s3c2410_iodesc[] __initdata __maybe_unused = { |
1da177e4 | 49 | IODESC_ENT(CLKPWR), |
1da177e4 | 50 | IODESC_ENT(TIMER), |
62ee914e | 51 | IODESC_ENT(WATCHDOG), |
1da177e4 LT |
52 | }; |
53 | ||
1da177e4 LT |
54 | /* our uart devices */ |
55 | ||
1da177e4 LT |
56 | /* uart registration process */ |
57 | ||
58 | void __init s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no) | |
59 | { | |
66a9b49a | 60 | s3c24xx_init_uartdevs("s3c2410-uart", s3c2410_uart_resources, cfg, no); |
1da177e4 LT |
61 | } |
62 | ||
63 | /* s3c2410_map_io | |
64 | * | |
65 | * register the standard cpu IO areas, and any passed in from the | |
66 | * machine specific initialisation. | |
67 | */ | |
68 | ||
74b265d4 | 69 | void __init s3c2410_map_io(void) |
1da177e4 | 70 | { |
782d8a3c KK |
71 | s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1up; |
72 | s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1up; | |
1ec7269f | 73 | |
1da177e4 | 74 | iotable_init(s3c2410_iodesc, ARRAY_SIZE(s3c2410_iodesc)); |
1da177e4 LT |
75 | } |
76 | ||
4a858cfc | 77 | struct bus_type s3c2410_subsys = { |
af5ca3f4 | 78 | .name = "s3c2410-core", |
4a858cfc | 79 | .dev_name = "s3c2410-core", |
a341305e BD |
80 | }; |
81 | ||
f0176794 | 82 | /* Note, we would have liked to name this s3c2410-core, but we cannot |
4a858cfc | 83 | * register two subsystems with the same name. |
f0176794 | 84 | */ |
4a858cfc | 85 | struct bus_type s3c2410a_subsys = { |
f0176794 | 86 | .name = "s3c2410a-core", |
4a858cfc | 87 | .dev_name = "s3c2410a-core", |
f0176794 BD |
88 | }; |
89 | ||
4a858cfc KS |
90 | static struct device s3c2410_dev = { |
91 | .bus = &s3c2410_subsys, | |
a341305e BD |
92 | }; |
93 | ||
4a858cfc | 94 | /* need to register the subsystem before we actually register the device, and |
a341305e | 95 | * we also need to ensure that it has been initialised before any of the |
6db3eee4 | 96 | * drivers even try to use it (even if not on an s3c2410 based system) |
a341305e BD |
97 | * as a driver which may support both 2410 and 2440 may try and use it. |
98 | */ | |
99 | ||
100 | static int __init s3c2410_core_init(void) | |
101 | { | |
4a858cfc | 102 | return subsys_system_register(&s3c2410_subsys, NULL); |
a341305e BD |
103 | } |
104 | ||
105 | core_initcall(s3c2410_core_init); | |
106 | ||
f0176794 BD |
107 | static int __init s3c2410a_core_init(void) |
108 | { | |
4a858cfc | 109 | return subsys_system_register(&s3c2410a_subsys, NULL); |
f0176794 BD |
110 | } |
111 | ||
112 | core_initcall(s3c2410a_core_init); | |
113 | ||
1da177e4 LT |
114 | int __init s3c2410_init(void) |
115 | { | |
116 | printk("S3C2410: Initialising architecture\n"); | |
117 | ||
4f506daf | 118 | #ifdef CONFIG_PM_SLEEP |
bb072c3c RW |
119 | register_syscore_ops(&s3c2410_pm_syscore_ops); |
120 | register_syscore_ops(&s3c24xx_irq_syscore_ops); | |
d8fdec16 | 121 | #endif |
bb072c3c | 122 | |
4a858cfc | 123 | return device_register(&s3c2410_dev); |
1da177e4 | 124 | } |
f0176794 BD |
125 | |
126 | int __init s3c2410a_init(void) | |
127 | { | |
4a858cfc | 128 | s3c2410_dev.bus = &s3c2410a_subsys; |
f0176794 BD |
129 | return s3c2410_init(); |
130 | } |