Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 //
0003 // Copyright (c) 2004-2006 Simtec Electronics
0004 //   Ben Dooks <ben@simtec.co.uk>
0005 //
0006 // Samsung S3C2440 Mobile CPU support
0007 
0008 #include <linux/kernel.h>
0009 #include <linux/types.h>
0010 #include <linux/interrupt.h>
0011 #include <linux/list.h>
0012 #include <linux/timer.h>
0013 #include <linux/init.h>
0014 #include <linux/platform_device.h>
0015 #include <linux/serial_core.h>
0016 #include <linux/device.h>
0017 #include <linux/syscore_ops.h>
0018 #include <linux/gpio.h>
0019 #include <linux/clk.h>
0020 #include <linux/io.h>
0021 
0022 #include <asm/mach/arch.h>
0023 #include <asm/mach/map.h>
0024 #include <asm/mach/irq.h>
0025 
0026 #include <asm/irq.h>
0027 
0028 #include "devs.h"
0029 #include "cpu.h"
0030 #include "pm.h"
0031 
0032 #include "gpio-core.h"
0033 #include "gpio-cfg.h"
0034 #include "gpio-cfg-helpers.h"
0035 #include "gpio-samsung.h"
0036 
0037 #include "s3c24xx.h"
0038 
0039 static struct device s3c2440_dev = {
0040     .bus        = &s3c2440_subsys,
0041 };
0042 
0043 int __init s3c2440_init(void)
0044 {
0045     printk("S3C2440: Initialising architecture\n");
0046 
0047     /* change irq for watchdog */
0048 
0049     s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT;
0050     s3c_device_wdt.resource[1].end   = IRQ_S3C2440_WDT;
0051 
0052     /* register suspend/resume handlers */
0053 
0054 #ifdef CONFIG_PM_SLEEP
0055     register_syscore_ops(&s3c2410_pm_syscore_ops);
0056     register_syscore_ops(&s3c24xx_irq_syscore_ops);
0057     register_syscore_ops(&s3c244x_pm_syscore_ops);
0058 #endif
0059 
0060     /* register our system device for everything else */
0061 
0062     return device_register(&s3c2440_dev);
0063 }
0064 
0065 void __init s3c2440_map_io(void)
0066 {
0067     s3c244x_map_io();
0068 
0069     s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1up;
0070     s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1up;
0071 }