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