diff options
author | Kukjin Kim <kgene.kim@samsung.com> | 2010-01-14 01:29:17 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-01-15 05:16:08 -0500 |
commit | 209fecd1b8e65b8046efbbc8314d449e53c4c6b6 (patch) | |
tree | 5b8cc8ea137431224c22fc5cfd6dbb21dd652ed6 /arch/arm/mach-s5p6440/cpu.c | |
parent | be97162d47b2e067f9d21097650f2f0405dacc9f (diff) |
ARM: S5P6440: Add new CPU initialization support
This patch adds Samsung's S5P6440 CPU support.
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s5p6440/cpu.c')
-rw-r--r-- | arch/arm/mach-s5p6440/cpu.c | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/arch/arm/mach-s5p6440/cpu.c b/arch/arm/mach-s5p6440/cpu.c new file mode 100644 index 000000000000..1794131aeacb --- /dev/null +++ b/arch/arm/mach-s5p6440/cpu.c | |||
@@ -0,0 +1,114 @@ | |||
1 | /* linux/arch/arm/mach-s5p6440/cpu.c | ||
2 | * | ||
3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
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. | ||
9 | */ | ||
10 | |||
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> | ||
18 | #include <linux/io.h> | ||
19 | #include <linux/sysdev.h> | ||
20 | #include <linux/serial_core.h> | ||
21 | #include <linux/platform_device.h> | ||
22 | |||
23 | #include <asm/mach/arch.h> | ||
24 | #include <asm/mach/map.h> | ||
25 | #include <asm/mach/irq.h> | ||
26 | |||
27 | #include <asm/proc-fns.h> | ||
28 | |||
29 | #include <mach/hardware.h> | ||
30 | #include <mach/map.h> | ||
31 | #include <asm/irq.h> | ||
32 | |||
33 | #include <plat/regs-serial.h> | ||
34 | #include <mach/regs-clock.h> | ||
35 | |||
36 | #include <plat/cpu.h> | ||
37 | #include <plat/devs.h> | ||
38 | #include <plat/clock.h> | ||
39 | #include <plat/s5p6440.h> | ||
40 | |||
41 | static void s5p6440_idle(void) | ||
42 | { | ||
43 | unsigned long val; | ||
44 | |||
45 | if (!need_resched()) { | ||
46 | val = __raw_readl(S5P_PWR_CFG); | ||
47 | val &= ~(0x3<<5); | ||
48 | val |= (0x1<<5); | ||
49 | __raw_writel(val, S5P_PWR_CFG); | ||
50 | |||
51 | cpu_do_idle(); | ||
52 | } | ||
53 | local_irq_enable(); | ||
54 | } | ||
55 | |||
56 | /* s5p6440_map_io | ||
57 | * | ||
58 | * register the standard cpu IO areas | ||
59 | */ | ||
60 | |||
61 | void __init s5p6440_map_io(void) | ||
62 | { | ||
63 | /* initialize any device information early */ | ||
64 | } | ||
65 | |||
66 | void __init s5p6440_init_clocks(int xtal) | ||
67 | { | ||
68 | printk(KERN_DEBUG "%s: initializing clocks\n", __func__); | ||
69 | |||
70 | s3c24xx_register_baseclocks(xtal); | ||
71 | s5p_register_clocks(xtal); | ||
72 | s5p6440_register_clocks(); | ||
73 | s5p6440_setup_clocks(); | ||
74 | } | ||
75 | |||
76 | void __init s5p6440_init_irq(void) | ||
77 | { | ||
78 | /* S5P6440 supports only 2 VIC */ | ||
79 | u32 vic[2]; | ||
80 | |||
81 | /* | ||
82 | * VIC0 is missing IRQ_VIC0[3, 4, 8, 10, (12-22)] | ||
83 | * VIC1 is missing IRQ VIC1[1, 3, 4, 10, 11, 12, 14, 15, 22] | ||
84 | */ | ||
85 | vic[0] = 0xff800ae7; | ||
86 | vic[1] = 0xffbf23e5; | ||
87 | |||
88 | s5p_init_irq(vic, ARRAY_SIZE(vic)); | ||
89 | } | ||
90 | |||
91 | static struct sysdev_class s5p6440_sysclass = { | ||
92 | .name = "s5p6440-core", | ||
93 | }; | ||
94 | |||
95 | static struct sys_device s5p6440_sysdev = { | ||
96 | .cls = &s5p6440_sysclass, | ||
97 | }; | ||
98 | |||
99 | static int __init s5p6440_core_init(void) | ||
100 | { | ||
101 | return sysdev_class_register(&s5p6440_sysclass); | ||
102 | } | ||
103 | |||
104 | core_initcall(s5p6440_core_init); | ||
105 | |||
106 | int __init s5p6440_init(void) | ||
107 | { | ||
108 | printk(KERN_INFO "S5P6440: Initializing architecture\n"); | ||
109 | |||
110 | /* set idle function */ | ||
111 | pm_idle = s5p6440_idle; | ||
112 | |||
113 | return sysdev_register(&s5p6440_sysdev); | ||
114 | } | ||