SMDKC100: add I2C0 and I2C1 buses support
[deliverable/linux.git] / arch / arm / mach-s5pc100 / cpu.c
CommitLineData
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
c3fcf5d1
KP
25#include <asm/proc-fns.h>
26
8acd1ade
BM
27#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>
c3fcf5d1 37#include <plat/regs-power.h>
8acd1ade
BM
38
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
c3fcf5d1
KP
51static 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
8acd1ade
BM
68/* 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 */
5eda288f
KP
78
79 /* the i2c devices are directly compatible with s3c2440 */
80 s3c_i2c0_setname("s3c2440-i2c");
81 s3c_i2c1_setname("s3c2440-i2c");
8acd1ade
BM
82}
83
84void __init s5pc100_init_clocks(int xtal)
85{
86 printk(KERN_DEBUG "%s: initialising clocks\n", __func__);
87 s3c24xx_register_baseclocks(xtal);
88 s5pc1xx_register_clocks();
89 s5pc100_register_clocks();
90 s5pc100_setup_clocks();
91}
92
93void __init s5pc100_init_irq(void)
94{
95 u32 vic_valid[] = {~0, ~0, ~0};
96
97 /* VIC0, VIC1, and VIC2 are fully populated. */
98 s5pc1xx_init_irq(vic_valid, ARRAY_SIZE(vic_valid));
99}
100
101struct sysdev_class s5pc100_sysclass = {
102 .name = "s5pc100-core",
103};
104
105static struct sys_device s5pc100_sysdev = {
106 .cls = &s5pc100_sysclass,
107};
108
109static int __init s5pc100_core_init(void)
110{
111 return sysdev_class_register(&s5pc100_sysclass);
112}
113
114core_initcall(s5pc100_core_init);
115
116int __init s5pc100_init(void)
117{
118 printk(KERN_DEBUG "S5PC100: Initialising architecture\n");
119
c3fcf5d1
KP
120 s5pc1xx_idle = s5pc100_idle;
121
8acd1ade
BM
122 return sysdev_register(&s5pc100_sysdev);
123}
This page took 0.046006 seconds and 5 git commands to generate.