blob: 0c0e30b6688f705ef80c44b4eab3c32b66c1b6cf [file] [log] [blame]
Krzysztof Kozlowski84b21702017-12-25 20:54:32 +01001// SPDX-License-Identifier: GPL-2.0+
2//
3// Copyright (c) 2004-2005 Simtec Electronics
4// http://armlinux.simtec.co.uk/
5// Ben Dooks <ben@simtec.co.uk>
6//
7// S3C2442 core and lock support
Ben Dooks96ce2382006-06-18 23:06:41 +01008
Ben Dooks96ce2382006-06-18 23:06:41 +01009#include <linux/init.h>
Ben Dooks491547d2010-01-26 16:13:35 +090010#include <linux/module.h>
11#include <linux/kernel.h>
12#include <linux/list.h>
13#include <linux/errno.h>
14#include <linux/err.h>
15#include <linux/device.h>
Rafael J. Wysockibb072c32011-04-22 22:03:21 +020016#include <linux/syscore_ops.h>
Ben Dooks491547d2010-01-26 16:13:35 +090017#include <linux/interrupt.h>
18#include <linux/ioport.h>
19#include <linux/mutex.h>
Vasily Khoruzhick812c4e42010-12-01 08:29:23 +020020#include <linux/gpio.h>
Ben Dooks491547d2010-01-26 16:13:35 +090021#include <linux/clk.h>
22#include <linux/io.h>
Ben Dooks96ce2382006-06-18 23:06:41 +010023
Arun Sharma600634972011-07-26 16:09:06 -070024#include <linux/atomic.h>
Ben Dooks491547d2010-01-26 16:13:35 +090025#include <asm/irq.h>
26
Arnd Bergmannc6ff1322019-09-02 18:37:30 +020027#include "regs-clock.h"
Ben Dooks491547d2010-01-26 16:13:35 +090028
Arnd Bergmannc6ff1322019-09-02 18:37:30 +020029#include "cpu.h"
30#include "pm.h"
Vasily Khoruzhick812c4e42010-12-01 08:29:23 +020031
Arnd Bergmannc6ff1322019-09-02 18:37:30 +020032#include "gpio-core.h"
33#include "gpio-cfg.h"
34#include "gpio-cfg-helpers.h"
35#include "gpio-samsung.h"
Ben Dooks96ce2382006-06-18 23:06:41 +010036
Arnd Bergmann71b91142019-09-02 17:47:55 +020037#include "s3c24xx.h"
Heiko Stuebnerd8fdec12013-01-29 10:25:22 -080038
Kay Sievers4a858cf2011-12-21 16:01:38 -080039static struct device s3c2442_dev = {
40 .bus = &s3c2442_subsys,
Ben Dooks96ce2382006-06-18 23:06:41 +010041};
42
43int __init s3c2442_init(void)
44{
45 printk("S3C2442: Initialising architecture\n");
46
Arnd Bergmann4f506da2015-02-27 05:50:22 +090047#ifdef CONFIG_PM_SLEEP
Rafael J. Wysockibb072c32011-04-22 22:03:21 +020048 register_syscore_ops(&s3c2410_pm_syscore_ops);
Heiko Stuebnerd8fdec12013-01-29 10:25:22 -080049 register_syscore_ops(&s3c24xx_irq_syscore_ops);
Rafael J. Wysockibb072c32011-04-22 22:03:21 +020050 register_syscore_ops(&s3c244x_pm_syscore_ops);
Arnd Bergmann4f506da2015-02-27 05:50:22 +090051#endif
Rafael J. Wysockibb072c32011-04-22 22:03:21 +020052
Kay Sievers4a858cf2011-12-21 16:01:38 -080053 return device_register(&s3c2442_dev);
Ben Dooks96ce2382006-06-18 23:06:41 +010054}
Vasily Khoruzhick812c4e42010-12-01 08:29:23 +020055
56void __init s3c2442_map_io(void)
57{
58 s3c244x_map_io();
59
Kukjin Kim782d8a32011-08-30 20:47:32 +090060 s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1down;
61 s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1down;
Vasily Khoruzhick812c4e42010-12-01 08:29:23 +020062}