1 /* linux/arch/arm/mach-s5p6440/cpu.c
3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
11 #include <linux/kernel.h>
12 #include <linux/types.h>
13 #include <linux/interrupt.h>
14 #include <linux/list.h>
15 #include <linux/timer.h>
16 #include <linux/init.h>
17 #include <linux/clk.h>
19 #include <linux/sysdev.h>
20 #include <linux/serial_core.h>
21 #include <linux/platform_device.h>
22 #include <linux/sched.h>
24 #include <asm/mach/arch.h>
25 #include <asm/mach/map.h>
26 #include <asm/mach/irq.h>
28 #include <asm/proc-fns.h>
30 #include <mach/hardware.h>
34 #include <plat/regs-serial.h>
35 #include <mach/regs-clock.h>
38 #include <plat/devs.h>
39 #include <plat/clock.h>
40 #include <plat/s5p6440.h>
41 #include <plat/adc-core.h>
43 /* Initial IO mappings */
45 static struct map_desc s5p6440_iodesc[] __initdata = {
47 .virtual = (unsigned long)S5P_VA_GPIO,
48 .pfn = __phys_to_pfn(S5P6440_PA_GPIO),
52 .virtual = (unsigned long)VA_VIC0,
53 .pfn = __phys_to_pfn(S5P6440_PA_VIC0),
57 .virtual = (unsigned long)VA_VIC1,
58 .pfn = __phys_to_pfn(S5P6440_PA_VIC1),
62 .virtual = (unsigned long)S3C_VA_UART,
63 .pfn = __phys_to_pfn(S3C_PA_UART),
69 static void s5p6440_idle(void)
73 if (!need_resched()) {
74 val = __raw_readl(S5P_PWR_CFG);
77 __raw_writel(val, S5P_PWR_CFG);
87 * register the standard cpu IO areas
90 void __init s5p6440_map_io(void)
92 /* initialize any device information early */
93 s3c_adc_setname("s3c64xx-adc");
95 iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc));
98 void __init s5p6440_init_clocks(int xtal)
100 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
102 s3c24xx_register_baseclocks(xtal);
103 s5p_register_clocks(xtal);
104 s5p6440_register_clocks();
105 s5p6440_setup_clocks();
108 void __init s5p6440_init_irq(void)
110 /* S5P6440 supports only 2 VIC */
114 * VIC0 is missing IRQ_VIC0[3, 4, 8, 10, (12-22)]
115 * VIC1 is missing IRQ VIC1[1, 3, 4, 10, 11, 12, 14, 15, 22]
120 s5p_init_irq(vic, ARRAY_SIZE(vic));
123 struct sysdev_class s5p6440_sysclass = {
124 .name = "s5p6440-core",
127 static struct sys_device s5p6440_sysdev = {
128 .cls = &s5p6440_sysclass,
131 static int __init s5p6440_core_init(void)
133 return sysdev_class_register(&s5p6440_sysclass);
136 core_initcall(s5p6440_core_init);
138 int __init s5p6440_init(void)
140 printk(KERN_INFO "S5P6440: Initializing architecture\n");
142 /* set idle function */
143 pm_idle = s5p6440_idle;
145 return sysdev_register(&s5p6440_sysdev);