1 /* linux/arch/arm/mach-s5p64x0/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>
23 #include <asm/mach/arch.h>
24 #include <asm/mach/map.h>
25 #include <asm/mach/irq.h>
26 #include <asm/proc-fns.h>
29 #include <mach/hardware.h>
31 #include <mach/regs-clock.h>
33 #include <plat/regs-serial.h>
35 #include <plat/devs.h>
36 #include <plat/clock.h>
37 #include <plat/s5p6440.h>
38 #include <plat/s5p6450.h>
39 #include <plat/adc-core.h>
41 /* Initial IO mappings */
43 static struct map_desc s5p64x0_iodesc
[] __initdata
= {
45 .virtual = (unsigned long)S5P_VA_GPIO
,
46 .pfn
= __phys_to_pfn(S5P64X0_PA_GPIO
),
50 .virtual = (unsigned long)VA_VIC0
,
51 .pfn
= __phys_to_pfn(S5P64X0_PA_VIC0
),
55 .virtual = (unsigned long)VA_VIC1
,
56 .pfn
= __phys_to_pfn(S5P64X0_PA_VIC1
),
62 static struct map_desc s5p6440_iodesc
[] __initdata
= {
64 .virtual = (unsigned long)S3C_VA_UART
,
65 .pfn
= __phys_to_pfn(S5P6440_PA_UART(0)),
71 static struct map_desc s5p6450_iodesc
[] __initdata
= {
73 .virtual = (unsigned long)S3C_VA_UART
,
74 .pfn
= __phys_to_pfn(S5P6450_PA_UART(0)),
78 .virtual = (unsigned long)S3C_VA_UART
+ SZ_512K
,
79 .pfn
= __phys_to_pfn(S5P6450_PA_UART(5)),
85 static void s5p64x0_idle(void)
89 if (!need_resched()) {
90 val
= __raw_readl(S5P64X0_PWR_CFG
);
93 __raw_writel(val
, S5P64X0_PWR_CFG
);
103 * register the standard CPU IO areas
106 void __init
s5p6440_map_io(void)
108 /* initialize any device information early */
109 s3c_adc_setname("s3c64x0-adc");
111 iotable_init(s5p64x0_iodesc
, ARRAY_SIZE(s5p64x0_iodesc
));
112 iotable_init(s5p6440_iodesc
, ARRAY_SIZE(s5p6440_iodesc
));
115 void __init
s5p6450_map_io(void)
117 /* initialize any device information early */
118 s3c_adc_setname("s3c64x0-adc");
120 iotable_init(s5p64x0_iodesc
, ARRAY_SIZE(s5p64x0_iodesc
));
121 iotable_init(s5p6450_iodesc
, ARRAY_SIZE(s5p6440_iodesc
));
125 * s5p64x0_init_clocks
127 * register and setup the CPU clocks
130 void __init
s5p6440_init_clocks(int xtal
)
132 printk(KERN_DEBUG
"%s: initializing clocks\n", __func__
);
134 s3c24xx_register_baseclocks(xtal
);
135 s5p_register_clocks(xtal
);
136 s5p6440_register_clocks();
137 s5p6440_setup_clocks();
140 void __init
s5p6450_init_clocks(int xtal
)
142 printk(KERN_DEBUG
"%s: initializing clocks\n", __func__
);
144 s3c24xx_register_baseclocks(xtal
);
145 s5p_register_clocks(xtal
);
146 s5p6450_register_clocks();
147 s5p6450_setup_clocks();
153 * register the CPU interrupts
156 void __init
s5p6440_init_irq(void)
158 /* S5P6440 supports 2 VIC */
162 * VIC0 is missing IRQ_VIC0[3, 4, 8, 10, (12-22)]
163 * VIC1 is missing IRQ VIC1[1, 3, 4, 10, 11, 12, 14, 15, 22]
168 s5p_init_irq(vic
, ARRAY_SIZE(vic
));
171 void __init
s5p6450_init_irq(void)
173 /* S5P6450 supports only 2 VIC */
177 * VIC0 is missing IRQ_VIC0[(13-15), (21-22)]
178 * VIC1 is missing IRQ VIC1[12, 14, 23]
183 s5p_init_irq(vic
, ARRAY_SIZE(vic
));
186 struct sysdev_class s5p64x0_sysclass
= {
187 .name
= "s5p64x0-core",
190 static struct sys_device s5p64x0_sysdev
= {
191 .cls
= &s5p64x0_sysclass
,
194 static int __init
s5p64x0_core_init(void)
196 return sysdev_class_register(&s5p64x0_sysclass
);
198 core_initcall(s5p64x0_core_init
);
200 int __init
s5p64x0_init(void)
202 printk(KERN_INFO
"S5P64X0(S5P6440/S5P6450): Initializing architecture\n");
204 /* set idle function */
205 pm_idle
= s5p64x0_idle
;
207 return sysdev_register(&s5p64x0_sysdev
);