blob: a23ca5795bc8bfbff450720229fa35615fa27ca1 [file] [log] [blame]
Byungho Min8acd1ad2009-06-23 21:40:15 +09001/* 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
Kyungmin Parkc3fcf5d2009-11-17 08:41:17 +010025#include <asm/proc-fns.h>
26
Byungho Min8acd1ad2009-06-23 21:40:15 +090027#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29#include <asm/mach/irq.h>
30
31#include <mach/hardware.h>
32#include <mach/map.h>
33#include <asm/irq.h>
34
35#include <plat/cpu-freq.h>
36#include <plat/regs-serial.h>
Kyungmin Parkc3fcf5d2009-11-17 08:41:17 +010037#include <plat/regs-power.h>
Byungho Min8acd1ad2009-06-23 21:40:15 +090038
39#include <plat/cpu.h>
40#include <plat/devs.h>
41#include <plat/clock.h>
42#include <plat/sdhci.h>
43#include <plat/iic-core.h>
44#include <plat/s5pc100.h>
45
46/* Initial IO mappings */
47
48static struct map_desc s5pc100_iodesc[] __initdata = {
49};
50
Kyungmin Parkc3fcf5d2009-11-17 08:41:17 +010051static void s5pc100_idle(void)
52{
53 unsigned long tmp;
54
55 tmp = __raw_readl(S5PC100_PWR_CFG);
56 tmp &= ~S5PC100_PWRCFG_CFG_DEEP_IDLE;
57 tmp &= ~S5PC100_PWRCFG_CFG_WFI_MASK;
58 tmp |= S5PC100_PWRCFG_CFG_WFI_DEEP_IDLE;
59 __raw_writel(tmp, S5PC100_PWR_CFG);
60
61 tmp = __raw_readl(S5PC100_OTHERS);
62 tmp |= S5PC100_PMU_INT_DISABLE;
63 __raw_writel(tmp, S5PC100_OTHERS);
64
65 cpu_do_idle();
66}
67
Byungho Min8acd1ad2009-06-23 21:40:15 +090068/* s5pc100_map_io
69 *
70 * register the standard cpu IO areas
71*/
72
73void __init s5pc100_map_io(void)
74{
75 iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc));
76
77 /* initialise device information early */
78}
79
80void __init s5pc100_init_clocks(int xtal)
81{
82 printk(KERN_DEBUG "%s: initialising clocks\n", __func__);
83 s3c24xx_register_baseclocks(xtal);
84 s5pc1xx_register_clocks();
85 s5pc100_register_clocks();
86 s5pc100_setup_clocks();
87}
88
89void __init s5pc100_init_irq(void)
90{
91 u32 vic_valid[] = {~0, ~0, ~0};
92
93 /* VIC0, VIC1, and VIC2 are fully populated. */
94 s5pc1xx_init_irq(vic_valid, ARRAY_SIZE(vic_valid));
95}
96
97struct sysdev_class s5pc100_sysclass = {
98 .name = "s5pc100-core",
99};
100
101static struct sys_device s5pc100_sysdev = {
102 .cls = &s5pc100_sysclass,
103};
104
105static int __init s5pc100_core_init(void)
106{
107 return sysdev_class_register(&s5pc100_sysclass);
108}
109
110core_initcall(s5pc100_core_init);
111
112int __init s5pc100_init(void)
113{
114 printk(KERN_DEBUG "S5PC100: Initialising architecture\n");
115
Kyungmin Parkc3fcf5d2009-11-17 08:41:17 +0100116 s5pc1xx_idle = s5pc100_idle;
117
Byungho Min8acd1ad2009-06-23 21:40:15 +0900118 return sysdev_register(&s5pc100_sysdev);
119}