blob: eb733555fab52d495be89fa14fba0407412ce13e [file] [log] [blame]
Ben Dooksa21765a2007-02-11 18:31:01 +01001/* linux/arch/arm/mach-s3c2440/s3c2440.c
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 *
Ben Dooks96ce2382006-06-18 23:06:41 +01003 * Copyright (c) 2004-2006 Simtec Electronics
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Samsung S3C2440 Mobile CPU support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
Linus Torvalds1da177e2005-04-16 15:20:36 -070011*/
12
13#include <linux/kernel.h>
14#include <linux/types.h>
15#include <linux/interrupt.h>
16#include <linux/list.h>
17#include <linux/timer.h>
18#include <linux/init.h>
Russell Kingd052d1b2005-10-29 19:07:23 +010019#include <linux/platform_device.h>
Ben Dooksb6d1f542006-12-17 23:22:26 +010020#include <linux/serial_core.h>
Kay Sievers4a858cf2011-12-21 16:01:38 -080021#include <linux/device.h>
Rafael J. Wysockibb072c32011-04-22 22:03:21 +020022#include <linux/syscore_ops.h>
Ben Dooks1ec72692010-05-03 14:39:45 +090023#include <linux/gpio.h>
Russell Kingf8ce2542006-01-07 16:15:52 +000024#include <linux/clk.h>
Russell Kingfced80c2008-09-06 12:10:45 +010025#include <linux/io.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29#include <asm/mach/irq.h>
30
Russell Kinga09e64f2008-08-05 16:14:15 +010031#include <mach/hardware.h>
Linus Walleijb0161ca2014-01-14 14:24:24 +010032#include <mach/gpio-samsung.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070033#include <asm/irq.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
Ben Dooksa2b7ba92008-10-07 22:26:09 +010035#include <plat/devs.h>
36#include <plat/cpu.h>
Rafael J. Wysockibb072c32011-04-22 22:03:21 +020037#include <plat/pm.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
Ben Dooks1ec72692010-05-03 14:39:45 +090039#include <plat/gpio-core.h>
40#include <plat/gpio-cfg.h>
41#include <plat/gpio-cfg-helpers.h>
42
Heiko Stuebnerd8fdec12013-01-29 10:25:22 -080043#include "common.h"
44
Kay Sievers4a858cf2011-12-21 16:01:38 -080045static struct device s3c2440_dev = {
46 .bus = &s3c2440_subsys,
Linus Torvalds1da177e2005-04-16 15:20:36 -070047};
48
Ben Dooks96ce2382006-06-18 23:06:41 +010049int __init s3c2440_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070050{
Ben Dooks96ce2382006-06-18 23:06:41 +010051 printk("S3C2440: Initialising architecture\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
53 /* change irq for watchdog */
54
55 s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT;
56 s3c_device_wdt.resource[1].end = IRQ_S3C2440_WDT;
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
Rafael J. Wysockibb072c32011-04-22 22:03:21 +020058 /* register suspend/resume handlers */
59
Arnd Bergmann4f506da2015-02-27 05:50:22 +090060#ifdef CONFIG_PM_SLEEP
Rafael J. Wysockibb072c32011-04-22 22:03:21 +020061 register_syscore_ops(&s3c2410_pm_syscore_ops);
Heiko Stuebnerd8fdec12013-01-29 10:25:22 -080062 register_syscore_ops(&s3c24xx_irq_syscore_ops);
Rafael J. Wysockibb072c32011-04-22 22:03:21 +020063 register_syscore_ops(&s3c244x_pm_syscore_ops);
Arnd Bergmann4f506da2015-02-27 05:50:22 +090064#endif
Rafael J. Wysockibb072c32011-04-22 22:03:21 +020065
Ben Dooks96ce2382006-06-18 23:06:41 +010066 /* register our system device for everything else */
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
Kay Sievers4a858cf2011-12-21 16:01:38 -080068 return device_register(&s3c2440_dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -070069}
Vasily Khoruzhick812c4e42010-12-01 08:29:23 +020070
71void __init s3c2440_map_io(void)
72{
73 s3c244x_map_io();
74
Kukjin Kim782d8a32011-08-30 20:47:32 +090075 s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1up;
76 s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1up;
Vasily Khoruzhick812c4e42010-12-01 08:29:23 +020077}