Ben Dooks | a21765a | 2007-02-11 18:31:01 +0100 | [diff] [blame] | 1 | /* linux/arch/arm/mach-s3c2440/s3c2440.c |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * |
Ben Dooks | 96ce238 | 2006-06-18 23:06:41 +0100 | [diff] [blame] | 3 | * Copyright (c) 2004-2006 Simtec Electronics |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | * 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | */ |
| 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 King | d052d1b | 2005-10-29 19:07:23 +0100 | [diff] [blame] | 19 | #include <linux/platform_device.h> |
Ben Dooks | b6d1f54 | 2006-12-17 23:22:26 +0100 | [diff] [blame] | 20 | #include <linux/serial_core.h> |
Kay Sievers | 4a858cf | 2011-12-21 16:01:38 -0800 | [diff] [blame] | 21 | #include <linux/device.h> |
Rafael J. Wysocki | bb072c3 | 2011-04-22 22:03:21 +0200 | [diff] [blame] | 22 | #include <linux/syscore_ops.h> |
Ben Dooks | 1ec7269 | 2010-05-03 14:39:45 +0900 | [diff] [blame] | 23 | #include <linux/gpio.h> |
Russell King | f8ce254 | 2006-01-07 16:15:52 +0000 | [diff] [blame] | 24 | #include <linux/clk.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 25 | #include <linux/io.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | |
| 27 | #include <asm/mach/arch.h> |
| 28 | #include <asm/mach/map.h> |
| 29 | #include <asm/mach/irq.h> |
| 30 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 31 | #include <mach/hardware.h> |
Linus Walleij | b0161ca | 2014-01-14 14:24:24 +0100 | [diff] [blame] | 32 | #include <mach/gpio-samsung.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | #include <asm/irq.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | |
Ben Dooks | a2b7ba9 | 2008-10-07 22:26:09 +0100 | [diff] [blame] | 35 | #include <plat/devs.h> |
| 36 | #include <plat/cpu.h> |
Rafael J. Wysocki | bb072c3 | 2011-04-22 22:03:21 +0200 | [diff] [blame] | 37 | #include <plat/pm.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | |
Ben Dooks | 1ec7269 | 2010-05-03 14:39:45 +0900 | [diff] [blame] | 39 | #include <plat/gpio-core.h> |
| 40 | #include <plat/gpio-cfg.h> |
| 41 | #include <plat/gpio-cfg-helpers.h> |
| 42 | |
Heiko Stuebner | d8fdec1 | 2013-01-29 10:25:22 -0800 | [diff] [blame] | 43 | #include "common.h" |
| 44 | |
Kay Sievers | 4a858cf | 2011-12-21 16:01:38 -0800 | [diff] [blame] | 45 | static struct device s3c2440_dev = { |
| 46 | .bus = &s3c2440_subsys, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | }; |
| 48 | |
Ben Dooks | 96ce238 | 2006-06-18 23:06:41 +0100 | [diff] [blame] | 49 | int __init s3c2440_init(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | { |
Ben Dooks | 96ce238 | 2006-06-18 23:06:41 +0100 | [diff] [blame] | 51 | printk("S3C2440: Initialising architecture\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | |
| 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | |
Rafael J. Wysocki | bb072c3 | 2011-04-22 22:03:21 +0200 | [diff] [blame] | 58 | /* register suspend/resume handlers */ |
| 59 | |
Domenico Andreoli | fb630b9 | 2011-10-22 04:00:53 +0900 | [diff] [blame] | 60 | #ifdef CONFIG_PM |
Rafael J. Wysocki | bb072c3 | 2011-04-22 22:03:21 +0200 | [diff] [blame] | 61 | register_syscore_ops(&s3c2410_pm_syscore_ops); |
Heiko Stuebner | d8fdec1 | 2013-01-29 10:25:22 -0800 | [diff] [blame] | 62 | register_syscore_ops(&s3c24xx_irq_syscore_ops); |
Domenico Andreoli | fb630b9 | 2011-10-22 04:00:53 +0900 | [diff] [blame] | 63 | #endif |
Rafael J. Wysocki | bb072c3 | 2011-04-22 22:03:21 +0200 | [diff] [blame] | 64 | register_syscore_ops(&s3c244x_pm_syscore_ops); |
Rafael J. Wysocki | bb072c3 | 2011-04-22 22:03:21 +0200 | [diff] [blame] | 65 | |
Ben Dooks | 96ce238 | 2006-06-18 23:06:41 +0100 | [diff] [blame] | 66 | /* register our system device for everything else */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | |
Kay Sievers | 4a858cf | 2011-12-21 16:01:38 -0800 | [diff] [blame] | 68 | return device_register(&s3c2440_dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | } |
Vasily Khoruzhick | 812c4e4 | 2010-12-01 08:29:23 +0200 | [diff] [blame] | 70 | |
| 71 | void __init s3c2440_map_io(void) |
| 72 | { |
| 73 | s3c244x_map_io(); |
| 74 | |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 75 | s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1up; |
| 76 | s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1up; |
Vasily Khoruzhick | 812c4e4 | 2010-12-01 08:29:23 +0200 | [diff] [blame] | 77 | } |