1 // SPDX-License-Identifier: GPL-2.0
3 // Copyright (c) 2003-2005 Simtec Electronics
4 // Ben Dooks <ben@simtec.co.uk>
6 // http://www.simtec.co.uk/products/EB2410ITX/
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>
14 #include <linux/gpio.h>
15 #include <linux/clk.h>
16 #include <linux/device.h>
17 #include <linux/syscore_ops.h>
18 #include <linux/serial_core.h>
19 #include <linux/serial_s3c.h>
20 #include <linux/platform_device.h>
21 #include <linux/reboot.h>
24 #include <asm/mach/arch.h>
25 #include <asm/mach/map.h>
26 #include <asm/mach/irq.h>
29 #include "gpio-samsung.h"
31 #include <asm/system_misc.h>
34 #include "regs-clock.h"
40 #include "gpio-core.h"
42 #include "gpio-cfg-helpers.h"
46 /* Initial IO mappings */
48 static struct map_desc s3c2410_iodesc
[] __initdata __maybe_unused
= {
54 /* our uart devices */
56 /* uart registration process */
58 void __init
s3c2410_init_uarts(struct s3c2410_uartcfg
*cfg
, int no
)
60 s3c24xx_init_uartdevs("s3c2410-uart", s3c2410_uart_resources
, cfg
, no
);
65 * register the standard cpu IO areas, and any passed in from the
66 * machine specific initialisation.
69 void __init
s3c2410_map_io(void)
71 s3c24xx_gpiocfg_default
.set_pull
= s3c24xx_gpio_setpull_1up
;
72 s3c24xx_gpiocfg_default
.get_pull
= s3c24xx_gpio_getpull_1up
;
74 iotable_init(s3c2410_iodesc
, ARRAY_SIZE(s3c2410_iodesc
));
77 struct bus_type s3c2410_subsys
= {
78 .name
= "s3c2410-core",
79 .dev_name
= "s3c2410-core",
82 /* Note, we would have liked to name this s3c2410-core, but we cannot
83 * register two subsystems with the same name.
85 struct bus_type s3c2410a_subsys
= {
86 .name
= "s3c2410a-core",
87 .dev_name
= "s3c2410a-core",
90 static struct device s3c2410_dev
= {
91 .bus
= &s3c2410_subsys
,
94 /* need to register the subsystem before we actually register the device, and
95 * we also need to ensure that it has been initialised before any of the
96 * drivers even try to use it (even if not on an s3c2410 based system)
97 * as a driver which may support both 2410 and 2440 may try and use it.
100 static int __init
s3c2410_core_init(void)
102 return subsys_system_register(&s3c2410_subsys
, NULL
);
105 core_initcall(s3c2410_core_init
);
107 static int __init
s3c2410a_core_init(void)
109 return subsys_system_register(&s3c2410a_subsys
, NULL
);
112 core_initcall(s3c2410a_core_init
);
114 int __init
s3c2410_init(void)
116 printk("S3C2410: Initialising architecture\n");
118 #ifdef CONFIG_PM_SLEEP
119 register_syscore_ops(&s3c2410_pm_syscore_ops
);
120 register_syscore_ops(&s3c24xx_irq_syscore_ops
);
123 return device_register(&s3c2410_dev
);
126 int __init
s3c2410a_init(void)
128 s3c2410_dev
.bus
= &s3c2410a_subsys
;
129 return s3c2410_init();