]>
Commit | Line | Data |
---|---|---|
8acd1ade BM |
1 | /* linux/arch/arm/mach-s5pc100/cpu.c |
2 | * | |
3 | * Copyright 2009 Samsung Electronics Co. | |
4 | * Byungho Min <bhmin@samsung.com> | |
5 | * | |
6 | * Based on mach-s3c6410/cpu.c | |
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. | |
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> | |
19 | #include <linux/clk.h> | |
20 | #include <linux/io.h> | |
21 | #include <linux/sysdev.h> | |
22 | #include <linux/serial_core.h> | |
23 | #include <linux/platform_device.h> | |
4341f9b3 | 24 | #include <linux/sched.h> |
8acd1ade BM |
25 | |
26 | #include <asm/mach/arch.h> | |
27 | #include <asm/mach/map.h> | |
28 | #include <asm/mach/irq.h> | |
29 | ||
acc84707 MS |
30 | #include <asm/proc-fns.h> |
31 | ||
8acd1ade BM |
32 | #include <mach/hardware.h> |
33 | #include <mach/map.h> | |
34 | #include <asm/irq.h> | |
35 | ||
8acd1ade | 36 | #include <plat/regs-serial.h> |
acc84707 | 37 | #include <mach/regs-clock.h> |
8acd1ade BM |
38 | |
39 | #include <plat/cpu.h> | |
40 | #include <plat/devs.h> | |
41 | #include <plat/clock.h> | |
66194a74 | 42 | #include <plat/ata-core.h> |
8acd1ade | 43 | #include <plat/iic-core.h> |
acc84707 | 44 | #include <plat/sdhci.h> |
327b9030 | 45 | #include <plat/adc-core.h> |
999304be | 46 | #include <plat/onenand-core.h> |
eb42b044 | 47 | #include <plat/fb-core.h> |
999304be | 48 | |
8acd1ade BM |
49 | #include <plat/s5pc100.h> |
50 | ||
51 | /* Initial IO mappings */ | |
52 | ||
53 | static struct map_desc s5pc100_iodesc[] __initdata = { | |
acc84707 MS |
54 | { |
55 | .virtual = (unsigned long)S5P_VA_SYSTIMER, | |
56 | .pfn = __phys_to_pfn(S5PC100_PA_SYSTIMER), | |
57 | .length = SZ_16K, | |
58 | .type = MT_DEVICE, | |
59 | }, { | |
60 | .virtual = (unsigned long)VA_VIC2, | |
45c79433 | 61 | .pfn = __phys_to_pfn(S5P_PA_VIC2), |
acc84707 MS |
62 | .length = SZ_16K, |
63 | .type = MT_DEVICE, | |
64 | }, { | |
65 | .virtual = (unsigned long)S5PC100_VA_OTHERS, | |
66 | .pfn = __phys_to_pfn(S5PC100_PA_OTHERS), | |
67 | .length = SZ_4K, | |
68 | .type = MT_DEVICE, | |
69 | } | |
8acd1ade BM |
70 | }; |
71 | ||
c3fcf5d1 KP |
72 | static void s5pc100_idle(void) |
73 | { | |
acc84707 MS |
74 | if (!need_resched()) |
75 | cpu_do_idle(); | |
c3fcf5d1 | 76 | |
acc84707 | 77 | local_irq_enable(); |
c3fcf5d1 KP |
78 | } |
79 | ||
8acd1ade BM |
80 | /* s5pc100_map_io |
81 | * | |
82 | * register the standard cpu IO areas | |
83 | */ | |
84 | ||
85 | void __init s5pc100_map_io(void) | |
86 | { | |
87 | iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc)); | |
88 | ||
89 | /* initialise device information early */ | |
86cd4f5f KP |
90 | s5pc100_default_sdhci0(); |
91 | s5pc100_default_sdhci1(); | |
92 | s5pc100_default_sdhci2(); | |
5eda288f | 93 | |
327b9030 NKC |
94 | s3c_adc_setname("s3c64xx-adc"); |
95 | ||
5eda288f KP |
96 | /* the i2c devices are directly compatible with s3c2440 */ |
97 | s3c_i2c0_setname("s3c2440-i2c"); | |
98 | s3c_i2c1_setname("s3c2440-i2c"); | |
999304be MS |
99 | |
100 | s3c_onenand_setname("s5pc100-onenand"); | |
eb42b044 | 101 | s3c_fb_setname("s5pc100-fb"); |
66194a74 | 102 | s3c_cfcon_setname("s5pc100-pata"); |
8acd1ade BM |
103 | } |
104 | ||
105 | void __init s5pc100_init_clocks(int xtal) | |
106 | { | |
acc84707 MS |
107 | printk(KERN_DEBUG "%s: initializing clocks\n", __func__); |
108 | ||
8acd1ade | 109 | s3c24xx_register_baseclocks(xtal); |
acc84707 | 110 | s5p_register_clocks(xtal); |
8acd1ade BM |
111 | s5pc100_register_clocks(); |
112 | s5pc100_setup_clocks(); | |
113 | } | |
114 | ||
115 | void __init s5pc100_init_irq(void) | |
116 | { | |
acc84707 | 117 | u32 vic[] = {~0, ~0, ~0}; |
8acd1ade BM |
118 | |
119 | /* VIC0, VIC1, and VIC2 are fully populated. */ | |
acc84707 | 120 | s5p_init_irq(vic, ARRAY_SIZE(vic)); |
8acd1ade BM |
121 | } |
122 | ||
acc84707 | 123 | static struct sysdev_class s5pc100_sysclass = { |
8acd1ade BM |
124 | .name = "s5pc100-core", |
125 | }; | |
126 | ||
127 | static struct sys_device s5pc100_sysdev = { | |
128 | .cls = &s5pc100_sysclass, | |
129 | }; | |
130 | ||
131 | static int __init s5pc100_core_init(void) | |
132 | { | |
133 | return sysdev_class_register(&s5pc100_sysclass); | |
134 | } | |
135 | ||
136 | core_initcall(s5pc100_core_init); | |
137 | ||
138 | int __init s5pc100_init(void) | |
139 | { | |
acc84707 | 140 | printk(KERN_INFO "S5PC100: Initializing architecture\n"); |
8acd1ade | 141 | |
acc84707 MS |
142 | /* set idle function */ |
143 | pm_idle = s5pc100_idle; | |
c3fcf5d1 | 144 | |
8acd1ade BM |
145 | return sysdev_register(&s5pc100_sysdev); |
146 | } |